Beginner · Ethernet, MAC addresses and the Cisco CLI · topic 7 of 57 · 30 min
Ethernet frames and MAC addresses
Explanation
Why frames?
A packet knows its final destination IP address, but on each local link something must say which NIC should pick it up next, and check that it arrived undamaged. That is the job of the Ethernet frame at Layer 2.
The fields of an Ethernet frame
| Field | Size | Purpose |
|---|---|---|
| Preamble and SFD | 7 + 1 bytes | A pattern of bits that lets the receiver lock on to the signal; the Start Frame Delimiter marks where the frame begins |
| Destination MAC | 6 bytes | Which NIC (or NICs) should receive the frame |
| Source MAC | 6 bytes | Which NIC sent it |
| Type / Length | 2 bytes | Which protocol is inside, for example 0x0800 for IPv4, 0x86DD for IPv6, 0x0806 for ARP |
| Data (payload) | 46 to 1500 bytes | The packet; padded up to 46 bytes if it is shorter |
| FCS | 4 bytes | Frame Check Sequence: a CRC checksum to detect damaged frames |
The destination comes first so a switch can start deciding where to send the frame early. If the FCS does not match, the receiver drops the frame silently; TCP higher up notices and resends. The largest payload, 1500 bytes, is called the MTU (Maximum Transmission Unit) of Ethernet.
MAC addresses
A MAC (Media Access Control) address is a 48-bit number that identifies a NIC on a LAN. It is written as 12 hexadecimal digits (0 to 9 and a to f, each worth 4 bits). The same address appears in three common formats:
00:1a:2b:3c:4d:5e Linux, macOS (colons)
00-1A-2B-3C-4D-5E Windows (hyphens)
001a.2b3c.4d5e Cisco IOS (dots, groups of four)The first 24 bits (first 3 bytes) are the OUI (Organisationally Unique Identifier), bought by the maker from the IEEE. The last 24 bits are given by the maker to each NIC. So 00:1a:2b is the maker part of the address above. Many phones today use a random, private MAC address for each Wi-Fi network for privacy, so do not assume a MAC address never changes.
Unicast, broadcast and multicast
- Unicast: to one NIC. Most frames are unicast.
- Broadcast: to every NIC in the LAN. The address is all ones: ff:ff:ff:ff:ff:ff, written ffff.ffff.ffff on Cisco. ARP requests and DHCP discovers use it.
- Multicast: to a group of NICs that asked for it. You can spot one because the lowest bit of the first byte is 1, which means the first byte is odd. Example: 01:00:5e:00:00:05, used for IPv4 multicast.
Worked example: first byte 0x01 is binary 00000001, last bit 1, so it is a group (multicast) address. First byte 0x00 ends in 0, so unicast. First byte 0x33 (used for IPv6 multicast) is 00110011, odd, so multicast. Broadcast is a special group address that includes everyone.
Speed, duplex and auto-negotiation
Duplex is about direction. Half duplex means a device can send or receive, but not both at once, like a walkie-talkie; it was needed with hubs. Full duplex means send and receive at the same time, like a phone call; switches use it. Speed is 10, 100, 1000 Mbps and so on.
Auto-negotiation lets the two ends agree the best speed and duplex they both support. Leave it on at both ends. If you set speed and duplex by hand on one side and leave the other on auto, the auto side can usually detect the speed but not the duplex; at 10 or 100 Mbps it falls back to half duplex.
The result is a duplex mismatch: one side full, the other half. The link stays up, so it looks fine, but it is very slow. The half-duplex side shows late collisions; the full-duplex side shows FCS or CRC errors and runts (frames shorter than 64 bytes).
Switch# show interfaces g0/1
GigabitEthernet0/1 is up, line protocol is up (connected)
Full-duplex, 1000Mb/s, media type is 10/100/1000BaseTX
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 output errors, 0 collisions, 0 late collisionNeed help?
Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.
Try:
Watch the lesson
Ethernet frames and MAC addresses · 1/7
An Ethernet frame carries a packet across one link. Let us look inside it.
Prefer a video by a teacher? Find free videos on “Ethernet frame format MAC address unicast multicast broadcast duplex mismatch CCNA” on YouTube ↗
In real life: Finding a rogue device on a campus network
The IT team at an engineering college in Coimbatore sees strange traffic from MAC address 3c:5a:b4:12:9e:01. They look up the OUI (3c:5a:b4) in the IEEE public list and find the maker, which tells them it is likely a phone rather than a lab PC. The switch MAC table shows which port it is on, so a technician walks to that room and finds a student running a hotspot app from a phone plugged into a lab socket.
mac = "3C-5A-B4-12-9E-01"
clean = mac.lower().replace("-", ":")
print(clean, "OUI:", clean[:8]) # 3c:5a:b4:12:9e:01 OUI: 3c:5a:b4Practice (0/3 done)
Which Ethernet frame field lets the receiver detect a damaged frame?
Write normalise_mac(text) that accepts a MAC address in any of the three common formats (aa:bb:cc:dd:ee:ff, aa-bb-cc-dd-ee-ff, or Cisco aabb.ccdd.eeff), in upper or lower case, and returns it as lower-case with colons: "aa:bb:cc:dd:ee:ff". Return None if the text is not a valid MAC address (wrong length, mixed separators, or a character that is not hex).
Write mac_kind(mac) for a MAC in the form "aa:bb:cc:dd:ee:ff". Return "broadcast" for ff:ff:ff:ff:ff:ff, "multicast" if the lowest bit of the first byte is 1, otherwise "unicast". Also write oui(mac) that returns the first three bytes, such as "00:1a:2b".
Quick quiz
Read more (free)
Related help
Before this, learn
This topic builds on these. If something here feels new, open them first.
Related topics
- How a switch learns and forwardsEthernet, MAC addresses and the Cisco CLI · same module
- ARP, the default gateway and pingEthernet, MAC addresses and the Cisco CLI · same module
- Switch management and interface troubleshootingSwitching and VLANs
- Why layer 2 loops are deadlySpanning Tree and EtherChannel
- IPv4 address structure and special rangesIPv4 addressing
- IPv6 address types, EUI-64, SLAAC and NDPSubnetting practice and IPv6
Questions people ask about this
Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.
How many bits are in a MAC address?
Answer: 48
A MAC address is 48 bits: 12 hex digits of 4 bits each.
What is the Ethernet broadcast MAC address written in Cisco format?
Answer: ffff.ffff.ffff
Broadcast is all ones. 255.255.255.255 is the IPv4 broadcast, not a MAC address.
Which part of a MAC address identifies the maker?
Answer: The OUI, the first 24 bits
The Organisationally Unique Identifier is assigned to the maker by the IEEE.
One end of a 100 Mbps link is set to full duplex by hand, the other is on auto and falls back to half. What will you most likely see?
Answer: Late collisions on one side, CRC errors on the other, and a slow link
That is a duplex mismatch: the link is up but slow and full of errors.
What is the largest payload a standard Ethernet frame can carry?
Answer: 1500 bytes
The standard Ethernet MTU is 1500 bytes. 9000 is a non-standard jumbo frame.
A port shows many late collisions. What is the usual cause?Related
Answer: A duplex mismatch
On switched networks, late collisions almost always mean one side is half duplex and the other full.
Which command shows the MAC address table on a Cisco switch?Related
Answer: show mac address-table
show mac address-table lists VLAN, MAC, type and port.
What is a broadcast storm?Related
Answer: Broadcasts copied endlessly around a layer 2 loop until the network is overloaded
In a loop, every switch keeps flooding the same broadcasts, so they multiply until links and CPUs are full.
Which device forwards a frame only out of the port where the destination MAC address is?Related
Answer: Switch
A switch learns MAC addresses per port and forwards frames only where needed.
From Network devices
Pass the quiz (60% or more) or mark this topic as done when you are ready.
Your progress is saved on this device only.
Next steps
- 3 more topics in “Ethernet, MAC addresses and the Cisco CLI” before its exam: How a switch learns and forwards, ARP, the default gateway and ping, The Cisco IOS command line.
- Module 2 exam: Ethernet, MAC addresses and the Cisco CLI · 13 questions · 20 min, without help. 5 topics of this module still to finish first.
- Then the next module, IPv4 addressing. 57 topics left in the course before the final exam.