1. Gyanastra
  2. Computer Networks
  3. IPv4 Header
  4. IPv4 Header: TTL, Protocol, Header Checksum, Source/Destination Address, Options
Free lesson, no account needed 4 min read 17 practice questions after it
Asked in past papers12 times
  • GATE CSE202520242020201720152014201020062003
  • ISRO2014
  • UGC NET20232014

Computer Networks · IPv4 Header

IPv4 Header: TTL, Protocol, Header Checksum, Source/Destination Address, Options

Overview

The IPv4 header is a variable-length header built from several fields. The fields covered here are TTL, Protocol, Header Checksum, Source IP Address, Destination IP Address, and Options.
The Options field is what makes the header length variable, so its size limits matter for how large a header can be.

Key concepts

  • TTL (Time To Live) – an 8-bit field.
  • Protocol – an 8-bit field.
  • Header Checksum – a 16-bit field.
  • Source IP Address – a 32-bit field; an IP address is a 32-bit number.
  • Destination IP Address – a 32-bit field.
  • Options – an optional field: there may be no options at all (0 bytes), and it can go up to 40 bytes.
  • Variable header length – because the Options field is variable in size, the total header size is variable.

How it works

The fields of the IPv4 header, in order, are:

  1. Fragment Offset – 13 bits (the field just before TTL).
  2. TTL (Time To Live) – 8 bits.
  3. Protocol – 8 bits.
  4. Header Checksum – 16 bits.
  5. Source IP Address – 32 bits.
  6. Destination IP Address – 32 bits.
  7. Options – optional; 0 bytes minimum, up to 40 bytes.

Formulas

  • Options size=0 to 40 bytes\text{Options size} = 0 \text{ to } 40 \text{ bytes}
  • Maximum header length=60 bytes\text{Maximum header length} = 60 \text{ bytes} (the Options field reaching its maximum of 40 bytes gives the full header maximum of 60 bytes)

Revision summary

  • TTL = 8 bits; Protocol = 8 bits; Header Checksum = 16 bits.
  • Source IP Address = 32 bits; Destination IP Address = 32 bits.
  • An IP address is a 32-bit number.
  • Options field: minimum 0 bytes, maximum 40 bytes.
  • The Options field is what makes the IPv4 header length variable.
  • The Options field limit is 40 bytes, but the full header maximum is 60 bytes — do not confuse the two.

Previous-year exam insights

  • TTL is decremented by 1 at every router; a router discards the datagram and sends ICMP Time Exceeded when TTL reaches 0, which prevents packets from looping indefinitely.
    Asked inGATE 2010GATE 2006GATE 2024GATE 2015
  • Every router forwarding a datagram modifies TTL (decrement) and therefore recomputes the Header Checksum; Source/Destination IP, Protocol and Total Length are not changed by a normal router (only NAT changes source/destination IP and checksum).
    Asked inGATE 2024GATE 2015GATE 2014GATE 2020
  • Protocol field values: 1 = ICMP, 2 = IGMP, 6 = TCP, 17 = UDP, 89 = OSPF;
    RIP uses UDP port 520, so RIP is not an IP protocol number.
    Asked inGATE 2025UGC NET 2023
  • The IPv4 header is 20 bytes minimum (no options) and 60 bytes maximum;
    IHL counts 32-bit words, so IHL = 5 means a 20-byte header.
    Asked inGATE 2017UGC NET 2023
  • The Options field supports Strict Source Routing, Loose Source Routing, Record Route and Timestamp; the Record Route option holds at most 9 router addresses (40 bytes minus 3 bytes of option type/length/pointer, one 4-byte slot per address).
    Asked inGATE 2017UGC NET 2014
  • Fragmentation may change Fragment Offset, Flags (MF), Total Length and Header Checksum, but TTL and checksum also change in transit; reassembly is done only at the final destination, not by intermediate routers.
    Asked inGATE 2014GATE 2020

IPv4 header field order and widths

Shows the order of the IPv4 header fields covered and the bit width of each, with Options as the variable-length field.

Pages 1–2 of 2