Ethernet and ARP
Duplex and speed
Whether a link's two ends may send at the same time, and how fast: agreed by auto-negotiation, or set by hand.
The problem
When the two ends of a cable disagree on whether both may talk at once, the link still works, but slowly and with errors.
- When a cable is plugged in, the two cards auto-negotiate: each offers what it can do, and both pick the best they share, say 1000 Mb/s, full duplex.
- Full duplex: both ends send at the same time. Half duplex: one at a time, as on an old shared hub.
- Set one end by hand to 100 Mb/s, full duplex, and it stops offering. The other end still senses the speed, but not the duplex, so it falls back to half.
- Now the half end hears the full end talk over it and counts late collisions, while the full end receives cut-off, damaged frames (CRC errors, runts).
What you'd see
$ ethtool eth0
Settings for eth0:
Speed: 10000Mb/s
Duplex: Full
Auto-negotiation: off
Link detected: yes
SpeedandDuplex: what the link runs at now.Auto-negotiation: off: this card is virtual (one end of a container's cable), with nothing to negotiate; a real port showson.Link detected: yes: the live link thatip linkshows asLOWER_UP.
Guess first
One end is set by hand to full duplex; the other negotiates. Which end ends up at half duplex?
Show answer
The one that negotiates. It hears no offer, so it can sense the speed but not the duplex, and falls back to half.
In short
Duplex says whether a link's two ends may send at once. Full duplex does; half duplex takes turns and backs off on a collision. The ends auto-negotiate speed and duplex. If one end is set by hand, the other falls back to half: a duplex mismatch. The link stays up but slow: late collisions on the half side, CRC errors on the full side. A speed mismatch gives no link.
Read next
- Interface counters What a card has counted since it started: packets and bytes each way, and every frame it dropped or found damaged.
- Network interface A card a machine sends and receives through, switched on or off, with or without a live link.
- Hub The switch's ancestor: it repeats every frame out of every port, so everyone hears everything.