Concepts / Ethernet and ARP

Ethernet and ARP

Duplex and speed

Also called full duplex, half duplex, duplex mismatch, speed mismatch, auto-negotiation, autoneg, collisions, late collisions

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.

  1. 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.
  2. Full duplex: both ends send at the same time. Half duplex: one at a time, as on an old shared hub.
  3. 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.
  4. 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).
A duplex mismatch is slow, not dead
A duplex mismatch is slow, not dead

When one end is full duplex and the other half, the link stays up. The full side sends over the half side's frames, so both count errors and traffic crawls.

What you'd see

$ ethtool eth0
Settings for eth0:
	Speed: 10000Mb/s
	Duplex: Full
	Auto-negotiation: off
	Link detected: yes
  • Speed and Duplex: 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 shows on.
  • Link detected: yes: the live link that ip link shows as LOWER_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.

See it on real machines

Read next

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab