0
0
Computer Networksknowledge~10 mins

Switching and bridging in Computer Networks - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Switching and bridging
Data Frame Arrives
Check Destination MAC
Is Destination in MAC Table?
NoFlood Frame to All Ports Except Incoming
Yes
Forward Frame to Specific Port
Update MAC Table with Source MAC and Port
End
Data frames arrive at a switch or bridge, which checks the destination address. If known, it forwards the frame to the correct port; if unknown, it floods the frame to all ports except the source. It also learns source addresses to update its MAC table.
Execution Sample
Computer Networks
Frame arrives at port 1
Check destination MAC
If known, forward to port 3
Else flood to all except port 1
Update MAC table with source MAC and port 1
This shows how a switch processes a frame: it decides where to send it based on the MAC address table and learns new addresses.
Analysis Table
StepActionDestination MAC Known?Forwarding DecisionMAC Table Update
1Frame arrives at port 1N/AN/AN/A
2Check destination MAC in tableNoFlood to all ports except port 1Add source MAC with port 1
3Next frame arrives at port 2N/AN/AN/A
4Check destination MAC in tableYes (port 3)Forward to port 3Add source MAC with port 2
5Frame arrives at port 3N/AN/AN/A
6Check destination MAC in tableYes (port 1)Forward to port 1Add source MAC with port 3
7No more framesN/AStop processingFinal MAC table stable
💡 No more frames to process; MAC table has learned all active devices.
State Tracker
VariableStartAfter Step 2After Step 4After Step 6Final
MAC TableEmpty{Source MAC from port 1}{Source MAC from port 1, Source MAC from port 2}{Source MAC from port 1, Source MAC from port 2, Source MAC from port 3}Stable with all learned MACs
Key Insights - 3 Insights
Why does the switch flood the frame when the destination MAC is unknown?
Because the switch does not know which port leads to the destination, it sends the frame to all ports except the one it came from to find the destination device. This is shown in execution_table row 2.
How does the switch learn which devices are connected to which ports?
The switch updates its MAC table with the source MAC address and the port it arrived on for every frame it receives, as seen in execution_table rows 2, 4, and 6.
What happens when the destination MAC is known in the MAC table?
The switch forwards the frame only to the specific port associated with that MAC address, avoiding unnecessary flooding. This is shown in execution_table rows 4 and 6.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table at step 2: what does the switch do when the destination MAC is unknown?
AForward the frame to a random port
BFlood the frame to all ports except the incoming port
CDrop the frame
DSend the frame back to the source port
💡 Hint
Refer to execution_table row 2 under 'Forwarding Decision'
At which step does the MAC table first contain entries for two ports?
AStep 2
BStep 6
CStep 4
DStep 7
💡 Hint
Check variable_tracker after Step 4 for MAC Table state
If the switch never updated its MAC table, what would happen to the forwarding decisions?
AIt would always flood frames to all ports except the source
BIt would forward frames correctly to specific ports
CIt would drop all frames
DIt would send frames back to the source port
💡 Hint
Consider the role of MAC table updates shown in execution_table rows 2, 4, and 6
Concept Snapshot
Switching and bridging process:
- Frame arrives at a port
- Check destination MAC in MAC table
- If known, forward to specific port
- If unknown, flood to all except source port
- Update MAC table with source MAC and port
- Repeat for each frame to learn network layout
Full Transcript
Switching and bridging involve receiving data frames on a network device like a switch or bridge. The device checks the destination MAC address in its MAC address table. If the address is known, it forwards the frame only to the port associated with that address. If unknown, it floods the frame to all ports except the one it came from to find the destination. The device also learns by adding the source MAC address and incoming port to its MAC table. This process repeats for each frame, allowing the device to build a map of where devices are connected and efficiently forward future frames.