IPV4
IPV4
Internet
Protocol
Version4
(IPv4)
Solution
There is an error in this packet. The 4 left-most bits (0100)
show the version, which is correct. The next 4 bits (0010)
show the wrong header length (2 × 4 = 8). The minimum
number of bytes in the header must be 20. The packet has
been corrupted in transmission.
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.
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).
Solution
To find the time-to-live field, we skip 8 bytes (16
hexadecimal digits). 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 (see Table 7.2)
■ End nodes
■ Avoids unnecessary work where large packets
are fragmented multiple times
■ If any fragment missing, delete entire packet
IP IP
Header Data
Lecture 9: 2-8-05 27
IP Fragmentation Example
#2 MTU =
2000
router
router
Length = 2000, M=1, Offset = 0
Length = 3820, M=0
IP IP
IP IP Header Data
Header Data
1980 bytes
3800 bytes
Length = 1840, M=0, Offset = 1980
IP IP
Header Data
1820 bytes
Lecture 9: 2-8-05 28
IP Fragmentation Example
#3 Length = 1500, M=1, Offset = 0
host IP IP
router
MTU = 1500 Header Data
Lecture 9: 2-8-05 30
Fragmentation and
Reassembly Concepts
■ Demonstrates many Internet concepts
■ Decentralized
■ Every network can choose MTU
■ Connectionless
■ Each (fragment of) packet contains full routing
information
■ Fragments can proceed independently and along
different routes
■ Best effort
■ Fail by dropping packet
■ Destination can give up on reassembly
■ No need to signal sender that failure occurred
■ Complex endpoints and simple routers
■ Reassembly at endpoints
Lecture 9: 2-8-05 31
Figure 7.8 Fragmentation example
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 nonfragmented
packet is considered the last fragment.
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). See also the next example.
Solution
Because the M bit is 1, it is either the first fragment or a
middle one. Because the offset value is 0, it is the first
fragment.
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 of the data.
Solution
The first byte number is 100 × 8 = 800. The total length is
100 bytes and the header length is 20 bytes (5 × 4), which
means that there are 80 bytes in this datagram. If the first
byte number is 800, the last byte number must be 879.
Solution
We look at the first (left-most) bit of the type for each
option.
Solution
We look at the second and third (left-most) bits of
the type.
a. No operation: type is 00000001; datagram
control.
b. End of option: type is 00000000; datagram
control.
c. Record route: type is 00000111; datagram
control.
d. Strict source route: type is 10001001; datagram
control.
e. Loose source route: type is 10000011; datagram
TCP/IP Protocol Suite 54
Example
7.12
One of the utilities available in UNIX to check the traveling
of the IP packets is ping. In the next chapter, we talk about
the ping program in more detail. In this example, we want to
show how to use the program to see if a host is available.
We ping a server at De Anza College named fhda.edu. The
result shows that the IP address of the host is 153.18.8.1.
The result also shows the number of bytes used.