An overview of how packets are routed in the Internet 1
Dijkstra s shortest path first algorithm (example of a Link State Algorithm ) 1. Exchange link state: A router floods to every other router the state of links connected to it. - Periodically - When link state changes 2. Run Dijkstra s algorithm: Each router independently runs Dijkstra s shortest path first algorithm. CS144, Stanford University Each router finds min-cost spanning tree to every other router. 2
An example: From R 8 R 1 1 4 4 R 2 R 4 R 6 4 R 3 5 4 1 1 2 R 5 6 R 7 1 R 8 2 CS144, Stanford University 3
An example: From R 8 R 1 1 4 4 R 2 R 4 R 6 4 R 3 5 4 1 1 2 R 5 6 R 7 1 R 8 2 Add path of cost 1 Add path of cost 2 Add path of cost 2 R 6 R 4 R 6 R 7 R 8 R 7 R 8 R 7 R 8.. 4
An example: From R 8 R 1 1 4 4 R 2 R 4 R 6 4 R 3 5 4 1 1 2 R 5 6 R 7 1 R 8 2 Add path of cost 4 Add path of cost 4 R 4 R 6 R 4 R 6 R 5 R 7 R 8 R 3 R 7 R 8 R 5 5
An example: From R 8 R 1 1 4 4 R 2 R 4 R 6 4 R 3 5 4 1 1 2 R 5 6 R 7 1 R 8 2 Add path of cost 5 Add path of cost 6 R 2 R 2 R 4 R 6 R 1 R 4 R 6 R 5 R 7 R 8 R 5 R 7 R 8 R 3 R 3 6
The algorithm R 1 1 4 4 R 2 R 4 R 6 4 R 3 5 4 1 1 2 R 5 6 R 7 1 R 8 2 0 1 2 3 4 5 6 7 Shortest Path Set Candidate Set R 8 R 3 R 5 R 6 R 7 Add R 7 CS144, Stanford University 7
The algorithm R 1 1 4 4 R 2 R 4 R 6 4 R 3 5 4 1 1 2 R 5 6 R 7 1 R 8 2 Shortest Path Set Candidate Set 0 1 2 3 4 5 6 7 R 8 R 8 R 7 R 8 R 7 R 6 R 8 R 7 R 6 R 4 R 8 R 7 R 6 R 4 R 3 R 8 R 7 R 6 R 4 R 3 R 2 R 8 R 7 R 6 R 4 R 3 R 2 R 1 R 8 R 7 R 6 R 4 R 3 R 2 R 1 R 5 R 3 R 5 R 3 R 5 R 3 R 5 R 3 R 5 R 5 R 2 R 5 R 1 R 5 Empty R 6 R 7 R 6 R 4 R 4 R 2 R 1 Add R 7 R 6 R 4 R 3 R 2 R 1 R 5 Done CS144, Stanford University 8
Dijkstra s Algorithm Questions: 1. How long does the algorithm take to run? 2. What happens when link costs change, or when routers/links fail? CS144, Stanford University 9
Dijkstra s algorithm in practice Dijkstra s algorithm is an example of a Link State algorithm. - Link state is known by every router. - Each router finds the shortest path spanning tree to every other router. It is the basis of OSPF (Open Shortest Path First), a very widely used routing protocol. CS144, Stanford University 10
Another view of Dijkstra CS144, Stanford University 11
3 A 4 R 1 4 R 4 2 4 R 2 R 3 R 5 3 4 B 2 CS144, Stanford University Thanks to Prof Jean Walrand, Berkeley 12
A R 1 R 4 R 2 R 3 R 5 B CS144, Stanford University 13
A R 1 3 4 4 4 R 2 R 3 2 R 4 R 5 3 4 2 CS144, Stanford University B 14
Routing between Autonomous Systems The Border Gateway Protocol (BGP) CS144, Stanford University 15
All organizations must use the same algorithm to talk to each other AT&T Superonline Stanford University Boğaziçi Üniversitesi 16
17
Border Gateway Protocol (BGP) Basics BGP is not a link-state or distance-vector routing protocol. - Instead, BGP uses what is called a Path vector BGP neighbors ( peers ) establish a TCP connection BGP routers advertise complete paths (a list of AS s). - Also called AS_PATH (this is the path vector) - Example of path advertisement: The network 171.64/16 can be reached via the path {AS1, AS5, AS13} When a link/router fails, the path is withdrawn. 18
Border Gateway Protocol (BGP) Basics The network 171.64/16 can be reached via the path {AS1, AS5, AS13} Paths with loops are detected locally and ignored. Local policies pick the preferred path among all advertised paths. 19
Current Version BGP Version 4 or BGP-4 Described in RFC 4271 (2006) Used by the Internet since 1994 Used to connect all Border Gateways in the Internet Used internally in some very large private networks 20
Customers and Providers provider provider customer IP traffic customer Customer pays provider to carry its packets. 21
Customer-Provider Hierarchy provider customer IP traffic 22
The Peering Relationship peer provider traffic allowed peer customer traffic NOT allowed Peers provide transit between their respective customers Peers do not provide transit between peers Peers (typically) do not exchange $$$ So how does traffic from the left side reach the right side? 23
Tier 1 Providers A tier 1 network is a transit-free network that peers with every other tier 1 network Tier 1 Tier 1 Tier 1 Tier 1 Examples: AT&T, CenturyLink, Level 3, Deutsche Telekom, Tata, Verizon, CS144, Stanford University 24
Tier 1 Tier 1 Tier 1 peer provider traffic allowed peer customer traffic NOT allowed Peers provide transit between their respective customers Peers do not provide transit between peers Peers (often) do not exchange $$$ 25
BGP Messages Open : Establish a BGP session. Keep Alive : Handshake at regular intervals. Notification : Shuts down a peering session. Update : Announcing new routes or withdrawing previously announced routes. BGP announcement = prefix + path attributes Path attributes Include: next hop, AS Path, local preference, Multi-exit discriminator, Used to select among multiple options for paths. 26
BGP Route Selection Summary Highest Local Preference Enforce relationships E.g. prefer customer routes over peer routes Shortest ASPATH Lowest MED i-bgp < e-bgp Lowest IGP cost to BGP egress Lowest router ID Traffic Engineering Throw up hands and break ties 27
ASPATH Attribute AS 1129 AS 1755 AS 1239 AS 12654 AS 7018 AS 6341 135.207.0.0/16 AS 3549 Prefix Originated 28
ASPATH Attribute 135.207.0.0/16 AS Path = 1755 1239 7018 6341 AS 1129 135.207.0.0/16 AS Path = 1239 7018 6341 AS 1755 135.207.0.0/16 AS Path = 1129 1755 1239 7018 6341 AS 1239 135.207.0.0/16 AS Path = 7018 6341 Pick shorter AS path AS 12654 135.207.0.0/16 AS Path = 6341 AS 6341 135.207.0.0/16 AS 7018 135.207.0.0/16 AS Path = 7018 6341 135.207.0.0/16 AS Path = 3549 7018 6341 AS 3549 Prefix Originated 29
So Many Choices peer provider peer customer AS 4 Frank s Internet Barn AS 3 AS 2 Which route should Frank pick to 13.13.0.0./16? AS 1 13.13.0.0/16 30
Summary of BGP All AS s in the Internet must connect using BGP-4. BGP-4 is a path vector algorithm, allowing loops to be detected easily. BGP-4 has a rich and complex interface to let AS s choose a local, private policy. Each AS decides a local policy for traffic engineering, security and any private preferences. CS144, Stanford University 32
Multicast routing in the Internet 33
Multicast A B C D R 1 R 2 R 4 R 6 R 5 R 7 R 3 R 8 E X 34
Multicast A B C D R 1 R 2 R 4 R 6 R 5 R 7 R 3 R 8 E X 35
Multicast Techniques and Principles - Reverse Path Broadcast (RPB) and Pruning - One versus multiple trees Practice - IGMP group management - DVMRP the first multicast routing protocol - PIM protocol independent multicast CS144, Stanford University 36
Reverse Path Broadcast (RPB) aka Reverse Path Forwarding (RPF) A B C D R 1 R 2 R 4 R 6 R 5 R 7 R 3 R 8 E X CS144, Stanford University 37
RPB + Pruning 1. Packets delivered loop-free to every end host. 2. Routers with no interested hosts send prune messages towards source. 3. Resulting tree is the minimum cost spanning tree from source to the set of interested hosts. CS144, Stanford University 38
One tree versus several trees? A B C D R 1 R 2 R 4 R 6 R 5 R 7 R 3 R 8 E X 39
Addresses and joining a group IPv4: Class D addresses are set aside for multicast. IGMP (Internet group management protocol) - Between host and directly attached router. - Hosts ask to receive packets belonging to a particular multicast group. - Routers periodically poll hosts to ask which groups they want. - If no reply, membership times out (soft-state). CS144, Stanford University 40
Multicast in practice Multicast used less than originally expected - Most communication is individualized (e.g. time shifting) - Early implementations were inefficient - Today, used for some IP TV and fast dissemination - Some application-layer multicast routing used Some interesting questions - How to make multicast reliable? - How to implement flow-control? - How to support different rates for different end users? - How to secure a multicast conversation? 41