What is a frame?
A frame is the unit of data transmission at the data link layer (L2). It is data packaged according to the rules of the data link layer so it can be transmitted within a single network.
Simply put: a frame is an "envelope" in which the data link layer places data and writes who it is from and who it is going to.
Why a frame is needed
The physical layer can only transmit bits (0 and 1). A frame is needed to:
- know where the data starts and where it ends
- indicate who the data is intended for
- check whether it got corrupted along the way
What a frame consists of (using Ethernet as an example)
A typical frame contains:
- Destination MAC address who the frame is sent to
- Source MAC address who sent the frame
- Data type what is inside (for example, an IP packet)
- Payload higher-level data (usually an IP packet)
- Checksum (FCS) error check
What is inside a frame
Inside a frame there is usually:
- a network-layer packet (IP packet)
The data link layer does not analyze this packet: it simply carries it.
An important distinction for an interview
- Bit - physical layer
- Frame - data link layer
- Packet - network layer
A very common mistake is confusing a frame with a packet.
Where a frame "lives"
- a frame exists only within a single local network
- when passing through a router:
- the old frame is discarded
- a new frame is created for the next network
Simple analogy
Mail:
- a frame is a box with addresses
- an IP packet is the letter inside
- the road is the physical layer
Short answer for an interview
A frame is a data-link-layer unit of data that contains MAC addresses, service information, and a payload, and is used to transmit data within a single network.
Short Answer
Interview readyA concise answer to help you respond confidently on this topic during an interview.