Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Internet Networking Spring 2002 Tutorial 2 IP Checksum, Fragmentation.

Similar presentations


Presentation on theme: "1 Internet Networking Spring 2002 Tutorial 2 IP Checksum, Fragmentation."— Presentation transcript:

1 1 Internet Networking Spring 2002 Tutorial 2 IP Checksum, Fragmentation

2 2 IP Header Diagram

3 3 IP Checksum Checksum field in IP header serves to ensure integrity of IP header values Checksum applies only to values in the IP header and not to the data of a packet Advantages (of separation) –Reduce processing time at routers –Allows higher level protocols to choose their own checksum scheme for the data Disadvantages –No checking of data integrity, higher level protocols should implement it by themselves

4 4 Algorithm for Counting Checksum (RFC 1071) Adjacent octets to be checksummed are paired to form 16-bit integers, and the 1's complement sum of these 16-bit integers is formed. The checksum field is cleared, the 16-bit 1's complement sum is computed over the octets concerned, and the 1's complement of this sum is placed in the checksum field.

5 5 Algorithm for Checking Checksum (RFC 1071) To check a checksum, the 1's complement sum is computed over the same set of octets, including the checksum field. If the result is all 1 bits, the check succeeds.

6 6 Checksum - Example

7 7 Checksum - Remarks There are different speed up techniques for implementation of counting checksum (described in RFC 1071). TCP/UDP checksums are counted in the similar way.

8 8 Checksum - Incremental Update Updating part of the IP header data doesn’t require recomputing the entire Checksum field. (For example: when a router changing the TTL field.) The technique for speed up checksum recomputing in this case called - incremental checksum update (RFC 1071 and corrections in RFC 1141).

9 9 Checksum - Incremental Update C - Old Sum, m - Old Data C’ - New Sum, m’ - New Data C’ = C + (-m) + m’ = C + ( m’ – m)  For counting the 1's complement of the checksum ~C: ~C' = ~(C + (-m) + m') = ~C + (m - m') = ~C + m + ~m'

10 10 Incremental Update - Example Subtracting 1 from TTL field (common case) ~C’ = ~C + (m - m’) = ~C + 0100H (TTL byte is higher byte of integer) If ~C=220dh then ~C’ = 220dH + 0100H = 230dH

11 11 IP Fragmentation When a packet sent on the Internet from one point to another it can traverse in its way through different physical networks. We prefer to put the entire IP datagram into one physical frame, but in each technology there is a limit for maximal number of bytes that could be sent in one physical frame. This limit called MTU – Maximal Transfer Unit (for example: in Ethernet MTU is 1500 bytes).

12 12 IP Fragmentation Host A Host B Net 3 MTU=1500 R1R2 Net 2 MTU=620 When a fragmentation is done? Example: Net 1 MTU=1500

13 13 IP Fragmentation IP layer automatically performs fragmentation of a datagram when its too large to be sent on physical network. Reassembling of a datagram performed at the final destination (making it transparent for TCP/UDP layer). A datagram could be fragmented more than one time. There is enough information in IP header to enable reassembling of the datagram.

14 14 Fragmentation Control Three fields in the datagram IP header controls fragmentation and reassembly of datagrams: –IDENTIFICATION –FLAGS –FRAGMENT OFFSET

15 15 Identification field Unique integer that identifies the datagram When a router fragments a datagram it copies most of the datagram header fields into each fragment. –IDENTIFICATION field should be copied –It’s primary purpose is to allow the destination to know which arriving packets belongs to which datagram –Computers sending IP datagrams must generate a unique Identification value for each datagram Implemented by counter, which increments by one

16 16 Fragment Offset field Specifies the offset of the data in a fragment comparing to the original datagram Measured in units of 8 bytes, starting at offset 0 –The reason: field size is 13 bits and needs to map a field of 16 bits (ID datagram total length field) Fragments don’t necessarily arrive in order –The destination should wait for arriving of all fragments to assembly the packet –It limits waiting by Reassemble timer.

17 17 Flags field Do not Fragment Bit –If set to 1 than a datagram shouldn’t be fragmented –Can be used, for example, when the receiver doesn’t know how to reassembly packets –If fragmentation required, but this bit is set than the packet is discarded and ICMP error is returned More Fragments Bit –If there are more fragments or this is the last –It has value 1 for all fragments except the last –Required to reassembly a packet (why?)

18 18 Fragmentation - Example Datagram header Data 1 600 octets Data 2 600 octets Data 3 200 octets Datagram header Data 1 600 octets Datagram header Data 2 600 octets Data 3 200 octets Datagram header Fragment 1 offset = 0 Fragment 2 offset = 75 Fragment 3 offset = 150 b a


Download ppt "1 Internet Networking Spring 2002 Tutorial 2 IP Checksum, Fragmentation."

Similar presentations


Ads by Google