Chap 19 IP Encapsulation Fragmentation and Reassembly u
Chap. 19 - IP Encapsulation, Fragmentation and Reassembly u In this chapter, we will introduce: u Datagram transmission and frames u Encapsulation u MTU u Fragmentation: 1/16/2022 1
Datagram Transmission and Frames u IP internet layer u Constructs datagram u Determines next hop u Hands to network interface layer u Network interface layer u Binds next hop address to hardware address u Prepares datagram for transmission 1/16/2022 2
LANs 1/16/2022 3
Types of Connection 1/16/2022 4
Encapsulation u Network interface layer encapsulates IP datagram as data area in hardware frame u Hardware ignores IP datagram format IP Header IP Data Area Frame Header u Standards Frame Data for encapsulation describe details: u Standard defines data type for IP datagram, as well as others (e. g. , ARP) u Receiving protocol stack interprets data area based on frame type 1/16/2022 5
Encapsulation Across Multiple Hops u Each router in the path from the source to the destination: u Unencapsulates incoming datagram from frame u Processes datagram - determines next hop u Encapsulates datagram in outgoing frame according to next hop u Datagram may be encapsulated in different hardware format at each hop u Datagram itself is unchanged unless it is larger than MTU 1/16/2022 6
Transmission Across an Internet S Source Net 1 R 1 Datagram Header 1 Net 2 Datagram R 2 Net 3 Header 2 Header 3 Net 4 1/16/2022 Destination Datagram R 3 D Datagram 7
Datagram Movement 1/16/2022 8
Datagram Movement Frame 1 DH 1 IP TH DT 1 Frame 2 DH 2 IP TH DT 2 Frame 3 DH 3 IP TH DT 3 DHX: Data link Header for network X DTX: Data link Trailer for network X IP : Internet Protocol header TH : Transport Header Internet packet 1/16/2022 9
Maximum Transmission Unit (MTU) u Every hardware technology specification includes the definition of the maximum data payload which is called the maximum transmission unit (MTU): u Ethernet: 1518 bytes u Token ring: 2048 or 4096 bytes u FDDI: 4500 bytes u ATM: 48 bytes u Any datagram encapsulated in a hardware frame must be smaller than the MTU for that hardware 1/16/2022 10
Datagram Transmission u IP datagrams is often larger than most hardware MTUs; IP: 216 - 1= 64 Kbytes u Source can simply limit IP datagram size to be smaller than local MTU u MTU = Data + header u Must pass local MTU up to TCP for TCP segments 1/16/2022 11
MTU and Heterogeneous Networks u An internet may have networks with different MTUs u Suppose downstream network has smaller MTU than local network? Net 1 (MTU=1500) H 1 Net 2 (MTU=1000) R Host 1/16/2022 H 2 Host 12
Fragmentation u It is a technique which limits datagram size to smallest MTU of any network u IP uses fragmentation: datagrams can be split into fragments to fit in network with small MTU u When a router detects datagram larger than network MTU: u Splits into pieces u Each piece smaller than the outbound network MTU 1/16/2022 13
IP Diagram (three fragments) IP Header IP Hdr 1 1/16/2022 data 1 original datagram data area IP Hdr 2 data 2 IP Hdr 3 data 3 14
Fragmentation (details) u Each fragment is an independent datagram u Includes all header fields u Bit in header indicates datagram is a fragment u Other fields have information for reconstructing original datagram u FRAGMENT OFFSET gives original location of fragment u Router uses local MTU to compute size of each fragment u Puts part of data from original datagram in each fragment u Puts other information into header 1/16/2022 15
Transparent Fragmentation u Frag. caused by a network is transparent to any subsequent nets through which the packet must pass on its way to the destination u Used in ATM and called Segmentation 1/16/2022 16
Transparent Fragmentation u It is simple to implement u Problems: u Overhead by fragmenting and assembling at every small network u Exit gateway must know when it receives all pieces using count field or end of packet bit u All packet must exit from the same gateway ( same route) which reduce performance 1/16/2022 17
Nontransparent Fragmentation • G 1 fragments a large packet into multiple fragments with numbers • The fragments are assembled at the final destination 1/16/2022 18
Nontransparent Fragmentation u All fragments are passed thru multiple exit gateways; high bandwidth u Re-assembly occurs at the destination host u Problems: u Every host should be able to assemble fragments u Overhead for large packets which have large number of fragments; everyone has its own header 1/16/2022 19
Datagram Reassembly u Reassembly is reconstruction of original datagram which is done in the destination or earlier H 1 Host Net 1 MTU=1500 Net 2 MTU=1000 R 1 1/16/2022 H 2 Net 3 MTU=1500 R 2 20
Datagram Reassembly u Fragments may arrive out of order; header bit identifies fragment containing end of data from original datagram u Fragment 3 identified as last fragment 1/16/2022 21
Fragment Identification u How are fragments associated with original datagram? u IDENT field in each fragment matches IDENT field in original datagram u Fragments from different datagrams can arrive out of order and still be sorted out 1/16/2022 22
Fragment Loss u IP may drop a fragment u What happens to original datagram? u Destination u How drops entire original datagram does destination identify lost fragment? u Sets timer with each fragment u If timer expires before all fragments arrive, fragment assumed lost u Datagram dropped u Source (application layer protocol) assumed to retransmit 1/16/2022 23
Fragmenting a Fragment u Fragment may encounter subsequent network with even smaller MTU u Router fragments the fragment to fit u Resulting (sub)fragments look just like original fragments (except for size) u No need to reassemble hierarchically; (sub)fragments include position in original datagram 1/16/2022 24
Summary u IP uses encapsulation to transmit datagrams in hardware frames u Each network technology has an MTU u IP uses fragmentation to carry IP datagrams larger than network MTU: u Transparent Fragmentation u Non-transparent Fragmentation 1/16/2022 25
- Slides: 25