1 / 114

Tema 2: Aspectos de encaminamiento

Tema 2: Aspectos de encaminamiento. Algoritmos básicos de encaminamiento Link state Distance Vector Encaminamiento en Internet RIP OSPF BGP Multi-Protocol Label Switching (MPLS). IP multicast. routing algorithm. local forwarding table. header value. output link. 0100 0101

sari
Download Presentation

Tema 2: Aspectos de encaminamiento

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. Tema 2: Aspectos de encaminamiento Algoritmos básicos de encaminamiento Link state Distance Vector Encaminamiento en Internet RIP OSPF BGP Multi-Protocol Label Switching (MPLS). IP multicast

  2. routing algorithm local forwarding table header value output link 0100 0101 0111 1001 3 2 2 1 value in arriving packet’s header 1 0111 Computer Networking: A Top Down Approach Featuring the Internet, 3rd edition. Jim Kurose, Keith RossAddison-Wesley, July 2004. 2 3 Interplay between routing, forwarding

  3. 5 3 5 2 2 1 3 1 2 1 x z w u y v Graph abstraction Graph: G = (N,E) N = set of routers = { u, v, w, x, y, z } E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) } Remark: Graph abstraction is useful in other network contexts Example: P2P, where N is set of peers and E is set of TCP connections

  4. 5 3 5 2 2 1 3 1 2 1 x z w u y v Graph abstraction: costs • c(x,x’) = cost of link (x,x’) • - e.g., c(w,z) = 5 • cost could always be 1, or • inversely related to bandwidth, • or inversely related to • congestion Cost of path (x1, x2, x3,…, xp) = c(x1,x2) + c(x2,x3) + … + c(xp-1,xp) Question: What’s the least-cost path between u and z ? Routing algorithm: algorithm that finds least-cost path

  5. Global or decentralized information? Global: all routers have complete topology, link cost info “link state” algorithms Decentralized: router knows physically-connected neighbors, link costs to neighbors iterative process of computation, exchange of info with neighbors “distance vector” algorithms Static or dynamic? Static: routes change slowly over time Dynamic: routes change more quickly periodic update in response to link cost changes Routing Algorithm classification

  6. net topology, link costs known to all nodes accomplished via “link state broadcast” all nodes have same info computes least cost paths from one node (‘source”) to all other nodes gives forwarding table for that node iterative: after k iterations, know least cost path to k destinations Notation: c(x,y): link cost from node x to y; = ∞ if not direct neighbors D(v): current value of cost of path from source to destination v p(v): predecessor node along path from source to v N': set of nodes whose least cost path definitively known A Link-State Routing Algorithm: Dijsktra’s Algorithm 1 Initialization: 2 N' = {u} 3 for all nodes v 4 if v adjacent to u 5 then D(v) = c(u,v) 6 else D(v) = ∞ 7 8 Loop 9 find w not in N' such that D(w) is a minimum 10 add w to N' 11 update D(v) for all v adjacent to w and not in N' : 12 D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N'

  7. Dijkstra’s algorithm example 5 3 B C 5 2 1 A F 2 3 1 2 D E 1 B C D E F

  8. Dijkstra’s algorithm example 5 3 B C 5 2 1 A F 2 3 1 2 D E 1 B C D E F

  9. Dijkstra’s algorithm example 5 3 B C 5 2 1 A F 2 3 1 2 D E 1 B C D E F

  10. Dijkstra’s algorithm example 5 3 B C 5 2 1 A F 2 3 1 2 D E 1 B C D E F

  11. Dijkstra’s algorithm example 5 3 B C 5 2 1 A F 2 3 1 2 D E 1 B C D E F

  12. Dijkstra’s algorithm example 5 3 B C 5 2 1 A F 2 3 1 2 D E 1 B C D E F

  13. C D A B E F destination link (A,B) B (A,D) D E (A,D) (A,D) C F (A,D) Dijkstra’s algorithm example Resulting shortest-path tree from A: Resulting forwarding table in A:

  14. Algorithm complexity: n nodes each iteration: need to check all nodes, w, not in N n(n+1)/2 comparisons: O(n2) more efficient implementations possible: O(nlogn) Oscillations possible: e.g., link cost = amount of carried traffic A A A A D D D D B B B B C C C C 1 1+e 2+e 0 2+e 0 2+e 0 0 0 1 1+e 0 0 1 1+e e 0 0 0 e 1 1+e 0 1 1 e … recompute … recompute routing … recompute initially Dijkstra’s algorithm, discussion

  15. v dx(y) = min {c(x,v) + dv(y) } Distance Vector Algorithm • Bellman-Ford Equation (dynamic programming) • Define: dx(y) := cost of least-cost path from x to y • Then • where min is taken over all neighbors v of x

  16. 5 3 5 2 2 1 3 1 2 1 x z w u y v Bellman-Ford example Clearly, dv(z) = 5, dx(z) = 3, dw(z) = 3 B-F equation says: du(z) = min { c(u,v) + dv(z), c(u,x) + dx(z), c(u,w) + dw(z) } = min {2 + 5, 1 + 3, 5 + 3} = 4 Node that achieves minimum is next hop in shortest path ➜ forwarding table

  17. Distance Vector Algorithm • Node x maintains the Distance vector: • Dx = [Dx(y): y є N ] • Where Dx(y) = estimate of least cost from x to y • Node x also maintains its neighbors’ distance vectors • For each neighbor v, x maintains Dv = [Dv(y): y є N ] • Node x knows the cost to each neighbor v: c(x,v)

  18. Distance vector algorithm Basic idea: • Each node periodically sends its own distance vector estimate to neighbors • When a node x receives new DV estimate from neighbor, it updates its own DV using B-F equation: • Under minor, natural conditions, the estimate Dx(y) converge to the actual least cost dx(y) Dx(y) ← minv{c(x,v) + Dv(y)} for each node y ∊ N

  19. Iterative, asynchronous: each local iteration caused by: local link cost change DV update message from neighbor Distributed: each node notifies neighbors only when its DV changes neighbors then notify their neighbors if necessary wait for (change in local link cost of msg from neighbor) recompute estimates if DV to any dest has changed, notify neighbors Distance Vector Algorithm Each node:

  20. cost to x y z x 0 2 7 y from ∞ ∞ ∞ z ∞ ∞ ∞ 2 1 7 z x y Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} = min{2+0 , 7+1} = 2 Dx(z) = min{c(x,y) + Dy(z), c(x,z) + Dz(z)} = min{2+1 , 7+0} = 3 node x table cost to cost to x y z x y z x 0 2 3 x 0 2 3 y from 2 0 1 y from 2 0 1 z 7 1 0 z 3 1 0 node y table cost to cost to cost to x y z x y z x y z x ∞ ∞ x 0 2 7 ∞ 2 0 1 x 0 2 3 y y from 2 0 1 y from from 2 0 1 z z ∞ ∞ ∞ 7 1 0 z 3 1 0 node z table cost to cost to cost to x y z x y z x y z x 0 2 7 x 0 2 3 x ∞ ∞ ∞ y y 2 0 1 from from y 2 0 1 from ∞ ∞ ∞ z z z 3 1 0 3 1 0 7 1 0 time

  21. Message complexity LS: with n nodes, E links, O(nE) msgs sent DV: exchange between neighbors only convergence time varies Speed of Convergence LS: O(n2) algorithm requires O(nE) msgs may have oscillations DV: convergence time varies may be routing loops count-to-infinity problem Robustness: what happens if router malfunctions? LS: node can advertise incorrect link cost each node computes only its own table DV: DV node can advertise incorrect path cost each node’s table used by others error propagate thru network Comparison of LS and DV algorithms

  22. Tema 2: Aspectos de encaminamiento Algoritmos básicos de encaminamiento Link state Distance Vector Encaminamiento en Internet RIP OSPF BGP Multi-Protocol Label Switching (MPLS). IP multicast

  23. Hierarchical Routing • Our routing study thus far - idealization • all routers identical • network “flat” • … not true in practice • scale: with 200 million destinations: • can’t store all dest’s in routing tables! • routing table exchange would swamp links! • administrative autonomy • internet = network of networks • each network admin may want to control routing in its own network

  24. Hierarchical Routing Gateway router • Direct link to router in another AS • aggregate routers into regions, “autonomous systems” (AS) • routers in same AS run same routing protocol • “intra-AS” routing protocol • routers in different AS can run different intra-AS routing protocol

  25. Forwarding table is configured by both intra- and inter-AS routing algorithm Intra-AS sets entries for internal dests Inter-AS & Intra-As sets entries for external dests 3a 3b 2a AS3 AS2 1a 2c AS1 2b 3c 1b 1d 1c Inter-AS Routing algorithm Intra-AS Routing algorithm Forwarding table Interconnected ASes

  26. Suppose router in AS1 receives datagram for which dest is outside of AS1 Router should forward packet towards one of the gateway routers, but which one? AS1 needs: to learn which dests are reachable through AS2 and which through AS3 to propagate this reachability info to all routers in AS1 Job of inter-AS routing! 3a 3b 2a AS3 AS2 1a AS1 2c 2b 3c 1b 1d 1c Inter-AS tasks

  27. Determine from forwarding table the interface I that leads to least-cost gateway. Enter (x,I) in forwarding table Use routing info from intra-AS protocol to determine costs of least-cost paths to each of the gateways Learn from inter-AS protocol that subnet x is reachable via multiple gateways Hot potato routing: Choose the gateway that has the smallest least cost Example: Choosing among multiple ASes • Now suppose AS1 learns from the inter-AS protocol that subnet x is reachable from AS3 and from AS2. • To configure forwarding table, router 1d must determine towards which gateway it should forward packets for dest x. • This is also the job on inter-AS routing protocol! • Hot potato routing: send packet towards closest of two routers.

  28. Intra-AS Routing • Also known as Interior Gateway Protocols (IGP) • Most common Intra-AS routing protocols: • RIP: Routing Information Protocol • OSPF: Open Shortest Path First • IGRP: Interior Gateway Routing Protocol (Cisco proprietary)

  29. u v destinationhops u 1 v 2 w 2 x 3 y 3 z 2 w x z y C A D B RIP ( Routing Information Protocol) • Distance vector algorithm • Included in BSD-UNIX Distribution in 1982 • Distance metric: # of hops (max = 15 hops) From router A to subsets:

  30. routed routed RIP advertisements • Distance vectors: exchanged among neighbors every 30 sec via Response Message (also called advertisement) • Each advertisement: list of up to 25 destination nets within AS • Table processing: • RIP routing tables managed by application-level process called route-d (daemon) • advertisements sent in UDP packets, periodically repeated Transprt (UDP) Transprt (UDP) network forwarding (IP) table network (IP) forwarding table link link physical physical

  31. RIP: Link Failure and Recovery • If no advertisement heard after 180 sec --> neighbor/link declared dead • routes via neighbor invalidated • new advertisements sent to neighbors • neighbors in turn send out new advertisements (if tables changed) • link failure info quickly propagates to entire net • poison reverse used to prevent ping-pong loops (infinite distance = 16 hops)

  32. OSPF (Open Shortest Path First) • “open”: publicly available • Uses Link State algorithm • LS packet dissemination • Topology map at each node • Route computation using Dijkstra’s algorithm • OSPF advertisement carries one entry per neighbor router • Advertisements disseminated to entire AS (via flooding) • Carried in OSPF messages directly over IP (rather than TCP or UDP

  33. OSPF “advanced” features (not in RIP) • Security: all OSPF messages authenticated (to prevent malicious intrusion) • Multiple same-cost paths allowed (only one path in RIP) • For each link, multiple cost metrics for different TOS (e.g., satellite link cost set “low” for best effort; high for real time) • Integrated uni- and multicast support: • Multicast OSPF (MOSPF) uses same topology data base as OSPF • Hierarchical OSPF in large domains.

  34. Hierarchical OSPF • Two-level hierarchy: local area, backbone. • Link-state advertisements only in area • each nodes has detailed area topology; only know direction (shortest path) to nets in other areas. • Area border routers: “summarize” distances to nets in own area, advertise to other Area Border routers. • Backbone routers: run OSPF routing limited to backbone. • Boundary routers: connect to other AS’s.

  35. Internet inter-AS routing: BGP • BGP (Border Gateway Protocol):the de facto standard • BGP provides each AS a means to: • Obtain subnet reachability information from neighboring ASs. • Propagate the reachability information to all routers internal to the AS. • Determine “good” routes to subnets based on reachability information and policy. • Allows a subnet to advertise its existence to rest of the Internet: “I am here”

  36. 3a 3b 2a AS3 AS2 1a 2c AS1 2b eBGP session 3c 1b 1d 1c iBGP session BGP basics • Pairs of routers (BGP peers) exchange routing info over semi-permanent TCP connections: BGP sessions • Note that BGP sessions do not correspond to physical links. • When AS2 advertises a prefix to AS1, AS2 is promising it will forward any datagrams destined to that prefix towards the prefix. • AS2 can aggregate prefixes in its advertisement

  37. BGP route selection • Router may learn about more than 1 route to some prefix. Router must select route. • Elimination rules: • Local preference value attribute: policy decision • Shortest AS-PATH • Closest NEXT-HOP router: hot potato routing • Additional criteria

  38. Why different Intra- and Inter-AS routing ? • Policy: • Inter-AS: admin wants control over how its traffic routed, who routes through its net. • Intra-AS: single admin, so no policy decisions needed • Scale: • hierarchical routing saves table size, reduced update traffic • Performance: • Intra-AS: can focus on performance • Inter-AS: policy may dominate over performance

  39. Tema 2: Aspectos de encaminamiento Algoritmos básicos de encaminamiento Link state Distance Vector Encaminamiento en Internet RIP OSPF BGP Multi-Protocol Label Switching (MPLS). IP multicast

  40. MPLS - The Motivation • IP Protocol Suite - the most predominant networking technology. • Voice & Data convergence on a single network infrastructure. • Continual increase in number of users. • Demand for higher connection speeds. • Increase in traffic volumes. • Ever-increasing number of ISP networks. • MPLS Working Groups and Standards • Standardized by the IETF - currently in Draft stage. • MPLS recommendations are done by IP players for IP services • MPLS core components are generic • MPLS doesn’t use specific technology process

  41. Applications 7to5 IP 3 PPP Frame Relay ATM (*) Physical (Optical - Electrical) 1 MPLS and ISO model IETF main goal is that when a layer is added, no modification is needed on the existing layers. All new protocol must be backward compatible TCP UDP 4 MPLS PPP Frame Relay ATM (*) 2 (*) ATM overlay model (without addressing and P-NNI) is considered as an ISO layer 2 protocol.

  42. Some MPLS Terms... • LER - Label Edge Router • LSR - Label Switch Router • FEC - Forward Equivalence Class • Label - Associates a packet to a FEC • Label Stack - Multiple labels containing information on how a packet is forwarded. • Shim - Header containing a Label Stack • Label Switch Path - path that a packet follows for a specific FEC • LDP - Label Distribution Protocol, used to distribute Label information between MPLS-aware network devices • Label Swapping - manipulation of labels to forward packets towards the destination.

  43. Routing protocol OSPF OSPF OSPF Forward Equivalence Class FEC table Local table Local table Local table Attributes Precedence Label table Local table Local table Local table Layer 2 Layer 2 Layer 2 Layer 2 Layer 2 Label Switch Layer 1 Layer 1 Layer 1 Layer 1 Layer 1 Ingress Node Core Node Egress Node MPLS Architecture LSP (Label-Switched Paths) Classification Label assignment Label swapping Label removal

  44. Label Switch Path OSPF / RIP / IS-IS FEC FEC FEC Precedence Label table Label table Label table Layer 2 Layer 2 Layer 2 Layer 2 Layer 2 Layer 1 Layer 1 Layer 1 Layer 1 Layer 1 Ingress Node Core Node Egress Node MPLS process Label removal Label removal Label swapping Label swapping Classification Label assignment Classification Label assignment

  45. MPLS Cloud LER: Label Edge Router L3 Routing LER LER L3 Routing L3 Routing LSR LSR LER Label Swapping Label Swapping LER L3 Routing L3 Routing IP Packet IP Packet w/ Label LSR: Label Switch(ing) Router

  46. Ingress Label FEC Egress Label 6 138.120.6/24 - xxxx 9 Ingress Label FEC Attribute Egress Label Ingress Label FEC Attribute Egress Label • FECs are manually initiated by the operator 6 138.120.6/24 - xxxx A 9 • A FEC is associated to at least one Label 6 138.120.6/24 - xxxx B 12 FEC Classification • A packet can be mapped to a particular FEC based on the following criteria: • destination IP address, • source IP address, • TCP/UDP port, • in case of inter AS-MPLS, Source-AS and Dest-AS, • class of service, • application used, • … • any combination of the previous criteria.

  47. L2 Type Port Ingress Label FEC L2 Type Egress Label Port ATM 1-1 12 (i.e. 4/65) F1 22 (i.e. 5/65) 3-4 ATM ATM 1-1 15 (i.e. 0/25) F4 9 (i.e. 101) 5-1 FR Gig Eth 5-1 7 F1 22 (i.e. 4/65) 3-4 ATM What is a Label? • A label is a short, fixed length, locally significant identifier used to identify a FEC. • The label can be identified by the L2 technology identifier (e.g. VPI/VCI for ATM, DLCI for FR or MPLS label for PPP/Ethernet). • MPLS Label Assignment Schemes • Topology Driven • Label assignment in response to routing protocols (OSPF and BGP) updates • Control Driven • Label assignment in response to RSVP, CR-LDP requests • Traffic Driven • Label assignment in response to flow detection & triggering

  48. Label(20 bits) Exp(3 bits) S (1 bit) TTL (8bits) The MPLS Shim Header • The Label (Shim Header) is represented as a sequence of Label Stack Entry • Each Label Stack Entry is coded by 4 bytes (32 bits) as described • 20 Bits is reserved for the Label Identifier (also named Label) • Based on the contents of the label a swap, push (impose) or pop (dispose) operation can be performed on the packet's label stack Label : Label value (0 to 15 are reserved for special use) Exp : Experimental Use S : Bottom of Stack (set to 1 for the last entry in the label) TTL : Time To Live

  49. Ingress Interface Ingress Label Egress Label FEC Egress Interface Ingress Interface Ingress Label Egress Label 12 FEC Egress Interface 5 12 1 4 138.120 x 1 3 138.120 Label Switched Path MPLS switch 3 1 138.120 4 1 2 3 MPLS switch 3 127.20 1 2 3 MPLS switch 192.168 1 2 2 MPLS switch Ingress Interface Ingress Label Egress Label FEC Egress Interface 5 1 x 3 138.120

  50. Ingress Interface Ingress Label Egress Label FEC Egress Interface Ingress Interface Ingress Label Egress Label FEC Egress Interface 1 Default 4 None x 1 Default 3 Default None ?? ?? MPLS switch ?? ?? 3 1 138.120 4 1 2 MPLS switch 3 127.20 1 2 3 3 MPLS switch 192.168 138.120.6.12 138.120.6.12 138.120.6.12 138.120.6.12 138.120.6.12 138.120.6.12 138.120.6.12 138.120.6.12 138.120.6.12 138.120.6.12 138.120.6.12 ?? 2 1 2 MPLS switch Ingress Interface Ingress Label Egress Label FEC Egress Interface Default 1 x 3 None Hop by Hop IP forwarding

More Related