Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.

Similar presentations


Presentation on theme: "© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas."— Presentation transcript:

1 © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas E. Comer Lecture PowerPoints By Lami Kaya, LKaya@ieee.org

2 © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.2 Chapter 21 IP Encapsulation, Fragmentation, And Reassembly

3 © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.3 Topics Covered 21.1 Introduction 21.2 Datagram Transmission And Frames 21.3 Encapsulation 21.4 Transmission Across An Internet 21.5 MTU, Datagram Size, And Encapsulation 21.6 Reassembly 21.7 Identifying A Datagram 21.8 Fragment Loss 21.9 Fragmenting A Fragment

4 © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.4 21.1 Introduction This chapter Concludes the discussion of IP by describing datagram transmission in detail Shows how a host or router sends a datagram across a physical NW Shows how routers handle the problem of sending large datagrams

5 © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.5 21.2 Datagram Transmission And Frames NW HW does not understand –datagram format or Internet addressing Each HW technology defines a frame format and a physical/HW addressing (HWA) scheme HW only accepts and delivers packets that –adhere to the specified frame format and use the specified HWA An internet can contain heterogeneous NW technology –the frame formats may differ

6 © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.6 21.3 Encapsulation How can a datagram be transmitted across a physical NW that does not understand the datagram format? –A technique known as “encapsulation” is used –IP encapsulation is similar to the encapsulation of ARP messages –When an IP datagram is encapsulated in a frame the entire datagram is placed in the data area of a frame How does a receiver know whether the data area in an incoming frame contains an IP datagram or other data? –The sender and receiver must agree on the value used in the frame type field

7 © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.7

8 8 21.4 Transmission Across An Internet After the sender selects a next hop –the sender encapsulates the datagram in a frame –and it transmits the result across the physical NW to the next hop When the frame reaches the next hop –the receiving SW removes the IP datagram –and it discards the frame If the datagram must be forwarded across another NW Then a new frame is created Frame headers do not accumulate during a trip –When a datagram arrives in a NW frame The receiver extracts the datagram from the frame data area and discards the frame header

9 © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.9

10 10 21.5 MTU, Datagram Size, And Encapsulation (1) Each HW technology specifies –the maximum amount of data that a frame can carry –the limit is known as a maximum transmission unit (MTU) A datagram must be smaller or equal to the NW MTU –Otherwise, it cannot be encapsulated for transmission In an internet that contains heterogeneous NWs –MTU restrictions can cause a problem Figure 21.3 illustrates a router that interconnects two NWs with MTU values of 1500 and 1000

11 © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.11

12 © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.12 21.5 MTU, Datagram Size, And Encapsulation (2) When a datagram > MTU –the router divides it into smaller pieces called fragments –and it sends each fragment independently A fragment has a similar format as other datagrams, but in the header –A bit in the FLAGS indicates whether a datagram is a fragment or a complete datagram –Other fields are assigned information that is used to reassemble –The FRAGMENT OFFSET field in the header of a fragment specifies where in the original datagram the fragment belongs A router uses the NW MTU and the datagram header size to calculate –the maximum amount of data that can be sent in each fragment –and the number of fragments that will be needed The router then –creates each fragment with a copy of the original header, –and then it modifies individual header fields.

13 © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.13

14 © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.14 21.6 Reassembly The process of creating original datagram from fragments –called “reassembly” The fragment that carries the final piece of data has an additional bit set in the header –a receiver performing reassembly can tell whether all fragments have arrived successfully IP specifies that –the ultimate destination host should reassemble fragments Requiring the ultimate destination to reassemble fragments has two main advantages –1 st, it reduces the amount of state information in routers –2 nd, it allows routes to change dynamically

15 © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.15

16 © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.16 21.7 Identifying A Datagram Recall that IP does not guarantee delivery –individual datagrams/fragments can be lost or arrive out-of-order How does IP SW reassemble fragments that arrive out of order? –Unique identification number in the IDENTIFICATION field When a router fragments the datagram –the identification number is placed into each fragment A receiver uses the identification number and IP source address in an incoming fragment –to determine the datagram to which the fragment belongs The FRAGMENT OFFSET field –tells a receiver how to order fragments within a given datagram

17 © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.17 21.8 Fragment Loss When one or more fragments from a datagram arrive, and some fragments are delayed or lost? –we must save the fragments in case missing fragments are only delayed A receiver cannot hold fragments an arbitrarily long time because fragments occupy space in the receiver's memory –To avoid exhausting memory IP specifies a maximum time to hold –When the first fragment arrives from a given datagram the receiver starts a timer –If all fragments of a datagram arrive before the timer expires the receiver cancels the timer and reassembles the datagram –If the timer expires before all fragments arrive the receiver discards those fragments that have arrived The result of IP's reassembly timer is all-or-nothing

18 © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.18 21.9 Fragmenting A Fragment What happens if a fragment eventually reaches another NW that has a smaller MTU? –Another router along the path divides into smaller fragments IP does not distinguish between original fragments and sub-fragments. –A receiver cannot know whether an incoming fragment was the result of one router fragmenting a datagram or multiple routers fragmenting fragments The advantage of making all fragments the same –is that a receiver can perform reassembly of the original datagram without first reassembling sub-fragments doing so saves CPU time and reduces the amount of information needed in the headers


Download ppt "© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas."

Similar presentations


Ads by Google