network layer - bgp
DESCRIPTION
Network Layer - BGP. CSC/ECE 573, Sections 001, 002 Fall, 2010. Acknowledgement: Material from various sources used, notably Timothy Griffin (AT&T), Battista et al (Roma Tre U). Autonomous Systems. - PowerPoint PPT PresentationTRANSCRIPT
Network Layer - BGPNetwork Layer - BGP
CSC/ECE 573, Sections 001, 002
Fall, 2010
Acknowledgement: Material from various sources used, notably Timothy Griffin (AT&T), Battista et al (Roma Tre U)
2
Autonomous SystemsAutonomous Systems An autonomous system (AS) is a region of the Internet that is
administered by a single entity and that has a unified routing policy Each autonomous system is assigned an Autonomous System
Number (ASN).NCSU’s campus network (AS11442) BellSouth Business Systems (AS5002)…
AS numbers between 1 and 65,535 (two bytes)– Numbers greater than 64,511 are “private”
AS numbers may be requested:– Global asn – from your regional internet registry (rir): ripe, arin, apnic– Private asn – from your upstream ISP
3
Interdomain and Intradomain Interdomain and Intradomain RoutingRouting
Routing protocols for intradomain routing are called interior gateway protocols (IGP)
– Objective: shortest path Routing protocols for interdomain routing are called exterior gateway protocols
(EGP)– Objective: satisfy policy of the AS
AS 6 AS 7
AS 4
AS 2 AS 5
AS 1
AS 3
4
Interdomain Routing Interdomain Routing
Interdomain routing is based on connectivity between autonomous systems
Interdomain routing can ignore many details of router interconnection
AS 1 AS 2
AS 3
5
Multiple Routing Protocols Multiple Routing Protocols Multiple routing protocols can
run on the same router Each routing protocol updates
the routing table
routingtable
IP Forwarding
routing tablelookup
incoming IP datagrams
outgoing IP datagrams
routing protocol
routing protocol
RIP Process
OSPFProcess
BGP Process
routing table updates
6
Autonomous Systems TerminologyAutonomous Systems Terminology local traffic = traffic with source or
destination in AS transit traffic = traffic that passes through
the AS Stub AS = has connection to only
one AS, only carry local traffic Multihomed AS = has connection to >1 AS,
but does not carry transit traffic Transit AS = has connection to >1 AS
and carries transit traffic
7
Stub and Transit Networks Stub and Transit Networks
AS 1, AS 2, and AS 5 are stub networks
AS 2 is a multi-homed stub network
AS 3 and AS 4 are transit networks
AS 3
AS 1
AS 4
AS 2
AS 5
8
Selective TransitSelective Transit
Example: Transit AS 3 carries traffic
between AS 1 and AS 4 and between AS 2 and AS 4
But AS 3 does not carry traffic between AS 1 and AS 2
The example shows a routing policy.
AS 2AS 1
AS 3
AS 4
9
Customer/ProviderCustomer/Provider
A stub network typically obtains access to the Internet through a transit network.
Transit network that is a provider may be a customer for another network
Customer pays provider for service
AS 5
AS 2
Customer/Provider
AS 6
Customer/Provider
AS 6
Customer/Provider
AS 4
Customer/Provider
AS 6
Customer/Provider
10
Customer/Provider and Peers Customer/Provider and Peers
Transit networks can have a peer relationship Peers provide transit between their respective customers Peers do not provide transit between peers Peers normally do not pay each other for service
AS 3
AS 5
AS 2Peers
Customer/Provider
AS 6
Customer/Provider
AS 1Peers
AS 6
Customer/Provider
AS 4
Customer/Provider
AS 6
Customer/Provider
11
Shortcuts through peering Shortcuts through peering
Note that peering reduces upstream traffic Delays can be reduced through peering But: Peering may not generate revenue
AS 3
AS 5
AS 2Peers
Customer/Provider
AS 6
Customer/Provider
AS 1Peers
AS 6
Customer/Provider
AS 4
Customer/Provider
AS 6
Customer/Provider
Peers
12
Border Gateway Protocol (BGP)Border Gateway Protocol (BGP) Border Gateway Protocol is the interdomain
routing protocol for the Internet for routing between autonomous systems
Currently in version 4 (1995)– Network administrators can specify routing policies– BGP is a distance vector protocol (However, routing
messages in BGP contain complete routes)
Uses TCP to transmit routing messages
13
Border Gateway Protocol (BGP)Border Gateway Protocol (BGP) An autonomous system uses BGP to advertise
its network address(es) to other AS’s
BGP helps an autonomous system with the following:
1. Collect information about reachable networks from neighboring AS’s
2. Disseminate the information about reachable networks to routers inside the AS and to neighboring AS’s
3. Picks routes if there are multiple routes available
Who uses BGPWho uses BGP BGP is used by:
– Customers connected to an Internet Service Provider (ISP)
– Customers connected to several ISPs– Transit providers– ISPs that exchange traffic in an exchange point
(NAP)– Customers with very large networks
Two kinds of BGPTwo kinds of BGP
When several organizations join to form the Internet they have to set up links between them
e-BGP: perform interdomain communication i-BGP: allow BGP speakers of same AS to communicate to each
other (full mesh) (not IGP, uses IGP)
16
BGP interactions BGP interactions Router establishes a TCP
connection (TCP port 175) Routers exchange BGP routes
– Offer connectivity – promise to deliver to destination
Periodically send updates BGP is executed between two
routers– BGP session– BGP peers or BGP
speakers Note: Not all autonomous
systems need to run BGP. On many stub networks, the route to the provider can be statically configured
AS 1
AS 2
BGP Session
17
BGP interactions BGP interactions
AS 2
AS 1
AS 3
The networks that are advertised are network IP addresses with a prefix, E.g., 128.100.0.0/16
Prefixes reachable from AS 1
Prefixes reachablefrom AS 3
18
BGP interactions BGP interactions BGP peers advertise
reachability of IP networks
A advertises a path to a network (e.g., 10.0.0.0/8) to B only if it is willing to forward traffic going to that network
Path-Vector:– A advertises the complete
path to the advertised network
– Path is sent as a list of AS’s
this avoids loops
A
B
Advertisepath to 10.0.0.0/24
10.0.0.0/24
BGP Peer
BGP Peer
19
iBGP sessionsiBGP sessions All iBGP peers in the same
autonomous system are fully meshed
Peer announces routes received via eBGP to iBGP peers
But: iBGP peers do not announce routes received via iBGP to other iBGP peers
Update from eBGP session
AS A
20
Hot Potato RoutingHot Potato Routing Router R3 in autonomous
system A receives two advertisements to network X
– Which route should it pick?
Hot Potato Rule: Select the iBGP peer that has the shortest IGP route
Analogy: Get the packet out of one’s own AS as quickly as possible, i.e., on the shortest path
Route to X
AS A
R1
Route to X
R2
Route to X Route
to X
R3
21
Hot Potato RoutingHot Potato RoutingFinding the cheapest IGP
route: Compare the cost of the two
paths– R3 R1 – R3 R2
according to the IGP protocol
Here: R1 has the shortest path
Add a routing table entry for destination X
Route to X
AS A
R1
Route to X
R2
Cost=6
R3
Cost=23
22
Hot Potato Routing can backfire!Hot Potato Routing can backfire! AS1 would serve its customer (source) better by
not picking the shortest route to AS 2 In fact, customer may have paid for a high-
bandwidth service!
AS 2
AS 1
Low bandwidth network
Cost=20
Destination
Source
Cost=5
High bandwidth network
23
BGP Message TypesBGP Message Types Open: Establishes a peering session
Keep Alive: Handshake at regular intervals
to maintain peering session
Notification: Closes a peering session
Update: Advertises new routes or
withdraws previously announced routes. Each
announced route is specified as a network
prefix with attribute values
24
Content of AdvertisementsContent of Advertisements
BGP routers advertise routes
Each route consists of a network prefix and a list of attributes that specify information about a route
Network Layer Reachability Information (NLRI)
Mandatory attributes:
ORIGIN
AS_PATH
NEXT_HOP Many other attributes
25
ORIGIN attributeORIGIN attribute Originating domain sends a route with ORIGIN attribute
ORIGIN attributes also specifies if the origin is internal to the AS or not
AS 1
AS 2 AS 4
AS 5
AS 3
10.0.1.0/8, ORIGIN {1}
10.0.1.0/8, ORIGIN {1}
10.0.1.0/8, ORIGIN {1}
10.0.1.0/8, ORIGIN {1}
10.0.1.0/8, ORIGIN {1}
26
AS-PATH attributesAS-PATH attributes Each AS that propagates a route prepends its own AS number
– AS-PATH collects a path to reach the network prefix Path information prevents routing loops from occurring Path information also provides information on the length of a path (By
default, a shorter route is preferred) Note: BGP aggregates routes according to CIDR rules
AS 1
AS 2 AS 4
AS 5
AS 3
10.0.1.0/8, AS-PATH {2,1}
10.0.1.0/8, AS-PATH {3,1}
10.0.1.0/8, AS-PATH {4,2,1}
10.0.1.0/8, AS-PATH {1}
10.0.1.0/8, AS-PATH {1}
27
NEXT-HOP attributesNEXT-HOP attributes Each router that sends a route advertisement it includes its own IP
address in a NEXT-HOP attribute The attribute provides information for the routing table of the receiving
router.
AS 5 AS 1
AS 3
128.100.11.1 128.143.71.21
10.0.1.0/8, NEXT-HOP {128.100.11.1}
10.0.1.0/8, NEXT-HOP {128.143.71.21}
28
Connecting NEXT-HOP with IGP Connecting NEXT-HOP with IGP informationinformation
AS 1
AS 3
128.100.11.1/24 192.0.1.2
eBGP
iBGP
R1IGP router
10.1.1.0/8, NEXT-HOP {128.100.11.1}
10.1.1.0/8, NEXT-HOP {128.100.11.1}
Dest. Next hop128.100.11.0/24 192.0.1.2
At R1:
Dest. Next hop10.1.1.0/8 128.100.11.1
Routing table
BGP info
Dest. Next hop128.100.11.0/24 192.0.1.2
10.1.1.0/8 192.0.1.2
Routing table
29
Route SelectionRoute Selection Router may get more than one route to an address Rules for selecting a route (in order of priorities):
– Preferences can be advertised as an attribute– Shorter routes are preferred– Close next-hop is preferred
Internal data structures maintained– Local Routing Information Base– Adjacent Routing Information Base – In and Out
Multiple conditions for a route to go into Loc-RIB– Next-hop must be reachable– Only one route to each destination goes into Adj-RIB-In– If preferable over existing, goes into Loc-RIB– External route trumps all i-BGP learned routes– Contributes to main FIB
30
Importing and Exporting RoutesImporting and Exporting Routes
An AS may not advertise all routes, or accept all routes that are advertised
Route policies determines which routes are filtered
BGP does not carry policies - carries information that allows local rules to make policy-based inferences
AS A desires some of exported routes to be advertised everywhere, some only in N America
ISP announces convention (outside BGP) that a BGP community identifier will be used for all advertisements meant to be global, and a different one for N America only
A attaches appropriate community attribute tags to exported routes
No enforcement or check is possible
Control Inbound
traffic
AS A
Change export rules
Change import rules
Control Outbound
traffic
31
Importing and Exporting RoutesImporting and Exporting Routes
Import and export rules allow control of traffic carried by AS
If an AS wants to have less inbound traffic it should adapt its export rules
If an AS wants to control its inbound traffic, it adapts its import rules
Control Inbound
traffic
AS A
Change export rules
Change import rules
Control Outbound
traffic
32
Routing PoliciesRouting Policies
Since AS 5 is a stub network it should not advertise routes to networks other than networks in AS 5
When AS 3 learns about the path {AS1, AS4}, it should not advertise the route {AS3, AS1, AS4} to AS 2.
AS 1
AS 3
AS 5
AS 2
Peers
Customer/Provider
Peers
Customer/Provider
AS 4
AS 6
Peers
Customer/Provider
33
Traffic Often Follows ASPATHTraffic Often Follows ASPATH In many cases, packets
are routed according to the AS-PATH
However, in some cases this is not true
(Here: AS 2 filters routes with a long prefix)
AS 2 AS 5AS 3AS 1128.100.0.0/16
128.100.0.0/16, AS-PATH {3,2,1}
AS 2 AS 5AS 3AS 1128.100.0.0/16
128.100.0.0/16, AS-PATH {3,2,1}
AS 4
128.100.22.0/24, AS-PATH {4}
128.100.22.0/24
128.100.0.0/16, AS-PATH {1}
128.100.0.0/16, AS-PATH {2, 1}
Does not advertise /24 networks
34
Short AS-PATH does not mean that route is shortShort AS-PATH does not mean that route is short
From AS 6’s perspective – Path {AS2, AS1} is short– Path {AS5, AS4, AS3,
AS1} is long
But the number of traversed routers is larger when using the shorter AS-PATH
AS 1
AS 3
AS 4
AS 5
AS 2
AS 6
35
BGP Table GrowthBGP Table Growth
BGP Table Growth - 2BGP Table Growth - 2
37
More DetailsMore Details Many other mechanisms
– Minimizing full mesh– Introduce route reflectors– Confederations
Issues with degrees of freedom– Multi-homed AS with multiple connections for stub sharing may routed
packets externally
ConclusionConclusion BGP Issues
– BGP is a simple protocol but it is very difficult to configure – BGP has severe stability issue due to policies BGP is known to not
converge– As of July 2010, 35,000+ AS numbers (of available 64,510) are
consumed– Better understood in detail, but global implications not always obvious– Many quirks remains in practice– http://www.computerworld.com/s/article/9182558/Research_experiment
_disrupts_Internet_for_some
http://www.cisco.com/en/US/products/products_security_advisory09186a0080b4411f.shtml
– Active area for innovation