Bird
Raised Fist0
Computer Networksknowledge~30 mins

Switching and bridging in Computer Networks - Mini Project: Build & Apply

Choose your learning style10 modes available
Understanding Switching and Bridging in Computer Networks
📖 Scenario: You are setting up a small office network. You want to understand how devices communicate within the network using switches and bridges.
🎯 Goal: Build a simple conceptual model that shows how switching and bridging work to connect devices in a network.
📋 What You'll Learn
Create a list of devices with their MAC addresses
Define a switch table to map MAC addresses to ports
Simulate the process of forwarding frames based on MAC addresses
Add a bridging rule to filter traffic between two network segments
💡 Why This Matters
🌍 Real World
Switches and bridges are essential in local area networks (LANs) to connect devices and control traffic efficiently.
💼 Career
Understanding switching and bridging helps network technicians and engineers design and troubleshoot network connectivity and performance.
Progress0 / 4 steps
1
Create a list of devices with MAC addresses
Create a list called devices containing these exact entries as dictionaries with keys 'name' and 'mac': {'name': 'PC1', 'mac': '00:11:22:33:44:55'}, {'name': 'PC2', 'mac': '66:77:88:99:AA:BB'}, and {'name': 'Printer', 'mac': 'CC:DD:EE:FF:00:11'}.
Computer Networks
Hint

Use a list of dictionaries. Each dictionary should have keys 'name' and 'mac' with the exact values given.

2
Define a switch table mapping MAC addresses to ports
Create a dictionary called switch_table that maps MAC addresses to port numbers as follows: '00:11:22:33:44:55' to 1, '66:77:88:99:AA:BB' to 2, and 'CC:DD:EE:FF:00:11' to 3.
Computer Networks
Hint

Use a dictionary with MAC addresses as keys and port numbers as values.

3
Simulate forwarding frames based on MAC addresses
Write a function called forward_frame that takes a dest_mac address and returns the port number from switch_table if the MAC address exists; otherwise, return 'Flood to all ports'.
Computer Networks
Hint

Check if dest_mac is in switch_table. Return the port if found, else return the string 'Flood to all ports'.

4
Add a bridging rule to filter traffic between two segments
Create a list called segment1_macs containing '00:11:22:33:44:55' and '66:77:88:99:AA:BB'. Then, write a function called bridge_filter that takes src_mac and dest_mac and returns true if both MAC addresses are in segment1_macs, otherwise false.
Computer Networks
Hint

Create the list with the two MAC addresses. The function should return true only if both source and destination MACs are in that list.

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