” CSc 361程序设计 写作、 辅导c++,Java程序1 CSc 361: Computer Communications and Networks2 (Spring 2021)3 Assignment 3: Analysis of IP Protocol4 Spec Out: March 5, 20215 Due: 11:55 pm April 2, 20216 1 Goal7 The purpose of this assignment is to learn about the IP protocol. You are required to write a8 python program to analyze a trace of IP datagrams.9 2 Introduction10 In this assignment, we will investigate the IP protocol, focusing on the IP datagram. Well do so11 by analyzing a trace of IP datagrams sent and received by an execution of the traceroute program.12 We will investigate the various fields in the IP datagram, and study IP fragmentation in detail.13 A background of the traceroute program is summarized as follows. The traceroute program14 operates by first sending one or more datagrams With the time-to-live (TTL) field in the IP header15 set to 1; it then sends a series of one or more datagrams towards the same destination with a TTL16 value of 2; it then sends a series of datagrams towards the same destination with a TTL value of 3;17 and so on. Recall that a router must decrement the TTL in each received datagram by 1 (actually,18 RFC 791 says that the router must decrement the TTL by at least one). If the TTL reaches 0, the19 router returns an ICMP message (type 11 TTL-exceeded) to the sending host. As a result of this20 behavior, a datagram with a TTL of 1 (sent by the host executing traceroute) will cause the router21 one hop away from the sender to send an ICMP TTL-exceeded message back to the sender; the22 datagram sent with a TTL of 2 will cause the router two hops away to send an ICMP message back23 to the sender; the datagram sent with a TTL of 3 will cause the router three hops away to send an24 ICMP message back to the sender; and so on. In this manner, the host executing traceroute can25 learn the identities of the routers between itself and a chosen destination by looking at the source26 IP addresses in the datagrams containing the ICMP TTL-exceeded messages. You will be provided27 with a trace file created by traceroute.28 Of course, you can create a trace file by yourself. Note that when you create the trace file,29 you need to use different datagram sizes (e.g., 2500 bytes) so that the captured trace file includes30 information on fragmentation.31 3 Requirements32 There are two requirements for this assignment:133 3.1 Requirement 1 (R1)34 You are required to write a python program to Analyze the trace of IP datagrams created by35 traceroute. To make terminologies consistent, in this assignment we call the source node as the36 computer that executes traceroute. The ultimate destination node refers to the host that is the37 ultimate destination defined when running traceroute. For example, the ultimate destination node38 is mit.edu when you run39 %traceroute mit.edu 200040 In addition, an intermediate destination node refers to the router that is not the ultimate destination41 node but sends back a ICMP message to the source node.42 As another example, you can set dont fragment bit and set the number of probes per ttl43 to 5 queries using the following command:44 %traceroute -F -q 5 mit.edu 20045 Your program needs to output the following information:46 List the IP address of the source node, the IP address of ultimate destination node, the IP47 address(es) of the intermediate destination node(s). If multiple intermediate destination nodes48 exist, they should be ordered by their hop count to the source node in the increasing order.49 Check the IP header of all datagrams in the trace file, and list the set of values in the protocol50 field of the IP headers. Note that only different values should be listed in a set.51 How many fragments were created from the original datagram? Note that 0 means no frag-52 mentation. Print out the offset (in terms of bytes) of the last fragment of the fragmented IP53 datagram. Note that if the datagram is not fragmented, the offset is 0.54 Calculate the average and standard deviation of round trip time (RTT) between the source55 node and the intermediate destination node (s) and the average round trip time between56 the source node and the ultimate destination Node. The average and standard deviation are57 calculated over all fragments sent/received between the source nodes and the (intermediate/58 ultimate) destination node.59 The output format is as follows: (Note that the values do not correspond to any trace file).60 The IP address of the source node: 192.168.1.1261 The IP address of ultimate destination node: 12.216.216.262 The IP addresses of the intermediate destination nodes:63 router 1: 24.218.01.102,64 router 2: 24.221.10.103,65 router 3: 12.216.118.1.6667 The values in the protocol field of IP headers:68 1: ICMP69 17: UDP707172 The number of fragments created from the original datagram is: 3273 The offset of the last fragment is: 36807475 The avg RTT between 192.168.1.12 and 24.218.01.102 is: 50 ms, the s.d. is: 5 ms76 The avg RTT between 192.168.1.12 and 24.221.10.103 is: 100 ms, the s.d. is: 6 ms77 The avg RTT between 192.168.1.12 and 12.216.118.1 is: 150 ms, the s.d. is: 5 ms78 The avg RTT between 192.168.1.12 and 12.216.216.2 is: 200 ms, the s.d. is: 15 ms7980 3.2 Requirement 2 (R2)81 Note: You can finish this part either with a python program or by manually col-82 lecting/analyzing data. In other words, coding is optional for the tasks listed in this83 section.84 From a given set of five traceroute trace files, all with the same destination address,85 determine the number of probes per ttl used in each trace file,86 determine whether or not the sequence of intermediate routers is the same in different trace87 files,88 if the sequence of intermediate routers is different in the five trace files, list the difference and89 explain why,90 if the sequence of intermediate routers is the same in the five trace files, draw a table as shown91 below (warning: the values in the table Do not correspond to any trace files) to compare92 the RTTs of different traceroute attempts. From the result, which hop is likely to incur the93 maximum delay? Explain your conclusion.TTL Average RTT Average RTT Average RTT Average RTT Average RTTin trace 1 in trace 2 in trace 3 in trace 4 in trace 51 0.5 0.7 0.8 0.7 0.92 0.9 1 1.2 1.2 1.33 1.5 1.5 1.5 1.5 2.54 2.5 2 2 2.5 35 3 2.5 3 3.5 3.56 5 4 5 4.5 49495 4 Miscellaneous96 Important! Please read!97 Same as in Assignment 2, you are not allowed in this assignment to use python packages that98 can automatically extract each packet from the pcap files. That means, you can re-use your99 code in Assignment 2 to extract packets.100 Some intermediate router may only send back one ICMP TTL exceeded message for multiple101 fragments of the same datagram. In this case, please use this ICMP message to calculate RTT102 for all fragments. For example, Assume that the source sends Frag 1, Frag2, Frag 3 (of the103 same datagram, ID: 3000). The timestamps for Frag1, Frag2, Frag3 are t1, t2, t3, respectively.3104 Later, the source receives one ICMP TTL exceeded message (ID: 3000). The timestamp is105 T. Then the RTTs are calculated as: T t1, T t2, T t3.106 More explanation about the output format107 The number of fragments created from the original datagram is:108109 The offset of the last fragment is:110 If there are multiple fragmented datagrams, you need to output the above information for111 each datagram. For example, assume that the source sends two datagrams: D1, D2, where112 D1 and D2 are the identification of the two datagrams. Assume that D1 has three fragments113 and D2 has two fragments. Then output should be:114 The number of fragments Created from the original datagram D1 is: 3115116 The offset of the last fragment is: xxx.117118119 The number of fragments created from the original datagram D2 is: 2120121 The offset of the last fragment is: yyy.122123 where xxx and yyy denote the actual number calculated by your program.124 If the tracefile is captured in Linux, the source port number included in the original UDP125 can be used to match against the ICMP error message. This is due to the special traceroute126 implementation in linux, which uses UDP and ICMP. If the tracefile is captured in Windows,127 we should use the sequence number in the returned ICMP error message to match the sequence128 number in the ICMP echo (ping) message from the source node. Note that this ICMP error129 message (type 11) includes the content of the ICMP echo message (type 8) from the source.130 This is due to the special traceroute implementation in Windows, which uses ICMP only131 (mainly message type 8 and message type 11). It is also possible that traceroute may be132 implemented in another different way. For instance, we have found that some traceroute133 implementation allows users to select protocol among ICMP, TCP, UDP and GRE. To avoid134 the unnecessary complexity of your program, you only need to handle the two scenarios135 in finding a match between the original datagram and the returned ICMP error136 message: either (1) use the source port number in the original UDP, or (2) use the137 sequence number in the original ICMP echo message. You code should automatically138 find out the right case for matching datagrams in the trace file. We will not test your code139 with a trace file not falling in the above cases.140 5 Deliverables and Marking Scheme141 For your final submission of your assignment, you are required to submit your source code to142 brightspace. You should include a Readme file to tell TA how to compile and run your code. In4143 addition, you are required to submit a pdf file for your solution of R2. Use %tar -czvf command in144 linux.csc.uvic.ca to generate a .tar file and submit the .tar file. Make sure that you use %tar -xzvf145 command to double-check if you have included all the files before submitting the tar file. Note that146 your code will be tested over linux.csc.uvic.ca.147 The marking scheme is as follows:Components WeightThe IP address of the source node (R1) 5The IP address of ultimate Destination node (R1) 5The IP addresses of the intermediate destination nodes (R1) 10The correct order of the intermediate destination nodes (R1) 5The values in the protocol field of IP headers (R1) 5The number of fragments created from the original datagram (R1) 15The offset of the last fragment (R1) 10The avg RTTs (R1) 10The standard deviations (R1) 5The number of probes per ttl (R2) 10Right answer to the second question (R2) 5Right answer to the third/or fourth question (R2) 10Readme.txt 5Total Weight 100148149 6 Plagiarism150 This assignment is to be done individually. You are encouraged to discuss the design of your solution151 with your classmates, but Each person must implement their own assignment.152 The End请加QQ:99515681 或邮箱:99515681@qq.com WX:codehelp
“
添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导。