In computer networks, data is not sent as a continuous stream but rather as discrete units called packets. A packet is a formatted unit of data used in network communication.
When large amounts of data (such as files, emails, or streaming videos) are transmitted over the network, the data is broken into smaller chunks called packets. These packets travel individually across the network and are reassembled at the destination into their original form.
IP packets are used to facilitate between devices on a network.
Components of a packet
Each IP packet includes a that contains important routing information.
Packet Header Contents
The header contains control and addressing information used for routing the packet across the network.
Source IP Address: The IP address of the sender of the packet.
Destination IP Address: The IP address of the recipient of the packet.
Version: The IP version being used (e.g., IPv4 or IPv6).
Protocol: Specifies the Layer 4 protocol (e.g., TCP, UDP) that is carried by the packet.
Time-to-Live (TTL): Limits the packet's lifetime by defining how many hops (routers) it can pass through before being discarded.
Packet Length: Indicates the total size of the packet, including header and data.
Identification, Flags, and Fragment Offset: Used for handling fragmentation if the packet needs to be broken into smaller pieces.
Header Checksum: Provides error-checking for the header itself.
The field in the IP header specifies the protocol used in the data portion of the packet.
Packet Payload
This is the actual data being transported by the packet. The payload can be any piece of information, such as a portion of a web page, a video file, or an email message.
Packet data size varies widely, generally ranging from 20 bytes (160 bits) to 65,535 bytes (524,280 bits), depending on the protocol and MTU limitations.
The most common size for Ethernet packets is 1500 bytes (12,000 bits) for the payload, with additional overhead for headers.
What does a packet's payload contain?
Packet Trailer
The trailer is used for error detection and control.
Checksum (Trailer)
A value used to verify that the packet has been transmitted without errors. If the checksum doesn't match the receiver's calculation, the packet may be discarded or retransmitted.
Padding (Optional)
Extra bits added to align the packet size with certain network standards.
Checksum
Packet Fragmentation
Fragmentation is the process of breaking a larger packet into smaller pieces (fragments) that are within the MTU limits of the network.
How it Works
When a packet is larger than the MTU, the sending device (host) divides the packet into smaller fragments.
Each fragment contains a portion of the original packet's data along with its own header information.
The original packet's header may include additional fields indicating the fragmentation (e.g., identification, flags, and offset).
IP packets may be fragmented if they are larger than the size that can be transmitted without fragmentation.
Fragmentation Example
If an original packet is 4000 bytes and the MTU is 1500 bytes, it will be divided into three fragments:
Fragment 1: 1500 bytes (Header + 1480 bytes of data)
Fragment 2: 1500 bytes (Header + 1480 bytes of data)
Fragment 3: 1000 bytes (Header + 980 bytes of data)
Reassembly
Once the fragments reach the destination, they are reassembled into the original packet using the information in the headers.
What happens if an IP packet is too large for the network to handle?
The maximum size of a packet that can be transmitted without fragmentation is known as the .