Bird
Raised Fist0
Computer Networksknowledge~20 mins

BGP and inter-domain routing in Computer Networks - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
BGP Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the primary role of BGP in inter-domain routing?

Border Gateway Protocol (BGP) is crucial for routing between different networks on the internet. What is its main function?

ATo exchange routing information between different autonomous systems
BTo manage routing within a single local network
CTo encrypt data packets between routers
DTo assign IP addresses to devices
Attempts:
2 left
💡 Hint

Think about how different large networks communicate routing information.

📋 Factual
intermediate
2:00remaining
Which attribute in BGP is used to select the best path when multiple routes exist?

When BGP routers receive multiple routes to the same destination, which attribute do they primarily use to decide the best path?

AMAC address
BSubnet mask
CTTL value
DAS_PATH length
Attempts:
2 left
💡 Hint

Consider which attribute reflects the number of networks a route passes through.

🔍 Analysis
advanced
2:00remaining
What happens if a BGP router receives a route with its own AS number in the AS_PATH?

Consider a BGP router that receives a route advertisement containing its own AS number in the AS_PATH attribute. What is the expected behavior?

AThe router resets the BGP session with the neighbor
BThe router rejects the route to prevent routing loops
CThe router modifies the AS_PATH by removing its AS number
DThe router accepts the route and forwards it normally
Attempts:
2 left
💡 Hint

Think about how BGP avoids routing loops between autonomous systems.

❓ Comparison
advanced
2:00remaining
How does BGP differ from interior gateway protocols (IGPs) like OSPF in inter-domain routing?

Compare BGP with IGPs such as OSPF regarding their roles and characteristics in routing.

ABGP automatically discovers neighbors, but IGPs require manual configuration
BBGP uses link-state algorithms, whereas IGPs use path-vector algorithms
CBGP is used for routing between autonomous systems, while IGPs operate within a single autonomous system
DBGP does not support policy-based routing, unlike IGPs
Attempts:
2 left
💡 Hint

Think about the scope of routing each protocol handles.

❓ Reasoning
expert
3:00remaining
Why is BGP considered a path-vector protocol rather than a distance-vector or link-state protocol?

BGP is classified as a path-vector protocol. What reasoning best explains this classification compared to distance-vector and link-state protocols?

ABecause BGP maintains the full path of autonomous systems for each route, enabling loop detection and policy enforcement
BBecause BGP only shares the cost of routes without path information
CBecause BGP floods link-state information to all routers in the network
DBecause BGP uses shortest path first algorithm like link-state protocols
Attempts:
2 left
💡 Hint

Consider how BGP tracks route information differently from other protocols.

Practice

(1/5)
1. What is the primary purpose of BGP (Border Gateway Protocol) in computer networks?
easy
A. To encrypt data packets for secure communication
B. To exchange routing information between different large networks on the internet
C. To assign IP addresses to devices within a local network
D. To manage wireless connections in home networks

Solution

  1. Step 1: Understand BGP's role

    BGP is designed to connect different large networks, called autonomous systems, on the internet.
  2. Step 2: Identify BGP's function

    It shares routing information to find the best path for data between these networks.
  3. Final Answer:

    To exchange routing information between different large networks on the internet -> Option B
  4. Quick Check:

    BGP = Routing between large networks [OK]
Hint: BGP connects big networks by sharing routes [OK]
Common Mistakes:
  • Confusing BGP with encryption protocols
  • Thinking BGP assigns IP addresses
  • Mixing BGP with local network management
2. Which of the following is the correct syntax to define a BGP neighbor in a router configuration?
easy
A. neighbor 192.168.1.1 remote-as 65001
B. set neighbor 192.168.1.1 as 65001
C. neighbor remote-as 65001 192.168.1.1
D. remote-as neighbor 192.168.1.1 65001

Solution

  1. Step 1: Recall BGP neighbor syntax

    The standard BGP command to define a neighbor includes the keyword 'neighbor', the IP address, and 'remote-as' followed by the AS number.
  2. Step 2: Match syntax to options

    neighbor 192.168.1.1 remote-as 65001 matches this format exactly: 'neighbor 192.168.1.1 remote-as 65001'. Others mix order or keywords incorrectly.
  3. Final Answer:

    neighbor 192.168.1.1 remote-as 65001 -> Option A
  4. Quick Check:

    neighbor IP remote-as AS_number = correct syntax [OK]
Hint: Remember: neighbor IP then remote-as AS number [OK]
Common Mistakes:
  • Swapping the order of IP and AS number
  • Using 'set' instead of 'neighbor'
  • Placing 'remote-as' before IP address
3. Consider the following simplified BGP routing table entries:
AS Path: 65001 65002 65003
AS Path: 65001 65004
AS Path: 65005 65003
Which AS path will BGP prefer to route traffic?
medium
A. AS Path: 65001 65002 65003
B. AS Path: 65001 65004
C. AS Path: 65005 65003
D. All paths are equally preferred

Solution

  1. Step 1: Understand BGP path selection criteria

    BGP prefers the path with the shortest AS path length to reduce the number of hops.
  2. Step 2: Compare AS path lengths

    Paths lengths are: 3 for '65001 65002 65003', 2 for '65001 65004', and 2 for '65005 65003'. Among these, the shortest paths are the ones with length 2.
  3. Step 3: Consider origin and other attributes

    Since no other attributes are given, BGP will prefer the path with the shortest AS path regardless of starting AS. Both '65001 65004' and '65005 65003' have length 2, but BGP prefers the path with the lowest next-hop IP or other tie-breakers. Without additional info, the shortest path is preferred. So either could be correct, but typically the path starting with the local AS is preferred. However, since local AS is not specified, the shortest path is the main factor.
  4. Final Answer:

    AS Path: 65005 65003 -> Option C
  5. Quick Check:

    Shortest AS path length = preferred [OK]
Hint: Shortest AS path usually wins in BGP routing [OK]
Common Mistakes:
  • Choosing longest AS path
  • Ignoring AS path length
  • Assuming all paths are equal
4. A network engineer configures BGP neighbors but notices no routes are exchanged. Which of the following is the most likely cause?
medium
A. The subnet mask on the interface is too large
B. The router's hostname is not set
C. The router is missing a default gateway
D. The neighbor IP address is incorrect or unreachable

Solution

  1. Step 1: Identify common BGP neighbor issues

    If no routes are exchanged, a common cause is that the neighbor IP is wrong or unreachable, preventing session establishment.
  2. Step 2: Evaluate other options

    Hostname settings do not affect BGP neighbor sessions. Missing default gateway or subnet mask issues may affect general connectivity but are less direct causes than neighbor IP errors.
  3. Final Answer:

    The neighbor IP address is incorrect or unreachable -> Option D
  4. Quick Check:

    Neighbor IP correct and reachable = routes exchanged [OK]
Hint: Check neighbor IP and reachability first [OK]
Common Mistakes:
  • Ignoring neighbor IP correctness
  • Blaming unrelated settings like hostname
  • Overlooking basic connectivity issues
5. An ISP uses BGP to connect with multiple other ISPs. They want to prefer routes learned from ISP A over ISP B, even if ISP B's path is shorter. Which BGP feature should they use to achieve this?
hard
A. AS path prepending to make ISP B's path appear longer
B. Changing the router's hostname to ISP A
C. Using a static route instead of BGP
D. Disabling BGP on ISP B's connection

Solution

  1. Step 1: Understand BGP path preference controls

    BGP chooses routes based on path attributes like AS path length. To prefer one ISP's route, you can make the other ISP's path look longer.
  2. Step 2: Apply AS path prepending

    AS path prepending adds extra AS numbers to the path advertised to ISP B, making it appear longer and less preferred.
  3. Step 3: Evaluate other options

    Changing hostname or using static routes won't affect BGP path selection properly. Disabling BGP on ISP B is extreme and not practical.
  4. Final Answer:

    AS path prepending to make ISP B's path appear longer -> Option A
  5. Quick Check:

    AS path prepending = prefer one ISP over another [OK]
Hint: Use AS path prepending to prefer routes [OK]
Common Mistakes:
  • Thinking hostname affects routing preference
  • Using static routes instead of BGP
  • Disabling connections instead of adjusting path attributes
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