In the CIS656 project, spring 2002, Prof Ott, you will write a program that mimmicks the behavior of routers. You are given a corporate network layout. You will be given next week network identifiers (in CIDR notation) and MTUs for the LANs in this corporate network. You will construct ``by hand'' routing tables for the routers in this network. Routing will be based on the ``min hop'' principle. You will be given a method to break ties. For example, Router 1 to network V has two ``two hop'' routes: III-R14-IX-R6-V and II-R3-VIII-R5-V . You then will write a program that reads packets entering Router 1 (R1) and decides what to do with them. The examples below and in the Sample Input File and Sample Output File are based on network addresses and MTUs from a previous version of the project. Network addresses and MTUs will change! In the real input file I will use to test your program I will have packets without options, and packets with the strict source route option. No other options. In the real input file I will use to test your program all input packets will enter Router R1, through one of the Interfaces A1, A2, A3, A4. You then decide what R1 does with that packet. For input, the format of a packet will be as follows (example): The current Sample Input File only contains packets without options, and is based on old addresses and MTUs. After I have modified LAN addresses and MTUs I will give new sample input files and sample output files that contain packets with the strict source route option. In my Sample Output File I repeat the input packet in ``human readable form''. I recommend you do that also. I have decided to break the project into two pieces: (1) write a program that reads an input packet in binary, and then prints the same packet in human readable form. This is done by every student individually, and is due March 25. I recommend you make sure to be done with this phase by March 16. (2) write the program that does the actual routing. This is done in teams. I recommend teams of 2. Teams of 1 are allowed, but I advice against it. Teams of 3 need special permission. Larger teams will not be allowed. All team members get the same grade for the project, independent of number of members. Students form their own teams. I recommend every team contains (at least) one student who is real good in organizing the logic of the program, and (at least) one who is real good in coding. The final project is due April 20. I prefer use of gcc, g++, CC, or javac. Programs I or Ms Zhang have trouble getting to run are not acceptable. No Visual Basic. Example (based on old adresses and MTUs, use this for format): INPUT (this line is not part of the input!) A3 01000101000000000000000011110000 01010101010101010000000000000000 00011111000100010000000000000000 00010100000101000001010000010100 10101010101010100001010100001111 This means: the packet enters R1 at Interface A3. The IP header is given in binary. Since the header length is 5 times 4 = 20 bytes, and the Total Length is 240 bytes, the number of data bytes must be 220 bytes. Unlike Professor Karvelas I do not give the number of data bytes separately: You must compute it. But I do give the input interface. Your output now will look as follows: OUTPUT (this line is not part of the output!): A4, direct delivery to a host on network I. 1 Fragment. Fragment 1: VERS = 4, HLEN = 5, Service = 0, TL = 240 Ident = 21845, FLAGS = 0, FragmOffset = 0 TTL = 30, PROT = 17, Checksum = 0 SourceAddress = 20.20.20.20 DestAddress = 170.170.21.15 DataField = 220 bytes. ------- (these ARE part of the output!). If you say ``PROT = UDP'' that is also OK (in this case). As long as your answer is correct. In case of fragmentation there are multiple output packets. Example: INPUT: A2 01000101000000000001010100000000 01010101010101010000000000000000 00011111000100010000000000000000 10101010101010101000000100010001 10101010101010100001000100010001 The packet has Total Length 5376 bytes (please check!). HLEN = 5, so there are 5376 - 4x5 = 5356 data bytes. 5376 is larger than the MTU of network I (4464 bytes), so fragmentation occurs. Fragment 1 will contain kx8 data bytes, where k is the largest integer for which kx8 + 20 is .LE. 4464. k = floor of (4464 - 20)/8 = 555. So fragment 1 will contain 555x8 = 4440 data bytes, and fragment 2 will contain 5356 - 4440 = 916 data bytes. Fragment 1 will have Total Length 4440 + 20 = 4460 bytes. Fragment 2 will have Total Length 916 + 20 = 936 bytes. OUTPUT: A4, Direct Delivery to Host on Network I. 2 Fragments Fragment 1: VERS = 4, HLEN = 5, Service = 0, TL = 4460 Ident = 21845, FLAGS = 1, FragOffset = 0 TTL = 30, PROT = UDP, Checksum = 0 SourceAddress = 170.170.129.17 DestAddress = 170.170.17.17 DataField = 4440 bytes Fragment 2: VERS = 4, HLEN = 5, Service = 0, TL = 936 Ident = 21845, FLAGS = 0, FragOffset = 555 TTL = 30, PROT = UDP, Checksum = 0 SourceAddress = 170.170.129.17 DestAddress = 170.170.17.17 DataField = 916 bytes ------- If you had said ``PROT = 17'' that would have been OK, too. As long as it is correct. Good Luck. Teun Ott.