Uploaded by mohammed zeinu

BGP Principle

advertisement
BGP
Objectives
When is BGP Applicable
Basic BGP Peer Configuration
Troubleshooting BGP Connections
BGP Operation and Path Attributes
Route Import/Export
Contents
BGP overview
BGP terminology
BGP packet types and connection status
BGP route announcing principles
BGP route announcing methods
BGP attributes and route selection
Internet development
Till Dec,1969 there was only 4 sites
Now it has developed to a global network
The whole network is divided into several ASs
Easy to manage
AS100
AS200
AS500
AS400
AS300
How big is Internet?
A router running BGP in Internet has:
◦ The size of the route table is bigger than 30 Mb
◦ More than 700,000 routes in the route table
◦ More than 6,500 AS numbers
Autonomous Systems
IGPs: RIP, IGRP,
EGPs: BGP
OSPF, EIGRP
A
H
B
E
C
F
D
Autonomous System 65000
J
G
I
Autonomous System 65500
AS(autonomous system ) is a big network under the same technique management.
IGPs work in the same AS(autonomous system)
EGPs connect different AS(autonomous system)
AS( Autonomous Systems )
Every AS has its own AS number
Routing policy in each AS is independent
AS number: 1 ~ 65535
B
A
AS100
C
D
E
BGP( Border Gateway Protocol )
BGP is a kind of EGP
BGP is a commonly used standard protocol
Version used now: BGPv4
BGP use AS number to avoid route loop
Inner routing protocol: RIP/IGRP/OSPF/EIGRP/ISIS
AS100
IGRP
AS200
OSPF
C
A
BGP
BGP
B
AS300
RIP
BGP is used between ASs
BGP
B
BA
AS
65000
AS
64500
B
AS
65500
BGP
E
F
BGP
C
AS
65250
D
BGP is used between AS’s to ensure that there is no loops in the
network
Comparison between some
routing protocols
Hierarchy
Required
Protocol
Interior or
Exterior
OSPF
Interior
LS
Yes
Cost
EIGRP
Interior
Advanced
DV
No
Composite
BGP
Exterior
Advanced
DV
No
Path vectors
or attributes
DV or LS
Metric
When to use BGP?
BGP is suitable in these occasions:
◦ One AS allow data stream to pass through it to reach another AS (such as ISP)
◦ One AS has several exits to other AS’s
◦ One AS wants to control the data stream within itself
Of course,you need to be familiar with the operation and function of
BGP to make good use of it
Contents.
BGP overview
BGP terminology
BGP packet types and connection status
BGP route announcing principles
BGP route announcing methods
BGP attributes and route selection
BGP features
BGP is a kind of enhanced distance vector routing protocol
Transmission protocol: TCP,port number: 179
Support CIDR(classless inter domain routing)
Route updates only send added route
Rich in route filtering and route policy configuration
Peers = Neighbors
Neighbors
AS 65500
B
C
Neighbors
A
AS 65000
Two routers establish TCP connection between each other to exchange BGP
route information,after TCP connection is established, the relationship
between them is peer or neighbor. BGP neighbors is divided into two types:
IBGP and EBGP.
External BGP
IBGP Neighbors
AS 65001
B
C
EBGP Neighbors
A
AS 65000
Neighbors are in different AS( autonomous systems )
Neighbors are usually directly connected
Internal BGP
IBGP Neighbors
AS 65500
B
C
Neighbors
A
AS 65000
Neighbors are in the same AS
Neighbors do not need to be directly connected
Internal BGP
There can be several non-BGP routers between peers
BGP information can be passed through non-BGP topology
R1
loopback
201.7.108.2/32
AS100
OSPF
OSPF
EBGP
OSPF
R2
loopback
201.7.108.1/32
EBGP
IBGP
Contents.
BGP overview
BGP terminology
BGP packet types and connection status
BGP route announcing principles
BGP route announcing methods
BGP attributes and route selection
BGP message types
BGP has four kinds of messages:
OPEN – used to establish BGP connection
KEEPALIVE – used to keep BGP connection
UPDATE – used to update or withdraw BGP route
NOTIFICATION – BGP error notification
BGP connection status
Idle:This is the first status when BGP initiates
Connect:the status when BGP is waiting for the success of TCP
connection
Active:the status when BGP restart to establish TCP connection
Open sent:when TCP establishing succeeds,BGP begin to send
OPEN message and wait for OPEN message from counterpart
Open confirm:after receiving OPEN message from neighbor,
BGP waits for Keepalive message or Notification message
Established:this is the last stage or stable status for the
neighbors to negotiate,BGP begin to exchange Update packets
between each other
Contents.
BGP overview
BGP terminology
BGP packet types and connection status
BGP route announcing principles
BGP route announcing methods
BGP attributes and route selection
BGP route announcing principles
When there are multiple paths, BGP Speaker will use the best one for
itself;
BGP Speaker will only announce the routes that it is using to their
neighbors;
BGP Speaker will announce the routes that it gets from EBGP neighbor
to all the BGP neighbors, including EBGP and IBGP neighbors;
BGP Speaker will not announce the routes that it get from IBGP
neighbor to all the other IBGP neifhbors;
If the BGP Speaker will announce the routes that it learns from IBGP
neighbor to its EBGP neighbor depends on the synchronous status of
IGP and BGP
Once the connection is established, BGP Speaker will announce all the
BGP routes to the neighbors
BGP synchronization
AS100
AS200
EBGP
EBGP
IBGP
AS300


Because IBGP neighbors may be not directly connected, so these non-BGP routers
will take part in the process of packets forwarding based on BGP routes,it is
required that IGP routers also have related BGP routes
Routes learned from IBGP neighbor that is also learned from IGP can be announced
to EBGP neighbor, this is called BGP and IGP synchronization. This function is
turned on by default, it needs to be turned off manually
Contents.
BGP overview
BGP terminology
BGP packet types and connection status
BGP route announcing principles
BGP route announcing methods
BGP attributes and route selection
Method-1: Network command
AS200
18.0.0.1/8
OSPF
RTB
OSPF finds route18.0.0.1/8。
How to announce this route to
the BGP route table of RTB?
RTB(config)#router bgp 200
RTB(config-router-bgp)#network 18.0.0.0 mask 255.0.0.0
Method-2: Route Redistribution
AS200
18.0.0.1/8
OSPF
RTB
OSPF finds route18.0.0.1/8。
How to announce this route to
the BGP route table of RTB?
RTB (config) # router bgp 200
RTB (config-router-bgp) # redistribute ospf
Contents.
BGP overview
BGP terminology
BGP packet types and connection status
BGP route announcing principles
BGP route announcing methods
BGP attributes and route selection
BGP Attributes
BGP attributes describe the features of BGP route
BGP attributes are a series parameters
BGP attributes are sent out in BGP UPDATE messages
BGP attributes are used for BGP route filtering and route deciding policy
BGP attributes are divided into Well-known and optional
Well-known Attributes
BGP well-known attributes:all the BGP routers must recognize
BGP well-known attributes are divided into “well-know mandatory” and
“well-known Discretionary ” two types
“well-known mandatory” attributes:must appear inHQ
all the update
messages
“well-known Discretionary ” attributes:may appear in the update
messages and may not
Optional Attributes
BGP optional attributes:BGP routers may or may not support
attributes
BGP optional attributes are divided into “ Transitive ” and
“nontransitive ” two types
“optional transitive” attributes:if accepted will be labeled as “global”
and then sent out;if not accepted will be labeled as “local” and then
sent out
“optional nontransitive ” attributes:if accepted will handle by itself
and will not be forwarded to the neighbors;if not accepted will be
discarded
BGP commonly used
Attributes
well-know mandatory :
◦ AS-path
◦ Next-hop
◦ Origin
well-known Discretionary:
◦ Local preference
optional transitive :
◦ Community
optional nontransitive :
◦ Multi-exit-discriminator (MED)
BGP Route Selection Decision
Process
At first,accept those routes without AS loop and has valid nexthop address,then:
1. Select the route with highest local preference ;
2. Select the route generated by local routers such as routes generated
by route aggregation;
3. Select the route with shortest AS-path;
4. Select the route with lowest origin code (IGP < EGP < Incomplete);
5. Select the route with lowest MED; (MED is set by EBGP neighbor)
6. If MED is the same, and they are both announced from IBGP and
EBGP, then the route from EBGP will be selected first;
7. Choose the path to the next hop from the nearest IGP neighbor;
8. Choose the route with the lowest neighbor Router-ID;
9. Choose the route with the lowest neighbor interface address.
Review Questions
1. Which are the four kinds of message types in BGP ,and their
function?
2. What are the well-known mandatory attributes in BGP,and their
function?
3. What is the function of configuring multi-hop in BGP?
Download