Download presentation
Presentation is loading. Please wait.
1
Dan LI CS Department, Tsinghua University
Intra-domain routing Dan LI CS Department, Tsinghua University Today we’ll talk about routing. 2018/11/12
2
Today’s Lecture Routing Model Intra-domain Routing 2018/11/12
3
Notion of an Internet Protocol
How is it possible to send bits across incompatible LANs and WANs? Solution: protocol software running on each host and router smooths out differences between different networks Implements an internet protocol (i.e., set of rules) that governs how hosts and routers should cooperate when they transfer data from network to network TCP/IP is protocol (family) for global IP Internet
4
What Does an Internet Protocol Do?
Provides naming scheme Defines uniform format for host addresses Each host (and router) is assigned at least one internet address that uniquely identifies it Provides delivery mechanism An internet protocol defines a standard transfer unit (packet) Packet consists of header and payload Header: contains info such as packet size, source and destination addresses Payload: contains data bits sent from source host Encapsulation - key to network messages
5
Transferring Data via Internet
Host A Host B client server (1) (8) data data protocol software protocol software internet packet (2) (7) data PH data PH LAN1 adapter LAN2 adapter Frame Router (3) (6) data PH FH1 data PH FH2 LAN1 adapter LAN2 adapter LAN1 LAN2 LAN2 frame (4) data PH FH1 (5) data PH FH2 protocol software
6
But… How do routers know where to forward frames?
How do routers learn when the network topology changes? That’s what routing protocol does…
7
Routing Goal: determine “good” path (sequence of routers) through network from source to destination “good path” Typically means minimum cost path Other definitions also possible 2018/11/12
8
Dynamic Routing IP traffic can be very bursty
Dynamic adjustments in routing typically operate more slowly than fluctuations in traffic load Dynamically adapting routing to account for traffic load can lead to wild, unstable oscillations of routing system Usually, IP routing protocols do not dynamically route around network congestion. 2018/11/12
9
Graph Model Represent each router as node
Direct link between routers represented by edge Symmetric links undirected graph Edge “cost” c(x,y) denotes measure of difficulty of using link delay, $ cost, or congestion level Task Determine least cost path from every node to every other node Path cost d(x,y) = sum of link costs 2018/11/12
10
A Simple Model (Cont.) E C 3 1 F 1 2 6 1 D 3 A 4 B 2018/11/12
11
Routes from Node A Properties Some set of shortest paths forms tree
Table for A Dest Cost Next Hop A B 4 C 6 E D 7 2 F 5 E C 3 1 F 1 2 6 1 D 3 A 4 B Properties Some set of shortest paths forms tree Shortest path spanning tree for each node Solution not unique E.g., A-E-F-C-D also has cost 7 2018/11/12
12
Ways to Compute Shortest Paths
Centralized Collect graph structure in one place Use standard graph algorithm Disseminate routing tables Partially Distributed Every node collects complete graph structure Each computes shortest paths from it Each generates own routing table “Link-state” algorithm 2018/11/12
13
Ways to Compute Shortest Paths (Cont.)
Fully Distributed No one has copy of graph Nodes construct their own tables iteratively Each sends information about its table to neighbors “Distance-Vector” algorithm 2018/11/12
14
Internet Routing Internet organized as a two level hierarchy
First level – autonomous systems (AS’s) AS – region of network under a single administrative domain AS’s run an intra-domain routing protocols Distance Vector, e.g., Routing Information Protocol (RIP) Link State, e.g., Open Shortest Path First (OSPF) Between AS’s runs inter-domain routing protocols, e.g., Border Gateway Routing (BGP) De facto standard today, BGP-4 2018/11/12
15
Example Interior router BGP router AS-1 AS-3 AS-2 2018/11/12
16
Today’s Lecture Routing Model IntraDomain Routing 2018/11/12
17
Intra-domain Routing Protocols
Based on unreliable datagram delivery Distance vector Routing Information Protocol (RIP), based on Bellman-Ford Every node advertises its cost towards all the other nodes in the network to its neighbors Link state Open Shortest Path First (OSPF), based on Dijkstra Every node advertises its cost towards its neighbors in the network to all the other nodes 2018/11/12
18
Distance Vector: Control Traffic
When the routing table of a node changes, the node sends its table to its neighbors A node updates its table with information received from its neighbors Host A Host B Host E Host D Host C N1 N2 N3 N4 N5 N7 N6 2018/11/12
19
Distance-Vector Method
Initial Table for A Dest Cost Next Hop A B 4 C – D E 2 F 6 E C 3 1 F 1 2 6 1 D 3 A 4 B Idea At any time, have cost/next hop of best known path to destination Use cost when no path known Initially Only have entries for directly connected nodes 2018/11/12
20
Distance-Vector Update
z d(z,y) c(x,z) y x d(x,y) Update(x,y,z) d c(x,z) + d(z,y) # Cost of path from x to y with first hop z if d < d(x,y) # Found better path return d,z # Updated cost / next hop else return d(x,y), nexthop(x,y) # Existing cost / next hop 2018/11/12
21
Algorithm Bellman-Ford algorithm Repeat Until Converge
For every node x For every neighbor z For every destination y d(x,y) Update(x,y,z) Until Converge 2018/11/12
22
Start Optimum 1-hop paths E C F D A B Table for A Dst Cst Hop A B 4 C
B 4 C – D E 2 F 6 Table for B Dst Cst Hop A 4 B C – D 3 E F 1 E C 3 1 F 1 2 6 1 D 3 A 4 B Table for C Dst Cst Hop A – B C D 1 E F Table for D Dst Cst Hop A – B 3 C 1 D E F Table for E Dst Cst Hop A 2 B – C D E F 3 Table for F Dst Cst Hop A 6 B 1 C D – E 3 F 2018/11/12
23
Iteration #1 Optimum 2-hop paths E C F D A B Table for A Dst Cst Hop A
B 4 C 7 F D E 2 5 Table for B Dst Cst Hop A 4 B C 2 F D 3 E 1 E C 3 1 F 1 2 6 1 D 3 A 4 B Table for C Dst Cst Hop A 7 F B 2 C D 1 E 4 Table for D Dst Cst Hop A 7 B 3 C 1 D E – F 2 Table for E Dst Cst Hop A 2 B 4 F C D – E 3 Table for F Dst Cst Hop A 5 B 1 C D 2 E 3 F 2018/11/12
24
Iteration #2 Optimum 3-hop paths E C F D A B Table for A Dst Cst Hop A
B 4 C 6 E D 7 2 F 5 Table for B Dst Cst Hop A 4 B C 2 F D 3 E 1 E C 3 1 F 1 2 6 1 D 3 A 4 B Table for C Dst Cst Hop A 6 F B 2 C D 1 E 4 Table for D Dst Cst Hop A 7 B 3 C 1 D E 5 F 2 Table for E Dst Cst Hop A 2 B 4 F C D 5 E 3 Table for F Dst Cst Hop A 5 B 1 C D 2 E 3 F 2018/11/12
25
Link Cost Changes Link cost changes:
Node detects local link cost change Updates distance table If cost change in least cost path, notify neighbors A C 1 4 50 B Node B D C N A 4 1 B D C N A 1 B D C N A 1 B D C N A 1 B “good news travels fast” Node C D C N A 5 B 1 D C N A 5 B 1 D C N A 2 B 1 D C N A 2 B 1 time Link cost changes here Algorithm terminates 2018/11/12
26
Count to Infinity Problem
A C 1 4 50 B 60 Node B D C N A 4 1 B D C N A 6 1 B D C N A 6 1 B D C N A 8 1 B “bad news travels slowly” Node C D C N A 5 B 1 D C N A 5 B 1 D C N A 7 B 1 D C N A 7 B 1 … time Link cost changes here 2018/11/12
27
Poisoned Reverse If C routes through B to get to A:
C tells B its (C’s) distance to A is infinite (so B won’t route to A via C) Will this completely solve count to infinity problem? A C 1 4 50 B 60 Node B D C N A 4 1 B D C N A 60 1 B D C N A 60 1 B D C N A 51 1 B D C N A 51 1 B Node C D C N A 5 B 1 D C N A 5 B 1 D C N A 50 B 1 D C N A 50 B 1 D C N A 50 B 1 time Link cost changes here; B updates D(B, A) = 60 as C has advertised D(C, A) = ∞ Algorithm terminates 2018/11/12
28
Poison Reverse Failures
Table for A Dst Cst Hop C 7 F Table for B Dst Cst Hop C 8 A Table for D Dst Cst Hop C 9 B Table for F Dst Cst Hop C 1 F C 6 1 B D A 4 Table for A Dst Cst Hop C – Table for F Dst Cst Hop C – Forced Update Forced Update Table for A Dst Cst Hop C 13 D Better Route Table for B Dst Cst Hop C 14 A The poison reverse sometimes fail, here we will show an example. The cost of the link F-C is 1, but the link goes down and the cost becomes infinity. With poison reverse, A and F change the cost to C to be infinity. But A find B also has a path to D with cost 9, and D doesn’t route to C via A, but B. So A consider it find a better router, and change the cost to be 13, it doesn’t know that the path from D to C also pass F-C. So the process will count to infinity. A possible solution is to make “infinity” smaller, but what is upper bound on maximum path length? Should it be larger or smaller, this is a problem. Forced Update Iterations don’t converge “Count to infinity” Solution Make “infinity” smaller What is upper bound on maximum path length? Table for D Dst Cst Hop C 15 B Forced Update Table for A Dst Cst Hop C 19 D • Forced Update 2018/11/12
29
Routing Information Protocol (RIP)
Earliest IP routing protocol (1982 BSD) Current standard is version 2 (RFC 1723) Features Every link has cost 1 “Infinity” = 16 Limits to networks where everything reachable within 15 hops Sending Updates Every router listens for updates on UDP port 520 RIP message can contain entries for up to 25 table entries 2018/11/12
30
RIP Updates Initial Periodic Triggered
When router first starts, asks for copy of table for every neighbor Uses it to iteratively generate own table Periodic Every 30 seconds, router sends copy of its table to each neighbor Neighbors use to iteratively update their tables Triggered When every entry changes, send copy of entry to neighbors Except for one causing update (split horizon rule) Neighbors use to update their tables 2018/11/12
31
RIP Staleness / Oscillation Control
Small Infinity Count to infinity doesn’t take very long Route Timer Every route has timeout limit of 180 seconds Reached when haven’t received update from next hop for 6 periods If not updated, set to infinity Soft-state refresh important concept!!! Behavior When router or link fails, can take minutes to stabilize 2018/11/12
32
RIP Table Processing RIP routing tables managed by application-level process called route-d (daemon) advertisements sent in UDP packets, periodically repeated 2018/11/12
33
Link State: Control Traffic
Each node floods its local information to every other node in the network Each node ends up knowing the entire network topology use Dijkstra to compute the shortest path to every other node Host A Host B Host E Host D Host C N1 N2 N3 N4 N5 N7 N6 2018/11/12
34
Link State Protocol Concept
Every node gets complete copy of graph Every node “floods” network with data about its outgoing links Every node computes routes to every other node Using single-source, shortest-path algorithm Process performed whenever needed When connections die / reappear 2018/11/12
35
Sending Link States by Flooding
X Wants to Send Information Sends on all outgoing links When Node Y Receives Information from Z Send on all links other than Z X A C B D (a) (b) (c) (d) 2018/11/12
36
Dijkstra’s Algorithm Given Shortest Path First Algorithm
Graph with source node s and edge costs c(u,v) Determine least cost path from s to every node v Shortest Path First Algorithm Traverse graph in order of least cost from source 2018/11/12
37
Dijkstra’s Algorithm: Concept
2 5 3 Current Path Costs Last Links E C 3 1 F 1 2 6 1 Source Node D 3 A 3 B Done Unseen Horizon Node Sets Done Already have least cost path to it Horizon: Reachable in 1 hop from node in Done Unseen: Cannot reach directly from node in Done Label d(v) = path cost From s to v Path Keep track of last link in path 2018/11/12
38
Dijkstra’s Algorithm: Initially
Current Path Costs E C 3 1 F 1 2 6 1 Source Node D 3 A 3 B Horizon Done Unseen No nodes done Source in horizon 2018/11/12
39
Dijkstra’s Algorithm: Selection
2 5 3 Current Path Costs E C 3 1 F 1 2 6 1 Source Node D 3 A 3 B B Done Unseen Horizon Select node v in horizon with minimum d(v) 2018/11/12
40
Dijkstra’s Algorithm: Selection (Cont.)
2 5 3 Current Path Costs Horizon E C 3 1 F 1 2 6 1 Source Node D 3 A 3 B Done Unseen Add selected node to Done 2018/11/12
41
Dijkstra’s Algorithm: Update
Unseen 2 5 3 Current Path Costs E C 3 4 6 Revised Path Costs 1 F 1 2 6 1 Source Node D 3 A 3 B Horizon Done Update costs based on paths having last link from newly added Done node Could change values of nodes in horizon Could add new nodes to horizon 2018/11/12
42
Link State Characteristics
With consistent LSDBs, all nodes compute consistent loop-free paths Can still have transient loops B 1 1 X 3 A C 5 2 D Packet from CA may loop around BDC if B knows about failure and C & D do not Link State Data Base 2018/11/12
43
OSPF Routing Protocol Open Shortest-path first More prevalent than RIP
Open standard created by IETF Shortest-path first Another name for Dijkstra’s algorithm More prevalent than RIP 2018/11/12
44
OSPF Reliable Flooding
Transmit link state advertisements Originating router Typically, minimum IP address for router Link ID ID of router at other end of link Metric Cost of link Link-state age Incremented each second Packet expires when reaches 3600 Sequence number Incremented each time sending new link information 2018/11/12
45
OSPF Flooding Operation
Node X Receives LSA from Node Y With Sequence Number q Looks for entry with same origin/link ID Cases No entry present Add entry, propagate to all neighbors other than Y Entry present with sequence number p < q Update entry, propagate to all neighbors other than Y Entry present with sequence number p > q Send entry back to Y , tell Y that it has out-of-date information Entry present with sequence number p = q Ignore it 2018/11/12
46
Flooding Issues When should it be performed
Periodically When status of link changes Detected by connected node What happens when router goes down & back up Sequence number reset to 0 Other routers may have entries with higher sequence numbers Router will send out LSAs with number 0 Will get back LSAs with last valid sequence number p Router sets sequence number to p+1 & resends 2018/11/12
47
Adoption of OSPF RIP viewed as outmoded OSPF Advantages
Good when networks small and routers had limited memory & computational power OSPF Advantages Fast convergence when configuration changes 2018/11/12
48
Comparison of LS and DV Algorithms
Message complexity LS: with n nodes, E links, O(nE) messages DV: exchange between neighbors only Speed of Convergence LS: Complex computation But…can forward before computation may have oscillations DV: convergence time varies may be routing loops count-to-infinity problem (faster with triggered updates) 2018/11/12
49
Comparison of LS and DV Algorithms (Cont.)
Space requirements: LS maintains entire topology DV maintains only neighbor state 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 errors propagate thru network Other tradeoffs Making LSP flood reliable 2018/11/12
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.