Lehrstuhl für Netzarchitekturen und Netzdienste Institut für Informatik Technische Universität München ilab Lab 3 Dynamic Routing
Static Routing TCP/ IP ISO/ OSI Concepts, Hardware, Software Minicom Application Application Presentation Session Transport Transport Ciscorouter , IPv4, ICMP, ARP Network Network Datalink Host-to-Net Physical 1. Setup - static routing 2. The routing table 3. The default gateway 4. Packet forwarding 5. Further configuring of the Cisco router 6. Checking if everything is set up correctly 7. Watching the packets travel 8. One more interesting experiment... 9. Suggestions/ complaints 10. Please remove the Cables ilab: Dynamic Routing 2
Dynamic Routing TCP/ IP ISO/ OSI Concepts, Hardware, Software Zebra Application Application Presentation Session Transport Transport RIP, OSPF, BGP Network Network Datalink Host-to-Net Cisco Serial Link Physical 1. Setup - Dynamic routing 2. RIP (Cisco/ Linux) 2.4. What did RIP do? 2.5. Changing the setup a little... 2.6. Configuring the serial link 2.7. RIP done. 3. OSPF (without/ with areas) 3.3. Distance values 3.6. Compare: OSPF with and without areas 3.7. Ad-/ Disadvantages of OSPF area routing 3.8. Inspecting OSPF packets 4. BGP 4.1. Autonomous systems ilab: Dynamic Routing 3
Routing – Problem definition 5 Given : Graph 3 B C Main problem : 5 2 How to determine the shortest A 2 F 1 path tree in order to forward packets 3 1 2 to their destination D E 1 Subproblems : 1. Information gathering - which information do we need 2. Path calculation 3. Forwarding – how does a node decide? • Based on its routing table Routing algorithms solve subproblems 1 and 2 ilab: Dynamic Routing 4
Distance Vector Routing 5 B costs 2 A costs 1 C costs 4 Approach 3 B costs 2 B C D costs 1 C costs 3 5 E costs 2 2 Information gathering E costs 1 F costs 4 F costs 3 A Neighboring nodes share their 2 F 1 3 routing information (destination, costs) 1 2 D Path calculation E ? 1 Distance table is updates if routing information has changed • e.g. costs have changed Outcome Update routing table if the best (least expensive) entry in distance table has changed Properties distributed – each nodes only shared information with its neighbor Iterative - algorithm terminates after all information has been exchanged ilab: Dynamic Routing 5
Distance Table Costs to destination via X = Distance from X to Y via Z D (Y,Z) E Z D () A B D c(X,Z) + min {D (Y,w)} = A 1 15 5 1 C B 7 B 7 8 5 A 8 2 C 6 9 4 1 D E D 4 11 2 2 Example E D c(E,D) + min {D (C,w)} = 2+2 = 4 D (C,D) = w Distance table contains unwanted routes E A Loop! c(E,A) + min {D (C,w)} = 1+5 = 6 D (C,A) = w Loops result in endlessly circulating packets (until the TTL field expires) ilab: Dynamic Routing 6
Distance table -> Routing table costs via E Exit link, D () A B D costs A 1 15 5 A A,1 B 7 8 5 B D,5 C 6 9 4 C D,4 D 4 11 2 D D,2 Routing table Distance table of E of E ilab: Dynamic Routing 7
Changes of the topology and of costs Rule: good news travels fast bad news travels slowly - “count to infinity” problem! etc. 60 Y 4 1 X Z 50 ilab: Dynamic Routing 8
Split Horizon with poison reverse, path vector Split-Horizon Update messages of node A to D do not contain routes to nodes, which A would route via D Poison Reverse Cost entry for such nodes is set to infinity Eliminates short loops 5 3 B C B costs 2 5 C costs ∞ 2 D costs ∞ A F 2 1 E costs ∞ 3 F costs ∞ 1 2 D E 1 Path vector routing Similar to distance vector protocol In order to avoid the count to infinity problem, nodes also include path information in their update messages ilab: Dynamic Routing 9
Link-State Routing 5 Flooding 3 B C Approach 5 2 Information gathering A 2 F 1 Nodes are aware of the network 3 topology due to the broadcasting of 1 2 D link properties E 1 Path calculation Each node calculates its own shortest Shortest path tree (itself being the root of the B C Path tree) 2 tree Algorithm used: A 1 F Dijkstra or Bellman-Ford 1 Derive routing table from shortest 2 D E path tree 1 Result: Routing table to via B B C-F D ilab: Dynamic Routing 10
Algorithm of Dijkstra Notation: INPUT 1. c(i,j): costs from node I to node j Q : set of all nodes 2. a : node d(v): distance from root a to v in the shortest 3. OUTPUT path tree 4. d : distance for each node p(v): Vorgänger von v im Kürzesten-Wege- 5. p : predecessor of each node in shortest-path tree Baum 6. BEGIN 7. FOR all nodes v DO d[v]=inf; ENDFOR 5 8. d[a]=0; 9. p[a]=null; 3 10. B C N={a}; // MinHeap regarding d[] 5 11. 2 WHILE N.notEmpty() DO 12. A 2 F v = N.popMinimum(); 1 13. 3 FOR all nodes u adjacent to v DO 14. 1 IF d[u] > d[v]+c(v,u) THEN 2 15. D E d[u] = d[v]+c(v,u); 1 16. p[u] = v; 17. N.addOrUpdate(u); 18. ENDIF 19. ENDFOR 20. ENDWHILE 21. END 22. Complexity: O(n 2 ), n being the number of nodes ilab: Dynamic Routing 11
Erstellen der Routing-Tabelle Erstellen der Routing-Tabelle aus dem Kürzeste-Wege-Baum 5 3 B C Nächster Hop Ziel 5 2 A F 2 1 B B 3 1 D CDEF 2 D E 1 Wünschenswert ist es, nicht jedes Ziel einzeln eintragen zu müssen, sondern Bereiche zusammenfassen zu können. siehe hierarchische Struktur der IP-Adressen ilab: Dynamic Routing 12
Forward-Search Algorithm In practice, nodes use a forward search alogorithm based on the original algorithm of Dijkstra All nodes flood the network with their Link State Packets (LSP) Nodes maintain a tentative and a confirmed list and calculate the routing table directly after receiving the LSPs 3 B C 2 A 4 8 1 D ilab: Dynamic Routing 13
Example for node D B C Step confirmed tentativ Notes 2 3 1 (D,0,-) Read LSP of D A 4 8 2 (D,0,-) (A,1,A) populate tentative list 1 (B,4,B) D (C,8,C) 3 (D,0,-) (B,4,B) Add the least expensive entry to the (A,1,A) (C,8,C) confirmed list (here A) 4 (D,0,-) (B,3,A) Read its LSP and update the entries (A,1,A) (C,8,C) (here: path to B) 5 (D,0,-) (C,8,C) Add the least expensive entry to the (A,1,A) confirmed list (B,3,A) (D,0,-) (C,6,A) 6 Read its LSP and update the entries (A,1,A) (here: route to C) (B,3,A) 7 (D,0,-) Add the least expensive entry to the (A,1,A) confirmed list (B,3,A) (C,6,A) ilab: Dynamic Routing 14
Routing in the internet ilab: Dynamic Routing 15
Internet: autonomous systems Inter-AS- connection AS A AS B AS X AS C Stub-AS Multihomed Autonomous AS AS X System X Border Router AS D AS Z Transittraffic ilab: Dynamic Routing 16
Dynamic routing in the internet Routing in the internet Interior Gateway Protocols (IGP) Exterior Gateway Protocols (EGP) • Routing Information Protocol (RIP) • Exterior Gateway Protocol (EGP) - outdated • Open Shortest Path First (OSPF) • Border Gateway Protocol (BGP) Autonomous System (AS): Networks under one administrative organization Interior Gateway (IG): Internal routers of an AS Exterior Gateway (EG): Border routers AS AS IG IG Core Network IG EG EG IG IG ilab: Dynamic Routing 17
Routing hierarchy – protocols Intra-Domain-Routing: OSPF (Open Shortest Path First) • IAB recommended protocol • „Link State“ protocol RIP (Routing Information Protocol) – for small networks • Less robust (routing loops) • Slower reaction on link changes • Distance vector protocol IGRP: Interior Gateway Routing Protocol (Cisco propr.) Inter-Domain-Routing: BGP (Border Gateway Protocol) • Path vector protocol • BGP Version 4 (BGP4) also supports Classless Inter-Domain Routing (CIDR) ilab: Dynamic Routing 18
RIP ( Routing Information Protocol) Distance-Vektor-Verfahren since 1982 in BSD-UNIX Metric: # of Hops (max = 15 Hops) Distance vectors: updates/advertisements are sent every 30s via UDP Each advertisement contains routes to max. 25 destination networks Link declared unreachable after 180s without an update Routes via this neighbor are considered invalid New advertisements have to be sent to all neighboring nodes Sende neue Advertisements zu den Nachbarn Neighbors also send new advertisements on changes Poison-Reverse to avoid loops (infinity = 16 hops) ilab: Dynamic Routing 19
OSPF (Open Shortest Path First) Link-State-Verfahren OSPF-Advertisement beinhaltet einen Eintrag pro Nachbarrouter Advertisements werden an ganzes AS geflutet Sicherheit: alle OSPF-Messages authentisiert, über TCP-Verbindung unterstützt Multiple-same-cost-Pfade Für jeden Link, multiple Kostenmetriken abhängig vom TOS (Linkkosten zum Beispiel abhängig davon, ob Best-Effort oder Realtime-Verkehr) Integrierte Unterstützung von Uni- und Multicast: Multicast OSPF (MOSPF) basiert auf gleicher Topologie-Datenbank wie OSPF Hierarchisches OSPF für große AS. ilab: Dynamic Routing 20
Hierarchical OSPF ilab: Dynamic Routing 21
Inter-AS-Routing ilab: Dynamic Routing 22
Recommend
More recommend