
The figure shows the IPv4 header information added to a packet at Layer 3. The important fields in the header are:.
- TTL (Time To Live): This field indicates the expiration date of data, a method to prevent infinite packet looping at Layer 3. If a router is incorrectly configured, IP packets can be looped between two or more routers. To prevent this, a number between 0 and 255 is placed in this field.
For example, if the TTL value is 15, each router that passes this packet will decrease the value of this field by 1. That is, after this packet passes through the first router, TTL=14, and after passing through the next router, TTL=13. When the TTL field becomes 0, the router discards the packet.
- Protocol: This field indicates whether the IP packet carries TCP or UDP traffic. When application data is passed to the lower layer, a header is added, depending on whether it's TCP or UDP, and then it's passed back to IP. From an IP perspective, TCP, UDP, and other protocols are at the upper OSI layer, so they are also called ULPs (Upper Layer Protocols).
- Source/Destination IP Address: The sender of this IP packet adds an IP address to the Source IP Address field. The final destination for the packet is added to the Destination IP field. In the diagram, the source IP address is 10.1.1.1 for Host A, and the destination IP address is 10.2.2.2 for Host B.
The remaining fields are values used by the Layer 3 router to perform its operations.
It receives inbound packets, analyzes the destination IP address, and forwards the packets on the best route to the destination.
I will explain the details later when I have the chance.
Next, let's learn about TCP/UDP headers.


