1. Homepage
  2. Programming
  3. Packet Switching practice: Route Lookup

Packet Switching practice: Route Lookup

Engage in a Conversation
Computer NetworksPacket SwitchingRoute LookupC

Packet Switching practice: Route Lookup CourseNana.COM


1. Goals CourseNana.COM

  • ●  Introduce the students to the next hop search problem (route lookup) in a CIDR router, as well as with its complexity, in a practical scenario. CourseNana.COM

  • ●  Introduce the students to the basic mechanisms of route lookup. CourseNana.COM

  • ●  Read state of the art algorithms. CourseNana.COM

  • ●  Implement a route lookup algorithm that improves the performance of the linear search CourseNana.COM

    algorithm, whose implementation is used as a reference. CourseNana.COM

  • ●  Evaluate the performance of the implemented route lookup algorithm, compared to the CourseNana.COM

    linear search algorithm. CourseNana.COM

  • ●  Present the challenge of improving existing algorithms. CourseNana.COM

    2. Algorithm selection and implementation CourseNana.COM

    Review the proposed algorithms below and choose one that you consider could outperform the reference one (e.g., in terms of search speed, memory consumption, etc.). This reference algorithm is also described in [1] (page 8, Linear Search of Hash Tables). CourseNana.COM

    It is necessary to choose and implement one of these algorithms. CourseNana.COM

b) Binary search with hash [1]. (12/10 pts.). To understand this method, please read: o Section 1: introduction. Pages 2 and 3.
o Section 2: existing algorithms. Page 4.
o Section 3: linear and binary search. Pages 8 to 12.
CourseNana.COM

o Section 5.1: creating a routing database. Pages 22 and 23.
This algorithm works better than the linear case for most real routing tables, but not always. You must understand when and why.
CourseNana.COM

c) LC-tries [3]. (12/10 pts.). Which is the algorithm implemented in Linux [2], is an optimization of the Patricia trie, so you will need to implement option a) before. CourseNana.COM

3. Specifications CourseNana.COM

The program implemented must meet the following requirements: CourseNana.COM

  • ●  Programming language: C. CourseNana.COM

  • ●  Operating System: Linux. CourseNana.COM

  • ●  Memory Limit: 50 MB of RAM memory. Consider a maximum number of 25.000 CourseNana.COM

    prefixes of any length. Suppose that the number of possible next hops or interfaces is CourseNana.COM

    lower than 32000. CourseNana.COM

  • ●  A program in C must be developed. The executable file must be my_route_lookup, CourseNana.COM

    and it will take the following two parameters: CourseNana.COM

    ./my_route_lookup FIB InputPacketFile
    o FIB: name of the ASCII file containing the FIB (Forwarding Information Base). CourseNana.COM

o InputPacketFile: name of the ASCII file containing a list of destination IP addresses to be processed, separated by new line characters (\n in C language). CourseNana.COM

  • ●  The FIB file represents a simplified Forwarding Table1, each line consisting of a <CIDR_Network_Prefix, Output Interface> tuple. Both fields will be separated by a single tab character (\t in C language). For example: CourseNana.COM

    Network Prefix Output Interface CourseNana.COM

  • ●  For each destination IP address included in the Input File named InputPacketFile, the program will obtain the appropriate output interface to forward the packet according to the FIB. CourseNana.COM

  • ●  Assumetheinputfileswillneverhaveanywrongaddressesorprefixes. CourseNana.COM

  • ●  The router interfaces are numbered from 1 on. A 0 represents the non-existence of an CourseNana.COM

    interface. CourseNana.COM

  • ●  Ifthereisnodefaultgateway,thepacketisdiscarded. CourseNana.COM

  • ●  Youmustchoosehowtomodelthedefaultgatewayinyourimplementation. CourseNana.COM

  • ●  As an output, the program will generate a single file, OutPutFile, where a <IPaddress, CourseNana.COM

    OutIfc, AccessedNodes, ComputationTime> tuple will be stored in each line, for each IP address in the input file (InputPacketFile). The fields of such tuple are defined as follows: CourseNana.COM

o IPaddress: an IP address read from the InputPacketFile.
o
OutIfc: output interface through which the packet should be routed ("MISS" should CourseNana.COM

be printed instead if no outgoing interface is found).
o
AccessedNodes: number of nodes visited (memory accesses) required to obtain the CourseNana.COM

appropriate outgoing interface for a given IP address. Do not consider the root CourseNana.COM

node for node counting.
o
ComputationTime: required time to get the appropriate outgoing interface for the CourseNana.COM

destination IP address. This time ONLY includes the outgoing interface calculation time in the FIB, but it DOES NOT INCLUDE the time required for reading/writing files to disk. The calculation time will be an integer value in nanoseconds. CourseNana.COM

TheOutPutFile,willfollowthisformat:
o The name of this file is formed by the input file name plus "
.out".
o It will have a tuple per line.
o The fields of each tuple will be separated by "
;". After the last field (Calculation CourseNana.COM

average number of accessed nodes by lookup and finally the average calculation time for the processed addresses. The last two fields will be printed with two decimals. Likewise, the consumed memory and CPU time will be also printed. The CourseNana.COM

1 Please remember that a real complete FIB would include, apart from the outgoing interface, the IP address of the next hop as well as link layer forwarding information associated to that neighbour (typically an Ethernet MAC address). It would also include the encapsulation information for the packet, the handler or hardware/software function to be invoked with those parameters and the pointer to the IP packet processed. CourseNana.COM

192.163.10.0/24 1 192.163.0.0/16 2 193.110.27.192/26 3 CourseNana.COM

format will be as follows: CourseNana.COM

Number of nodes in the tree = NNNNN Packets processed= X CourseNana.COM

Average node accesses= YY.YY
Average packet processing time (nsecs)= Z.ZZ Memory (Kbytes) = KB
CPU Time (secs)= T.TTTTTT
CourseNana.COM

These parameters related to the performance of the algorithm along with the number of correct lookups will be considered when grading the lab assignment. CourseNana.COM

4. Example CourseNana.COM

A complete example for the required program, including input and output files, is shown next: CourseNana.COM

File: r.txt CourseNana.COM

192.163.10.0/24 1 192.163.0.0/16 2 193.110.27.192/26 3 CourseNana.COM

File: i.txt CourseNana.COM

192.163.10.123 195.50.230.11 193.110.27.224 CourseNana.COM

Command line CourseNana.COM

File: i.txt.out CourseNana.COM

pract> ./my_route_lookup r.txt i.txt CourseNana.COM

192.163.10.123;1;2;500 195.50.230.11;MISS;1;200 193.110.27.224;3;1;200 CourseNana.COM

Number of nodes in the tree = 4
Packets processed = 3
Average node accesses = 1.33
Average packet processing time (nsecs) = 300 Memory (Kbytes) = 21258
CourseNana.COM

CPU Time (secs) = 0.044427 CourseNana.COM

pract>_ CourseNana.COM

5. Provided files CourseNana.COM

To make it easy for the student to reproduce the output file format, a set of files with functions is given. These functions will be useful to develop the program to be deliverd. These files are:
-
io.c/h: These files include the necessary code to parse a routing table and read a file with IP addresses to be routed. There are functions that generate a file with the format specified in the sections above.
-
utils.c/h: These files contain a hash function and another function that calculates an IP mask from a given prefix length. The hash function might be of use or not depending on the implemented algorithm. The students may use other hash tables if they consider it convenient.
-
routing_table.txt/routing_table_simple.txt: Routing tables that you must process to ensure that the developed program works properly.
-
prueba0/1/2/3.txt: Files with IP addresses that must be routed as specified in this document.
-
Makefile: A makefile example that shows how to generate the required executable file. You must change this file by modifying the list of files scanned by the makefile to match those of your CourseNana.COM

solution.
-
linearSearch: Executable that makes a linear search and that will be used as a reference to compare with the solution developed by the students. CourseNana.COM

Suggestions: CourseNana.COM

  1. As a first step, implement a binary tree module with a set of functions for creating, CourseNana.COM

    releasing, printing, etc. the content of nodes and binary trees (printing will be useful for CourseNana.COM

    visualizing trees while debugging). CourseNana.COM

  2. Start testing with the simplest route tables, and gradually increase the complexity of the CourseNana.COM

    cases you want to test. CourseNana.COM

  3. For simplicity, create the uncompressed trie first with all the routes and then compress it, CourseNana.COM

    freeing the memory of the nodes that are removed (this will only reduce the effective memory used in some cases because the OS allocates larger memory blocks to processes than what the user requests, and the block may contain nodes that have not been released). CourseNana.COM

  4. Ensure that tables with the default route 0.0.0.0/0 work correctly. CourseNana.COM

6. Lab. Assignment Delivery CourseNana.COM

The deadline for submitting the lab assignment is Tuesday, April 9 2024, 23:59 CET. CourseNana.COM

The student must deliver a .zip file through the Aula Global delivery system, meeting the following requirements: CourseNana.COM

- The zip file must be called GRUPOXX (even if you are in the English group). So if your group number is 5, the assignment must be GRUPO05.zip. CourseNana.COM

- You must include all the code files (both yours and provided to you as part of the lab assignment) needed to compile and generate the executable.
- You must include a makefile. The makefile must not be executed always. Instead, it must be as follows:
CourseNana.COM

all: my_route_lookup
my_route_lookup: <list_of_files>
In this makefile, the target "all" depends on the target "my_route_lookup". The target
CourseNana.COM

my_route_lookup" is generated as long as:
a) The file "my_route_lookup" does not exist. b) Any of the files in <list_of_files> changes.
CourseNana.COM

<list_of_files> is the list with all the source files of your program (both yours and provided to you as part of the lab assignment).
In addition, it must always include the following directive:
.PHONY: clean
CourseNana.COM

In order to indicate that "clean" is not a file.
- A file named "
nias.txt": This file must have two lines with the NIA (student ID) of the two students that develops the solution. For example: CourseNana.COM

     100012345
     100023456

- Please do not zip a folder, but the collection of files (code files + auxiliary files such as the ASCII report, nias.txt, etc). CourseNana.COM

- Every submission must meet these requirements. Otherwise, it will not be graded. CourseNana.COM

The number associated to each group will be the one selected in the form at Aula Global. The form will be open until the end of the second session of the lab. CourseNana.COM

It will be considered that those students who do not perform such registration before the deadline will not do the lab assignment. Only in the case that the number of students of a given degree were odd, the student without group may be regrouped in a 3 student group. CourseNana.COM

IMPORTANT NOTE CourseNana.COM

It is the responsibility of the students to protect their own code. With the delivery of this lab assignment, the student implicitly acknowledges the authorship of the delivered code. The only non self-developed code to be used is the one given to the students by the teachers. The use of Open Source libraries for hash tables should be approved by the teachers. An automated detection system will be employed to detect plagiarism. Source code plagiarism will be reported to the academic authorities and both plagiarising and plagiarised students will be punished. CourseNana.COM

7. Evaluation conditions CourseNana.COM

No algorithm will be accepted if: CourseNana.COM

  • ●  The program does not compile. CourseNana.COM

  • ●  The programs leaks memory. CourseNana.COM

  • ●  Run time exceptions are detected on the evaluation tests. CourseNana.COM

  • ●  More than 50 MB of RAM are used for 25000 routes with prefix of different lengths from CourseNana.COM

    0 to 32 bits. Please notice that these conditions are more strict than in real cases. CourseNana.COM

  • ●  The next hop is not calculated correctly in all cases. CourseNana.COM

    Students are allowed to assume that the number of possible next hops or interfaces is lower than 32000. CourseNana.COM

    The assessment has two parts:
    1.
    Code submission. The performance improvement over the reference algorithm, as CourseNana.COM

    well as the clarity and organization of the code will be evaluated.
    2.
    Class assessment. The understanding of both the problem and technical CourseNana.COM

    characteristics of the delivered solution will be evaluated in two parts. CourseNana.COM

    1. In the second session of the lab, the students will be asked to explain and justify, technically speaking, their solution as well as describe how they are CourseNana.COM

      going to implement it. CourseNana.COM

    2. A face-to-face exam after the code submission where the students will be asked CourseNana.COM

      individually about specific details of the design and the implementation of the submitted code. The students can be asked about technical details of the algorithm concerning its space and time complexity as well as its drawbacks or limitations. CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
Computer Networks代写,Packet Switching代写,Route Lookup代写,C代写,Computer Networks代编,Packet Switching代编,Route Lookup代编,C代编,Computer Networks代考,Packet Switching代考,Route Lookup代考,C代考,Computer Networkshelp,Packet Switchinghelp,Route Lookuphelp,Chelp,Computer Networks作业代写,Packet Switching作业代写,Route Lookup作业代写,C作业代写,Computer Networks编程代写,Packet Switching编程代写,Route Lookup编程代写,C编程代写,Computer Networksprogramming help,Packet Switchingprogramming help,Route Lookupprogramming help,Cprogramming help,Computer Networksassignment help,Packet Switchingassignment help,Route Lookupassignment help,Cassignment help,Computer Networkssolution,Packet Switchingsolution,Route Lookupsolution,Csolution,