...

/

The Structure of an IPv4 Packet

The Structure of an IPv4 Packet

Learn about the structure and components of an IPv4 packet.

IPv4 packet

We can see the structure (header) of an IPv4 packet below:

Here we can identify some important components that we’ll interact with in many situations throughout our course:

  • IP source address
  • IP destination address
  • Time to live (TTL)
  • Type of service (ToS)
  • Header checksum
  • Flags, Identifiers, or Fragments Offset

Let’s discuss each of these in more detail.

IP addresses

We’ll start with IP addresses. For any communication between two devices, we need a source address and a destination address.

Two fields are reserved in the IPv4 packet structure for the source IP address and destination IP address.

For example, in the figure above, we can see two networks: A and S. If the PC from Network A (with the IP 10.0.0.5) wants to communicate with the server (with the IP 192.168.10.8) from network S, then the source address of each packet will be 10.0.0.5 (PC’s IP), and the destination address will be 192.168.10.8 (Server’s IP).

Network loop prevention with TTL

Another very important element within the IP header is known as time-to-live (TTL). TTL is a protection mechanism against network loops that might happen on the internet or in connections between routers.

By default, the value of a TTL is 255 for each packet, although it can have a value between 1 and255. This value decreases (on every hop) each time it reaches another routerRouter interconnects multiple networks through ports (or another network). If the TTL ...