BGP Question
BGP Question
BGP Question
Border Gateway Protocol (BGP) is the Internet's postal service. When someone places
a letter in a mailbox, the Postal Service processes it and determines the most efficient
way to send it to its intended destination. When someone sends data over the
Internet, BGP is in charge of analysing all of the possible paths for the data to take and
selecting the best one, which frequently involves hopping between autonomous
systems. BGP is the protocol that allows data to be routed across the Internet. For
example, the border gateway protocol is the protocol that allows a user in Singapore
to communicate swiftly and efficiently with origin servers in Argentina when they visit
a website.
The protocol can link any autonomous system's internetwork together utilising any
topology. The sole need is that each autonomous system should have at least one
BGP-capable router that is connected to the BGP router of at least one other
autonomous system. The primary purpose of BGP is to communicate network
reachability information with other BGP systems. Based on the information transmitted
between BGP routers, the Border Gateway Protocol creates an autonomous systems
graph.
Crack your next tech interview with confidence!
Take a free mock interview, get instant⚡️feedback and recommendation💡
Attempt Now
Events|Powered By
Software Dev
Data Science
All Events
Master Hierarchical Data Structures : understand Binary Tree concept with an Expert
Starts on: 08:00 PM, 24 January 2023 (IST)
1865 Registered
Know More
Register Now
Java Vs Python
Starts on: 08:00 PM, 25 January 2023 (IST)
10164 Registered
Know More
Register Now
374 Registered
Know More
Register Now
Learn how to collaborate with Millions of Coders using Github
Starts on: 07:00 PM, 31 January 2023 (IST)
2877 Registered
Know More
Register Now
View All
The Border Gateway Protocol uses the Transmission Control Protocol (TCP) port
number 179.
BGP is frequently set up between two routers that are directly connected and belong
to distinct autonomous systems. BGP routers don't require their neighbours to be on
the same subnet. Instead, they employ a TCP connection between the routers to send
and receive BGP messages, allowing neighbouring routers to be on the same or
distinct subnets.
You can download a PDF version of Bgp Interview Questions.
Download PDF
No, you can't have two BGP processes running on the same router. This is because
BGP is an Exterior Gateway Protocol.
The following table lists the differences between the internal Border Gateway Protocol
and the external Border Gateway Protocol:
internal Border Gateway Protocol (iBGP) external Border Gateway Protocol (eBGP)
It connects two BGP routers in a single It connects two BGP routers in separate
autonomous system. independent systems.
Its Administrative Distance is set to 200 by Its Administrative Distance is set to 20 by
default. default.
IBGP routes obtained from an IBGP peer EBGP routes can be published to EBGP and
can be broadcast to an EBGP peer but not IBGP peers when received from an EBGP
to another IBGP peer. peer.
It necessitates the use of full mesh It does not necessitate a complete mesh
topology. topology.
It's used between corporations or between
Within the same corporation, it's used.
corporations and Internet service providers.
For loop prevention, it employs BGP Split
It prevents loops by using an AS path.
Horizon.
TTL (Time To Live) = 255 is the default TTL (Time To Live) = 1 is the default setting
setting for peers. for peers.
Attributes such as local preference are Attributes such as local preference are not
exchanged between IBGP peers. communicated between EBGP peers.
The next hop remains constant when a When a route is announced to an EBGP peer,
route is advertised to an IBGP peer. the local router becomes the next hop.
The modified routing information allows the R1 router to send packets to the
10.0.0.0/16 network via the R2 and R3 routers. The R1 router will not be able to
advertise this network route back to the R2 router if a split horizon is enabled. If the R1
router does not have split-horizon enabled, it will broadcast the route to the R2 router,
which will update its routing table to reflect the network route available through the
R1 router.
The presence of the R1 route in the R2 routing database is not an issue in typical
operations because it is plainly a lot more expensive route than a direct R2-to-R3
connection. If the R2-to-R3 connection fails and the R2 router receives a packet from
R1 destined for the 10.0.0.0/16 network, the R2 router will return the packet to R1
because the router advertised a functional network path. However, based on its own
routing information, the R1 router will just return the packet to the R2 router, resulting
in a routing loop that will continue until the packet dies. The R1 router will not
advertise the network route to the R2 router if the split horizon is enabled, preventing
the routing loop.
BGP peers are two routers that have established a link for exchanging BGP
information. Such BGP peers provide routing information via TCP-based BGP sessions,
which are dependable, connection-oriented, and error-free protocols.
The above image shows a BGP peering session between two BGP routers. We may
utilise peer groups to simplify BGP configuration and reduce the amount of updates
BGP has to produce. We can create a peer group with the neighbours and then apply
all of our setups to it.
Peering works only if both routers have the same password and are configured for
authentication. When a router has a password configured for a neighbour but the
neighbour router does not, the console displays a message like this when the routers
try to create a BGP session.
%TCP-6-BADAUTH: No MD5 digest from [peer's IP address]:11003 to
[local router's IP address]:179
Similarly, if the two routers are configured with different passwords, a message like
this will appear on the screen:
%TCP-6-BADAUTH: Invalid MD5 digest from [peer's IP address]:11004 to [local
router's IP address]:179
The order of preference in BGP differs depending on whether the attributes are used
for inbound or outbound updates.
1. Route-map
2. Filter-list
3. Prefix-list
4. distribute-list
1. Filter-list
2. Route-map | unsuppress-map
3. Advertise-map (conditional-advertisement)
4. Prefix-list
5. distribute-list.
No, we can't use BGP instead of any IGP because BGP connects different autonomous
systems, whereas IGP works inside autonomous systems.
Two BGP systems will go through a succession of BGP Neighbor Adjacency States
before becoming neighbours. They are as follows:
Idle - The router initialises BGP resources. Attempts to establish a BGP incoming
connection are rejected. The BGP protocol establishes a TCP connection with
the peer.
Connect - BGP waits for the three way handshake to finish. The OPEN message
is transmitted to the peer if it is successful, and BGP shifts to the OpenSent
state. If we are unsuccessful, we will return to the Active state. If the
ConnectRetry timeout expires, however, BGP will continue in this condition, with
the timer reset and a new three way handshake launched.
Active - BGP returns to the Connect state after the ConnectRetry timeout is
reset.
OpenSent - BGP waits for an OPEN message from its peer before sending it.
BGP enters the OpenConfirm state after receiving a message.
OpenConfirm - BGP waits for a peer to send a keepalive message. BGP goes to
the Established state if a response is received before the timeout ends.
Otherwise, BGP switches to Idle mode.
Established - Both peers exchange UPDATE messages once the connection is
established. If any of the UPDATE messages include an error, the BGP peer will
send a NOTIFICATION message and enter the Idle state.
Weight
Local Preference (highest local value will be preferred, default value is 100)
Originate
AS path length
Origin code
Multi-Exit Discriminator (MED)
eBGP path over iBGP path
Shortest IGP path to BGP next hop
Oldest path
Router ID
Neighbor IP address.
17. What exactly do you mean by a route reflector in the context of
Border Gateway Protocol? Why is it necessary?
In BGP, a route reflector is a router which is capable of breaking the internal Border
Gateway Protocol (iBGP) loop avoidance rule. Under certain settings, a route reflector
can broadcast updates received from an iBGP peer to another iBGP peer.
By breaking the criterion and designing iBGP networks that scale quickly and cleanly,
route reflectors are employed to eliminate the full mesh requirement.
Open Shortest Path First (OSPF): Open shortest path first (OSPF) is a link-state
routing protocol that uses its own shortest path first (SPF) algorithm to discover the
optimum path between the source and destination router. A link-state routing
protocol employs the idea of triggered updates, in which updates are only triggered
when a change in the learnt routing table is detected, as opposed to the distance-
vector routing protocol, in which the routing table is exchanged over a period of time.
Open shortest path first (OSPF) is an Interior Gateway Protocol (IGP) that tries to move
packets within a large autonomous system or routing domain. It's a network layer
protocol that uses AD value 110 and runs on protocol number 89. OSPF employs the
multicast address 224.0.0.5 for routine communication and 224.0.0.6 for updates to
designated routers (DRs) and backup designated routers (BDRs) (BDR).
Following are the differences between Border Gateway Protocol (BGP) and Open
Shortest Path First (OSPF):
Open Shortest Path First (OSPF) Border Gateway Protocol (BGP)
Open Shortest Path First is a fast concurrency
BGP is a slow concurrency protocol.
protocol.
OSPF is a network topology or design that is
It uses a sort of mesh topology or design.
hierarchical.
Internal gateway protocol is another name for It is referred to as an external gateway
it. protocol.
OSPF is a simple protocol to set up. BGP implementation is challenging.
It connects to port 89. It works with port number 179.
Transmission control protocol is
The internet protocol is employed in OSPF.
employed in this.
OSPF is a type of Link State. BGP is a Vector State type.
The best path algorithm is employed in
The Dijkstra algorithm is employed in OSPF.
this case.
OSPF prioritises the quickest path over the BGP prefers the best path.
shortest path.
19. Differentiate between hard reset and soft reset in the context of
BGP.
Following are the differences between hard reset and soft reset in the context of BGP:
BGP offers a variety of Path Attributes, which are used to compare competing BGP
pathways (routes) in the BGP table to identify the best possible path (route).
A BGP community is a transitive, optional BGP property that is recognised and sent
between BGP peers. A BGP community is a tag that is appended to the BGP routes that
are exchanged between two BGP peers. A community is a 32-bit number that is
divided into two 16-bit sections. The first 16 bits indicate the community's AS number,
while the following 16 bits represent a unique number assigned by the AS. Because
each AS number is distinct, each community on the internet is similarly distinct. This
means that an AS with the ASN 9999 (or 0x270F in hex) can have communities ranging
from 0x270F0000 to 0x270FFFFF.
No-Advertise Community
When a route is associated with a No-Advertise community, the BGP speaker will not
advertise the route to any internal or external BGP peers.
R1 does not advertise a No-Advertise Route (10.10.10.0/24) to peers R11, R12, and
R111 in the following example.
Community with No Exports
When a No-Export community is associated with a route, the router will only advertise
the route to internal peers.
R1, R11, and R12 are not advertising a No-Export Route (10.10.10.0/24) to their
external peer, R111, as seen in the following example.
R1 will not advertise the route to R111 in this situation, just to R11 and R12, because
they are internal BGP peers. As a result, because R111 is an external BGP peer, R11 and
R12 will not advertise either route to it.
Local AS Community
There is an important regulation about internal BGP neighbours to avoid BGP routing
loops: an IBGP neighbour cannot advertise a route to another IBGP neighbour if it
obtained that route from another IBGP neighbour.
A Local AS Route (10.10.10.0/24) is not promoted between IBGP neighbours (R11 and
R111) within the local AS in the following example.
According to the criteria indicated above, R11 advertises the route to R22, but R22
does not advertise the path to R111. There are several options for getting the route to
R111, including constructing a full mesh of IBGP sessions between AS11 routers or
dividing the AS 11 into a sub-AS within a confederation.
Outside of AS11, no one knows what AS 1000 and AS1001 are. R111 can now receive
the 10.10.10.0/24 route even if it does not have full mesh BGP peering. Outside of the
sub-AS, the Local-AS community does not advertise routes.
Graceful Shutdown Community
When a router's peer router is about to be purposely shut down, the Graceful
SHUTDOWN (65535:0) community is used to seamlessly shut down paths it could use.
Consider the following scenario: R111 is utilising R11 to access the 10.10.10.0/24
network, but R11 will be rebooted to be upgraded:
R111 replies by transferring traffic to R12 with minimum disruption when R11
announces this community:
Extended Community
There are three fields in an extended community: kind, administrator, and assigned
number (type:administrator:assigned-number). The administrator field can be an AS or
an IP address, depending on the value of the high-order byte in the Type field. MPLS-
VPN is the most well-known use for extended communities, as it uses two extended
communities:
A Virtual Routing and Forwarding (VRF) table is a virtual routing table that can have its
own routing policies that are independent of the global routing table or other VRFs.
Essentially, you can connect numerous client sites and create a distinct routing table
(VRF) throughout the entire network exclusively for this customer, with routing policies
that differ from those of other customers.
In MPLS VPN setups, the Route Target community is used to segregate two customers'
routing tables, as depicted in the diagram below:
VRF Customer RED is only present on R1 and R12, and VRF Customer BLUE is only
present on R11 and R22 in this scenario, but they may have been present on all four
routers.
When a route is exported from VRF Red using BGP, the route-target 100:100 is
assigned to the route. When the route reaches R12, the route from R1 is imported,
allowing the sites connected to R1 and R12 to communicate.
When PE1 receives the route from CE1, it attaches the route origin community in
addition to the route-target that is linked to the route (through export).
The route reaches PE2, but PE2 does not inform CE2 because it is aware that it
originated at the location.
23. What do you mean by BGP Message Types? Explain the different
Message Types in BGP in detail.
The BGP Message types are used to create a neighbour relationship and exchange
parameters such as the autonomous system number and authentication values. A BGP
message is made up of two parts: a BGP header and data. The header format is the
same in all of the BGP messages. TCP is used to transmit BGP messages (port 179). The
length of the message ranges from 19 to 4096 octets. Each BGP message's header is
19 octets long and consists of three fields.
Open : A BGP adjacency is established using the OPEN message. Before a BGP
peering is established, both parties negotiate session capabilities. The BGP
version number, ASN of the originating router, Hold Time, BGP Identifier, and
other optional characteristics that define the session capabilities are all included
in the OPEN message.
Keepalive : To ensure that the neighbours are still alive, BGP does not rely on
the TCP connection status. Every one-third of the Hold Timer agreed upon
between the two BGP routers, keepalive messages are exchanged. Generally, the
default Hold Time for devices is 180 seconds, so the default Keepalive interval
is 60 seconds. No Keepalive messages are delivered between BGP neighbours if
the Hold Time is set to zero.
Update : The Update message can either advertise or remove previously
advertised routes, or it can do both. When advertising prefixes, the Update
message includes the Network Layer Reachability Information (NLRI), which
includes the prefix and related BGP PAs. Only the prefix is included in NLRIs that
have been withdrawn. To save needless bandwidth, a UPDATE message can be
used as a Keepalive.
Notification : When a BGP session error is discovered, such as a hold timer
expiring, neighbour capabilities changing, or a BGP session reset is requested, a
Notification message is sent. The BGP connection is closed as a result of this.
Following are the differences between Border Gateway Protocol (BGP) and Routing
Information Protocol (RIP) :
Border Gateway Protocol (BGP) Routing Information Protocol (RIP)
The Bellman Ford algorithm is used by Routing
It is based on the best-path algorithm.
Information Protocol.
In comparison to RIP, it is mostly It is primarily utilised by companies of a smaller
utilised for very large organisations size.
It's a protocol for connecting to an It is a dynamic routing protocol that is widely
external gateway. used in the business.
In RIP, areas, subareas, autonomous systems,
In BGP, the networks are divided into
and backbone areas are the different types of
two categories: areas and tables.
networks.
The metric is calculated in terms of Hop
The metric is calculated in terms of Bandwidth.
Count.
It is a hybrid type. It is a Vector State type.
There is no such limit on the number of
It allows for a total of 15 hops.
hops.
26. Differentiate between Enhanced Interior Gateway Routing Protocol
(EIGRP) and Border Gateway Protocol (BGP).
Enhanced Interior Gateway Routing Protocol (EIGRP): If two routers in the same
area exist, EIGRP is used to share information between them. It's also a complicated
protocol, but it's simple to set up and use in both small and big networks. It's also a
hybrid protocol, as it combines elements of both distance vector and link-state routing
protocols.
Following table lists the differences between Enhanced Interior Gateway Routing
Protocol (EIGRP) and Border Gateway Protocol (BGP):
Enhanced Interior Gateway Routing Protocol (EIGRP) Border Gateway Protocol (BGP)
It is based on the best-path
In EIGRP, the Dual Distance Vector Algorithm is used.
algorithm.
In comparison to EIGRP, it is
It is primarily used by large organisations. mostly used for very large
organisations.
It is a hybrid type. It's a type of Vector State.
It outperforms EIGRP in terms of
It is a protocol for intelligent routing.
routing intelligence.
It is a protocol for connecting to
It is a protocol for internal gateways.
an external gateway.
It has administrative distances of 90 (internal) and 170 Its administrative distances are 20
(external). (internal) and 200 (external).
27. What do you understand about TTL Security in the context of BGP?
What is the need for TTL security in BGP?
By default, BGP sends packets with a TTL of 1 to external neighbours and accepts
packets with a TTL of 0 or higher from external neighbours (as measured after the local
router has decremented the TTL of the incoming packet).
By requiring BGP to originate packets with a TTL of 255, the TTL-Security modifies the
default behaviour of originating.
28. What are the different types of loop prevention mechanisms in BGP?
Conclusion:
In this article, we have covered the most frequently asked interview questions on
Border Gateway Protocol (BGP). If you are preparing for a BGP interview, you can
expect questions from networking as well. Do not worry, we got you covered. To go
through the most frequently asked interview questions on networking, visit this link.