ELEC3506

MAC and LANsLecture 426 min

CSMA/CD and the Ethernet Frame

How a station senses a collision, why that forces a minimum frame size, and the exact backoff and distance numbers that follow from it.

By the end of this page you should be able to

  • Explain carrier sensing and collision detection in terms of energy level
  • Derive the minimum Ethernet frame size from the maximum propagation time
  • State the binary exponential backoff rule and where it stops
  • Give both the theoretical and real collision-domain distance for 10 Mbps Ethernet, and say why they differ

The idea

Ethernet has no controller. No station outranks another, nothing schedules who transmits next, and there is no rule about who goes first — every station just competes for the wire. That works fine until two stations guess wrong at the same moment and transmit together. The two signals collide, and both frames come out corrupted.

Carrier Sense Multiple Access with Collision Detection (CSMA/CD) is the rule that makes that survivable. Before sending, listen. While sending, keep listening — and if a collision turns up, stop immediately, tell everyone else a collision happened, and try again later, at a randomly chosen and increasingly long delay.

Sensing and detecting

How it works

Carrier sense, then collision detection

A station reads the cable’s energy level to know what is happening on it:

  • Zero — the channel is idle.
  • Normal — one station is transmitting successfully.
  • Abnormal, roughly twice normal — two signals are on the wire together. That is a collision.

If the channel is idle, transmit. If it is busy, wait until it is idle, then transmit. While transmitting, keep sensing — that is what turns plain CSMA into CSMA/CD. Detect a collision and the station aborts immediately, sending a short jam signal so every other station on the segment also learns a collision happened, rather than mistaking it for an ordinary garbled frame.

The sending station must detect that collision before it sends the last bit of the frame. Miss that window and the station finishes transmitting believing the frame went out clean, when it did not.

Why there is a minimum frame size

Two stations sit at opposite ends of the collision domain, as far apart as the standard allows. Station A starts transmitting. Its signal takes the maximum propagation time, Tp, to reach station B. If B happens to start transmitting in that same window, before A’s signal arrives, the two collide — and the effect of that collision takes another Tp to travel back to A.

The worst case therefore takes 2Tp to resolve: Tp out, Tp back. A must still be transmitting when that collision report arrives, or it will never know the frame needs resending. That gives the rule directly.

Worked example

10 Mbps Ethernet, Tp = 25.6 µs

  1. The rule. Frame transmission time must be at least twice the maximum propagation time: Tfr ≥ 2 × Tp.

  2. Plug in Tp. Tfr = 2 × 25.6 µs = 51.2 µs. This is also called the slot time.

  3. Convert to bits at 10 Mbps. 10 Mbps × 51.2 µs = 512 bits.

  4. Convert to bytes. 512 bits ÷ 8 = 64 bytes — the minimum Ethernet frame size.

  5. Why it matters. Once the first 512 bits are out the door without a collision, a collision on this segment can no longer happen. The sender only has to watch for one during those first 512 bits, not the whole frame.

AnswerMinimum frame = 512 bits = 64 bytes

The 512 bits has a name of its own, the slot time, and every backoff wait below is measured in it.

The frame itself

An IEEE 802.3 Ethernet frame: a 7-byte preamble, a 1-byte start frame delimiter, 6-byte destination and source MAC addresses, a 2-byte type or length field, a data field of 46 to 1500 bytes, and a 4-byte CRC.BYTES (DATA FIELD NOT TO SCALE)Preamble7 B1Destination6 BSource6 B2Data46–1500 BCRC4 B
The 46-byte minimum on the data field is not arbitrary — it exists so a frame lasts long enough for a collision at the far end of the segment to reach the sender before it stops transmitting.

Reading it left to right: an 8-byte preamble — seven bytes of 10101010, then one byte of 10101011, the start frame delimiter — exists purely to let the two clocks lock together before any real data starts. Then 6-byte destination and source MAC addresses, a 2-byte type field naming the higher-layer protocol (usually IP, but Novell IPX and AppleTalk are both legal values), the data itself, anywhere from 46 to 1500 bytes, and a 4-byte CRC.

That 46-byte data floor is exactly what makes the frame add up to the minimum 64 bytes worked out above: 6 + 6 + 2 + 46 + 4 = 64. The preamble is not counted — its job is finished before the frame proper begins.

Where marks get lost

The receiver never acknowledges anything

Ethernet is connectionless — no handshake between sending and receiving NICs before data moves — and unreliable — the receiving NIC sends neither ACK nor NAK. If the CRC check fails, the frame is simply dropped.

Recovery is not Ethernet’s job. A dropped frame is only resent if something above it, TCP most commonly, notices it is missing and asks again. Do not describe Ethernet as reliable, and do not invent an ACK step in a diagram of it.

Binary exponential backoff

A collision means both stations have to try again, but not immediately — if they retried at once they would just collide again. Instead each station picks a random wait.

After the m-th collision on a frame, a station draws K uniformly at random from {0, 1, 2, ..., 2^m − 1}, then waits K × 512 bit times before listening again. More collisions mean a wider range to draw from, so the expected wait grows — but only up to a point.

Worked example

After the 3rd collision

  1. m = 3. The range is {0, 1, ..., 2^3 − 1} = {0, ..., 7}.

  2. Worst-case K = 7. Wait = 7 × 512 = 3584 bit times.

  3. At 10 Mbps, one bit time is 0.1 µs, so that wait is 358.4 µs.

AnswerK drawn from {0..7}; worst case waits 3584 bit times

Aside

Two numbers the lecture leaves out

The lecture states the backoff rule but not where it stops. Standard IEEE 802.3 — not lecture content, confirmed against the 802.3 specification — fills in both gaps: the range stops doubling after the 10th collision, capping at K up to 2^10 − 1 = 1023, and a station still colliding after 16 attempts gives up, reporting an excessive-collision error to the layer above rather than retrying forever.

Try it

CSMA/CD timeline

Try it

Collision #K rangeA drewB drew

At 10 Mbps the slot time gives a theoretical 5120 m collision domain — propagation delay only. Real 10BASE5 is limited to 2500 m once repeater and safety margins are budgeted in. At 1 Gbps the same 512-bit slot theoretically allows only 51 m, one reason gigabit Ethernet gave up on shared media and went full duplex.

Run a few collisions through it and watch the K values it draws. Reset and try again — the range depends only on the collision count, not on what happened before.

Collision domain

How it works

How far apart can two stations be?

The slot time sets a hard limit on distance, because the whole 2Tp argument only works if a collision has time to get back to the sender.

Theoretical maximum. Distance = propagation speed × Tp. Electrical signal in copper travels at roughly two-thirds the speed of light, about 2 × 10^8 m/s. With Tp = 25.6 µs:

(2 × 10^8 m/s) × (25.6 × 10^-6 s) = 5120 m

Real maximum: 2500 m. Lecture 4 gives the reason directly — delay at repeaters, hubs and network interfaces reduces the theoretical figure to 2500 m, roughly 48% of the 5120 m calculation. The idealised formula only accounts for the speed-of-light delay across a single clean run of cable. It has no room for the time each repeater spends receiving and re-amplifying a signal before passing it on, the processing delay inside a NIC, or a safety margin for the worst case rather than the typical one.

Aside

Where 2500 m actually comes from

The slides give the reason but not the mechanism. The concrete standard behind it — not lecture content, confirmed against IEEE 802.3 — is the 5-4-3 rule: at most 5 cable segments, joined by at most 4 repeaters, of which at most 3 may have stations attached. Each 10BASE5 segment maxes out at 500 m, so 5 × 500 m = 2500 m.

Where marks get lost

The 100 Mbps figure is not something to reconstruct

The lecture gives a collision-domain figure for 100 Mbps Ethernet, 250 m, but the derivation behind it does not hold together — it appears to combine the propagation-delay calculation with a 0.48 practical-reduction factor, and the two do not reconcile cleanly from what the slides show. Do not try to rebuild this derivation for an exam answer. If a question asks for the 100 Mbps collision domain, quote 250 m as the lecture’s stated answer, without presenting working you cannot actually walk through.

Check yourself

A frame has just collided for the 2nd time. What range is K drawn from, and in bit times, what is the longest possible wait?

m = 2, so K comes from 3. Worst case K = 3, wait = 3 × 512 = 1536 bit times.

Speeds and cable types, briefly

IEEE 802.3 covers far more than 10 Mbps. The lecture lists 2 Mbps, 10 Mbps, 100 Mbps, 1 Gbps, 10 Gbps and 40 Gbps, over cable types including 10BASE5, 10BASE2, 10BASET and 10BASEF. The next topic covers what changes at each speed, including why higher speeds gave up on CSMA/CD entirely.

MethodWhat it checksResponse
Carrier sensingIs the channel idle right now?Idle → transmit. Busy → wait, then transmit when idle
Collision detectionIs another signal on the wire while I transmit?No collision → done. Collision → abort, jam, back off
Sensing decides when to start. Detection decides whether to keep going. CSMA/CD needs both.

In the exam

  • Energy level sensing. Zero idle, normal one sender, roughly double normal a collision. This is how a station tells the three states apart.
  • The minimum frame derivation. Tfr ≥ 2Tp, giving 512 bits at 10 Mbps with Tp = 25.6 µs. Show the working, not just the answer.
  • Ethernet fields sum to the minimum. 6 + 6 + 2 + 46 + 4 = 64 bytes. The 8-byte preamble is not part of that count.
  • Ethernet is connectionless and unreliable. No handshake, no ACK/NAK. Recovery is a higher layer’s job.
  • Binary exponential backoff. K × 512 bit times, K from {0, ..., 2^m − 1}. The cap at the 10th collision and the abort at 16 attempts are standard IEEE 802.3, not lecture content — say so if you cite them.
  • Collision domain: give both numbers. 5120 m theoretical, 2500 m real, and the reason — repeater, hub and NIC delay. The 5-4-3 rule is the mechanism behind the second number.
  • The 100 Mbps derivation is unreliable. Quote 250 m if asked; do not invent working for it.

Check yourself

  1. Why must a sending station detect a collision before the last bit of the frame leaves?
  2. A 10 Mbps Ethernet segment has Tp = 25.6 µs. What is the minimum frame size?
  3. A frame has just collided for the 4th time. What is the widest range K can be drawn from?
  4. After how many collisions does 802.3 stop doubling the backoff range, and after how many attempts does the station give up entirely?
  5. Why is the theoretical 5120 m collision domain never usable on a real 10BASE5 network?
  6. The lecture gives 250 m as the 100 Mbps collision domain, but its derivation mixes a propagation calculation with a 0.48 reduction factor that does not reconcile. What is the right thing to do with that in an exam answer?