IP Header Format

IP data packets are preceded with header information which is used for routing and error control. Place the following IPv4 and IPv6 header sections correctly to show the right IP header format. Click once on the text you would like to move, then click on an empty box you would like to move it to. You can only move text into empty boxes. Though some header information for IPv4 and IPv6 is the same, such as the protocol field or source address, you cannot place IPv4 items in IPv6 fields, and vice versa.



Move to:




Move To:


For the correct order see: IPv4 and IPv6 headers

An IP datagram is a packet of data made up of two parts; the header and the payload. The payload is the data being sent, and usually used by a higher level application. The header is the IP information used by the IP. You can think of IP similar to a letter. A letter comes with two parts, the actual letter meant to be read by the recipient, and the envelope, which directs the post office on where to send the letter. The header is like the envelope.

Like a letter, the post office uses the information on the envelope to see where a letter is coming from and where it is going. You can also judge to see if the letter has been torn or damaged by looking at the envelope. If there are water stains and damage to the envelope, then the letter is probably damaged, and might need to even be re-written. The envelope will also give you hints as to what kind of letter you are getting. Is it a formal looking envelope from a business or a hand written letter from a friend?

An IP header contains similar information. It includes the source and destination addresses, error checking, and other information which helps deliver data across a network.


IPv4 Header Information

An IPv4 header has a larger number of fields than the more modern IPv6 headers. It begins with a version number. For an IPv4 packet, this will be the number 4. This field tells the IP protocol what version of the IP protocol is being used on this particular piece of data.

Next comes the Internet Header Length (IHL), which is 4 bits long and specifies the header length. The header length can range from 160 to 480 bits and is always a multiple of 32 bits. IPv4 needs to specify the header length due to the different options that can be added to the header.

Next comes the Type of Service or Differentiated Services Code Point (DSCP) field. This field is largely used for quality of service features, such as determining the priority of a packet. For example, a voice-over IP packet may be given higher priority over an HTTP packet.

Total Length is a 16-bit field used to define the length of the whole packet, including the header and the payload. This can range from 20 bytes to 65,535 bytes.

Identification contains a 16-bit value common to all fragments of a message. This is used to reassemble fragmented messages.

Flags specify whether a packet has been or is allowed to be fragmented.

Fragment Offset specifies where in a fragmented message this particular fragment occurred.

Time To Live specifies how many hops the packet can cross before being dropped. This prevents a packet from being sent back and forth forever.

Protocol identifies which higher-layer protocol is being carried in the data. Possibilities include TCP, UDP, and ICMP.

The Header Checksum is a basic method of error detection. It is used to see if the header data was corrupted during the transmission of the packet.

The Source IP Address and the Destination IP Address specify the packet’s originating and destination IP addresses.

Options is a rarely used field of several types of additional options.

Padding is used to make sure that the total header size is a multiple of 32 bits. Following all this comes the actual data inside the packet.


IPv6 Header Information

Like IPv4, IPv6 headers start with the Version number. The value 6 identifies the packet as an IPv6 packet.

This is followed by the Traffic Class. The Traffic Class specifies the packet’s priority by assigning a certain class to that packet. For example, a voice packet will probably have a higher priority than a data packet due to the more noticeable lag in voice communication.

This is followed by a Flow Label. Packets that belong to the same Flow Label should be routed through the same path. Packets with different Flow Labels can be routed to the same destination using different paths.

The Payload Length specifies the size of the post-header data.

The Next Header identifies the type of header immediately following the IPv6 header, for example, a TCP or UDP header.

Hop Limit replaces the IPv4 Time to Live data. This specifies how many hops the packet can take before being dropped.

The Source Address and Destination Address specify the IP address the packet originated from and the IP address it is being sent to.

You can use our other interactive pages to check how to remember the OSI model and Ethernet RJ45 568A and 568B Wiring.

Download our Subnet Cheat Sheet for all the essential information you need to quickly perform subnet calculations in your head.If you want to learn more about networking and get the Cisco CCNA certification, we highly recommend the Cisco CCNA Gold Bootcamp as your CCNA training course. The CCNA is by far the most in-demand networking certification by employers, and the Gold Bootcamp is the highest rated Cisco course online. It has an average rating of 4.8 from over 30,000 public reviews:
Cisco CCNA Gold Bootcamp training course