Thursday, December 22, 2011

IP packet header

IP packet header:

-most fields in this packet have some importance to routing




Version: set to 0100 (ipv4), set to 0110 (ipv6)

Header length: 4bits, Specifies the length of the IP packet header in 32 bit words. The minimum value for a valid header is 5.

ToS/Diffserv: 8bits, 6->DSCP 2->ECN

Total Length: 16-bit field specifying the total length of the packet, including the header, in octets. Maximum possible size of an IP packet is 65,535 octets (16bits ON converted to decimal)

Identifier: 16-bit field used in conjunction with the Flags and Fragment Offset fields for fragmentation of a packet. Packets must be fragmented into smaller packets if the original length exceeds the Maximum Transmission Unit (MTU) of a data link through which they pass.

The router marks each fragment with the same number in the Identifier field so that a receiving device can identify the fragments that go together.

Flags: 3-bits, 1st ->unused, 2nd ->DF bit (setting to 1 will not fragment the packet, use with extended ping to test MTU size), 3rd ->MF bit (always 1 in fragmented packets except the last is 0)

Fragment Offset:  Allows the fragmented pieces to be reassembled in the correct order

Time to Live (TTL) is an eight-bit field that will be set with a certain number when the packet is first generated. As the packet is passed from router to router, each router will decrement this number. If the number reaches zero, the packet will be discarded and an error message will be sent to the source. This process prevents "lost" packets from wandering endlessly through a network

Protocol: eight-bit field that gives the "address," or protocol number, of the transport layer protocol for which the information in the packet is destined eg; 1-ICMP, 6-TCP, 17-UDP

Header Checksum is the error detection field for the IP header. If no errors have occurred during the packet's travels, the resulting checksum will be all ones

Source and Destination Addresses are the 32-bit IP addresses of the originator of the packet and the destination of the packet

Options: Is a variable-length field used primarily for testing. Used with extended ping: Loose, Strict, Record, Timestamp, Verbose

Padding: Ensures that the header ends on a 32-bit boundary by adding zeros after the option field until a multiple of 32 is reached

No comments:

Post a Comment