Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

10 routing-bgp

1,550 views

Published on

Tenth lesson of the computer networking class

Published in: Engineering
  • Be the first to comment

10 routing-bgp

  1. 1. Week 10 Routing in IP networks Interdomain routing with BGP
  2. 2. Agenda • Routing in IP networks • IPv6 subnets • Routing organisation • RIP • OSPF • Interdomain routing
  3. 3. Neighbour discovery IPv6: 1080:0:0:0:8:A Eth : A 1080:0:0:0:8:A wants to send a packet to 1080:0:0:0:8:C 1 2 Neighbour solicitation: Addr Eth 1080:0:0:0:8:C ? sent to IPv6 multicast address 3 IPv6: 1080:0:0:0:8:E Eth : E Ipv6: 1080:0:0:0:8:C Eth : C Ipv6: 1080:0:0:0:8:C Eth : C IPv6: 1080:0:0:0:8:E Eth : E IPv6: 1080:0:0:0:8:A Eth : A Ipv6: 1080:0:0:0:8:C Neighbour advertisement: 1080:0:0:0:8:C is reachable via Ethernet Add : C Eth : C IPv6: 1080:0:0:0:8:E Eth : E IPv6: 1080:0:0:0:8:A Eth : A
  4. 4. ICMPv6 Neighbor Discovery • Neighbour solicitation Type : 135 Code:0 Checksum The IPv6 address for which the link-layer Reserved R : true if node is a router S : true if answers to a neighbour solicitation • Neighbour advertisement Target IPv6 Address (e.g. Ethernet) address is needed. May also contain an optional field with the link-layer (e.g. Ethernet) address of the sender. Type : 136 Code:0 Checksum R S O Reserved Target IPv6 Address Target link layer Address The IPv6 and link-layer addresses
  5. 5. Router advertisements Ver Tclass Flow Label 58 255 Payload Length Router IPv6 address (link local) FF02::1 (all nodes) Type:134 Code : 0 Checksum CurHLim Router lifetime Retrans Timer Maximum hop limit to avoid spoofed packets from outside LAN M O Res Reachable Time Options Value of hop limit to be used by hosts when sending IPv6 packets The lifetime associated with the default router in units of seconds. 0 is the router sending the advertisement is not a default router. The time, in milliseconds, that a node assumes a neighbour is reachable after having received a reachability confirmation. The time, in milliseconds, between retransmitted Neighbor Solicitation messages. MTU to be used on the LAN Prefixes to be used on the LAN
  6. 6. RA options • Format of the options • MTU option • Prefix option Type Length Options Options (cont.) Type : 5 Length:1 Reserved MTU Type : 3 Length:4 PreLen L A Res. Valid Lifetime Preferred Lifetime Reserved2 IPv6 prefix Number of bits in IPv6 prefix that identify subnet The validity period of the prefix in seconds The duration in seconds that addresses generated from the prefix via stateless address autoconfiguration remain preferred.
  7. 7. Autoconfiguration • What happens when an endsystem boots ? ICMPv6 : Neighbour Solicitation Sent to multicast address Is someone using IPv6 address : FE80::M64(800:200C:417A) ? • Use Link-local IPv6 address (FE80::/64) • Each host, has a link-local IPv6 address • But another node might have chosen the same address ! R Ethernet : 0800:200C:417A FE80::M64(800:200C:417A) Address is valid if nobody answers
  8. 8. Global IPv6 address • How to obtain the IPv6 prefix of the subnet ? • Wait for router advertisements • Solicit router advertisement R ICMPv6 : Router Solicitation IPv6 Src: FE80::M64(800:200C:417A) Ethernet : 0800:200C:417A IPv6 Dest: FF02::2 FE80::M64(800:200C:417A)
  9. 9. Global IPv6 address • IPv6 addresses are allocated for limited lifetime • This allows IPv6 to easily support renumbering R ICMPv6 : Router Advertisement IPv6 Src: FE80::M64(EthernetR) IPv6 Dest: FF02::1 IPv6 Prefix = 2001:6a8:1100::/48 Prefix lifetime Ethernet : 0800:200C:417A FE80::M64(800:200C:417A)
  10. 10. Privacy issues • Autoconfigured IPv6 addresses contain the MAC address of the hosts • How to maintain privacy with IPv6 ? • Use DHCPv6 and never reallocate the same IPv6 address • Allow hosts to use random host ids • algorithms have been implemented to generate such random host ids on nodes with and without stable storage
  11. 11. ICMP Redirect 2001:db8:1234:5678::1 R1 2001:db8:1234:5678::/64 2001:db8:1234:5678::AA 2001:db8:1234:5678::BB R2 2001:db8:2345::/48 2001:db8:1234:5678::2 ::/0
  12. 12. Agenda • IPv6 • Routing in IP networks • IPv6 subnets • RIP • OSPF
  13. 13. RIP • Distance vector • default period : 30 seconds (with jitter) • distance vector is multicasted in UDP message to all RIP routers in local subnets • Optional extension : • send distance vector after each change • but some links flaps... • send distance vector if routing table changed and did not send another vector within the last 5 seconds
  14. 14. RIP : message format • RIP messages are sent over UDP • port 520
  15. 15. RIP : Route Entries
  16. 16. Agenda • Routing in IP networks • IPv6 subnets • RIP • OSPF
  17. 17. OSPF • Standard link-state routing protocol for TCP/IP architecture • Builds upon link-state routing with some extensions • Hierarchical routing with areas • Designated routers on subnets • Equal Cost Multipath
  18. 18. OSPF • Operation • HELLO packets to discover neighbours • Update of routing tables • Link state packets • acknowledgements, sequence numbers, age • periodic transmission/ link changes • Database description • Link state Request • used when a router boots to request link state packets from neighbours
  19. 19. OSPF details R R R R 2001:db8:1::A/48 2001:db8:1::B/48 2001:db8:1::C/48 2001:db8:1::D/48 2001:db8:1::C/48 2001:db8:1::B/48 2001:db8:1::A/48 2001:db8:1::D/48
  20. 20. OSPF details (2) R R R R 2001:db8:1::A/48 2001:db8:1::B/48 2001:db8:1::C/48 2001:db8:1::D/48 2001:db8:1::C/48 2001:db8:1::B/48 2001:db8:1::A/48 LAN 2001:db8:1::D/48
  21. 21. OSPF in large networks • Divide network in areas • Backbone area : network backbone • all routers connected to two or more areas belong to the backbone area • All non-backbone areas must be attached to the backbone area • at least one router inside each area must be attached to the backbone • OSPF routing must allow any router to send packets to any other router
  22. 22. OSPF details (4) R1 R5 R7 R8 D E R9 R10 C D E R3 R4 RA RC RB Inside each non-backbone area l Routers exchange link state packets to distribute the topology of the area l Routers do not know the topology of other areas, but each router knows how to reach the backbone area Stub AREA 1 AREA 0 AREA 2 Inside backbone area l Routers exchange link state packets to distribute the topology of the backbone area l Each router knows how to reach the other areas and distance vectors are used to distribute inter-area routes
  23. 23. OSPF areas
  24. 24. Equal Cost Multipath • How to use all paths without hurting TCP performance R3 R7 R1 R2 R4 R5 R6 R8 R9 RD
  25. 25. Agenda • Routing in IP networks • Interdomain routing • Peering links • BGP basics
  26. 26. Interdomain routing • Goals • Allow to transmit IP packets along the best path towards their destination through several transit domains while taking into account their routing policies of each domain without knowing their detailed topology • From an interdomain viewpoint, best path often means cheapest path • Each domain is free to specify inside its routing policy the domains for which it agrees to provide a transit service and the method it uses to select the best path to reach each destination
  27. 27. Interdomain links • Private link • Usually a leased line between two routers belonging to the two connected domains R1 R2 DomainA DomainB
  28. 28. Interconnection exchanges • How to efficiently connect several domains together ? R1 R2 R3 R4 Physical link Interdomain link
  29. 29. An Internet exchange point
  30. 30. AMS-IX • Largest IX in the world
  31. 31. AMS-IX
  32. 32. Routing policies • A domain specifies its routing policy by defining on each BGP router two sets of filters for each peer • Import filter • Specifies which routes can be accepted by the router among all the received routes from a given peer • Export filter • Specifies which routes can be advertised by the router to a given peer
  33. 33. Routing policies with RPSL AS1 AS2 AS3 AS4 $ AS7 Customer-provider $ $ $ $ Shared-cost Import policy for AS4 Import: from AS3 accept AS3 import: from AS7 accept AS7 import: from AS1 accept ANY import: from AS2 accept ANY Export policy for AS4 export: to AS3 announce AS4 AS7 export: to AS7 announce ANY export: to AS1 announce AS4 AS7 export: to AS2 announce AS4 AS7 Import policy for AS7 Import: from AS4 accept ANY Export policy for AS4 export: to AS4 announce AS7
  34. 34. Agenda • Routing in IP networks • Interdomain routing • Peering links • BGP basics
  35. 35. Border Gateway Protocol • Path vector protocol • BGP router advertises its best route to each destination AS1 AS2 AS4 2001:db8:1/48 AS5 lprefix:2001:db8:1/48 lASPath: AS1 lprefix: 2001:db8:1/48 ASPath: ::AS2:AS4:AS1 lprefix: 2001:db8:1/48 lASPath: AS4:AS1 lprefix: 2001:db8:1/48 ASPath: AS1 • ... with incremental updates
  36. 36. BGP : Principles • BGP relies on the incremental exchange of path vectors BGP session established over TCP connection between peers Each peer sends all its active routes As long as the BGP session remains up Incrementally update BGP routing tables AS3 R1 R2 AS4 BGP session BGP Msgs
  37. 37. BGP basics (2) • 2 types of BGP messages • UPDATE (path vector) • advertises a route towards one prefix • Destination address/prefix • Interdomain path (AS-Path) • Nexthop • WITHDRAW • a previously announced route is not reachable anymore • Unreachable destination address/prefix
  38. 38. BGP router BGP Loc-RIB Peer[N] All BGP Msgs from Peer[N] BGP Msgs Peer[1] Import filter Attribute manipulation Peer[N] Peer[1] Export filter Attribute manipulation acceptable routes BGP Decision Process BGP Routing Information Base Contains all the acceptable routes learned from all Peers + internal routes l BGP decision process selects the best route towards each destination BGP Msgs from Peer[1] to Peer[N] BGP Msgs to Peer[1] Import filter(Peer[i]) Determines which BGM Msgs are acceptable from Peer[i] Export filter(Peer[i]) Determines which routes can be sent to Peer[i] One best route to each destination BGP Adj-RIB-In BGP Adj-RIB-Out
  39. 39. Example AS20 R2 AS30 AS10 UPDATE lprefix: 2001:db8:12/48, lNextHop:R1 lASPath: AS10 UPDATE lprefix: 2001:db8:12/48, lNextHop:R2 lASPath: AS20:AS10 R1 R3 2001:db8:12/48 BGP R4 AS40 BGP BGP UPDATE lprefix: 2001:db8:12/48, lNextHop:R1 lASPath: AS10 UPDATE lprefix: 2001:db8:12/48, lNextHop:R4 lASPath: AS40:AS10 l What happens if link AS10-AS20 goes down ?
  40. 40. How to prefer some routes over others ? RA RB R1 Backup: 2Mbps Primary: 34Mbps AS1 AS2
  41. 41. BGP router BGP RIB Peer[N] Peer[1] Import filter Attribute manipulation Peer[N] Peer[1] Export filter Attribute manipulation BGP Msgs from Peer[N] BGP Msgs from Peer[1] BGP Msgs to Peer[N] BGP Msgs All acceptable routes BGP Decision Process One best to Peer[1] route to each destination Import filter l Selection of acceptable routes l Addition of local-pref attribute inside received BGP Msg lNormal quality route : local-pref=100 lBetter than normal route :local-pref=200 lWorse than normal route :local-pref=50 Simplified BGP Decision Process l Select routes with highest local-pref l If there are several routes, choose routes with the shortest ASPath l If there are still several routes tie-breaking rule
  42. 42. How to prefer some routes over others • Limitations RA R1 R2 R3 RB Cheap Expensive AS1 AS2 AS3 AS4 R5 AS5
  43. 43. How to prefer routes ? RA RB R1 Backup: 2Mbps Primary: 34Mbps AS1 AS2 RPSL-like policy for AS1 aut-num: AS1 import: from AS2 RA at R1 set localpref=100; from AS2 RB at R1 set localpref=200; accept ANY export: to AS2 RA at R1 announce AS1 to AS2 RB at R1 announce AS1 RPSL-like policy for AS2 aut-num: AS2 import: from AS1 R1 at RA set localpref=100; from AS1 R1 at RB set localpref=200; accept AS1 export: to AS1 R1 at RA announce ANY to AS2 R1 at RB announce ANY
  44. 44. How to prefer routes ? RA R1 R2 R3 RB Cheap Expensive AS1 AS2 AS3 AS4 R5 AS5 RPSL policy for AS1 aut-num: AS1 import: from AS2 RA at R1 set localpref=100; from AS4 R2 at R1 set localpref=200; accept ANY export: to AS2 RA at R1 announce AS1 to AS4 R2 at R1 announce AS1 u AS1 will prefer to send over cheap link u But the flow of the packets destined to AS1 will depend on the routing policy of the other domains
  45. 45. local-pref and economical l In practicer, elolcaalti-oprnefsish oiftpens combined with filters to enforce economical relationships Prov1 Prov2 $ $ AS1 Peer1 Peer2 Peer3 Peer4 Cust1 Cust2 $ Customer-provider $ Shared-cost $ Local-pref values used by AS1 > 1000 for the routes received from a Customer 500 – 999 for the routes learned from a Peer < 500 for the routes learned from a Provider
  46. 46. local-pref • Which route will be used by AS1 to reach AS5 ? AS1 $ $ AS4 AS2 AS3 Shared-cost $ $ AS5 $ Customer-provider $ • and how will AS5 reach AS1 ? $ AS8 AS6 AS7 $ $ Internet paths are often asymmetrical
  47. 47. Internet 1990s • NSFNet • American backbone • no commercial traffic • Some regional networks • US regions, national networks in Europe • Universities/research labs • connected to regional networks or NSFNet
  48. 48. Internet early 2000s • Tier-1 ISPs • Dozen transit ISPs shared-cost • Tier-2 ISPs • Regional/ National ISPs • Tier-3 ISPs • Smaller ISPs, Entreprises, • shared-cost with other T3 ISPs
  49. 49. Today’s Internet • Hyper Giants • google, microsoft, yahoo, amazon, ... • google peers 70% ISPs • Tier-1 ISPs • Tier-2 ISPs • Tier-3 ISPs Craig Labovitz), Scott Iekel-Johnson, Danny McPher•son, JMon Oabenrhyeid ep, Faerneamr Jianhagniasn, at IXPs Internet Inter-Domain Traffic, SIGCOMM 2010

×