Sub topic 17
Learning Switches and Collision Domains
Prerequisites
Assume you know what a data-link frame is, what a MAC address identifies, and that a network can carry frames over a shared physical medium.
Why switches are needed
A collision domain is the part of a network in which two simultaneous transmissions can interfere. A hub repeats every incoming signal to all ports, so all devices connected to that hub share one collision domain. A collision can affect every connected device.
A learning switch examines the source MAC address of each incoming Ethernet frame. It records that address and the port on which it arrived in a MAC address table. This process is called learning.
For a frame addressed to a known destination, the switch sends the frame only through the destination's port. The two devices then have a separate collision domain from devices attached to other switch ports.
Forwarding decisions
A switch handles a frame as follows:
- It learns the source address by associating it with the incoming port.
- It looks up the destination address.
- If the destination is on another port, it forwards the frame only there.
- If the destination is on the same incoming port, it filters the frame instead of sending it back.
- If the destination is unknown, it floods the frame through all ports except the incoming port.
- A broadcast frame is also flooded, because every device in the broadcast domain should receive it.
An entry can expire after a period of inactivity. If a device moves to another port, the switch can learn the new location when it receives the device's next frame.
Collision domains and broadcast domains
With a switch, each port is normally a separate collision domain. A frame sent from port 1 to port 3 does not create a collision domain involving port 2. In full-duplex Ethernet, a link can transmit and receive simultaneously, so collisions do not occur on that link.
A switch does not automatically separate broadcast domains. Broadcast frames still reach all ports in the same switched LAN. Routers, or logically separate VLANs, are used to divide broadcast domains.
| Device or link | Collision-domain behavior | Broadcast behavior |
|---|---|---|
| Hub | One shared collision domain | Repeats broadcasts |
| Switch port | Separate domain per port | Floods within the LAN |
| Router interface | Separate network segment | Does not forward broadcasts by default |
Exercise
A switch knows that A is on port 1 and C is on port 3. A sends a frame to C. Which ports receive the frame, and how many collision domains are involved?
Show answer
The switch forwards the frame only to port 3. Ports 1 and 3 belong to separate collision domains, so the transmission uses the link between the switch and C without involving port 2.