Documente Academic
Documente Profesional
Documente Cultură
Protocol
Introduction
Scalable Infrastructure
Workshop
AfNOG 2012
0:
1:
2:
3:
4:
5:
BGP Part 0
Why use BGP?
Provider
IGP routes inside
Static routes or
IGP routes to
small customers
Small ISP
Static or IGP
routes inside
Static default
route to
provider
Africa
Small
ISP
Small
ISP
multiple connections
to achieve:
redundancy
connection diversity
increased speeds
Upstream
ISP
Upstream
ISP
Large ISP
Africa
Europe
Terminology: Policy
Policy (continued)
Implementing policy:
Policy Implementation
local peering
no free transit!
Terminology:
Peering and Transit
Terminology: Aggregation
Combining of several smaller blocks of
address space into a larger block
For example:
Aggregation (continued)
Aggregation (continued)
Aggregation is very necessary when using
BGP to talk to the Internet
Saves memory and CPU for routing
calculations
Saves bandwidth for BGP announcements
Some providers may filter (ignore) deaggregated route announcements
Summary:
Why do I need BGP?
upstream providers
local networks regional peering to get local
traffic
Policy discrimination
BGP Part 1
Forwarding and Routing
Routing Table/RIB
Routing table is managed by a routing
protocol (e.g. OSPF or BGP)
Often called the RIB Routing Information
Base
Each routing protocol has its own way of
managing its own routing tables
Each routing protocol has a way of
exchanging information between routers
using the same protocol
Forwarding Table/FIB
Static Routes
IP Routing
IP Routing
Classless routing
destination
next-hop
mask (prefix-length) indicating size of address space
described by the entry
Longest match
IP routing
Default route
0.0.0.0/0
IP route lookup:
Longest match routing
R3
Packet: Destination
IP address: 10.1.1.1
R1
Based on
destination
IP address
R2
R4
Most of
10.0.0.0/8 except
for
10.1.0.0/16
10.1.0.0/16
IP route lookup:
Longest match routing
R3
Packet: Destination
IP address: 10.1.1.1
R1
Based on
destination
IP address
R2
Most of
10.0.0.0/8 except
for
10.1.0.0/16
R4
10.1.0.0/16
IP route lookup:
Longest match routing
R3
Packet: Destination
IP address: 10.1.1.1
R1
Based on
destination
IP address
R2
Most of
10.0.0.0/8 except
for
10.1.0.0/16
R4
10.1.0.0/16
IP route lookup:
Longest match routing
R3
Packet: Destination
IP address: 10.1.1.1
R1
Based on
destination
IP address
R2
Most of
10.0.0.0/8 except
for
10.1.0.0/16
R4
10.1.0.0/16
IP route lookup:
Longest match routing
R3
Packet: Destination
IP address: 10.1.1.1
R1
Based on
destination
IP address
R2
Most of 10.0.0.0/8
except for
10.1.0.0/16
R4
10.1.0.0/16
IP route lookup:
Longest match routing
R3
Packet: Destination
IP address: 10.1.1.1
R1
Based on
destination
IP address
R2
Most of
10.0.0.0/8 except
for
10.1.0.0/16
R4
10.1.0.0/16
IP route lookup:
Longest match routing
Static routes
Set up by administrator
Changes need to be
made by administrator
Only good for small
sites and star
topologies
Bad for every other
topology type
Dynamic routes
Provided by routing
protocols
Changes are made
automatically
Good for network
topologies which have
redundant links (most!)
Dynamic Routing
Routers compute routing tables
dynamically based on information provided
by other routers in the network
Routers communicate topology to each
other via different protocols
Routers then compute one or more next
hops for each destination trying to
calculate the most optimal path
Automatically repairs damage by choosing
an alternative route (if there is one)
BGP Part 2
Interior and Exterior Routing
Interior gateway
protocol (IGP)
Automatic neighbour
discovery
Under control of a
single organisation
Generally trust your IGP
routers
Routes go to all IGP
routers
Usually not filtered
Exterior gateway
protocol (EGP)
Specifically configured
peers
Connecting with outside
networks
Neighbours are not
trusted
Set administrative
boundaries
Filters based on policy
IGP
Interior Gateway Protocol
Within a network/autonomous system
Carries information about internal prefixes
Examples OSPF, ISIS, EIGRP, RIP
EGP
Exterior Gateway Protocol
Used to convey routing information
between networks/ASes
De-coupled from the IGP
Current EGP is BGP4
Hierarchy
Limit scope of failure
Scalability:
Not using static routes
ip route their_net their_gw
Does not scale
Millions of networks around the world
Scalability:
Not using IGP (OSPF/ISIS)
Described in RFC4271
BGP Part 3
BGP Building Blocks
Identified by AS number
Examples:
Autonomous System
Number (ASN)
Two ranges
Usage:
0-65535
(original 16-bit range)
65536-4294967295 (32-bit range - RFC4893)
0 and 65535
(reserved)
1-64495
(public Internet)
64496-64511
(documentation - RFC5398)
64512-65534
(private use only)
23456
(represent 32-bit range in 16-bit world)
65536-65551
(documentation - RFC5398)
65552-4294967295 (public Internet)
http://as4.cluepon.net
Autonomous System
Number (ASN)
580 have been assigned, but only 100 are visible on the
Internet (as of 2009) (early adopters)
See www.iana.org/assignments/as-numbers
Using AS numbers
AS 1
accept
announce
packet flow
Routing flow
announce
accept
AS2
ingress
packet flow
Egress Traffic
Packets exiting the network
Based on:
Ingress Traffic
Packets entering your network
Ingress traffic depends on:
Types of Routes
Static Routes
Connected Routes
Interior Routes
configured manually
Routes within an AS
learned via IGP (e.g. OSPF)
Exterior Routes
Routes exterior to AS
learned via EGP (e.g. BGP)
Hierarchy of Routing
Protocols
Other ISPs
BGP4
Other ISPs
at a Local
IXP
BGP4
Customers
Static routes
or BGP4
depending on
customer size
DMZ
Network
AS 101
D
AS
102
192.168.0.0/16 or 192.168.0.0/255.255.0.0
701 3561 1
BGP Part 4
Configuring BGP
Basic commands
Getting routes into BGP
Configuration commands
router bgp <AS-number>
no auto-summary
no synchronization
neighbor <ip address> remote-as <as-number>
Show commands
show ip bgp summary
show ip bgp neighbors
show ip bgp neighbor <ip address>
Router A:
Router B:
router bgp 70000
neighbor 1.1.1.2 remote-as 100
network command
redistribute static
network command
Configuration Example
router bgp 1
network 105.32.4.0 mask 255.255.254.0
ip route 105.32.4.0 255.255.254.0 serial 0
redistribute static
Configuration Example:
router bgp 1
redistribute static
ip route 105.32.4.0 255.255.254.0 serial0
redistribute static
Cant flap!
BGP Part 5
Introducing IPv6
RFC4760
RFC2545
RFC4760
RFC2545
BGP Considerations
Routing Information
Independent operation
C
B
AS1 AS2
TCP Interaction
Router ID
BGP Configuration
BGP Configuration
Two options for configuring BGP peering
Using link local addressing
As with IPv4
RECOMMENDED
Router A
AS 1
router bgp 1
no bgp default ipv4 unicast
neighbor 2001:db8:0:2::2 remote-as 2
!
address-family ipv6
neighbor 2001:db8:0:2::2 activate
network 2001:db8:2::/48
!
A
:1
2001:db8:0:2::/64
AS 2
:2
B
TH
IS
AS 1
fe0/0
D
O
O
T
AS 2
fe80::260:3eff:c043:1143
BGP Configuration
IPv4 and IPv6
Summary
We have learned: