Ethernet carries data in the local network in frames. Every frame starts with the destination and the source MAC address, followed by the EtherType, which says what is inside. At the end is the checksum FCS (CRC-32): the receiver recomputes it and drops the frame if it does not match. Before the frame the network card sends preamble and SFD (layer 1) so the receiver can find the clock.
Ethernet IIFrame · IEEE 802.3
Preamble7 bytes
SFD1 bytes
Destination MAC6 bytes02:00:00:00:04:00
Source MAC6 bytes02:00:00:00:01:00
EtherType2 bytes0x0800
Payload46–1500 bytes140 Byte
FCS4 bytes0x9facebdb
Gap (IFG)12 bytes
Left to right, in the order the bytes are sent. Grey dashed: never part of a capture (layer 1 or line framing). Point at a field for an explanation.
Field
Length
Example value
Meaning
Preamble (layer 1)
7 bytes
10101010 × 7
Seven bytes 10101010: the receiver synchronises its clock. Part of the physical layer.
SFD (layer 1)
1 bytes
10101011
Start frame delimiter 10101011: the frame starts now.
Destination MAC
6 bytes
02:00:00:00:04:00
To whom? FF:FF:FF:FF:FF:FF is broadcast, a first byte with the lowest bit set is multicast.
Source MAC
6 bytes
02:00:00:00:01:00
From whom? The MAC address of the sending interface; the switch learns it.
EtherType
2 bytes
0x0800
What is inside: 0x0800 IPv4, 0x86DD IPv6, 0x0806 ARP, 0x8100 VLAN tag, 0x8864 PPPoE. Values from 0x0600 are types, smaller ones a length (IEEE 802.3).
Payload
46–1500 bytes
140 Byte
The layer-3 packet, 46 to 1500 bytes (MTU). If it is shorter, the sender pads with zeros so the frame including FCS is 64 bytes long.
FCS
4 bytes
0x9facebdb
Frame check sequence: CRC-32 over the whole frame from the destination MAC. If it does not match, the receiver drops the frame.
Gap (IFG) (layer 1)
12 bytes
At least 12 bytes of silence before the next frame (interframe gap). Part of the physical layer.
Values: Real frame from the demo “DNS, TCP and HTTP” (no. 36, 158 bytes), exactly as the packet list in leyoNET shows it.
A frame is at least 64 and at most 1518 bytes long. The sender pads shorter packets. More on VLAN tag, LLC and Wi-Fi frames: Structure of frames and packets.
A MAC address has 48 bits, written as six hexadecimal pairs. On a real device the first three bytes name the manufacturer. leyoNET assigns “locally administered” addresses (02:…) derived from the device number, so every project stays reproducible.
How a switch learns
A switch remembers for every sender on which port it has seen it: the MAC table, also called SAT (source address table): the switch learns from the source address. A frame to a known address goes only to that port. If the address is unknown or a broadcast, the switch sends it to all other ports (flooding). Entries expire after a few minutes.
Duplicate MAC addresses
If two devices have the same MAC, the switch sees the same address alternately on two ports and rewrites its table each time. Replies end up at the wrong device. In practice this happens with cloned virtual machines. The demo “Duplicate MAC address” shows it; the switch reports “MAC flapping”.
How to do it in leyoNET
The same text as in the app’s help (F1 key).
Switching
A switch records each frame's source MAC and port (MAC table, also called SAT for “source address table”). If it knows the destination it forwards only there, otherwise to all ports (flooding). Broadcasts such as ARP always go to every port in the same VLAN. If two devices share a MAC address, the switch learns it alternately on two ports («MAC flapping»): frames reach the wrong device and the switch console reports «MAC moves».
See an example
Duplicate MAC address
Three computers on a switch; the notebook has the same MAC address as PC 2.
PC 1 pings PC 2 while the notebook pings PC 1. The switch learns the MAC alternately on two ports and reports «MAC moves»; replies reach the wrong device and pings are lost.
In leyoNET under Tools → Exercise catalogue. Every exercise checks itself.
What leyoNET simplifies
Protocol
Layer
Simplification in the simulation
Ethernet II, 802.1Q
2
With FCS (CRC-32) and padding to 64 bytes; preamble, SFD and gap only as information on layer 1; no jumbo frames
Standards
IEEE 802.3 – IEEE Standard for Ethernet (current edition: IEEE 802.3-2022)
Read on
Structure of frames and packetsHow Ethernet frames, IPv4 and IPv6 packets, TCP segments and UDP datagrams nest inside each other, field by field according to the standards, with real bytes from leyoNET.
SwitchConnects devices in the same network, learns MAC addresses, separates networks with VLANs and prevents loops with spanning tree.
ARPHow a device finds the MAC address for an IP address in its own network – with a broadcast request, a reply and a cache.
VLANs and trunksOne switch, several separate networks: access ports, trunks with 802.1Q tag, native VLAN and routing between VLANs.