Wiki DE Start in the browser

Wiki › Basics

Collision and broadcast domain, duplex

Who hears whom? Collision domain and broadcast domain, hub, switch and router compared, CSMA/CD, half and full duplex and autonegotiation.

Layer
1 und 2
Standard
IEEE 802.3, IEEE 802.1Q, RFC 826
See an example
2 demos

Two questions for every network

  • Collision domain: Which devices share one medium, so that two simultaneous transmissions interfere?
  • Broadcast domain: Which devices does a broadcast reach (e.g. an ARP request to ff:ff:ff:ff:ff:ff)?

The answer depends on the devices in between:

DeviceLayerCollision domainBroadcast domain
Hub (repeater)1one for all portsone
Switch2one per portone per VLAN
Router3one per interfaceone per interface

Counting example

Two switches with four PCs each, connected through a router:

  • Collision domains: 8 PC ports + 2 links switch–router = 10
  • Broadcast domains: one per router interface = 2

If one switch is replaced by a hub with four PCs, that part, including its link to the router, becomes one collision domain: 4 PC ports and 1 link at the remaining switch plus 1 for the hub gives 6.

CSMA/CD: rules for a shared medium

In early Ethernet (coaxial cable, later hubs) everyone shared one cable. The rule for this is called CSMA/CD (Carrier Sense Multiple Access with Collision Detection, IEEE 802.3, Clause 4):

  1. Listen (carrier sense): is the line free?
  2. Send when it is free.
  3. Detect a collision: if someone else sends at the same time, both stop and send a jam signal.
  4. Wait a random time (backoff) and start again.

Today a switch connects every device through its own link in full duplex: there are no more collisions, CSMA/CD is switched off. Wi-Fi, by contrast, still has a shared medium (the radio cell); there CSMA/CA (collision avoidance) applies according to IEEE 802.11, because a radio cannot listen while it transmits.

Half and full duplex

ModeMeaningWhere
Half duplexsend or receive in turnhub, early Ethernet, Wi-Fi
Full duplexsend and receive at the same timeswitch port, router interface, fibre

With full duplex the usable data rate doubles in total: 1 Gbit/s out and 1 Gbit/s back.

Autonegotiation

When plugged in, two Ethernet ports on copper negotiate which speed and which duplex both support and choose the best (IEEE 802.3, Clause 28; mandatory for 1000BASE-T). Classic mistake: one side is fixed at 100 Mbit/s full duplex, the other negotiates and falls back to half duplex. The network works, but slowly and with many errors (duplex mismatch). Fix: both sides on “auto” or both fixed to the same values.

Unicast, multicast, broadcast

TypeDestinationExample (MAC)
Unicastexactly one device02:00:00:00:01:00
Multicasta group01:00:5e:00:00:05 (OSPF), 33:33:00:00:00:01 (IPv6 all nodes)
Broadcasteveryone in the broadcast domainff:ff:ff:ff:ff:ff (ARP, RFC 826)

A switch sends broadcasts and unknown destinations to all ports of the same VLAN (flooding). IPv6 no longer has broadcast and uses multicast instead (see Neighbor Discovery (NDP) and SLAAC).

In leyoNET

  • See the broadcast domain: start a ping to a new destination. The ARP request appears as a dot on all cables of the VLAN, the reply only on the way back.
  • leyoNET does not simulate collisions: all cable connections run in full duplex, as in today's networks. Instead, a loop without spanning tree shows how broadcasts multiply endlessly (demo “broadcast storm”, see Spanning tree (STP)).
  • With VLANs (VLANs and trunks) one switch becomes several broadcast domains; only a router or layer 3 switch connects them.

How to do it in leyoNET

The same text as in the app’s help (F1 key).

Switching

A switch records each frame's source MAC and port (MAC table, also called SAT for “source address table”). If it knows the destination it forwards only there, otherwise to all ports (flooding). Broadcasts such as ARP always go to every port in the same VLAN. If two devices share a MAC address, the switch learns it alternately on two ports («MAC flapping»): frames reach the wrong device and the switch console reports «MAC moves».

VLANs

VLANs split one switch into separate networks. An access port belongs to exactly one VLAN, a trunk carries several (Trunks).

Under Tools → VLANs each VLAN gets a name and a colour. The colour automatically tints every port of that VLAN on the canvas and in the port table. Between VLANs you need a router (Router on a stick) or a layer 3 switch.

Creating VLANs: a switch only forwards VLANs it knows (tab Switching → VLANs on this switch or vlan 20, name Training). Assigning a new VLAN to an access port creates it, as on Cisco. A switch in the middle with trunks only still needs the VLANs, otherwise it drops the frames (console: «VLAN 20 is not created»). no vlan 20 deletes a VLAN, its ports become inactive. Files before version 1.2 have no list: there all VLANs in use count as created.

See an example

  • Demo “ARP and ping in the LAN” in leyoNETDemo “ARP and ping in the LAN” in leyoNET
    Slow motion This is how it looks in the simulation: every dot is a frame on the cable.
    ARP and ping in the LAN

    Three computers on a switch, all in 192.168.1.0/24.

    PC 1 asks for PC 2's MAC with an ARP broadcast, then four ICMP echoes follow. The switch learns its MAC table.

    Watch live Project file

  • Demo “Broadcast storm” in leyoNETDemo “Broadcast storm” in leyoNET
    Slow motion This is how it looks in the simulation: every dot is a frame on the cable.
    Broadcast storm

    Three switches in a ring, but without spanning tree.

    The very first ARP request circles endlessly and multiplies. Then enable STP and compare.

    Watch live Project file

“Watch live” opens the network in leyoNET, the simulation runs in a loop. In the app you find it under File → Demo networks, with a step-by-step tour.

Practise

  • ★★☆☆☆ Small LAN with a switch · 4 goals · Worksheet (German)
  • ★★★☆☆ Separate networks with VLANs · 4 goals · Worksheet (German)
  • ★★☆☆☆ Two networks with a router · 4 goals · Worksheet (German)

In leyoNET under Tools → Exercise catalogue. Every exercise checks itself.

Standards

  • IEEE 802.3 – IEEE Standard for Ethernet (current edition: IEEE 802.3-2022)
  • IEEE 802.1Q – Bridges and Bridged Networks (current edition: IEEE 802.1Q-2022)
  • RFC 826 – An Ethernet Address Resolution Protocol

Read on

Found a mistake or have an idea? Source of this page on GitHub.