Computer Networks

[Day 9] 8. IPv4 Header

D
DITISS Admin
••2 min read

Breakdown of an IPv4 Header (20 bytes)

  1. Version (4 bits):

    • Specifies the IP version (IPv4 = 4, IPv6 = 6).
    • Size: 4 bits.
  2. IHL (Internet Header Length) (4 bits):

    • Indicates the length of the IP header in 32-bit words. The minimum value is 5 (for 20 bytes).
    • Size: 4 bits.
  3. Type of Service (TOS) (8 bits):

    • Used for QoS (Quality of Service), specifying priority and handling.
    • Size: 1 byte.
  4. Total Length (16 bits):

    • Specifies the total length of the IP packet (header + data).
    • Size: 2 bytes.
  5. Identification (16 bits):

    • A unique identifier for fragmentation, used to reassemble fragmented packets.
    • Size: 2 bytes.
  6. Flags (3 bits):

    • Controls fragmentation. The most significant bit is reserved, and the other two bits are used for fragmentation control.
    • Size: 3 bits.
  7. Fragment Offset (13 bits):

    • Indicates the position of the fragment’s data in the original packet.
    • Size: 2 bytes.
  8. Time to Live (TTL) (8 bits):

    • Limits the lifespan of a packet to prevent it from circulating forever in the network.
    • Size: 1 byte.
  9. Protocol (8 bits):

    • Indicates the protocol used in the data portion (e.g., 6 for TCP, 17 for UDP).
    • Size: 1 byte.
  10. Header Checksum (16 bits):

    • Used for error-checking the header.
    • Size: 2 bytes.
  11. Source IP Address (32 bits):

    • The IP address of the sender.
    • Size: 4 bytes.
  12. Destination IP Address (32 bits):

    • The IP address of the receiver.
    • Size: 4 bytes.

Read Next

8/26/2026

[Day 10] 1. Access Control List (ACL)

An **Access Control List (ACL)** is a set of rules configured on a router to filter and control the flow of network traffic based on specified criteri...

8/26/2026

[Day 10] 2. Standard ACL

A **Standard ACL** filters traffic based solely on the **source IP address**, allowing or blocking traffic based on whether it matches a specified add...