BGP
BGP
BGP
The number of routers is relatively small, the dynamic routing LSDB capacity is
relatively low, and the number of Layer 3 routing domains is relatively small.
Routing policies and policy-based routing (PBR) are changed frequently, so fine-
grained routing is required.
There are a variety of OSPF route types (internal and external routes), area types
(backbone, common, and special areas), and network types (a maximum of five
network types), as well as well-designed cost calculation (configured based on
bandwidth).
The architecture is flat, requiring IGP as basic routing protocols to serve BGP.
The LSDB is large and sensitive to link convergence and the link cost is high.
Simplicity, high efficiency, and high scalability are required to meet various customer
service requirements (IPv6/IPX).
IS-IS has many advantages in backbone networks, including IS-IS fast algorithm
(enhanced PRC), simple packet structure (TLV), fast neighbor relationship
establishment, and large-capacity route transmission.
IS-IS is a dynamic routing protocol initially designed by the International Organization for
Standardization (ISO) for its Connectionless Network Protocol (CLNP).
To support IP routing, the Internet Engineering Task Force (IETF) extends and modifies
IS-IS in RFC 1195. This enables IS-IS to be applied to TCP/IP and OSI environments.
This type of IS-IS is called Integrated IS-IS. Unless otherwise stated, IS-IS refers to
Integrated IS-IS.
IS-IS is an Interior Gateway Protocol (IGP) and used within an Autonomous System (AS).
IS-IS is a link state protocol and uses Shortest Path First (SPF) algorithm to calculate
routes.
Neighbor relationship establishment:
Different from OSPF, IS-IS exchanges link state information using link state PDUs
(LSPs) instead of link state advertisements (LSAs). In IS-IS, CSNPs and PSNPs
are used to synchronize the LSDB and request as well as acknowledge link state
information (link state information summary). Detailed topology of link state
information and routing information are transmitted using LSPs.
Route calculation:
IS-IS SPF calculation is similar to OSPF SPF calculation except that the IS-IS
algorithm separates the topology and IP network segment and speeds up network
convergence.
NSAP address:
The IDP is equal to the network number in an IP address. As defined by the ISO,
the IDP consists of the Authority and Format Identifier (AFI) and Initial Domain
Identifier (IDI). The AFI specifies the address allocation authority and address
format; the IDI identifies a domain.
The DSP is equal to the subnet number and host number in an IP address. The
DSP consists of the High Order DSP (HODSP), system ID, and NSAP Selector
(SEL). The HODSP is used to divide areas; the system ID identifies a host; the
SEL indicates the service type.
The IDP together with the HODSP of the DSP can identify a routing domain and
the areas in a routing domain; therefore, the combination of the IDP and HODSP is
referred to as an area address, which is equal to an area ID in OSPF.
System ID uniquely identifies a host or router in an area and has a fixed length of
48 bits (6 bytes).
The role of an SEL is similar to the Protocol field of an IP header. Different network
layer services match different SELs. The SEL is always 00 in IP.
NET:
An NET indicates the network layer information of an IS itself and can be regarded
as a special type of NSAP (SEL=0). The NET length is the same as the NSAP
length. The maximum NSAP length is 20 bytes and its minimum length is 8 bytes.
When configuring IS-IS on a router, you can configure only a NET instead of an
NSAP.
A Level-1 router establishes neighbor relationships with only Level-1 and Level-1-2
routers in the same area. It maintains a Level-1 LSDB, which contains intra-area
routing information and forwards packets destined for other areas to the nearest
Level-1-2 router. A Level-1 router can establish only Level-1 adjacencies.
Level-2 router:
Level-1-2 router:
A router, which belongs to both Level-1 area and Level-2 area, is called a Level-1-
2 router. A Level-1-2 router maintains two LSDBs, that is, a Level-1 LSDB and a
Level-2 LSDB. The Level-1 LSDB is used for intra-area routing and the Level-2
LSDB is used for inter-area routing.
A Level-1-2 router can establish Level-1 neighbor relationships with Level-1 routers
in the same area. It can also establish Level-2 neighbor relationships with Level-2
routers and Level-1-2 routers in other areas.
In a broadcast network, Level-1 IS-IS routers use Level-1 LAN IS-IS Hello (IIH)
packets with the destination multicast MAC address 0180-c200-0014.
In a broadcast network, Level-2 IS-IS routers use Level-2 LAN IIH packets with the
destination multicast MAC address 0180-c200-0015.
P2P IIH packets are used in a non-broadcast network and do not carry any field
indicating the DIS (also called pseudo node).
IIH packets need to use the padding field for negotiating the size of packets sent
between devices on the two ends.
In two-way handshake, upon receiving a Hello packet from its neighbor, a router
considers the neighbor Up and establishes a neighbor relationship with the
neighbor. However, there is a risk of unidirectional communication.
When a router receives from its neighbor a Hello PDU that does not contain its
system ID, the state machine enters the initialized state.
The state machine enters the Up state only when the router receives from its
neighbor a Hello PDU that contains its system ID, eliminating the risk of
unidirectional communication.
On a broadcast network, the DIS (also called pseudo node) will be elected after
the neighbor state becomes Up. The DIS functions similarly to the Designated
Router (DR) in OSPF.
DIS and pseudo node:
DIS characteristics:
In IS-IS, the router with priority 0 also takes part in DIS election. In OSPF, the
router with priority 0 does not take part in DR election.
In OSPF, DR/BDR election requires 40s waiting time and is complicated. In IS-IS,
DIS election requires two Hello intervals and is simple and fast.
In IS-IS, only the DIS is elected. In OSPF, both the DR and BDR are elected, and
BDR functions as the backup of the DR.
After election is complete, if a new router with a higher priority is added, it can
become the new DIS in IS-IS but cannot become the new DR in OSPF.
Both the DIS and DR function as a virtual node during SPF calculation,
simplifying MA network topology.
In IS-IS, the DIS sends CSNPs to synchronize the LSDB (IS-IS extension).
IS-IS TLV:
TLV indicates the type, length, and value. It is a data structure and contains three
fields.
Using TLV to construct packets can ensure flexibility, scalability, and stable packet
structure. If new characteristics are added, only new TLVs need to be added,
removing the need to change the packet structure.
Using TLV to indicate network topology and routing information can improve
packet flexibility and scalability.
Link State Protocol PDU (LSP PDU):
LSPs are similar to LSAs in OSPF and used to transmit link state information,
including the topology and network ID.
Level-1 LSPs are transmitted by Level-1 routers.
Level-2 LSPs are transmitted by Level-2 routers.
After establishing a neighbor relationship, RTA and RTB send a CSNP to each
other. If the LSDB of the neighbor and the received CSNP are not synchronized,
the neighbor sends a PSNP to request the required LSP.
If RTB needs to request an LSP from RTA, it sends a PSNP to RTA. RTA then
sends the required LSP to RTB and starts the LSP retransmission timer, waiting for
RTB to send a PSNP to acknowledge the received LSP.
If RTA does not receive any PSNP from RTB after the LSP retransmission timer
expires, RTA retransmits the required LSP until it receives a PSNP from RTB.
LSDB synchronization between the newly added router and DIS on an MA network:
Assume that the newly added router RTC has established neighbor relationships
with RTB (DIS) and RTA.
After establishing neighbor relationships, RTC sends its LSP to the multicast
address (01-80-C2-00-00-14 in a Level-1 area and 01-80-C2-00-00-15 in a Level-2
area). Then all neighbors on the network receive this LSP.
The DIS on the network adds the LSP received from RTC to its LSDB, waits for the
expiry of the CSNP timer (the DIS sends CSNPs at an interval of 10s). After the
CSNP timer expires, the DIS sends a CSNP to synchronize the LSDBs on the
network.
RTC receives the CSNP from the DIS, checks its LSDB, and then sends a PSNP to
the DIS to request the LSPs that it does not have. For example, RTC does not have
the LSPs of RTA and RTB.
RTB (the DIS) receives the PSNP and then sends the LSPs required by RTC for
LSDB synchronization.
IS-IS route calculation characteristics:
A router in an area performs the full SPF algorithm when it starts for the first time.
If the received LSPs are updated and part of the topology is changed, the router
performs incremental SPF (ISPF) algorithm.
If only routing information is changed, the router performs partial route calculation
(PRC).
Because the algorithm that separates the topology and network is used, the route
convergence speed is improved.
Narrow mode: The default interface cost is 10, and the manually configured
interface cost ranges from 1 to 63.
Wide mode: The default interface cost is 10, and the manually configured interface
cost ranges from 1 to 16777215.
As shown in the preceding figure, differences between IS-IS and OSPF are as follows:
In IS-IS, each link can belong to different areas. In OSPF, each link belongs to only one
area.
In IS-IS, no area is defined as the backbone area. In OSPF, Area 0 is defined as the
backbone area.
In IS-IS, Level-1 and Level-2 routers use the SPF algorithm to generate their shortest path
trees. In OSPF, the SPF algorithm is used only in the same area, and inter-area routes
need to be forwarded through the backbone area.
Level-1 router characteristics:
Its routing table does not contain routing information of other areas.
Its routing table has one default route with the next hop pointing to a Level-1-2
router.
Its LSDB has LSPs of routers in the backbone area but no LSPs of Level-1 routers.
The Level-1 LSDB has LSPs of routers in the local area, and the Level-2 LSDB
has LSPs of routers in the backbone area.
IS-IS supports only two network types and defines the same default cost for all
bandwidths. OSPF supports four network types and defines the cost based on
bandwidth.
Area types:
IS-IS areas are classified into Level-1 and Level-2 areas. Level-2 area is the
backbone area and has all specific routes. There are only default routes from
Level-1 to Level-2 areas. OSPF areas are classified into the backbone area,
common area, and special area. Devices in common and special areas must
communicate across the backbone area.
Packet types:
IS-IS uses only LSPs to transmit routing information and does not differentiate
internal and external routing information, so IS-IS is simple and efficient. OSPF
uses a variety of LSAs to transmit routing information, including Types 1, 2, 3, 4, 5,
and 7, and applies to fine-grained scheduling and calculation.
Routing algorithm:
In IS-IS, when changes occur on the network segment where a node in an area
resides, PRC algorithm is triggered, ensuring fast route convergence and low route
calculation cost. In OSPF, network address is used for building the network topology,
and ISPF algorithm is triggered when the network segment address in an area is
changed, which is complicated.
Scalability:
In IS-IS, all routing information is transmitted using TLVs, ensuring simple structure
and providing easy scalability. For example, to support IPv6, only two TLVs are
added to IS-IS. Additionally, IS-IS also supports protocols such as IPX. OSPF is
developed to support IP and provides two independent versions OSPFv2 and
OSPFv3 to support IPv4 and IPv6.
NET address number:
RTA: 49.0001.0000.0000.0001:00
RTB: 49.0001.0000.0000.0002:00
RTC: 49.0001.0000.0000.0003:00
RTD: 49.0001.0000.0000.0004:00
RTE: 49.0001.0000.0000.0005:00
Intra-area routing configuration roadmap:
Configure RTA as a Level-1 router in IS-IS process 100 and retain the
default IS-IS level of RTB and RTC as Level-1-2 routers.
Change the DIS priority of RTA to be the highest priority so that RTA
becomes the DIS.
Intra-area routing configuration roadmap:
Configure RTB as a Level-1-2 router and configure a NET for RTC in IS-IS process
100.
Route leaking:
If a Level-1 area has more than two Level-1-2 routers, a Level-1 router in the Level-
1 area accesses other areas through the nearest Level-1-2 router, but only the
intra-area cost is calculated. If the cost from the nearest Level-1-2 router in a Level-
2 area to the destination network is high, the sub-optimal path exists. In this
situation, route leaking needs to be performed to import specific routes (including
the cost) of the Level-2 area into the Level-1 area, and then the Level-1 router
calculates the optimal path to access other areas.
This example requires RTA to access Area 49.0002 through the optimal path.
Because the bandwidth of the link connecting RTB to RTD is relatively high, it is
better to transmit traffic through RTB. To do this, in the IS-IS processes of RTB and
RTC, import Level-2 routes into the Level-1 area. The LSDB of RTA contains all
specific routes of the Level-2 area so that RTA can select the optimal path to reach
Area 49.0002.
Answer: IS-IS routers are classified into Level-1 router, Level-2 router, and Level-1-2
router.
Answer: IS-IS has simple packet structure, strong route transmission capacity, well-
designed routing algorithm, and high scalability.
EGP, the predecessor of BGP, is simple in design and can only transmit routing
information between ASs and cannot select optimal routes or prevent routing loops
between ASs. Therefore, EGP was replaced by BGP.
Compared with EGP, BGP has the following advantages:
Discovers neighbors and establishes neighbor relationships.
Selects optimal routes and advertises routes.
Prevents routing loops, efficiently transmits routes, and maintains a large amount
of routing information.
Provides various route control capabilities between ASs that are not fully trusted.
Using BGP to transmit routing information, a routing domain functions as a whole to
exchange routing information with another routing domain. This routing domain is an AS.
An AS is a set of routers and networks that consist of these routers. These routers are
under a single technical administration and use the same routing policies.
An AS is uniquely identified by an AS number, which is assigned by the Internet
Assigned Numbers Authority (IANA). Before January 2009, only 2-byte AS numbers can
be used, which range from 1 to 65535. AS numbers 1 to 64511 are public AS numbers,
and AS numbers 64512 to 65534 are private AS numbers. After January 2009, the IANA
decided to use 4-byte AS numbers, which range from 65536 to 4294967295.
To ensure reliable data transmission between ASs, BGP uses TCP to establish
connections. Therefore, BGP can establish a neighbor relationship across multiple
routers, while IGP can only establish a neighbor relationship hop by hop.
Routers between ASs do not completely trust each other. To implement on-demand
route control and selection, various BGP attributes are designed.
BGP is designed to run between ASs to transmit routers. There are WAN links between
ASs, and unpredictable link congestion or packet loss may occur during packet
transmission on WANs. Therefore, BGP uses TCP as the transport protocol to ensure
reliability.
BGP uses TCP port 179 to establish neighbor relationships, and TCP establishes
connections in unicast mode. Therefore, unlike RIP and OSPF, BGP does not discover
neighbors in multicast mode. Establishing connections in unicast mode requires
neighbors to be manually specified in BGP.
EBGP transmits routes only between different ASs. In the figure, RTB and RTC in AS
100 can learn different routes from AS 200 and AS 300 respectively. How to transmit
routes of AS 200 and AS 300 within AS 100?
To meet this requirement, on RTB and RTC, import BGP routes into IGP (OSPF in the
figure) and then import IGP routes back into BGP.
There are a huge number of BGP routes on the public network. After these BGP
routes are imported into IGP, IGP cannot support these BGP routes.
When BGP routes are imported into IGP, strict control is required. This
complicates the configuration and maintenance.
When BGP attributes carried in BGP routes are imported into IGP, these attributes
may be lost because they cannot be identified by IGP.
Description:
Selects the highest IP address among all physical interfaces if it does not
have loopback interfaces.
The peer keyword indicates the IP address used by the neighbor to establish a BGP
neighbor relationship, identifying the destination address of the TCP connection
initiated with the neighbor. This address can be the IP address of the neighbor’s
directly connected interface or the IP address of an indirectly connected loopback
interface (ensure that this IP address is reachable). Loopback interface IP addresses
are often used to establish IBGP neighbor relationships. This is because loopback
interfaces are always Up after being enabled. As long as routes are reachable, IBGP
neighbor relationships remain stable. Directly connected interface IP addresses are
often used to establish EBGP neighbor relationships. This is because EBGP
neighbor relationships are established between ASs and routes between indirectly
connected interfaces are unreachable before the neighbor relationships are
established.
Directly connected interface IP addresses are often used to establish EBGP neighbor
relationships, and loopback interface IP addresses are often used to establish IBGP
neighbor relationships.
BGP routers exchange BGP messages to establish neighbor relationships and update
routing information. BGP messages are classified into Open, Update, Notification,
Keepalive, and Route-refresh messages.
Open message: is the first message sent after a TCP connection is established. It
is used to establish a BGP connection between neighbors. After a BGP neighbor
receives an Open message and negotiation succeeds, the neighbor sends a
Keepalive message to confirm and retain the connection. Then BGP neighbors
can exchange Update, Notification, Keepalive, and Route-refresh messages.
An Update message can advertise multiple reachable routes with the same
route attributes. These routes can share a group of route attributes. All the
route attributes carried in a specific Update message apply to all the
destinations (specified by IP prefixes) of the Network Layer Reachability
Information (NLRI) field in this Update message.
You can use an Update message just to withdraw routes so that this message
does not need to contain the path attribute or NLRI. Alternatively, you can use
an Update message just to advertise reachable routes so that this message
does not need to contain withdrawn route information.
Notification message: is sent when a BGP router detects an error. Then a BGP
connection is terminated immediately.
Keepalive message: is sent periodically from a BGP router to its neighbor to retain
their connection.
During message exchange, the Idle state is the initial state of a BGP router. In Idle state,
the BGP router rejects the connection request from its neighbor. Only after receiving the
Start event of itself, the BGP router tries to establish a TCP connection with its neighbor
and transitions to the Connect state.
In Connect state, the BGP router starts the Connect Retry timer, waiting for a TCP
connection to be established.
If the BGP router does not receive any response from its neighbor until the
Connect Retry timer expires, the BGP router continues to try to establish a
TCP connection with its neighbor and stays in the Connect state.
In Active state, the BGP router always tries to establish a TCP connection.
If a TCP connection fails to be established, the BGP router stays in the Active
state.
If the BGP router does not receive any response from its neighbor until the
Connect Retry timer expires, the BGP router transitions to the Connect state.
In OpenSent state, the BGP router waits for an Open message from its neighbor and
checks information carried in the Open message, including AS number, version
number, and authentication password.
If the received Open message is correct, the BGP router sends a Keepalive
message to its neighbor and transitions to the OpenConfirm state.
If the received Open message is incorrect, the BGP router sends a Notification
message to its neighbor and transitions to the Idle state.
In OpenConfirm state, the BGP router waits for a Keepalive or Notification message
from its neighbor. If it receives a Keepalive message, it transitions to the Established
state. If it receives a Notification message, it transitions to the Idle state.
In Established state, the BGP router can exchange Update, Keepalive, Route-
refresh, and Notification messages with its neighbor.
Two BGP route generation modes are available: using the network command and using
the import command.
In the figure, RTA has two user network segments 100.0.0.0/24 and 100.0.1.0/24, and
RTB has a static route to 100.0.0.0/24 and learns the route to 100.0.1.0/24 through
OSPF. RTB and RTC establish an EBGP neighbor relationship, and RTB advertises the
routes 100.0.0.0/24, 100.0.1.0/24, and 10.1.12.0/24 using the network command so that
RTC can learn the routes in the routing table of RTB.
In the figure, RTA has two user network segments 100.0.0.0/24 and 100.0.1.0/24, and
RTB has a static route to 100.0.0.0/24 and learns the route to 100.0.1.0/24 through
OSPF. RTB and RTC establish an EBGP neighbor relationship, and RTB advertises the
routes 100.0.0.0/24, 100.0.1.0/24, and 10.1.12.0/24 using the import command so that
RTC can learn the routes of RTB.
To prevent other routes from being imported into BGP, you need to configure IP-prefix
for precise matching and apply route-policy to control the imported routes.
When multiple valid routes exist, a BGP router advertises only the optimal route to its
neighbor.
RTD can learn the route 100.0.0.0/24 from two BGP neighbors (RTB and RTC)
and RTD advertises its directly connected route 200.0.0.0/24 into BGP. Run the
display bgp routing-table command on RTD. The following command output is
displayed:
Run the display bgp routing-table command on RTE. The following command
output is displayed. You can view that RTD has advertised the optimal route
marked valid to its BGP neighbor RTE.
In the figure, RTA has a user network segment 100.0.0.0/24 and advertises this
network segment to a BGP neighbor RTB through EBGP. After RTB receives this
route from its EBGP neighbor, it advertises this route to its IBGP neighbor RTC and
EBGP neighbor RTD.
A BGP router does not advertise the optimal route obtained through IBGP to other IBGP
neighbors.
In the figure, RTA has a user network segment 100.0.0.0/24. RTA, RTB, and RTC
are IBGP neighbors. RTA advertises the route 100.0.0.0/24 to RTB and RTC
through IBGP, but RTB does not advertise the received IBGP route to its IBGP
neighbor RTC.
This design prevents routing loops within an AS. As defined, when a BGP route is
transmitted within an AS, its AS_Path attribute remains unchanged. In the figure,
when RTA advertises the route 100.0.0.0/24 to RTB, the AS_Path attribute of this
route remains unchanged and is empty. If RTB can advertise this IBGP route to
RTC, RTC may also advertise this route to RTA because the AS_Path attribute of
the route is still empty, and RTA will not reject this route. As a result, a routing loop
occurs. Therefore, this route advertisement rule can prevent routing loops within
an AS.
RTA has a user network segment 100.0.0.0/24 and advertises it to RTB through EBGP. RTB and RTD
establish an IBGP neighbor relationship. RTD learns this BGP route through IBGP and advertises it to the
EBGP neighbor RTE.
When RTE accesses the network segment 100.0.0.0/24, it examines its routing table, finding that the next
hop of the route to 100.0.0.0/24 is RTD. After RTE finds the outbound interface, it sends a packet to RTD.
RTD receives the packet and examines its routing table, finding that the next hop of the route is RTB and the
outbound interface is the interface connected to RTC and sends the packet to RTC. RTC receives the
packet and examines its routing table, finding that there is no route to 100.0.0.0/24 and discards this packet.
In this situation, the routing blackhole problem occurs.
BGP route advertisement rule: Before a BGP router advertises a route learned from an IBGP neighbor to
another BGP neighbor, IGP must know this route. That is, BGP must synchronize with IGP.
In the figure, after RTD receives an IBGP route from RTB, RTD needs to check whether IGP (OSPF)
has learned this route before advertising this route to RTE. If OSPF can learn this route, RTD
advertises it to RTE.
By default, synchronization check between BGP and IGP is disabled on Huawei routers to ensure
normal IBGP route advertisement. However, disabling synchronization check will lead to the routing
blackhole problem. To solve this problem, two methods are available:
Import BGP routes into IGP to ensure synchronization between BGP and IGP. However, the
number of BGP routes on the Internet is huge and importing so many BGP routes into IGP will
bring a huge processing and storage burden to an IGP router. If the IGP router is overloaded,
it may crash.
IBGP routers must be fully meshed to ensure that all routers can learn advertised routes. This
method can solve the routing blackhole problem occurring after synchronization check is
disabled.
IP routing table (IP_RIB): global routing information database, including all IP routing
information.
BGP routing table (Local_RIB): BGP routing information database, including routes
selected by the local BGP router, neighbor table, and neighbor list.
After receiving an Update message from a BGP neighbor, a BGP router uses the route
selection algorithm to determine the optimal route for each prefix and stores the selected
optimal route to the local BGP routing table (Local_RIB).
If multipath is enabled on a BGP router, it submits the optimal route and all equal-cost
routes to IP_RIB to determine whether to install them. In addition to the optimal route
received from BGP neighbors, Local_RIB also includes the routes injected by the router.
These routes are called locally originated routes.
In Local_RIB, a router encapsulates only the optimal prefix in an Update message and
advertises it to BGP neighbors.
Solutions to the two problems:
During routing information exchange between ASs, various BGP attributes are
designed to flexibly control routes and select the optimal route.
1. Adjust the link metric between ASs to change routing entries in the routing
table. 2. Use routing policies to change the next hop of routes. However,
these methods have limitations in some situations and cannot meet various
network requirements.
Optional transitive attributes cannot be identified by some BGP routers but can be
carried in BGP messages and then advertised to neighbors.
A BGP router can ignore the messages carrying optional non-transitive attributes
and does not advertise these message to neighbors.
In the figure, OSPF runs within AS 200, and the network segment 200.0.0.0/24 is
advertised into OSPF. RTB changes the route 200.0.0.0/24 into a BGP route by using
the network command and advertises it to RTA. RTC changes the route 200.0.0.0/24
into a BGP route by using the import command and advertises it to RTA.
BGP transmits routing information between ASs. If there are multiple routes to the same
destination IP prefix and BGP learns these routes using different methods, the Origin
attribute determines which route is selected as the optimal route and identifies the
origins of these routes.
i indicates that this BGP route is injected using the network command.
e indicates that this BGP route is learned through EGP. EGP is seldom used on
the live network and the Origin attribute of a route can be changed to e using a
routing policy.
? is for Incomplete, indicating that this BGP route is learned using other methods,
for example, a route is imported using the import command.
The three Origin attributes can be listed in ascending order of priority as i > e >
Incomplete (?).
The AS_Path attribute is designed to address the two problems. It records the numbers
of all the ASs that a route passes through.
When RTA receives the route 100.0.0.0/24 from RTB, the AS_Path attribute is
(2,4). When RTA receives the route 100.0.0.0/24 from RTC, the AS_Path attribute
is (3,5,4). As defined, a shorter AS_Path attribute indicates a better route because
it records fewer AS numbers. Therefore, RTA prefers the route 100.0.0.0/24
received from RTB.
When RTE advertises the route 100.0.0.0/24 through BGP, a routing loop may
occur if the link RTE->RTB->RTC->RTD->RTE is used. To prevent the loop, RTE
checks the AS_Path attribute of the route received from RTD. If RTE finds that this
AS_Path attribute contains its AS number, it discards this route.
Four AS_Path attributes are available:
AS_Sequence: will be described in BGP route aggregation.
AS_Set: will be described in BGP route aggregation.
AS_Confed_Sequence: is used in the BGP Confederation and not described in
this course.
AS_Confed_Set: is used in the BGP Confederation and not described in this
course.
When a BGP router advertises a locally originated route to an IBGP neighbor, it sets the
local interface IP address used to establish a neighbor relationship as the Next_hop
attribute of this route.
In the figure, when RTA advertises the network segment 100.0.0.0/24 to RTB, the
Next_hop attribute of this route is the IP address of the interface that directly
connects RTA to RTB if RTA and RTB establish an IBGP neighbor relationship
using directly connected interfaces. If they use loopback interfaces to establish an
IBGP neighbor relationship, the Next_hop attribute of this route is the loopback
interface IP address of RTA.
When a BGP router advertises a route to an EBGP neighbor, it sets the interface IP
address used to establish a neighbor relationship as the Next_hop attribute of this route.
In the figure, when RTB advertises the network segment 100.0.0.0/24 to RTC, the
Next_hop attribute of this route is the IP address of the interface that directly
connects RTB to RTC.
When a BGP router advertises to an IBGP neighbor a route learned through EBGP, the
Next_hop attribute of this route remains unchanged.
When RTA learns from RTB the network segment 200.0.0.0/24 advertised by RTC,
the Next_hop attribute of this route is the outbound interface IP address of RTD.
Because RTB and RTD reside on the same network segment, the Next_hop
attribute of the route advertised from RTC to RTB is the outbound interface IP
address of RTD.
When an IGP, for example, RIP advertises a route, the next hop of the route is
changed each time it passes through a router, and each router that advertises this
route declares that it can reach the destination address and transmits packets hop
by hop to the destination network. However, routers on the network do not know
which router originated this route. Subsequently, a loop occurs. To prevent loops,
BGP changes the Next_hop attribute of a route only when this route is transmitted
between EBGP neighbors and retains the Next_hop attribute when a route learned
through EBGP is advertised between IBGP neighbors.
In the figure, AS 200 has a user network segment 200.0.0.0/24 and advertises it to AS
100 through BGP. How can the administrator of AS 100 access this network segment
over a high-bandwidth link?
The Local_Pref attribute is valid only between IBGP neighbors and not advertised to
other ASs. This attribute indicates the BGP preference of a router. A larger value
indicates a higher preference.
This attribute determines the optimal route for traffic leaving an AS. When a BGP router
obtains from different IBGP neighbors multiple routes with the same destination address
but different next hops, the router selects the route with the largest Local_Pref attribute
value as the optimal route. The default Local_Pref attribute value is 100.
In the figure, the administrator of AS 300 wants to perform operations in AS 300 to
enable AS 200 to access the network segment 100.0.0.0/24 over the high-bandwidth link.
The MED attribute is transmitted only between two neighboring ASs. An AS that receives
this attribute does not advertise it to any other ASs. In the figure, AS 100 will not receive
the MED configured in AS 300, but AS 200 will. Therefore, AS 200 can select the high-
bandwidth link.
The MED attribute corresponds to the metric in IGP. It determines the optimal route for
traffic entering an AS. When a BGP router obtains from different EBGP neighbors
multiple routes with the same destination address but different next hops, the router
selects the route with the smallest MED attribute value as the optimal route. The default
MED attribute value is 0.
In the figure, AS 10 has a user network segment 10.1.10.0/24, and AS 11 has a user
network segment 10.1.11.0/24. To differentiate the two user network segments, the
Community attribute 10:12 is configured for the route 10.1.10.0/24 in AS 10, and the
Community attribute 11:12 is configured for the route 10.1.11.0/24 in AS 11. After the
two routes are advertised to AS 12 through BGP, AS 12 wants to aggregate the routes,
advertises only the aggregated route to AS 13, and expects AS 13 not to transmit this
route to other ASs.
Internet: is the default attribute. All routes belong to the Internet. Routes
carrying the Internet attribute can be advertised to all BGP neighbors.
Verification: Run the tracert command on RTC to check the routers that the route
200.0.0.0/24 passes through.
In AS 200, RTB and RTC have users on the network segment 200.0.0.0/24 and change
the route 200.0.0.0/24 into a BGP route using the import command. RTB aggregates the
routes and then sends the aggregated route to RTA. Both manual aggregation and
automatic aggregation are enabled on RTB. How does RTB prefer the aggregated route?
Both manual aggregation and automatic aggregation are enabled on RTB. Run the
display bgp routing table on RTB. The command output shows that only the manually
aggregated route is sent to RTA, but the automatically aggregated route is not. This
indicates that a manually aggregated route has a higher priority than an automatically
aggregated route.
Automatic aggregation takes effect only for imported BGP routes, but manual
aggregation can also take effect for routes in a BGP routing table. For details, see the
BGP route aggregation section. In the preceding scenario, the routes to be aggregated
are imported routes. Therefore, both automatic aggregation and manual aggregation can
meet this requirement. If the BGP routing table has both imported routes and routes
advertised using the network command, only manual aggregation can meet this
requirement.
In the figure, AS 200 has a network segment 200.0.0.0/24 and advertises it to RTA and
RTB through EBGP. RTB also advertises it to RTA through IBGP. Then RTA receives
two routes to 200.0.0.0/24. How does RTA select the optimal route?
According to route selection rules, RTA prefers the route learned from an EBGP
neighbor.
In the figure, AS 200 has a user network segment 200.0.0.0/24 and advertises it to RTB
and RTC through EBGP. RTB and RTC advertise it to RTA through IBGP. The
administrator of AS 100 wants to access this network segment over the high-bandwidth
links. How to meet this requirement on RTA?
Set the OSPF cost of the interface that connects RTA to RTB to 100. RTA then accesses
this network segment over the link RTA->RTC->RTD.
RTA selects the route with the next hop 10.1.12.2 to access this network segment.
RTA selects the link RTA->RTB->RTD to access this network segment because
RTB has a smaller router ID than RTC. BGP prefers the route advertised by the
router with a smaller router ID.
RTA selects the interface with the next-hop address 10.1.12.2 as the outbound
interface because BGP prefers the route learned from a neighbor with a lower IP
address.
Run the display bgp routing-table 200.0.0.0 command on RTA. The following command
output is displayed:
AS-path 200, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, pre255, IGP cost 2,
not preferred for router ID
……
In the figure, AS 300 has two user network segments 200.0.0.0/24 and 100.0.0.0/24. To
differentiate users on the two network segments, the Community attribute 300:100 is
configured for the route 100.0.0.0/24, and the Community attribute 300:200 is configured
for the route 200.0.0.0/24. When users in AS 100 access the two network segments,
traffic needs to be load balanced between RTB and RTC. When users in AS 200 access
the two network segments, traffic needs to be load balanced between RTE and RTF.
RTE and RTF advertise routes carrying the Community attributes to RTD.
After RTD receives the routes carrying the Community attributes, it uses two
Community-filters to match different Community attributes, use two route-policies
to invoke the two Community-filters, and set the next hops of the routes with the
Community attributes 300:100 and 300:200 as the outbound interface addresses
of RTE and RTF respectively.
On RTD, configure another two route-policies. That is, configure one route-policy
to set the MED value of the route with the Community attribute 300:100 to 100 and
apply this route-policy in the export direction. Configure the other route-policy to
set the MED value of the route with the Community attribute 300:200 to 100 and
apply this route-policy in the export direction.
Configuration on RTD:
bgp 200
#
ipv4-family unicast
undo synchronization
#
if-match community-filter 10
#
if-match community-filter 20
apply ip-address next-hop 10.1.46.6
#
#
if-match community-filter 20
#
tracert 100.0.0.1: Check the IP addresses that the route passes through.
tracert 200.0.0.1: Check the IP addresses that the route passes through.
Method to meet this requirement:
On RTC, aggregate the specific routes in AS 100 and AS 200 into an aggregated
route 10.1.8.0/21 and advertise this aggregated route to the client AS.
Currently, there are a large number of routes on the Internet, bringing in the following
problems:
Storing the routing table will occupy a lot of memory resources, and transmitting
routing information needs to consume a lot of bandwidth resources.
Use a static route to aggregate specific routes into the route 10.1.8.0/22 with the
next hop pointing to NULL 0. Because the aggregated route is not identified by a
specific address and is only the replacement of specific routes when being
advertised to AS 200, the next hop of the aggregated route points to Null 0 to
prevent routing loops.
Because a static route is used, the route 10.1.8.0/22 with the next hop Null 0 is
generated in the routing table. To aggregate specific routes, use the network
command to change the route 10.1.8.0/22 in the IP routing table into a BGP route
and advertise this route to the BGP neighbor.
AS 100 has four user network segments, which are changed into BGP routes using the import
command. AS 200 is connected to AS 300, a client AS. RTC in AS 300 has low processing
capabilities. Therefore, it is required that RTC can access the network segments in AS 100 and
AS 200 but do not receive many routes. How to meet this requirement?
On RTB and RTC, run the display bgp routing-table command. The following command output
is displayed:
Automatic aggregation can aggregate only imported BGP routes. BGP aggregates routes
according to the natural network segment and sends only the aggregated route to neighbors.
AS 100 has four user network segments, which include BGP routes imported using the
import command and the network command. AS 200 is connected to AS 300, a client AS.
RTC in AS 300 has low processing capabilities. Therefore, it is required that RTC can
access the network segments in AS 100 and AS 200 but do not receive many routes.
How to meet this requirement?
On RTB and RTC, run the display bgp routing-table command. The following
command output is displayed:
<RTB>display bgp routing-table
The AS_Path attribute is a sequenced list because each AS number is added to the
AS_Path list each time the AS_Path attribute passes through an AS and the first AS
number is added to the leftmost of the AS_Path list.
In the figure, when AS 400 advertises the aggregated route to AS 300, the
AS_Path attribute (except that enclosed in braces) of the route indicates that this
route passes through AS 200 and then AS 400.
If the aggregated route needs to carry the AS numbers that all specific routes pass
through to prevent loops, you need to specify the as-set parameter following the route
aggregation command.
In the figure, specific routes are aggregated and the as-set parameter is specified in
AS 200. The aggregated route carries an AS-Set to indicate AS_Path information of
the specific routes. AS numbers in the list are not recorded in the sequence in which
the route passes through ASs. In this manner, loops are prevented.
Discussion
Route aggregation solves two problems. That is, it reduces resources required for route
transmission and calculation and reduces route flapping on network stability because it
hides specific routing information. However, after route aggregation is used, the AS_Path
attribute is lost, creating a risk of routing loop.
If the aggregated route carries information about the ASs that all specific routes pass
through, this route may also be frequently updated when the specific routes frequently flap.
Therefore, whether the aggregated route carries lost AS_Path information requires
network designers to determine based on the network environment.
Answer: ABC.
Answer: B.