NetKubeLab ไทย

Network Fundamental Inside one network

Collision and broadcast domains — the line everyone can name and few can place

What each device actually stops, and thirty years in which one boundary shrank to nothing while the other never moved at all

· Part 3 · Inside one network · 10 min read

Both terms are in every textbook, and most people can say what they are.

The harder question is where the line falls, and why the two lines are not in the same place.

The answer is thirty years of history in which one boundary shrank away to nothing, while the other stayed exactly where it was until somebody invented a new way to cut it.

If you have never looked, start here

The machine you are on may already be running a bridge without your knowing.

$ ifconfig | grep -A2 bridge

On the machine this was written on, that returns

  proto stp   maxaddr 100   timeout 1200
  member: vmenet0 flags=3<LEARNING,DISCOVER>

The word LEARNING on that line is the whole mechanism of this article, and the two numbers above it come back at the end.

A collision domain is the reach over which a collision still means something

The Ethernet article explains why the minimum frame is 64 bytes: the sender has to still be sending when the collision signal gets back to it.

Every machine plugs into one hub, so a signal from any of them reaches all of them, and two sending at once collide and stop the whole segment

A collision domain is the boundary within which two simultaneous sends collide. Across the boundary, they do not touch each other.

Its size was not chosen by taste. It falls out of the slot time — the same number that fixes the minimum frame.

  rate       slot time   one way    theoretical   actual limit
  10 Mbps     51.20 us   25.60 us       5,120 m       2,500 m
  100 Mbps     5.12 us    2.56 us         512 m         205 m

The real limits are shorter than the theoretical ones because the equipment in between spends time too. But the ratio is the point: ten times the speed, one tenth the distance.

The reason is that slot time is counted in bits, not in time. 512 bits at 10 Mbps takes 51.2 microseconds; the same 512 bits at 100 Mbps takes 5.12.

Repeaters — extend the cable, and extend the problem with it

The first device people used to grow a network was the repeater. Its job is to take a weakening signal and send it on at full strength.

It works on the signal and never reads whose frame is inside. A hub is a repeater with more ports.

What follows is something people of that era genuinely had to work out.

  hub ports   collision domains   simultaneous senders
      8               1                     1
     24               1                     1
     48               1                     1

However many hubs you chain, it stays one domain — and the longer the chain, the closer to the distance ceiling in the table above.

The arithmetic that killed the approach

Carry the calculation on to 1 Gbps with the same slot time.

  rate       slot time   one way    theoretical
  1 Gbps       0.51 us    0.26 us          51 m

Fifty-one metres — shorter than the single 100-metre cable the standard allows.

The physical layer article explains why cable stops at a hundred metres. Here is the number saying that on the old slot time, the collision domain would be smaller than one cable run, which is to say unusable.

The standard therefore had to enlarge the slot time for gigabit — and then almost nobody used the mode that needed it, because by then everyone had moved to switches.

The bridge — the first device that read what was inside

The turning point was a device that did not repeat a raw signal but read the destination address in the frame and then decided.

A bridge reads the address in the frame and sends it only out of the port that needs it, so the two sides can send at once and are separate collision domains

RFC 1493 of 1993, which describes how to manage a bridge, defines its table

"A table that contains information about unicast entries for which the bridge has forwarding and/or filtering information. This information is used by the transparent bridging function in determining how to propagate a received frame."

"Filtering" is the thing a hub cannot do. A hub passes everything on; a bridge can decide not to.

And each entry carries a status saying where it came from.

  learned(3)   the bridge worked it out from frames going past
  self(4)      the bridge's own address
  mgmt(5)      somebody configured it
  invalid(2)   it was learned once, and has since aged out

Nobody has to configure a bridge. It looks at the source address of a frame arriving on a port and remembers that the address lies that way. That is the LEARNING my machine printed at the top of this article.

Memory that has to forget, and a number that disagrees with the standard

Learned addresses have to expire, or moving a machine would send its frames the wrong way forever.

RFC 1493 defines the setting, with a recommendation.

"The timeout period in seconds for aging out dynamically learned forwarding information. 802.1D-1990 recommends a default of 300 seconds."

The bridge on the machine I wrote this on is set to

  standard recommends    300 s
  this machine ships   1,200 s

Four times longer. That is not a fault. It is somebody's decision about what to trade: how quickly a moved machine is followed, against how often a frame has to go out of every port because the address was forgotten.

The maxaddr 100 is the same kind of trade — a hundred addresses remembered, and older ones discarded past that.

What a bridge cannot divide

A bridge knows which port each destination lies behind, so it can choose.

But when the destination is "everyone", there is nothing to choose. A broadcast frame goes out of every port, always. There is no other option.

  frame type    bridge behaviour
  unicast       out of the one port it knows the destination is on
  unicast new   destination unknown, so out of every port
  broadcast     out of every port, always

The second line matters more than it looks. A frame whose destination is not yet known is flooded too — which is why the ageing time above has a real effect on how much traffic there is.

A broadcast domain is how far the word "everyone" reaches

A broadcast domain is the set of machines a single broadcast frame reaches.

And because a bridge must always pass a broadcast on, adding bridges does not make the broadcast domain one machine smaller.

This is where the two boundaries part company.

A bridge cuts the collision domain in two, while the broadcast domain still covers both halves exactly as before

The ARP article shows that every conversation on a segment opens with a question addressed to everybody. The bigger the broadcast domain, the more machines those questions interrupt for no reason of their own.

And RFC 1286 of 1991 is blunt about loops in bridges.

"unlike transparent bridging this is not catastrophic to the network if there are loops"

"Catastrophic" refers to bridging. Nothing stops a broadcast frame going round a loop, because a frame has no TTL — which is why STP had to exist.

The switch — a bridge with many ports, done in hardware

A switch is not a new idea. It is a bridge with a lot of ports that decides in hardware.

What follows is the collision domain count.

  device       ports   collision domains
  hub             24                   1
  bridge           2                   2
  switch          24                  24

Every port of a switch is its own collision domain, which means twenty-four machines can send at once instead of one.

But the column not in that table is the broadcast domain, which is still 1 on all three rows.

Full duplex — when the collision domain shrinks to nothing

The last step was giving up the shared wire entirely. When a switch port has one machine on it and a separate pair for each direction, a collision cannot happen at all.

On the machine this was written on

$ ifconfig en1 | grep media
  media: autoselect <full-duplex>

On a full-duplex link CSMA/CD is disabled — not merely unused, but switched off, because there is nothing left to detect.

So the collision domain went from two and a half kilometres to effectively zero in about twenty years.

Where the lines fall — the table that answers the opening question

  device       stops collisions   stops broadcast
  repeater             no                no
  hub                  no                no
  bridge              yes                no
  switch              yes                no
  router              yes               yes

Only one kind of device stops a broadcast, and it is the router — because it does not forward the frame at all. It reads the packet inside and builds a new frame, as the routing article describes.

And that is why VLANs were invented: so one switch could divide a broadcast domain without buying another router. Which is the subject of the VLAN article.

When it lies

"A switch divides broadcast domains." It does not. A plain switch with no VLANs is one broadcast domain from end to end.

"A hub and a switch differ only in speed." They differ in that a hub repeats without reading and a switch reads the address first. The result is a difference in collision domains equal to the port count.

"Collisions are gone, so this does not matter now." True of switched copper. Wi-Fi still shares a medium, and the collision domain idea still describes it directly.

"A switch's address table is something you configure." The default status is learned: worked out from frames going past. Nobody sets it.

"A broadcast domain can be any size if the switch is fast enough." The switch is not the constraint. Every machine in the domain has to process every broadcast frame that reaches it.

Real cases from real work

Case 1 — the network slows down as machines are added

Situation More machines on the segment and everyone feels it, while bandwidth is nowhere near exhausted.

How to read it Ask how many machines share one broadcast domain. Every broadcast frame reaches all of them and every one has to process it, so that work grows with the machine count even where the real traffic does not.

What this does not prove Slowness has many causes. Counting machines tells you there is exposure, not that it is the cause. Look at the actual share of broadcast frames.

Case 2 — deciding where to cut a VLAN

Situation One segment is getting large and has to be divided.

How to read it The meaningful boundary is the broadcast domain, not the cabling. The question is which group has no reason to hear another group's ARP.

  1  which groups mostly talk among themselves
  2  which groups already cross a router anyway
  3  which group holds the most machines

What this does not prove Dividing a broadcast domain reduces the noise and adds work for the router. Traffic that used to cross inside the switch now has to go up to layer three, which may move the bottleneck rather than remove it.

Case 3 — reading a device's address-table settings

Situation You want to know how long the device remembers an address, and how many it holds.

How to read it Two values: the ageing time and the maximum.

  ageing time   too long, and a moved machine is followed slowly
                too short, and frames are flooded more often
  max entries   once full, older entries are discarded

What this does not prove A vendor's default can be far from the standard's recommendation — the machine I wrote this on is set to 1,200 seconds where 802.1D recommends 300. Seeing the number does not tell you why they chose it.

Thirty years in three lines

  repeater / hub   collision domains 1
  bridge / switch  collision domains one per port
  full duplex      collision domains none left

Across all three lines the broadcast domain never moved. It stayed at one, until somebody worked out how to divide it with a four-byte tag — which is the next article.

References

Standards

  • RFC 1493, July 1993, Definitions of Managed Objects for Bridges — the forwarding table, the entry statuses, and the ageing default that cites 802.1D-1990
  • RFC 1286, December 1991, its predecessor, and the sentence about loops in bridges quoted here

Measured on the machine this was written on

  • ifconfig on a real bridge here — the LEARNING flag on the port, maxaddr 100, and timeout 1200, four times the standard's recommendation
  • ifconfig en1, reporting the link as full duplex

Computed here

  • The collision-domain distance table is computed from a 512-bit slot time and a signal speed in copper of about 2 x 10^8 metres per second. The actual limits per standard are figures the standards set, not results of this calculation.

What could not be confirmed from the source

  • IEEE 802.3 and 802.1D are paid documents. The slot time and maximum distances cited here therefore come from the calculation and from documents that refer to those standards, not from reading the standards themselves.

Measured on a real machineComputed here

อ่านหน้านี้เป็นภาษาไทย