Sub topic 18
The Ethernet frame: fields and size limits
This chapter assumes you know what a frame is at the data link layer, how a CRC is computed by modulo-2 division, and why Ethernet needs a minimum frame length. It covers each field of the classic Ethernet frame, the limits on payload size, and the overhead calculations GATE questions use.
The layout of a frame
An Ethernet (IEEE 802.3) frame is a sequence of fields sent in a fixed order. The first two fields are a signal for the receiver's hardware. The rest are the frame proper.
| Field | Size | Purpose |
|---|---|---|
| Preamble | 7 bytes | Alternating 1010... bits that let the receiver synchronize its clock |
| Start frame delimiter (SFD) | 1 byte | The pattern 10101011. The final two 1 bits mark the start of the frame |
| Destination address | 6 bytes | MAC address of the receiving interface (unicast, multicast, or broadcast) |
| Source address | 6 bytes | MAC address of the sending interface |
| Type/Length | 2 bytes | Identifies the upper-layer protocol, or gives the payload length |
| Payload | 46 to 1500 bytes | Data from the network layer, padded if too short |
| Frame check sequence (FCS) | 4 bytes | CRC-32 over the frame |
What counts as "the frame"
The preamble and SFD are not part of the frame size. The frame runs from the destination address through the FCS, and its size limits are:
- Minimum frame: 6 + 6 + 2 + 46 + 4 = 64 bytes (512 bits).
- Maximum frame: 6 + 6 + 2 + 1500 + 4 = 1518 bytes.
The preamble and SFD add 8 bytes on the wire. After each frame the sender must also leave an interframe gap of 96 bit times (12 bytes) before sending again. This gives the following totals:
- The 64-byte minimum frame occupies 64 + 8 + 12 = 84 byte times of channel time.
- The 1518-byte maximum frame occupies 1518 + 8 + 12 = 1538 byte times.
Questions often hinge on whether the preamble is included, so read the wording carefully.
The payload limits
The 1500-byte maximum is the Ethernet MTU (maximum transmission unit). It is a convention chosen long ago to keep any one station from holding the shared channel too long and to limit buffer cost. It does not come from the physics.
The 46-byte minimum comes from the 64-byte minimum frame. The header and trailer take 18 bytes (6 + 6 + 2 + 4), so 64 − 18 = 46 bytes remain for the payload. If the network layer hands down less than 46 bytes, the sender adds padding bytes (usually zeros) after the data. The receiver cannot tell padding from data by looking at the frame alone. The upper layer must know the real length, for example from the IP total-length field. In the 802.3 form, the Length field gives the length of the data before padding.
Type or Length
The 2-byte field has two meanings, and the value tells you which one applies:
- A value of 1500 (0x05DC) or less is a length, in the 802.3 form.
- A value of 1536 (0x0600) or more is an EtherType, in the original DIX (Ethernet II) form. Common values are 0x0800 for IPv4, 0x0806 for ARP, and 0x86DD for IPv6.
- Values from 1501 to 1535 are not defined.
IP over Ethernet normally uses the EtherType form, so the receiver can pass the payload to the right protocol without any extra header.
The FCS
The FCS is a 32-bit CRC computed with the standard CRC-32 generator polynomial, x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x + 1. It covers the destination address, source address, Type/Length, and payload including padding. It does not cover the preamble or SFD. The receiver recomputes the CRC. If the result does not match, it silently discards the frame. Ethernet does not ask for retransmission, so recovery is left to higher layers such as TCP.
A 32-bit CRC detects every burst error of 32 bits or fewer. It also detects any odd number of bit errors, because the generator has the factor (x + 1).
Building a frame in code
This program pads a short payload, then appends the CRC-32 as the FCS. It uses Python's zlib.crc32, which implements the same CRC-32 algorithm.
import struct
import zlib
MIN_PAYLOAD = 46
MAX_PAYLOAD = 1500
def build_frame(dst: bytes, src: bytes, ethertype: int, payload: bytes) -> bytes:
if len(payload) > MAX_PAYLOAD:
raise ValueError("payload exceeds the 1500-byte MTU")
if len(payload) < MIN_PAYLOAD:
payload = payload + bytes(MIN_PAYLOAD - len(payload)) # zero padding
body = dst + src + struct.pack("!H", ethertype) + payload
fcs = zlib.crc32(body)
return body + struct.pack("<I", fcs)
dst = bytes.fromhex("ffffffffffff") # broadcast
src = bytes.fromhex("020000000001")
frame = build_frame(dst, src, 0x0800, b"hello")
print(len(frame)) # 64
received_fcs = struct.unpack("<I", frame[-4:])[0]
print(received_fcs == zlib.crc32(frame[:-4])) # TrueA 5-byte payload is padded to 46 bytes, so the frame is exactly 64 bytes.
Overhead and efficiency
Per-frame overhead is 38 bytes if you count everything that uses channel time: 18 bytes of header and trailer, 8 bytes of preamble and SFD, and 12 bytes of interframe gap. Efficiency, the fraction of channel time that carries payload, is:
efficiency = payload / (payload + 38)
| Payload | Time on channel | Efficiency |
|---|---|---|
| 46 bytes | 84 bytes | 46/84 = 54.8% |
| 1500 bytes | 1538 bytes | 1500/1538 = 97.5% |
Large frames are efficient, and small frames waste time on fixed overhead. Many GATE questions drop the preamble and gap and use only the 18-byte header and trailer. Use whatever overhead the question states.
Why the minimum matters
The 64-byte minimum is the same 512 bits that you derive from bandwidth times round-trip time for 10 Mbps Ethernet. A sender must still be transmitting when a collision signal returns from the far end of the network. Padding short payloads up to 46 bytes guarantees this. Changing the minimum frame size or the maximum network length would break collision detection unless you change the other to match.
Common mistakes
- Counting the preamble as part of the 64 or 1518 bytes.
- Saying the minimum payload is 64 bytes. It is 46 bytes.
- Forgetting that the receiver discards frames with a bad FCS without notifying the sender.
- Treating a Type/Length value of 1520 as a length. It is above 1500, but below 1536 it is undefined, so check which range the value falls in.
Exercise
A host sends 100 bytes of IP data in an Ethernet frame. (a) How many bytes of padding are added? (b) What is the frame size from destination address to FCS? (c) What is the channel efficiency if you count the preamble, SFD and 12-byte interframe gap as overhead?
Show answer
(a) None. 100 bytes is above the 46-byte minimum. (b) 6 + 6 + 2 + 100 + 4 = 118 bytes. (c) Total channel time is 118 + 8 + 12 = 138 bytes, so efficiency = 100/138 ≈ 72.5%.
Exercise
A Type/Length field holds 0x0800. Is it a length or an EtherType, and what is the smallest possible frame carrying a 20-byte payload?
Show answer
0x0800 is 2048, which is at least 1536, so it is an EtherType (IPv4). The 20-byte payload is padded with 26 bytes to reach 46, so the frame is 64 bytes.