9/18/08

IP Packet Structure explained

A packet is a unit of data carried over a computer network.When data is transmitted from one device to another it gets breaked up into small chunks called packets which reassemble on reaching their destination device.A packet structure consists of three parts which are as follows:-

1.Header - It consists of the information or instructions which the packets needs to obey.The header consists of :-


  • Version(Occupies 4 bits) - Version of the packet(ipv4 or ipv6).

  • IHL(Internet Header Length)(Occupies 4 bits) - Header size of the packet in 32 bits.

  • Type of Service(Occupies 8 bits) - The service priority desired.

  • Total Length(Occupies 16 bits) - Length of the packet.

  • Identification(Occupies 16 bits) - A value set by the source(sender) helping in the reassembling of the fragments of the packet.

  • Flags(Occupies 3 bits) - Controls various flags.For eg:-there is a flag which decides whether a packet should be fragmented or not.

  • Fragment Offset(Occupies 13 bits) - Identifies the postion of the fragment in the packet.

  • Time to Live(Occupies 8 bits) - Denotes the span of time till which the packet will continue to exist over the network.

  • The Protocol(Occupies 8 bits) - TCP,UDP,etc..The packets have to follow these set of rules.Protocol defines the type of packets carried over a network,i.e.,whether they are chat packets,email packets,etc.

  • Header Checksum(Occupies 16 bits) - Error checking may be done if certain fields like the 'time to live' may alter.

  • The Source Ip address(Occupies 32 bits).

  • The Destination Ip address(Occupies 32 bits).

  • Options(variable size) - They have to be implemented by all kinds of nodes.
2.Payload - The body of the packet which comprises the actual data which is sent by the sender to the destination.

3.Footer - It tells the receiver/destination device that the packet has reached its end.An error checking may occur.

0 comments: