1 / 31

Network Layer Routing

Network Layer Routing. IS250 Spring 2010 chuang@ischool.berkeley.edu. Outline. Introduction Router operation Metric vs. policy based routing Metric-based routing Shortest path computation Distance vector and link-state algorithms and protocols Policy-based routing

joben
Télécharger la présentation

Network Layer Routing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Network LayerRouting IS250 Spring 2010 chuang@ischool.berkeley.edu

  2. Outline • Introduction • Router operation • Metric vs. policy based routing • Metric-based routing • Shortest path computation • Distance vector and link-state algorithms and protocols • Policy-based routing • Border Gateway Protocol (BGP) John Chuang

  3. Two Basic Functions in Packet Switching • Routing • Learn the best route to (or best next-hop for) any given destination • Exchange local link status or destination reachability information • Compute best path to destinations • Algorithms for computing shortest paths (e.g., Dijkstra’s) • Policies that reflect business agreements (use BGP) • Update the routing table • Packet forwarding • For each packet received on an incoming link, forward it to an outgoing link according to the routing table John Chuang

  4. Routing of Atoms John Chuang

  5. Routing of Bits Backbone MAN Ethernet Local loop Host A Host B 12.2.14.60 128.32.226.87 John Chuang

  6. Packet Switch (Router) • Special-purpose computer system • CPU • Memory • I/O interfaces • Software • Connects to • Other packet switches • End hosts • Store-and-forward paradigm • “Stores” packet in memory • Examines packet’s destination address • Looks up next-hop in routing table • “Forwards” packets toward destination (hop-by-hop) John Chuang

  7. Packet Switch in Action Incoming links Packet Outgoing links Data Plane Destination Address Outgoing Link w.x.y.z C Control Plane Routing table Control plane of a router communicates with its counterparts at other routers using routing protocols (e.g., RIP, OSPF, BGP) John Chuang

  8. What is the Best Route? • Route selection may be based on: • Latency/hop-count • Bandwidth capacity • Loss rate • Cost • Security requirements • Business relationships (e.g., transit or peering agreements) • … • Two flavors of routing: metric-based and policy-based John Chuang

  9. Metric-Based Routing and Policy-Based Routing • Both used in practice for routing on the Internet • Metric-based routing typically employed within a network domain • Policy-based routing typically employed across network domains • A network domain, also known as an autonomous system (AS), is a collection of IP networks and routers, usually under the control of a single administrative entity, that presents a common routing policy to the Internet • Examples: ISPs, corporations, universities John Chuang

  10. Outline • Introduction • Router operation • Metric vs. policy based routing • Metric-based routing • Shortest path computation • Distance vector and link-statealgorithms and protocols • Policy-based routing • Border Gateway Protocol (BGP) John Chuang

  11. Routing: A Graph Theoretic Perspective • Note that each node has different view of the network, and therefore different routing table John Chuang

  12. Shortest Path Computation • Algorithm from graph theory • Distributed computation (no central authority) • A switch • Must learn route to all destinations • While communicating only with directly connected neighbors • Example: John Chuang

  13. Shortest Path Algorithms • Distance vector • Switches exchange routing table info • Link state • Switches exchange link status info • Both used in practice • e.g., RIP (RFC 1058, 1388, 1723) is a distance vector routing protocol, OSPF (RFC 1131, 1247) is a link state routing protocol John Chuang

  14. Link-State Routing • Pair of switches periodically • Test link between them • Broadcast link status message to all switches in network • Switch • Receives link status messages • Computes new routes (using Dijkstra’s algorithm) John Chuang

  15. Dijkstra’s Algorithm • Shortest Path First (SPF) algorithm • Greedy algorithm • Input: graph with nodes and weighted edges • Output: shortest paths from source node i to every other node; cost of each path John Chuang

  16. Dijkstra’s Algorithm John Chuang Source: Doug Comer

  17. Algorithm Intuition • Start at source node • Move outward • At each step: • Find node u that • has not been considered before; and • is closest to source • Compute: • Distance from u to each neighbor v • If distance shorter, make path to v go through u John Chuang

  18. Dijkstra’s Algorithm Example Distance Predecessor John Chuang

  19. Node A’s Routing Table John Chuang

  20. Routing Dynamics • Dijkstra’s Algorithm has a run-time of O(|V|2+|E|), but the routers run the algorithm continuously to keep their routing tables updated • Link states constantly updated • New links can be added to network • Latency can change continuously • if link goes down, cost = infinity • Routing tables may have transient inconsistency • Link state messages take time to propagate across network • Routers not synchronized in running route computation algorithm • Transient routing loops or routing black-holes John Chuang

  21. Outline • Introduction • Router operation • Metric vs. policy based routing • Metric-based routing • Shortest path computation • Distance vector and link-state algorithms and protocols • Policy-based routing • Border Gateway Protocol (BGP) John Chuang

  22. Internet Routing Protocols • Interior Gateway Protocols (IGPs) • Intra-AS or intra-domain • Metric-based routing (e.g., hops, latency, cost) • AS free to choose IGP and metric • Examples: RIP, OSPF, IBGP • Exterior Gateway Protocols (EGPs) • Inter-AS or inter-domain • Policy-based routing • All AS’s have to use the same EGP (currently BGP v4) John Chuang

  23. Route Advertisement • Instead of computing shortest paths based on DV or LS information, inter-domain routing is based on advertisements of routes • Example: ISP1 sends route advertisement to ISP2 • ISP1 is willing to receive packets, destined to end-hosts within its domain, from ISP2 • ISP2 will enter this information into its routing table John Chuang

  24. transit AS 1 AS 3 AS 2 peering Network Interconnection • AS3 is a transit-provider of AS1: • For a payment, AS3 agrees to advertise route to AS1 to rest of Internet • AS2 and AS3 are peers: • Exchange route advertisements (without any payments) John Chuang

  25. Stub, Transit, and Multi-homed • Three different types of AS: • Stub AS • Transit AS • Multi-homed AS AS 3 AS 5 AS 4 AS 1 AS 2 John Chuang

  26. Border Gateway Protocol (BGP) • Version 4: RFC 1771 (March 1995) • Routing among Autonomous Systems • No routing metrics • Provisions for policies • Individual AS’s control advertisement of routes • Facilities for transit routing • transit vs. stub domains • Multi-homing • Reliable transport • Two BGP peers establish TCP session John Chuang

  27. BGP Attributes • Community attribute (no-advertise, no-export, internet) controls propagation of advertisement John Chuang

  28. Community Attribute No Advertise No Export Internet John Chuang

  29. BGP Attributes • Community attribute (no-export, no-advertise, internet) controls propagation of advertisement • Other attributes used for selecting best path among multiple paths to same destination: • Weight (local to a router) • Local preference (propagated throughout AS) • Multi-exit discriminator (suggestion to external AS) • Origin (IGP, EGP, Incomplete) • AS_Path (AS hop count, loop detection) • Next hop (IP Address) John Chuang

  30. BGP Path Selection • If the path specifies a next hop that is inaccessible, drop the update. • Prefer the path with the largest weight. • If the weights are same, prefer the path with largest local preference. • If the local preferences are same, prefer the path originated by BGP running on this router. • If no route was originated, prefer the route that with shortest AS_path. • If all paths have the same AS_path length, prefer the path with the lowest origin type (where IGP < EGP < incomplete). • If the origin codes are same, prefer the path with lowest MED attribute. • If the paths have same MED, prefer external over internal path. • If the paths are same, prefer path through the closest IGP neighbor. • Prefer path with lowest IP address, as specified by the BGP router ID. John Chuang

  31. Summary • Packet switching as key network layer responsibility • Packet switching = routing + packet forwarding • Internet uses combination of metric-based routing (intra-domain) and policy-based routing (inter-domain) • Metric-based routing: shortest path computation based on distance vector or link state algorithms • Policy-based routing: route advertisements John Chuang

More Related