Week 6 · Lesson 9

IPv4 and IPv6 Headers

The IP header is the control panel of Layer 3. Every field exists for a reason, and the exam expects you to know the exact bit widths of both the IPv4 and the IPv6 header — including the fact that IPv6 uses a fixed 40-byte header with no checksum.

CCNA 200-301 Domain 1.0 Network Fundamentals Verified 2026-10-11
Part 1

Why the header matters

An IP packet is a header plus a payload. The payload is the transport-layer segment that IP carries without looking inside it; the header is the metadata routers need to do their job. Fields such as the source and destination address tell a router where the packet is from and where it is going. The protocol number tells the receiving host which upper-layer protocol should get the payload. TTL/hop limit stops packets looping forever, and the checksum (in IPv4) detects corruption of the header.

Because the header format is fixed and public, two routers from different vendors on different continents can read each other’s packets. That interoperability is exactly why the layout is standardised in an RFC and why exam questions test the field widths so heavily: change a field width and every device on Earth stops understanding the packet.

Definition — header. The IP header is the fixed-format set of control fields placed in front of the payload. It carries addressing, lifetime, and protocol information but no user data.
Part 2

The IPv4 header layout

IPv4 is defined in RFC 791. Its header is drawn as five rows of 32 bits (four bytes). The first byte contains two four-bit halves: the Version and the Internet Header Length (IHL). When no options are present the header is exactly 5 words × 4 bytes = 20 bytes, the minimum.

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version|  IHL  |  DSCP   ECN   |         Total Length          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|        Identification         | Flg |     Fragment Offset     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      TTL      |   Protocol    |        Header Checksum        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        Source Address                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      Destination Address                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                Options + Padding (0-40 bytes)                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
IPv4 header · 20–60 bytes IPv6 header · fixed 40 bytes Version | IHL | DSCP/ECN Total Length ID | Flags | Fragment Offset TTL | Protocol | Header Checksum Source Address (32 bits) Destination Address (32 bits) Options + Padding (optional) Version | Traffic Class | Flow Label Payload Length | Next Header | Hop Limit Source Address (128 bits) Destination Address (128 bits) Has a 16-bit header checksum No checksum · no options field IHL makes the header variable always 40 bytes — fast to process
IPv4 header fields · select one
Width in bits

Part 3

IPv4 fields, field by field

Learn this table exactly. The widths are the single most commonly tested numbers in this lesson.

FieldWidthPurpose
Version4 bitsIP version number; = 4 for IPv4.
IHL (Internet Header Length)4 bitsHeader length in 32-bit words; minimum 5 (= 20 bytes).
DSCP + ECN (Type of Service)8 bitsDSCP (6 bits): QoS marking. ECN (2 bits): congestion signalling.
Total Length16 bitsWhole packet size, header + payload, in bytes; maximum 65,535.
Identification16 bitsTags all fragments that came from one original packet.
Flags3 bitsBit 1 reserved; DF (Don’t Fragment); MF (More Fragments).
Fragment Offset13 bitsPosition of this fragment in 8-byte units.
Time to Live (TTL)8 bitsDecremented by 1 at every router; at 0 the packet is dropped.
Protocol8 bitsPayload type: 1 = ICMP, 6 = TCP, 17 = UDP.
Header Checksum16 bitsError check over the header only; recomputed at every hop.
Source Address32 bitsThe sender’s IPv4 address.
Destination Address32 bitsThe final receiver’s IPv4 address.
Options + Padding0–40 bytesOptional features; padding aligns the header to a 4-byte boundary.
Exam tip. Two numbers to memorise: IHL minimum = 5 (5 × 4 = 20 bytes) and the header is variable from 20 to 60 bytes (IHL maximum = 15, 15 × 4 = 60). The Protocol number is a favourite: 1 ICMP, 6 TCP, 17 UDP.
Note. Because the checksum covers only the header, and because TTL changes at every router, the IPv4 header checksum is recalculated at every hop. That is a small cost paid on every packet, and it is one reason IPv6 removes it.
How big is the header? · choose an IHL value

Part 4

The IPv6 header layout

IPv6 is defined in RFC 8200. It was designed to be simpler and faster for routers. The address grew from 32 to 128 bits, but the header stayed small because fields that were optional or per-hop were removed from the base header. Its layout is exactly two rows of 32 bits, then the two large address rows:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Vers  | Traffic Class |              Flow Label               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|        Payload Length         |   Next Hdr    |   Hop Limit   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                  Source Address  (128 bits)                   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                Destination Address  (128 bits)                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Definition — IPv6 base header. The IPv6 base header is fixed at 40 bytes: 8 bytes of control fields plus two 16-byte (128-bit) addresses. It never carries options; those live in separate extension headers.
Part 5

IPv6 fields, field by field

FieldWidthPurpose
Version4 bitsIP version number; = 6 for IPv6.
Traffic Class8 bitsDSCP (6 bits) + ECN (2 bits) — same role as IPv4 ToS.
Flow Label20 bitsLabels a packet flow for special handling; rarely used in practice.
Payload Length16 bitsSize of everything that follows the 40-byte base header.
Next Header8 bitsType of the next header: an extension header or an upper-layer protocol (TCP = 6, UDP = 17, ICMPv6 = 58).
Hop Limit8 bitsIPv6’s version of TTL: decremented by 1 at every router.
Source Address128 bitsThe sender’s IPv6 address.
Destination Address128 bitsThe final receiver’s IPv6 address.

Add the widths: 4 + 8 + 20 = 32 bits on the first row, and 16 + 8 + 8 = 32 bits on the second, for 8 bytes of control fields. The two addresses add 32 bytes, giving the famous 40-byte IPv6 base header.

Exam tip. 40 bytes. If a question asks for the size of the IPv6 header, the answer is a fixed 40 bytes — never 20 and never variable. IPv6 has no IHL, because the header length never changes.
IPv6 header fields · select one
Width in bits

Part 6

IPv4 vs IPv6, and extension headers

FeatureIPv4IPv6
Header size20–60 bytes (variable)40 bytes (fixed)
Address size32 bits128 bits
Header checksumYes, 16-bit, per hopNone
Header length fieldIHL (4 bits)None (fixed length)
FragmentationRouters may fragmentRouters never fragment — source uses Path MTU Discovery
Protocol / Next HeaderProtocol (8 bits)Next Header (8 bits)
Lifetime fieldTTL (8 bits)Hop Limit (8 bits)
OptionsInside the base headerSeparate extension headers
BroadcastYesNo — uses multicast and anycast
Address configurationManual or DHCPSLAAC, DHCPv6, or manual
Why IPv6 removed fragmentation at routers. Fragmenting a packet mid-path costs a router CPU time and re-assembly state. IPv6 forbids it: the source discovers the smallest MTU along the path (Path MTU Discovery) and sends packets that fit. If a router sees a packet too big, it sends an ICMPv6 “Packet Too Big” message and the source reduces the size.

Extension headers

IPv4 puts rarely used options into the same header, which forces every router to check the IHL and slow down when options are present. IPv6 instead chains optional features as extension headers placed between the base header and the payload. The base header’s Next Header field says which one comes first, and each extension header has its own Next Header field, forming a linked list.

Examples include the Hop-by-Hop Options header, Routing header, Fragment header, and Destination Options header. This design keeps the fixed 40-byte base header fast: a router processes only the extension headers it is required to inspect.

The big differences · pick a feature

Part 7 · Your turn

Review

Check what you have learned with these review questions.

Review · 6 questions

Sources

Sources & references

  1. Postel, J. RFC 791: Internet Protocol (1981), Section 3.1 (header format and all IPv4 field widths). rfc-editor.org/rfc/rfc791.
  2. Deering, S. & Hinden, R. RFC 8200: Internet Protocol, Version 6 (IPv6) Specification (2017), Section 3 (IPv6 header format). rfc-editor.org/rfc/rfc8200.
  3. Postel, J. RFC 768: User Datagram Protocol (1980) — protocol number 17. rfc-editor.org/rfc/rfc768.
  4. Postel, J. RFC 793: Transmission Control Protocol (1981) — protocol number 6. rfc-editor.org/rfc/rfc793.
  5. Postel, J. RFC 792: Internet Control Message Protocol (1981) — protocol number 1. rfc-editor.org/rfc/rfc792.
  6. Cisco. CCNA (200-301) Exam Topics, Network Fundamentals. cisco.com.

Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.