0
0
Computer Networksknowledge~30 mins

BGP and inter-domain routing in Computer Networks - Mini Project: Build & Apply

Choose your learning style9 modes available
Understanding BGP and Inter-Domain Routing
📖 Scenario: You are a network engineer learning how the internet routes data between different organizations. The Border Gateway Protocol (BGP) is the main system that helps different networks (called Autonomous Systems) share information about how to reach each other.In this project, you will build a simple model of BGP routing information using a dictionary to represent Autonomous Systems and their connections.
🎯 Goal: Build a basic data structure that shows how Autonomous Systems connect and share routing information using BGP. You will create the initial data, add a configuration for route preferences, apply the main logic to select routes, and complete the model with a final step to represent route advertisement.
📋 What You'll Learn
Create a dictionary representing Autonomous Systems (AS) and their direct neighbors
Add a configuration variable for route preference threshold
Implement logic to select preferred routes based on the threshold
Complete the model by adding route advertisement information
💡 Why This Matters
🌍 Real World
BGP is the protocol that makes the internet work by connecting different networks worldwide. Understanding its basics helps in managing internet traffic and ensuring data reaches the right destination.
💼 Career
Network engineers and administrators use BGP knowledge to configure routers, optimize traffic flow, and troubleshoot inter-domain routing issues.
Progress0 / 4 steps
1
Create Autonomous Systems and their neighbors
Create a dictionary called autonomous_systems with these exact entries: AS1 connected to AS2 and AS3, AS2 connected to AS1 and AS4, AS3 connected to AS1, and AS4 connected to AS2.
Computer Networks
Need a hint?

Think of each AS as a key in the dictionary, and its neighbors as a list of connected ASes.

2
Add route preference threshold
Create a variable called preference_threshold and set it to 2. This will represent the maximum acceptable route cost for selecting a route.
Computer Networks
Need a hint?

This variable helps decide which routes are good enough to use.

3
Select preferred routes based on threshold
Create a dictionary called preferred_routes. Use a for loop with variables as_name and neighbors to iterate over autonomous_systems.items(). Inside the loop, select neighbors whose route cost (assumed as 1 per hop) is less than or equal to preference_threshold. Assign these neighbors as the preferred routes for each AS.
Computer Networks
Need a hint?

Since each neighbor is one hop away, the cost is 1. Use a list comprehension inside the loop to filter neighbors.

4
Add route advertisement information
Create a dictionary called route_advertisements where each AS advertises its preferred routes. Use a for loop with variables as_name and routes to iterate over preferred_routes.items(). Assign each AS's advertised routes as the list of its preferred routes.
Computer Networks
Need a hint?

This step models how each AS shares its chosen routes with others.