Bird
Raised Fist0
Computer Networksknowledge~10 mins

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

Choose your learning style10 modes available
Concept Flow - Switching and bridging
Data Frame Arrives
↓
Check Destination MAC
↓
Is Destination in MAC Table?
No→Flood 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.

Practice

(1/5)
1. What is the main purpose of a network switch in a local area network?
easy
A. To block all incoming traffic
B. To send data directly to the intended device
C. To assign IP addresses to devices
D. To connect different networks over the internet

Solution

  1. Step 1: Understand the role of a switch

    A switch connects devices within the same network and forwards data only to the device it is meant for.
  2. Step 2: Compare with other options

    Assigning IP addresses is done by a DHCP server, connecting different networks is done by routers, and blocking all traffic is not a switch's function.
  3. Final Answer:

    To send data directly to the intended device -> Option B
  4. Quick Check:

    Switch forwards data to correct device [OK]
Hint: Switch sends data only to the target device [OK]
Common Mistakes:
  • Confusing switch with router
  • Thinking switch assigns IP addresses
  • Believing switch blocks all traffic
2. Which of the following is the correct function of a network bridge?
easy
A. To connect and filter traffic between two network segments
B. To assign IP addresses to devices
C. To provide wireless access to devices
D. To encrypt data packets

Solution

  1. Step 1: Define the role of a bridge

    A bridge connects two or more network segments and controls the flow of data between them by filtering traffic.
  2. Step 2: Eliminate incorrect options

    Assigning IP addresses is DHCP's job, wireless access is provided by access points, and encryption is done by security protocols, not bridges.
  3. Final Answer:

    To connect and filter traffic between two network segments -> Option A
  4. Quick Check:

    Bridge connects segments and filters traffic [OK]
Hint: Bridge links segments and filters data flow [OK]
Common Mistakes:
  • Confusing bridge with DHCP server
  • Thinking bridge provides wireless access
  • Assuming bridge encrypts data
3. Consider a network with two segments connected by a bridge. If a device on segment A sends data to a device on segment B, what will the bridge do?
medium
A. It will forward the data only if the destination is on segment B
B. It will block the data to prevent traffic
C. It will broadcast the data to all devices on both segments
D. It will assign a new IP address to the data packet

Solution

  1. Step 1: Understand bridge filtering

    The bridge learns which devices are on each segment and forwards data only to the segment where the destination device is located.
  2. Step 2: Analyze options

    Blocking data prevents communication, broadcasting to all devices wastes bandwidth, and assigning IP addresses is not a bridge function.
  3. Final Answer:

    It will forward the data only if the destination is on segment B -> Option A
  4. Quick Check:

    Bridge forwards data only to correct segment [OK]
Hint: Bridge forwards data only to destination segment [OK]
Common Mistakes:
  • Thinking bridge blocks all data
  • Assuming bridge broadcasts to all devices
  • Confusing bridge with DHCP server
4. A network administrator sets up a switch but notices that data is being sent to all devices instead of just the intended one. What is the most likely cause?
medium
A. The switch is assigning IP addresses incorrectly
B. The switch is blocking all traffic due to security settings
C. The switch is operating in hub mode or has a faulty MAC address table
D. The switch is connected to a wireless access point

Solution

  1. Step 1: Identify switch behavior

    If a switch sends data to all devices, it behaves like a hub, often due to a missing or corrupted MAC address table.
  2. Step 2: Rule out other causes

    Blocking all traffic would stop communication, IP assignment is unrelated to forwarding, and wireless access points do not cause this behavior.
  3. Final Answer:

    The switch is operating in hub mode or has a faulty MAC address table -> Option C
  4. Quick Check:

    Switch flooding due to MAC table issue [OK]
Hint: Switch flooding means MAC table problem or hub mode [OK]
Common Mistakes:
  • Confusing IP assignment with forwarding issues
  • Thinking wireless access point causes flooding
  • Assuming security blocks cause flooding
5. In a large office, two separate departments have their own network segments connected by a bridge. The bridge is configured to filter traffic between them. Which of the following is a key benefit of this setup?
hard
A. It automatically assigns IP addresses to all devices in both departments
B. It allows all devices to receive every data packet for better communication
C. It encrypts all data passing between the two segments
D. It reduces unnecessary traffic between departments, improving network performance

Solution

  1. Step 1: Understand bridge filtering benefits

    By filtering traffic, the bridge prevents unnecessary data from crossing between segments, reducing congestion and improving speed.
  2. Step 2: Eliminate incorrect options

    Allowing all devices to receive all packets causes congestion, IP assignment is DHCP's role, and encryption is handled by security protocols, not bridges.
  3. Final Answer:

    It reduces unnecessary traffic between departments, improving network performance -> Option D
  4. Quick Check:

    Bridge filtering reduces traffic [OK]
Hint: Bridge filtering cuts traffic, boosts speed [OK]
Common Mistakes:
  • Thinking bridge broadcasts all data
  • Confusing bridge with DHCP server
  • Assuming bridge encrypts data
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard