Packet architecture

Data

Represents the application layer payload; this is the actual content or message generated by the application.

Segment (Transport Layer)

At the transport layer, data is split into segments (or datagrams), with additional headers such as source and destination ports, sequence and acknowledgment numbers for TCP (referred to as segments), or simply source and destination ports for UDP (referred to as datagrams).

Packet (Internet Layer)

When a segment is passed down to the internet layer, it is encapsulated into an IP packet, which includes an IP header that contains crucial information for routing, such as the source and destination IP addresses. Packets act as the primary unit of data transfer across IP networks.

Frame (Network Layer)

At the network layer (sometimes known as the link layer), the packet is further encapsulated into a frame that adds a header with the MAC addresses of the source and destination. This encapsulation prepares the packet for transmission over the physical network medium.

Bits

The frame is then converted into a series of electrical, light, or radio signals that represent bits, which are transmitted across the physical network medium. At the simplest level, bits are the 1s and 0s that encode all network communication data during its transmission through cables, fiber optics, or wireless space.

Packet encapsulation

Packet encapsulation

IPv4 Packet

https://upload.wikimedia.org/wikipedia/commons/thumb/6/60/IPv4_Packet-en.svg/1200px-IPv4_Packet-en.svg.png