📝 Border Gateway Protocol Version 4 (BGP4) inter-domain routing (43 MCQs)
BGP-4 Exchanges Reachability Between Autonomous Systems
Border Gateway Protocol version 4 is the Internet's principal inter-domain routing protocol. It exchanges IP prefix reachability between BGP-speaking routers in different autonomous systems and within an autonomous system. BGP is a path-vector protocol: advertisements carry attributes describing the route, allowing networks to apply routing policies and reduce loops between administrative domains. It helps coordinate reachability across the public Internet.
BGP Peers, Sessions and Path Attributes
BGP routers establish peer sessions over TCP port 179. External BGP exchanges routes between autonomous systems, while Internal BGP distributes BGP information within the same AS. Important attributes include AS_PATH, NEXT_HOP, and ORIGIN; local preference and other policy attributes can influence which available route is selected for route exchange and updates.
BGP Route Advertisement and Withdrawal
A BGP speaker sends UPDATE messages to advertise reachable network-layer prefixes or withdraw routes that are no longer available. When advertising an external route, it normally prepends its own AS number to AS_PATH. A receiving router evaluates path attributes and local policy, then installs a preferred route and advertises eligible information to peers.
Interpreting an Example BGP AS_PATH
Suppose a router in AS 64530 receives a prefix advertisement with AS_PATH 64510 64520. The sequence shows the route passed through AS 64510 and AS 64520 before reaching the current speaker. If a later advertisement contains AS 64530 in its path, the router detects a loop and normally rejects that route.
Policy Control and Internet Routing Scalability
BGP supports independent routing policies for providers, customers, and peers, which is essential because Internet networks are not controlled by one authority. Operators can prefer customer routes, control traffic exits, filter prefixes, and influence inbound paths. This flexibility supports global scalability, but it also means the selected route is not necessarily the shortest physical path.
Misconceptions About BGP-4 Route Selection
'BGP always selects the route with the fewest AS hops' is incorrect because policy attributes and local configuration matter. 'BGP uses UDP for peer sessions' is incorrect because BGP runs over TCP port 179. 'BGP is used only between different ISPs' is incorrect because iBGP also distributes routing information inside an autonomous system.
Analysing BGP Messages and Route Attributes
Students should distinguish eBGP from iBGP, identify TCP port 179, and interpret AS_PATH, NEXT_HOP, and ORIGIN attributes. Trace how an AS number is prepended and how a local-AS occurrence prevents a loop. Explain route withdrawals, policy-based selection, and why BGP differs from OSPF or RIP in scope and decision criteria.
(BGP4) inter-domain routing: Key Terms
- BGP-4 - Path-vector inter-domain routing protocol.
- Peer - Router exchanging BGP information.
- AS_PATH - Sequence of autonomous systems traversed.
- eBGP - BGP session between different autonomous systems.
- iBGP - BGP session within one autonomous system.
- UPDATE - BGP message advertising or withdrawing routes.
📝 All Border Gateway Protocol Version 4 (BGP4) inter-domain routing MCQs
Q1. What does the acronym BGP stand for?
📖 Explanation: The acronym BGP expands to Border Gateway Protocol, which is the routing protocol used between autonomous systems on the Internet. It enables the exchange of reachability information and path attributes, allowing routers to make policy‑based decisions about how traffic should be forwarded across the global network.
Q2. Which TCP port does BGP use for establishing a session?
📖 Explanation: BGP sessions are established over TCP port 179. This dedicated port ensures reliable transport of BGP messages, as BGP relies on TCP’s connection‑oriented features for ordered delivery and error handling, which are essential for the exchange of routing information between peers.
Q3. In BGP, what is the purpose of the AS_PATH attribute?
📖 Explanation: The AS_PATH attribute records the sequence of autonomous system numbers that a route advertisement has passed through. By examining this list, a router can detect loops, prefer shorter paths, and apply routing policies based on the autonomous systems involved.
Q4. What is the effect of the BGP attribute ‘LOCAL_PREF’ on route selection?
📖 Explanation: LOCAL_PREF is a well‑known discretionary attribute that is propagated only within a single autonomous system. Higher LOCAL_PREF values are preferred, allowing network operators to influence which exit point is chosen for outbound traffic, thereby shaping intra‑AS routing decisions.
Q5. Why does BGP use TCP instead of UDP for its transport?
📖 Explanation: BGP relies on the reliability guarantees of TCP, such as retransmission of lost packets, in‑order delivery, and flow control. These features are critical for maintaining consistent routing tables across peers, as lost or out‑of‑order update messages could cause routing instability or loops.
Q6. If a BGP speaker receives a route with the AS_PATH attribute , what can it infer?
📖 Explanation: The AS_PATH lists each autonomous system the route advertisement has traversed, in order. In this case, the route has passed through AS 65001, then 65002, and finally 65003, indicating a three‑hop AS traversal before reaching the receiving speaker.
Q7. Which BGP attribute is used to prevent routing loops by checking for the presence of the local AS number?
📖 Explanation: The AS_PATH attribute is examined by a BGP speaker to detect its own autonomous system number within the path. If the local AS appears in the AS_PATH, the route is rejected, thereby preventing routing loops that could otherwise arise from circular path advertisements.
Q8. A network administrator wants to prefer routes learned from a specific external BGP neighbor. Which attribute should they modify?
📖 Explanation: MED is a non‑transitive attribute that influences the inbound path selection of neighboring autonomous systems. By assigning a lower MED value to routes received from the preferred external neighbor, the administrator can make those routes more attractive to the remote AS, shaping inbound traffic.
Q9. What is the main difference between iBGP and eBGP sessions?
📖 Explanation: iBGP peers belong to the same autonomous system and share routing information without altering the NEXT_HOP attribute, while eBGP peers are in different autonomous systems and convey the NEXT_HOP to indicate the exit point. This distinction impacts route propagation and policy enforcement across AS borders.
Q10. Consider two routes to the same prefix: Route X has LOCAL_PREF = 200, AS_PATH length = 2; Route Y has LOCAL_PREF = 150, AS_PATH length = 1. Which route will BGP select?
📖 Explanation: BGP’s decision process first evaluates LOCAL_PREF; the route with the higher LOCAL_PREF is preferred regardless of AS_PATH length. Consequently, Route X with LOCAL_PREF = 200 is chosen even though its AS_PATH is longer, reflecting the policy‑driven nature of BGP.
Q11. Why might a network engineer configure a BGP route reflector?
📖 Explanation: A route reflector centralizes route distribution, allowing multiple iBGP peers to send updates to a single reflector instead of maintaining a full mesh of peerings. This design reduces configuration complexity and scalability issues while preserving the iBGP requirement that routes be reflected with the correct attributes.
Q12. A BGP speaker receives two identical prefixes from different peers. Peer 1 advertises the route with COMMUNITY = and Peer 2 advertises it without that community. Assuming all other attributes are equal, which route will be preferred for internal redistribution?
📖 Explanation: The community instructs routers not to advertise the route to external peers, but it does not affect internal preference. When other attributes are identical, BGP selects the route without the restrictive community, making Peer 2’s advertisement the preferred internal path.
Q13. What Hard inference can be drawn if a BGP router’s RIB shows a prefix with an ORIGIN attribute of ‘IGP’?
📖 Explanation: The ORIGIN attribute indicates the source of the route. An ORIGIN value of ‘IGP’ means the route was originated inside the router’s own autonomous system, typically via an internal IGP such as OSPF or IS‑IS, rather than being learned from an external BGP neighbor.
Q14. If a router applies a route‑map that sets LOCAL_PREF to 250 for routes received from a particular neighbor, what is the likely impact on traffic flow?
📖 Explanation: Increasing LOCAL_PREF for routes from a specific neighbor makes those routes more attractive for outbound traffic decisions within the autonomous system. Consequently, traffic destined for those prefixes is more likely to exit via the neighbor that advertised them, shaping the flow of outbound data.
Q15. A network uses BGP confederations to simplify policy. Which statement best describes the effect of confederations on AS_PATH?
📖 Explanation: Within a confederation, internal AS numbers are concealed from external peers by replacing them with the confederation’s identifier in the AS_PATH. This maintains loop‑prevention while simplifying policy enforcement, as external routers see only the confederation as a single autonomous system.
Q16. When comparing two routes where one has a higher MED value, what does this indicate about the route’s desirability?
📖 Explanation: The Multi‑Exit Discriminator (MED) is a non‑transitive attribute used by neighboring autonomous systems to convey a preference for inbound traffic. A higher MED value signals a less preferred path, so the route with the lower MED is typically chosen for inbound traffic.
Q17. Which statement correctly contrasts eBGP and iBGP route propagation rules?
📖 Explanation: eBGP routes are exchanged between different autonomous systems and are advertised only to external peers. iBGP routes, by contrast, stay within the same AS and preserve the NEXT_HOP attribute, requiring a full‑mesh or route‑reflector design to ensure all internal routers receive the updates.
Q18. How does the BGP decision process prioritize attributes when multiple routes to the same prefix exist?
📖 Explanation: BGP follows a deterministic hierarchy: first it compares LOCAL_PREF values (higher wins), then evaluates the shortest AS_PATH length, and subsequently considers MED among other tie‑breakers. This ordered evaluation ensures consistent and policy‑driven route selection across the network.
Q19. A network engineer observes that routes learned from a particular eBGP neighbor are being ignored despite being valid. Which BGP attribute is the most likely cause?
📖 Explanation: If the NEXT_HOP attribute points to an unreachable IP address, the router will reject the route even if other attributes are valid. This is because the NEXT_HOP tells the router where to forward packets for that prefix, and an invalid next hop makes the route unusable.
Q20. Compare the impact of using a route‑reflector versus a full‑mesh iBGP topology on convergence time. Which is generally true?
📖 Explanation: Route‑reflectors centralize route dissemination, allowing many iBGP peers to receive updates from a single reflector instead of a full mesh of peerings. This reduction in the number of update messages generally speeds up convergence, especially in large networks where a full mesh would generate excessive traffic.
Q21. What is the effect of configuring a BGP router to set the ORIGIN attribute to ‘EGP’ for all advertised routes?
📖 Explanation: The ORIGIN attribute indicates the route’s source: ‘IGP’ (intra‑AS), ‘EGP’ (inter‑AS), or ‘INCOMPLETE’. An ‘EGP’ origin is generally considered less preferred than ‘IGP’, so peers may treat such routes as lower priority unless overridden by other attributes like LOCAL_PREF.
Q22. A BGP speaker receives two routes to the same prefix: Route A has MED = 20, LOCAL_PREF = 100; Route B has MED = 10, LOCAL_PREF = 100. Which route is selected and why?
📖 Explanation: When LOCAL_PREF values are identical, BGP proceeds to compare MED. The route with the lower MED (10) is preferred, making Route B the chosen path. If MED were also equal, BGP would move to subsequent tie‑breakers such as eBGP over iBGP or router ID.
Q23. Explain why BGP does not use a distance‑vector algorithm like RIP. Which characteristic of BGP necessitates a path‑vector approach?
📖 Explanation: BGP’s path‑vector mechanism carries the full AS_PATH attribute, enabling each router to detect loops across diverse autonomous systems. A pure distance‑vector algorithm lacks this visibility, risking routing loops when routes traverse multiple, independently administered domains.
Q24. A network uses BGP communities to tag routes for a specific downstream ISP. If the community is attached, what does this imply?
📖 Explanation: BGP communities are 32‑bit values that convey policy information. The community can be interpreted by the receiving ISP (identified by the second part) as a directive—such as preferring the route, applying a specific filter, or handling it in a predefined manner—according to the ISP’s policy definitions.
Q25. What Hard deduction can be made if a BGP router’s RIB shows a prefix with a NEXT_HOP pointing to an IP address that is not directly reachable?
📖 Explanation: If the NEXT_HOP attribute references an IP that the router cannot reach, the route is considered infeasible because the router would have no way to forward packets toward the destination. Consequently, BGP will reject the route, preventing black‑hole forwarding.
Q26. When a BGP speaker receives a route with the COMMUNITY attribute , what inference can be drawn about the route’s intended propagation?
📖 Explanation: The community signals that the route should not be advertised beyond the local autonomous system. This policy ensures that the prefix remains internal and is not propagated to external BGP peers, providing a mechanism for controlling route visibility.
Q27. A network administrator wants to ensure that routes learned from a certain upstream provider are always preferred, regardless of other attributes. Which BGP attribute should be manipulated?
📖 Explanation: LOCAL_PREF is a well‑known discretionary attribute that is compared before AS_PATH and MED. By assigning a higher LOCAL_PREF to routes from the desired upstream provider, the administrator guarantees those routes are selected over others, overriding most other attribute considerations.
Q28. If a BGP router is configured with a route‑map that strips the AS_PATH attribute from received updates, what is the most likely consequence?
📖 Explanation: The AS_PATH attribute is essential for loop detection; removing it eliminates the router’s ability to recognize its own AS number in the path. Consequently, the router may accept routes that create loops, leading to routing instability across the network.
Q29. Compare the effect of setting a higher MED value versus a lower LOCAL_PREF on route selection. Which statement is accurate?
📖 Explanation: BGP evaluates attributes in a defined order: LOCAL_PREF first, then MED. Therefore, a route with a higher LOCAL_PREF will be selected even if its MED is larger, because the preference hierarchy gives precedence to LOCAL_PREF over MED.
Q30. Why might an autonomous system implement BGP confederations?
📖 Explanation: Confederations allow an AS to be subdivided into multiple sub‑ASes for internal policy simplification, while external peers see the entire confederation as a single autonomous system. This reduces the complexity of iBGP full‑mesh requirements without exposing internal AS numbers externally.
Q31. What inference can be drawn if a BGP router advertises a prefix with the ORIGIN attribute set to ‘INCOMPLETE’?
📖 Explanation: ‘INCOMPLETE’ indicates that the origin of the route is unknown or was learned from a source that does not provide a clear IGP or EGP origin, such as a redistribution from another routing protocol. This classification often results in lower preference compared to IGP or EGP origins.
Q32. A network uses BGP multipath to load‑balance traffic across two equal‑cost links. Which condition must be true for multipath to be activated?
📖 Explanation: BGP multipath requires that candidate routes be considered equal according to the BGP decision process. This means attributes like LOCAL_PREF, AS_PATH length, and MED must match; otherwise, BGP will select a single best path rather than load‑balancing across multiple links.
Q33. Which attribute is most commonly used by ISPs to influence inbound traffic to a customer’s network?
📖 Explanation: ISPs often manipulate the MED attribute to signal preferred entry points for inbound traffic from neighboring autonomous systems. By advertising a lower MED for routes that enter through a particular edge router, the ISP can steer inbound traffic toward the customer's desired ingress point.
Q34. If a BGP speaker receives a route with AS_PATH , what can be deduced?
📖 Explanation: The presence of the same autonomous system number (65001) more than once in the AS_PATH indicates a loop, as the route has traversed the same AS twice. BGP will reject such a route to prevent routing loops.
Q35. What is the primary purpose of the BGP KEEPALIVE message?
📖 Explanation: KEEPALIVE messages are periodic BGP messages that keep the TCP session alive and confirm that the peer is still operational. They do not carry routing information but prevent the session from timing out due to inactivity.
Q36. Which BGP message type is used to withdraw a previously advertised route?
📖 Explanation: The UPDATE message carries both new route advertisements and withdrawals. When a route is withdrawn, the UPDATE includes the withdrawn route’s prefix without any path attributes, signaling to peers that the previously advertised path is no longer valid.
Q37. In BGP, what does the ‘eBGP Multihop’ feature enable?
📖 Explanation: eBGP Multihop permits BGP sessions to be established between routers that are not directly connected, by allowing the TTL of BGP packets to be increased beyond the default value of 1. This is useful in scenarios where peers are separated by multiple hops.
Q38. What is the impact of setting the BGP attribute ‘ORIGIN’ to ‘IGP’ for a route learned from an external neighbor?
📖 Explanation: Setting ORIGIN to ‘IGP’ for an externally learned route signals that the route is treated as if it originated inside the local AS, which generally makes it more preferred over routes with ‘EGP’ or ‘INCOMPLETE’ origins, influencing inbound traffic decisions.
Q39. A router receives two routes to the same prefix: one with LOCAL_PREF = 150, AS_PATH length = 3; another with LOCAL_PREF = 100, AS_PATH length = 1. Which route will BGP select and why?
📖 Explanation: BGP’s decision hierarchy gives precedence to LOCAL_PREF. The route with LOCAL_PREF = 150 is selected even though its AS_PATH is longer, demonstrating that policy attributes dominate over path length in the BGP selection process.
Q40. If a BGP speaker is configured with a route‑map that adds the COMMUNITY to all outbound routes, what is the expected behavior?
📖 Explanation: The community instructs all BGP peers to suppress the route from being advertised further, effectively preventing the route from being propagated to any other routers, whether internal or external, thereby limiting its visibility to the originating router only.
Q41. Explain why BGP’s path‑vector mechanism is more scalable than a pure distance‑vector approach in the context of the global Internet.
📖 Explanation: The path‑vector model includes the AS_PATH attribute, giving each autonomous system visibility into the exact sequence of ASes traversed. This enables policy‑based routing, loop prevention, and selective advertisement without requiring every router to maintain a complete view of the global topology, thereby scaling efficiently.
Q42. A network operator wants to ensure that routes learned from a particular peer are never advertised to another specific peer. Which BGP feature can enforce this policy?
📖 Explanation: By applying a route‑map with a deny clause on the outbound updates destined for the specific peer, the operator can selectively suppress certain routes, ensuring that routes learned from one peer are not propagated to the undesired peer, thereby enforcing precise export policies.
Q43. Consider a BGP network where a route reflector receives two identical updates for the same prefix from different clients. How does the reflector handle the duplicate?
📖 Explanation: Route reflectors maintain a table of the best path for each prefix. When a duplicate update arrives, the reflector recognizes that the prefix already has a stored best path and therefore does not retransmit the duplicate to other clients, avoiding unnecessary traffic.