BGP Basics: Webinar Course
BGP Basics: Webinar Course
BGP Basics: Webinar Course
WEBINAR COURSE
1 v1.0
Overview
• What is BGP?
• BGP Features
• Path Vector Routing Protocol
• BGP General Operation
• BGP Terminology
• Inserting Prefixes into BGP
2 v1.0
What is BGP?
• Described in RFC4271
o RFC4276 gives an implementation report on BGP
o RFC4277 describes operational experiences using BGP
3 v1.0
BGP Features
4 v1.0
What is an Autonomous System?
5 v1.0
Autonomous System Number (ASN)
6 v1.0
What is Path Vector Routing Protocol
7 v1.0
Path Vector Routing Protocol
172.16.0.0/16
172.16.0.0/16
64503
64501 64503
AS64500 AS64501
172.16.0.0/16
AS64503
AS64502 172.16.0.0/16
8 v1.0
Definitions
• Transit
§ carrying traffic across a network, usually for a fee
• Peering
§ exchanging routing information and traffic
9 v1.0
Peering and Transit example
D to get packets
provider B
to/from C
provider C
10 v1.0
BGP General Operation
11 v1.0
BGP Attributes
12 v1.0
Internal & External BGP
13 v1.0
BGP Message Types
• Open:
o After a TCP connection has been established between two BGP routers, an Open
message is sent
- Once the open message is confirmed (keepalive), the BGP session is established –
become BGP peers/neighbors!
o Contains:
- Sender’s ASN
- BGP version
- BGP router ID
- Hold-time (3 x keepalive interval)
14 v1.0
BGP Message Types
• Keepalive:
o Exchanged initially to acknowledge Open messages
o Exchanged periodically (60 secs) to maintain BGP session
- Dataless packet
• Update:
o BGP peers exchange network information through Update messages
- One update for each path!
o Contains:
- Withdrawn routes – no more reachable
- Path attributes – attributes for this path to reach the destinations specified by the NLRI
- NLRI – list of networks reachable through this path <prefix, length>
15 v1.0
BGP Message Types
• Notification:
o Sent when an error condition is detected
o The BGP session is torn down immediately!
o Contains:
- Error code
- Error sub-code
- Data related to error
16 v1.0
BGP Neighbor States
17 v1.0
BGP Neighbor States
o Active
- A router transitions to Active state if the initial TCP connection was not successful (in
Connect state)
- Restarts the TCP connection
- If successful, sends an Open message
- Else, falls back to Idle state
• OpenSent
- An Open message has been sent to the neighbour
- Waiting for Open message from neighbour
- If it receives an Open message and there are no mismatches (version, source addr same
as TCP addr, ASN, router-ID, TTL, md5), sends KeepAlive, moves to OpenConfirm
- Else (if mismatches/errors), sent Notification and falls back to Idle
18 v1.0
BGP Neighbor States
• OpenConfirm
- waiting for the initial KeepAlive
- If received, transitions to Established
- If holdtimer expires or Notification received, moves to Idle
• Established
- The BGP neighbor relationship (session) is established!
- Routing information can now be exchanged
- If holdtimer expires/error, moves back to Idle
19 v1.0
BGP State Machine
Idle
Connect
Active
OpenSent
OpenConfirm
Established
20 v1.0
BGP/IGP model used in ISP networks
exchange prefixes
with other ASes iBGP iBGP iBGP iBGP
and implement IGP IGP IGP IGP
routing policy
AS65001 AS65002 AS65003 AS65004
21 v1.0
eBGP Neighbor Relationship
• eBGP neighbors/peers
o BGP session established between routers in different ASes
o Generally directly connected!
- Session established using directly connected interface IP
- Peering address must match the TCP session!
o Else, we need a static route to reach the neighbor and change the eBGP TTL
value (default 1)
22 v1.0
iBGP Neighbor Relationship
• iBGP neighbors/peers
o BGP session established between routers within the same AS
o Does not need to be directly connected
- IGP ensure reachability (TCP connection)
o Generally using loopback addresses
23 v1.0
iBGP Operation
24 v1.0
iBGP full-mesh
R2:
R2 router bgp 65400
neighbor 10.10.10.1 remote-as 65400
neighbor 10.10.10.3 remote-as 65400
neighbor 10.10.10.4 remote-as 65400
!
25 v1.0
Sourcing iBGP from Loopback
26 v1.0
Insert Prefixes into BGP
27 v1.0
Inserting prefixes into BGP – network command
• Configuration Example
• A matching route must exist in the routing table before the network is
announced
• Forces origin to be “IGP”
28 v1.0
Configuring Aggregation – Network Command
• A matching route must exist in the routing table before the network is
announced
• Easiest and best way of generating an aggregate
29 v1.0
APNIC Helpdesk Chat
30 v1.0
Acknowledgements
Some materials used in this course were originated from the Cisco ISP/IXP
Workshop Programme developed by Philip Smith & Barry Greene.
All images and icons used on these slides, that include an APNIC
logo, are licensed or owned by APNIC.
31 v1.0