INFORMATIO
Solutions_OSI_Exercises.pdf

# How to compute 1 divide the header into 16 bit blocks

• Homework Help
• 50

This preview shows pages 9–14. Sign up to view the full content.

How to compute: (1) Divide the header into 16- bit blocks. Use 2’s complement addition to add all 16-bit blocks (8 blocks), store the result in a 32-bit word. (2) Add the carry (bits higher than the 16 th bit) back to the 16-bit result (3) Compute the 1’s complement of the 16 -bit result Example: “2a67” is the result. Set it to zero before we compute the checksum.

This preview has intentionally blurred sections. Sign up to view the full version.

Computer Networks: An Open Source Approach 10 (1) 4 5 0 0 0 0 d 3 0 1 8 4 0 0 0 0 8 0 1 1 0 0 0 0 8 c 7 1 7 a 8 d 8 c 7 1 +) 7 a b f ------------- 2 d 5 9 6 (2) d 5 9 6 +) 0 0 0 2 ------------- d 5 9 8 (3) ~( d 5 9 8)= 2 a 6 7 Open Source Implementation 4.4: IPv4 Fragmentation Exercises
Computer Networks: An Open Source Approach 11 Use wireshark to capture some IP fragments and observe identifier, more flag, and offset fields in their headers. Answer (1 hour): In the following example, we observe a packet with identification 0x116e is fragmented into three fragments (frame 45~47). As we can see from the captured fragments, the more bit of the first two fragments are set to 1 while that of the last fragment is set to zero. Offest of these three fragments are 0, 1480, 2960, respectively. Identification Flag Offset 1 0x116e(4462) 02 0 2 0x116e(4462) 02 1480 3 0x116e(4462) 00 2960

This preview has intentionally blurred sections. Sign up to view the full version.

Computer Networks: An Open Source Approach 12 Open Source Implementation 4.5: NAT Exercises Trace adjust_tcp_sequence() and explain how to adjust sequence number of TCP packets when packets are changed due to address translation. Answer (1.5 hours): As seen in the above figure, mangle_rfc959_packet() will modify the FTP commands according to the new IP address and port number. It then calls nf_nat_mangle_tcp_packet() to modify the packet content. If the length of the new packet is different from the original packet, it sets the IPS_SEQ_ADJUST_BIT flag and then calls adjust_tcp_sequence(). In adjust_tcp_sequence() , this_way is a variable of data type ip_nat_seq. It first checks the following condition: if ( this_way -> offset_before == this_way -> offset_after || before ( this_way -> correction_pos , seq )) adjust_tcp_sequence()
Computer Networks: An Open Source Approach 13 If offset_before==offset_after, it means the packet has not been initialized; The before() function will calculate and check whether correction_pos seq is less than 0; if yes,it means seq is larger than correction_pos, the packet needs to be corrected. If the condition is true, this_way -> correction_pos = seq ; Set correction_pos to seq, this_way -> offset_before = this_way -> offset_after ; Set offset_before to offset_after; this_way -> offset_after += sizediff ; The offset_after is increased by rep_len - match_len. Open Source Implementation 4.6: ARP Exercises The function, _ _neigh_lookup() , is a common function which implements hash buckets. Use free text search or cross reference tool to find out which functions call _ _neigh_lookup() . Trace neigh_lookup() and explain how to lookup an entry from hash buckets.

This preview has intentionally blurred sections. Sign up to view the full version.

This is the end of the preview. Sign up to access the rest of the document.
• Winter '15
• MAhmoudali
• IP address, Transmission Control Protocol

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern