Packets & Frames
IP Packets
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.
Components of a packet

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.
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.
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).
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?
Data Preparation
When data is requested by a user or posted from a form, the raw data must first be prepared by the application at the Application layer of the TCP/IP Model. This may involved encoding and encrypting the data at this level, especially if end-to-end encryption has been used.

Segments
Segmentation is the process of breaking down data from the higher layers (e.g., application layer) into smaller, manageable units for transmission. These smaller units are called segments.
These segments contain sequence numbers and other control information.

Packets
In IP (Internet Protocol) networks, data is encapsulated into packets. Packets contain not only the data but also network layer addressing information. Each packet includes the source and destination IP addresses and other information for routing.
This happens at the Network Layer.

Which one is used in the IP protocol?
Frames
In Ethernet networks, data is formatted into frames. Each frame includes source and destination MAC addresses, frame delimiters, and error-checking information like CRC (Cyclic Redundancy Check). This occurs at the data link layer.
Once a frame has been applied the data is finally ready to be sent over the network.

Introduction to Packets
- IP Packets
- Components of a packet
- Packet Header Contents
- Packet Payload
- Packet Trailer
- Packet Fragmentation
- Fragmentation Example
Data, Segments, Stacks & Layers
- Data Preparation
- Segments
- Packets
- Frames