background image
OSI Layer 3: Routed and Routing Protocols
45
The Flags field follows, using only three bits. This field is used to control
fragmentation of a datagram. If the datagram may be fragmented, the first
bit has a value of 0. A value of 1 is assigned to the first bit if the datagram
is not to be fragmented. The second bit is used to indicate the last fragment
of a fragmented datagram. The third bit is an undefined bit and is set to 0.
Fragment Offset
follows the Flags field. This value uses 13 bits and
specifies the fragments position in the original datagram. The position is
measured from the beginning of the datagram and marked off in 64-bit
increments. This again brings you to 32 bits, so you must move down to the
next layer in the IP packet.
The third layer begins with the Time-to-Live (TTL) field. This field is a
counter whose units are measured in hops. A starting value is given and it
counts decrements by one as it passes through each hop or router. Once the
value of this field is 0, the packet is discarded. This field uses eight bits.
The protocol field (IP Type) follows the TTL parameter. This field tells
Layer 3 which upper-layer protocol is supposed to receive the packet. It uses
a decimal value to specify the protocol. This field uses eight bits.
The Header Checksum field finishes the third layer. The checksum is used
to help verify the integrity of the IP header. This field uses 16 bits.
Layers 4 and 5 are 32 bits long, Because IP addresses use four octets--
eight bits each--the IP address occupies the entire level. Layer 4 is reserved
for the source address, and the fifth layer is reserved for the destination
address.
An Options field occupies the sixth and final layer of the header. The field
needs to be 32 bits long so that any additional empty bits are padded.
Figure 2.8 gives a good visual representation of the IP packet structure.
F I G U R E 2 . 8
The IP packet structure
Version
IHL
Type of service
Total length
Identification
Flags
Fragment offset
TTL
Protocol
Header checksum
Source IP address
Destination IP address
Options
Padding
0
4
8
16
19
31
Copyright ©2000 SYBEX , Inc., Alameda, CA
www.sybex.com