
Routing & Forwarding: Routing: Network Layer Part II Logical View of a Router • Routing Algorithms: 5 – Link state vs. Distance Vector B 3 C • Routing in the Internet 2 5 A 2 – Intra-AS vs. Inter-AS routing 3 1 F 1 2 – Intra-AS: RIP and OSPF D E 1 – Inter-AS: BGP and Policy Routing •MPLS Readings: Textbook: Chapter 4: Sections 4.2-4.3, 4.5-4.6 Csci 232 – Computer Networks Routing and Network Layer Part II 1 Csci 232 – Computer Networks Routing and Network Layer Part II 2 IP Forwarding Process IP Forwarding Table 1. Remove a packet 2. Check for sanity, 4. Place packet on from an input decrement TTL correct output queue field queue Destination Next Hop Interface Net A Router 1 INT 7 Net B Direct INT 4 Forwarding Process NCH3Net C, Host 3 R2Router 2 INT 3 Net C Router 1 INT 7 3. Match packet’s If queues If queues destination to get full, just get full, just a table entry drop packets! drop packets! A destination is usually The next hop is either a a network. May also be directly connected network A physical interface IP Forwarding Table a host, or a “gateway or a router on a directly of last resort” (default) Router connected network Csci 232 – Computer Networks 3 Csci 232 – Computer Networks 4 How Are Forwarding Tables Populated to Implement Routing? Dynamic Routing: Intra- vs. Inter-AS Statically Dynamically Administrator Routers exchange network reachability OSPF manually configures information using ROUTING PROTOCOLS. forwarding table entries Routers use this to compute best routes + Can rapidly adapt to changes BGP + More control AS 1 itktlin network topology + Not restricted to IGP = Interior Gateway Protocol + Can be made to scale well destination-based - Complex distributed algorithms forwarding Metric based: OSPF, IS-IS, RIP, - Consume CPU, Bandwidth, Memory - Doesn’t scale EIGRP (cisco) EIGRP - Debugging can be difficult - Slow to adapt to - Current protocols are destination-based EGP = Exterior Gateway Protocol AS 2 network failures Policy based: BGP In practice : a mix of these. Static routing mostly at the “edge” The Routing Domain of BGP is the entire Internet Csci 232 – Computer Networks 5 Csci 232 – Computer Networks Routing and Network Layer Part II 6 1 Internet AS Hierarchy Intra-AS vs. Inter-AS Routing border (exterior gateway) routers Inter-AS C.b routing between B.a A.a A and B Host b A.c c h2 a a C b a B Host d Intra-AS routing h1 c A b within AS B Intra-AS routing within AS A interior routers Csci 232 – Computer Networks Routing and Network Layer Part II 7 Csci 232 – Computer Networks Routing and Network Layer Part II 8 Intra-AS and Inter-AS Routing Where Does Forwarding Table Come From? C.b RIP Process BGP Process B.a “Gateways”: •perform inter- A.a RIP Routing tables BGP Routing tables AS routing b c a A.c a amongst C b BGP a B themselves OSPF Process •perform intra- d c A b AS routing with OSPF Routing tables other routers in their AS network layer inter-AS, intra-AS link layer RIP routing in Domain OSPF Forwarding Table Manager gateway A.c physical layer Domain Forwarding Table Csci 232 – Computer Networks Routing and Network Layer Part II 9 Csci 232 – Computer Networks 10 Routing Basic Routing Problem • Goal: determine a “good” path through • Assume the network from source to destination – A network with N nodes, where each – Good means usually the shortest path edge is associated a cost –A node knows only its neighbors and the • Network modeled as a graph 5 cost to reach them –Routers nodes 3 • How does each node learn how B C –Link edges 2 5 5 • Edge cost: delay, congestion level,… to reach every other node A 2 1 F 3 3 B C along the shortest path? 5 1 2 2 D E 1 A 2 1 F 3 1 2 D E 1 Csci 232 – Computer Networks Routing and Network Layer Part II 11 Csci 232 – Computer Networks Routing and Network Layer Part II 12 2 Routing: Issues Routing Paradigms •Hop-by-hop Routing • How are routing tables determined? – Each packet contains destination address • Who determines table entries? – Each router chooses next-hop to destination • routing decision made at each (intermediate) hop! • What info is used in determining table • packets to same destination may take different paths! entries? – Example: IP’s default datagram routing •Source Routing • When do routing table entries change? – Sender selects the path to destination precisely • Where is routing info stored? – Routers forward packet to next-hop as specified • Problem: if specified path no longer valid due to link failure! • How to control routing table size? –Example: • IP’s loose/strict source route option Answer these questions, we are done! • virtual circuit setup phase in ATM (or MPLS) Csci 232 – Computer Networks Routing and Network Layer Part II 13 Csci 232 – Computer Networks Routing and Network Layer Part II 14 Routing Algorithms/Protocols Centralized vs. Distributed Routing Algorithms Issues Need to Be Addressed: • Route selection may depend on different criteria Centralized: – Performance: choose route with the smallest delay • A centralized route server collects routing information and – Policy: choose a route that doesn’t cross .gov network network topology, makes route selection decisions, then distributes them to routers • Adapt to changes in network topology or condition Distributed: – Self-healing: little or no human intervention •Routers cooperate using a distributed protocol • Scalability –to create mutually consistent routing tables – Must be able to support a large number of hosts, routers •Two standard distributed routing algorithms – Link State (LS) routing – Distance Vector (DV) routing Csci 232 – Computer Networks Routing and Network Layer Part II 15 Csci 232 – Computer Networks Routing and Network Layer Part II 16 Link State vs Distance Vector Link State Algorithm • Both assume that • Basic idea: Distribute link state packet to – The address of each neighbor is known –The cost of reaching each neighbor is known all routers •Both find global information – Topology of the network • Cost of each link in the network – By exchanging routing info among neighbors • Each router independently computes • Differ in the information exchanged and optimal paths route computation – From itself to every destination – LS: tells every other node its distances to neighbors – Routes are guaranteed to be loop free if – DV: tells neighbors its distance to every other node • Each router sees the same cost for each link • Uses the same algorithm to compute the best path Csci 232 – Computer Networks Routing and Network Layer Part II 17 Csci 232 – Computer Networks Routing and Network Layer Part II 18 3 Link State: Control Traffic Link State: Node State • Each node floods its local information to every other node in the network C C • Each node ends up knowing the entire network A A D Host C C D topology use Dijkstra to compute the shortest A D path to every other node Host A Host D B B E E Host C B E Host A Host D N2 N1 C A D N1 N2 N3 C A D B N3 E C N5 A D N5 B C E A D Host B B Host B N4 Host E N4 Host E B E N6 N7 N6 N7 Csci 232 – Computer Networks Routing and Network Layer Part II 19 Csci 232 – Computer Networks Routing and Network Layer Part II 20 Topology Dissemination Topology Database: Example • Each router creates a set of link state 5 packets (LSPs) 3 – Describing its links to neighbors B C 5 – LSP contains 2 • Router id, neighbor’s id, and cost to its neighbor A 2 1 F 3 • Copies of LSPs are distributed to all 1 2 routers D E 1 –Using controlled flooding • Each router maintains a topology database link state database – Database containing all LSPs Csci 232 – Computer Networks Routing and Network Layer Part II 21 Csci 232 – Computer Networks Routing and Network Layer Part II 22 Constructing Routing Table: Algorithm (at Node X) Dijkstra’s Algorithm • Given the network topology • Initialization – How to compute the shortest path to each destination? –N = {X} • Some notation – For all nodes V • If V adjacent to X, D(V) = C(X,V) else D(V) = – X: source node – N: set of nodes to which shortest paths are known so far • Loop • N is initially empty –Find U not in N such that D(U) is the smallest – D(V): the cost of the known shortest path from source X – Add U into set N to V – Update D(V) for all V not in N – C(U,V): cost of link U to V •D(V) = min{D(V), D(U) + C(U,V)} • C(U,V) = if not neighbors – Until all nodes in N Csci 232 – Computer Networks Routing and Network Layer Part II 23 Csci 232 – Computer Networks Routing and Network Layer Part II 24 4 Example: Dijkstra’s Algorithm Example: Dijkstra’s Algorithm Step start N D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) D(F),p(F) Step start N D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) D(F),p(F) 0 A 2,A 5,A 1,A 0 A 2,A 5,A 1,A 1 1 AD 4,D 2,D 2 2 3 3 4 4 5 5 … 5 1 Initialization: 5 2 N = {A}; 8 Loop 9 find w not in N s.t. D(w) is a minimum; B 3 C 3 for all nodes v B 3 C 2 5 2 5 10 add w to N; 4 if v adjacent to A 11 update D(v) for all v adjacent A 2 1 F A 2 1 F 3 5 then D(v) = c(A,v); 3 to w and not in N: 1 2 6 else D(v) = ; 1 2 12 D(v) = min( D(v), D(w) + c(w,v) ); D E D E 1 … 1 13 until all nodes in N; Csci 232 – Computer Networks Routing and Network Layer Part II 25 Csci 232 – Computer Networks Routing and Network Layer Part II 26 Example: Dijkstra’s Algorithm Example: Dijkstra’s Algorithm Step start N D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) D(F),p(F) Step start N D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) D(F),p(F) 0 A 2,A 5,A 1,A 0 A 2,A 5,A 1,A 1 AD 4,D 2,D 1 AD 4,D 2,D 2 ADE 3,E 4,E 2 ADE 3,E 4,E 3 3 ADEB 4 4 5 5 … … 5 8 Loop 5 8 Loop 9 find w not in N s.t.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages16 Page
-
File Size-