0
0
Computer Networksknowledge~30 mins

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

Choose your learning style9 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
Need a 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
Need a 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
Need a 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
Need a 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.