IPv4 Datagram Options and Option Format
IP Option Format
Internet Protocol Version 4 (IPv4) Option Format
All IP datagrams must include the standard 20-byte header, the creators of IPv4 included the ability to add options that provide additional flexibility in how IP handles datagrams.
The IP datagram may contain zero, one or more options, which makes the total length of the Options field in the IP header variable. Each of the options can be either a single byte long, or multiple bytes in length, depending on how much information the option needs to convey. When more than one option is included they are just concatenated together and put into the Options field as a whole. Since the IP header must be a multiple of 32 bits, a Padding field is included if the number of bits in all options together is not a multiple of 32 bits.
Each IP option has its own subfield format, generally structured as shown in below table and picture. For most options, all three subfields are used: Option Type, Option Length and Option Data.
Subfield Name
|
Size (bytes)
|
Description
|
Option Type
|
1
| |
Option Length
|
0 or 1
|
Option Length: For variable-length options, indicates the size of the entire option, including all three subfields shown here, in bytes.
|
Option Data
|
0 or Variable
|
Option Data: For variable-length options, contains data to be sent as part of the option.
|
Internet Protocol Version 4 (IPv4) Option Format
* Copied --> Fragments (1 or 0 ) (1 bit)
* Option Class --> 0: Control 2: Debug (2bits) * Option Number --> 32 different of value can be assigned.
Below table lists the most common IPv4 options, showing the option class, option number and length for each (a length of 1 indicating an option that consists of only an Option Type field), and providing a brief description of how each is used.
Each IP option has its own subfield format, generally structured as shown in below table and picture. For most options, all three subfields are used: Option Type, Option Length and Option Data.
IP Options and Source Routing
In some cases, the source of a datagram may specify the route a datagram takes through the network. This is called source routing.
There are two IP options that support source routing. In each, the option includes a list of IP addresses specifying the routers that must be used, to reach the destination. When strict source routing is used, this means that the path specified in the option must be used exactly, in sequence, with no other routers permitted to handle the datagram at all. In contrast, loose source routing specifies a list of IP addresses that must be followed in sequence, but having intervening hops in between the devices on the list is allowed.
* This is from http://www.tcpipguide.com/free/t_IPDatagramOptionsandOptionFormat-3.htm |