Unit-3 - IPv4 and IPv6 - 5 PDF
Unit-3 - IPv4 and IPv6 - 5 PDF
Unit-3 - IPv4 and IPv6 - 5 PDF
Solution
There is an error in this packet. The 4 leftmost bits (0100)
show the version, which is correct. The next 4 bits (0010)
show an invalid header length (2 × 4 = 8). The minimum
number of bytes in the header must be 20. The packet has
been corrupted in transmission.
Example 20.2
Solution
The HLEN value is 8, which means the total number of
bytes in the header is 8 × 4, or 32 bytes. The first 20 bytes
are the base header, the next 12 bytes are the options.
Example 20.3
Solution
The HLEN value is 5, which means the total number of
bytes in the header is 5 × 4, or 20 bytes (no options). The
total length is 40 bytes, which means the packet is
carrying 20 bytes of data (40 − 20).
Example 20.4
Solution
To find the time-to-live field, we skip 8 bytes. The time-to-
live field is the ninth byte, which is 01. This means the
packet can travel only one hop. The protocol field is the
next byte (02), which means that the upper-layer protocol
is IGMP.
Fragmentation
How do we connect networks with different maximum packet sizes?
Need to split up packets, or discover the largest size to use.
Different networks have different maximum packet sizes
Or MTU (Maximum Transmission Unit)
Packet Size Solutions
Fragmentation
Split up large packets in the network acceptable
range
Routers fragment packets that are to large to forward
Receiving host reassembles to reduce the load on
routers
Classic method
Discovery
Find the largest that fits on the network path and
use it
IP uses today instead of fragmentation
IPv4 Fragmentation Fields
Header fields used to handle packet size differences
Identification, Fragmentation offset, MF/DF control bits
IPv4 Fragmentation Procedure:
Routers split a packet that is too large:
Solution:
For Ethernet v2, MTU = 1,500 bytes.
a) The data payload of the packet is : DP = PL-IPHL
Solution
If the M bit is 0, it means that there are no more
fragments; the fragment is the last one. However, we
cannot say if the original packet was fragmented or not. A
non-fragmented packet is considered the last fragment.
Example 20.6
Solution
If the M bit is 1, it means that there is at least one more
fragment. This fragment can be the first one or a middle
one, but not the last one. We don’t know if it is the first
one or a middle one; we need more information (the
value of the fragmentation offset).
Example 20.7
Solution
Because the offset value is 0, it is the first fragment.
Example 20.8
Solution
To find the number of the first byte, we multiply the offset
value by 8. This means that the first byte number is 800.
We cannot determine the number of the last byte unless
we know the length.
Example 20.9