IP header
IP header format
0-3 | 4-7 | 8-15 | 16-18 | 19-31 |
---|---|---|---|---|
Version | Head size | Type of Service | Total length | |
Identifier | Flags | Fragment Position | ||
Lifetime | Protocol | Head Control Sume | ||
IP Address of Origin | ||||
IP Address of Destination | ||||
Options | Filling |
Description of each of the fields
The minimum size of the header (ip_pci) is 20 bytes while the maximum is 60 bytes.
Version: 4-bit
It can vary between (0100) or (0110) depending on whether IP version 4 (IPv4) or IP version 6 (IPv6) is used. This field describes the format of the header used. The table describes version 4.
Header Size (IHL): 4 bits
Length of the header, in 32-bit words. Its minimum value is 5 words (5x32 = 160 bits, 20 bytes) for a correct header, and the maximum is 15 words (15x32 = 480 bits, 60 bytes).
Type of Service: 8 bits
Indicates a series of parameters on the desired quality of service during transit through a network. Some networks offer service priorities, considering certain types of "most important" than others (particularly these networks only support packets with high priority in times of overload). These 8 bits are grouped as follows:
- The first 3 bits are related to the precedence of the messages, an attached indicator that indicates the level of urgency based on the military system of precedence (see Message Precedence) of the CCEB, a military electronic communications organization consisting of 5 nations. The urgency of these states increases as the number formed by these 3 bits does, and respond to the following names.
- 000: Routine.
- 001: Priority.
- 010: Immediate.
- 011: Lightning.
- 100: Lightning.
- 101: Processing Critical and Emergency Call.
- 110: Control of Internet work.
- 111: Network control.
- The lower weight 5 bits are independent and indicate service characteristics.
Bit breakdown
- Bits 0 to 2: Priority.
- Bit 3: Retardo. 0 = normal; 1 = low.
- Bit 4: Performance. 0= normal; 1= tall.
- Bit 5: Reliability. 0=normal; 1= tall.
- Bit 6-7: Not used. Reserved for future use.
Total Length: 16 bits
This is the total size, in octets, of the datagram, including the size of the header and the size of the data. The minimum size of the datagrams normally used is 576 octets (64 headers and 512 data). A machine should not send datagrams smaller or larger than this size unless it is certain that they will be accepted by the destination machine.
In case of fragmentation this field will contain the size of the fragment, not the original datagram.
Identifier: 16 bits
Unique identifier of the datagram. It will be used, in case the datagram must be fragmented, to be able to distinguish the fragments of one datagram from those of another. The originator of the datagram must ensure a unique value for the source-destination pair and the protocol type for as long as the datagram can be active on the network. The value assigned in this field must be in network format.
Flags: 3 bits
Currently used only to specify values related to packet fragmentation. The 3 bits (in order from highest to lowest weight) are:
- bit 0: Reserved; must be 0
- bit 1: 0 = Divisible, 1 = Non-Divisible (DF)
- bit 2: 0 = Ultimate Fragment, 1 = Intermediate Fragment (read more fragments) (MF)
- The indication that a package is indivisible must be taken into account under any circumstances. If the package needs to be fragmented, it will not be shipped.
Fragment Position: 13 bits
In fragmented packets indicates the position, in 64-bit units, that the current packet occupies within the original datagram. The first packet of a series of fragments will contain in this field the value 0.
Time to Live (TTL): 8 bits
Indicates the maximum number of routers that a packet can traverse. Each time a node processes this packet, its value decreases by at least one unit. When it reaches 0, the packet will be dropped. It typically takes the value 64 or 128 in datagrams.
Protocol: 8 bits
Indicates the upper layer protocol to which the packet must be delivered See IP Protocol Numbers to understand how to interpret this field.
Header Checksum: 16 bits
- Amount of header control. It is recalculated every time any node changes any of its fields (for example, the Time of Life). The method of calculation -intentionally simple- consists of adding to 1 each word of 16 bits of the header (considering value 0 for the sum field of header control) and making the complement to 1 of the resulting value.
Source IP address: 32 bits
- See IP addresses. It must be given in network format.
Destination IP address: 32 bits
- See IP addresses. It must be given in network format.
Options: Variable
Although the use of this field is not mandatory, any node must be able to interpret it. It can contain an indeterminate number of options, which will have two possible formats:
Simple option formatting
It is determined with a single octet indicating the 'Option Type', which is divided into 3 fields.
- Copy indicator: 1 bit. In case of fragmentation, the option will be copied to each new fragment according to the value of this field:
- 0 = not copied
- 1 = copied.
- Option class: 2 bits. Possible classes are:
- 0 = control
- 1 = reserved
- 2 = depuration and measurements
- 3 = reserved
- Option number: 5 bits. Option ID.
Composite Option Formatting
One octet for 'Option Type', another for 'Option Size', and one or more octets making up 'Option Data'.
The 'Option Size' includes the octet for 'Option Type', 'Option Size' and the sum of the data octets.
The following table shows the currently defined options:
Class | Number | Size | Description |
---|---|---|---|
0 | 0 | - | Final list of options. Simple format. |
0 | 1 | - | No operation (NOP). Simple format. |
0 | 2 | 11 | Security. |
0 | 3 | variable | Routed from Origin, open (Loose Source Routing). |
0 | 9 | variable | Routed from Origin, strict (Strict Source Routing). |
0 | 7 | variable | Route Register (Record Route). |
0 | 8 | 4 | Flow identifier (Stream ID). |
2 | 4 | variable | Time mark (Internet Timestamping). |
- 'Final Options List': It is used at the end of the options list, if it does not match the end of the IP header.
- 'No Operation (NOP)': It can be used to force the alignment of the options in 32-bit words.
- 'Security': Specifies safety levels ranging from "No Classified" to "Secret Maximum", defined by the U.S. National Defense Security Agency. U.S.
- 'Enrutado desde el Origen (abierto) y Registro de Ruta (LSSR)': This option provides the mechanism for the originator of a datagram to indicate the itinerary to follow through the network and to record the path followed.
- Option Data consist of a pointer (an octeto) and a list of IP addresses (4 octets each) to be reached ("process").
- The pointer indicates the position of the following direction of the route, within the Option; thus, its minimum value is 4.
- When an Internet node processes the address of the list pointed out by the pointer (i.e., that direction is reached) the pointer increases in 4, and redirects the package to the next address. If the pointer becomes greater than the Option Size means that the route information has been completely processed and recorded and the package will be redirected to your destination address.
- If the destination address is reached before processing the full address list (the pointer is less than the Option Size) the following address of the list replaces the destination address of the package and is in turn replaced by the node address that is processing the datagram ("Recorded Route"), further increasing the pointer in 4.
- Using this method of replacing the address specified in origin by the Registered Route ensures that the size of the Option (and the IP header) does not vary during its route through the network.
- It is considered that the route specified by the originator is "open" because any node that processes the package is free to direct it to the following address following any other intermediate route.
- It can only be used once in a datagram, and, in case of fragmentation, the option will be copied to the resulting packages.
- 'Running from Origin (strict) and Road Registry (SSRR)': exactly as LSSR, except in the treatment that nodes will make of this datagram. As the specified "strict" route, a node must forward the package directly to the following address, that is, it will not be able to redirect it to another network.
- 'Registration of Route': Using this option you can register the itinerary of a datagram. The Option Data consists of a pointer (an octeto) and a space filled with zeros that will contain the Registered Route for the package.
- When a node receives a package in which this option is present, it will write its IP address in the position indicated by the pointer, provided that it is less than the Option Size, and increase the pointer by 4.
- It is necessary that the space reserved for the Registered Route has a multiple length of 4; if when attempting to record its address a node detects that there is free space but is less than 4 octets, the package is not forwarded (it is lost) and the error is notified, through ICMP, to the originator of the datagram.
- This Option is not copied in case of fragmentation, and can only appear once in a package.
Padding: Variable
Used to ensure that the size, in bits, of the header is a multiple of 32. The value used is 0.
Contenido relacionado
Global system for mobile communications
Hexadecimal system
Redhat