Title: IP Encapsulation, Fragmentation, And Reassembly
1IP Encapsulation, Fragmentation, And Reassembly
- Computer Science
- Prof. Martins
2Introduction
- Previous chapter
- IP datagram format
- Routing
- This chapter
- IP datagram transmission
3Datagram Transmission
- IP software selects the next hop to Transmit the
datagram across the physical network - Network hardware does not understand datagram
format or internet addressing - Hardware understands frames
- Frames may differ from network to network
4Encapsulation
- How can a datagram be transmitted across a
network that does not understand the datagram
format? - The answer Encapsulation
- When an IP datagram is encapsulated in a frame,
the entire datagram is placed in the data area of
a frame.
5Encapsulation
- Figure 21.1 - An IP datagram encapsulated in
a hardware frame. The entire datagram resides in
the frame data area. In practice, the frame
format used with some technologies includes a
frame trailer as well as frame header.
6Encapsulation
- How does a receiver know whether the data area in
an incoming frame contains an IP datagram or
other data? - Answer The sender and receiver agree on the
value used in the frame type field. - A special value is reserved for IP.
7Encapsulation
- In addition to placing a datagram in the data
area of a frame, encapsulation requires the
sender to supply the physical address of the next
computer - Address binding computes the appropriate
hardware address (ARP - chapter 19) - The binding translates the IP address of the next
hop into an equivalent hardware address.
8Summary
- A datagram is encapsulated in a frame
- The destination address in the frame is the
address of the next hop - The destination of the next hop is obtained by
translating the IP address of the next hop to an
equivalent hardware address.
9Transmission Across An Internet
Figure 21.2 - An IP datagram as it appears at
each step during a trip across an internet.
Whenever it travels across a physical network,
the datagram is encapsulated in a frame
appropriate to the network.
10Transmission Across An Internet
- Encapsulation applies to one transmission at a
time - After the sender selects a next hop, the sender
encapsulates the datagram in a frame and
transmits the result across the physical network
to the next hop. - When the frame receives the next hop, the
receiving software removes the IP datagram and
discards the frame.
11Transmission Across An Internet
- Frame headers do not accumulate during a trip
through the internet. - Before a datagram is transmitted across a given
network, the datagram is encapsulated - When the frame arrives at the next hop, the
datagram is removed from the incoming frame,
before being routed and encapsulated in an
outgoing frame.
12Transmission Across An Internet
- When the datagram reaches its final destination,
the frame that carried the datagram is discarded - The datagram appears exactly the same as when it
was originally sent - When a datagram arrives in a network frame, the
receiver extracts the datagram from the frame
data area and discards the frame header.
13MTU, Datagram Size, and Encapsulation
- MTU is the Maximum Transmission Unit the
maximum amount of data that a frame can carry. - In an Internet that connects heterogeneous
networks, MTU restrictions can cause a problem
14MTU, Datagram Size, and Encapsulation
Figure 21.3 - An example of a router that
connects two networks with different MTU values.
A frame that travels across the network 1 can
contain 1500 octets of data, while a frame that
travels across network 2 can contain at most 1000
octets of data.
15MTU, Datagram Size, and Encapsulation
- An IP router uses a technique known as
fragmentation to solve the problem of
heterogeneous MTUs. - When a datagram is larger than the MTU, the
router divides the datagram into smaller pieces
called fragments. - Each fragment is sent separately.
16MTU, Datagram Size, and Encapsulation
- A bit in the FLAGS field indicate whether a
datagram is a fragment or a complete datagram. - A fragment has the same format as the other
datagrams. - The FRAGMENT OFFSET field in the header of a
fragment specifies where in the original datagram
the fragment belongs.
17MTU, Datagram Size, and Encapsulation
Figure 21.4 - An IP datagram divided into three
fragments. Each fragment carries some data from
the original datagram, and has an IP header
similar to the original datagram.
18Summary
- A datagram cannot be larger than the MTU of a
network over which it is sent. - A router divides the datagram into smaller pieces
called fragments. - Each fragment uses the IP datagram format, but
carries only parts of the data.
19Reassembly
- The process of creating a copy of the original
datagram from fragments is called reassembly. - All fragments have the same destination address
as the original datagram. - 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.
20Reassembly
Figure 21.5 - An example internet in which hosts
can generate datagrams that require
fragmentation. Once a datagram has been
fragmented, the fragments are forwarded to the
final destination, which reassembles them.
21Identifying A Datagram
- Since IP does not guarantee delivery, some
fragments can be lost or arrive out of order. - How does IP reassemble fragments that arrive out
of order? - IDENTIFICATION field a unique ID number of each
outgoing datagram.
22Identifying A Datagram
- When a router fragments the datagram, the router
copies the ID number into each fragment. - The FRAGMENT OFFSET field tells a receiver how to
order fragments within a given datagram
23Fragment Loss
- Recall that IP does not guarantee datagram
delivery - Some fragments may be delayed or lost
- Datagrams with lost fragments cannot be
reassembled - Fragments may be saved temporarily.
- IP specifies a maximum time to hold fragments.
- After a timer expires, saved fragments are
discarded.
24Fragmenting a Fragment
- If a fragment reaches another network that has a
smaller MTU, it is possible to further fragment a
fragment. - IP does not distinguish between original
fragments and sub fragments. - The advantage of making all fragments the same is
that a receiver can perform reassembly without
first reassembling sub fragments.
25Summary
- An IP datagram is encapsulated in a network frame
for transmission across a hardware network. - To encapsulate a datagram, the sender places the
entire datagram in the data area of a network
frame. - Each network technology defines the maximum
amount of data (MTU) accepted.
26Summary
- When a router receives a datagram that is larger
than the network MTU, the router divides the
datagram into fragments. - Each fragment travels to the ultimate
destination, which is responsible for
reassembling fragments into the original
datagram.