Link State Routing Principles The Goal is to avoid the routing loops typical of DV routing and to scale to bigger networks and to varying topologies. 5-1 S38.121/RKa s-01 Open Shortest Path First(OSPF) is a recommended link state protocol for Interior routing in Internet 1 2 A B C Example network 3 4 5 D E • A Link state protocol maintains the topology map 6 (Link state DB) of the network. • When topology changes, maps are updated quickly. • The map is used to produce the Routing Table. • OSPF is IETF specified link state protocol for Internet - OSPF is recommended as the follower of RIP. 5-2 S38.121/RKa s-01
The map is the full list of all links F rom T o L in k D istance 1 2 A B C A B 1 1 A D 3 1 3 4 5 B A 1 1 B C 2 1 D E B E 4 1 6 C B 2 1 C E 5 1 • One node is responsible for a D A 3 1 D E 6 1 particular entry E B 4 1 • Link directions are separate E C 5 1 entries E D 6 1 5-3 S38.121/RKa s-01 Flooding protocol distributes information about topology changes 1 2 From A to B, link 1, dist = inf, message number A B C xxxxx Flooding Algorithm is 3 4 5 Receive m D E 6 Find entry in link DB L Yes No L.mn = m.mn Yes found L.mn < m.mn No yes No Add entry Update entry Create m from L End Broadcast msg Broadcast msg Send m to all other i/f to all other i/f to sender 5-4 S38.121/RKa s-01
Link DB after distribution of failure of link AB From To Link Distance M-Nr 1 A B 1 inf 2 2 A B C xxxxx A D 3 1 1 B A 1 i in nf f 2 3 4 5 B C 2 1 1 D E B E 4 1 1 6 C B 2 1 1 C E 5 1 1 • Message numbering starts from 1 on D A 3 1 1 node restart. D E 6 1 1 E B 4 1 1 • Modulo arithmetic is used to determine E C 5 1 1 what is “a little bigger than” E D 6 1 1 --> message numbering can overflow without problems. 5-5 S38.121/RKa s-01 If network splits into islands, DBs in islands may diverge 1 2 A B C xxxxx 3 4 5 D xxxxx E 6 From T o L ink D istance M -nr From To Link Distance M -nr A B 1 inf 2 A B 1 inf 2 A D 3 1 1 A D 3 1 1 B A 1 inf 2 B A 1 inf 2 B C 2 1 1 B C 2 1 1 B E 4 1 1 B E 4 1 1 C B 2 1 1 C B 2 1 1 C E 5 1 1 C E 5 1 1 D A 3 1 1 D A 3 1 1 D E 6 1 1 D E 6 inf 2 E B 4 1 1 E B 4 1 1 E C 5 1 1 E C 5 1 1 E D 6 inf 2 E D 6 1 1 5-6 S38.121/RKa s-01
Link 2 fails -> DBs diverge even more 1 2 A B C xxxxx xxxxx DBs at B, C and E: From T o L ink D istance M -nr 3 4 5 A B 1 inf 2 A D 3 1 1 D xxxxx E B A 1 inf 2 6 B C 2 inf 2 B E 4 1 1 C B 2 inf 2 C E 5 1 1 D A 3 1 1 D E 6 1 1 There is no immediate problem, E B 4 1 1 but if link 1 goes up again ... E C 5 1 1 E D 6 inf 2 5-7 S38.121/RKa s-01 After reconnection of the islands “Bringing Up Adjacencies ” is required B A DB description<link-id+m-nr> m.mn>L.mn or m.link-id DB description<link-id+m-nr> not in L Yes Link state request <interesting link-id> Changed information We also talk about DB alignment DB update and flooding or merging of the DBs to all neighbors 5-8 S38.121/RKa s-01
Integrity of the Link DB must be secured • Flooding messages are acknowledged link by link • DB description messages are acknowledged • Each DB entry is protected by obsolescence timer, if an update does not arrive in time, entry is removed. • Each Entry is protected by a checksum • Messages carry also authentication info • But: while update is in progress, some nodes receive info earlier than others --> routing mistakes happen 5-9 S38.121/RKa s-01 OSPF is based on Dijkstra’s SPF algorithm • SPF - shortest path first -algorithm computes the shortest path from source node S to all other nodes • Initially nodes are divided to Evaluated E , the paths from which are known and to other nodes R . • In addition an ordered list of paths O is needed. 5-10 S38.121/RKa s-01
Dijkstra’s shortest-path-first algorithm 1 2 A B C E ={S=B}, R ={A, C, D, E}, P = ∅ 3 4 5 O ={<B,C,1>,<B,E,1>,<B,A,1>} sort D E Return: 6 L O = ∅ or P contains paths F r o m T o L in k D is t. Yes R =unreachable A B 1 1 O(1).m=inf A D 3 1 nodes B A 1 1 B C 2 1 p= <B,C,1> ; O = O \ p; V=p.to-node =C B E 4 1 C B 2 1 V ∈ E C E 5 1 Yes D A 3 1 D E 6 1 E = E ∪ V, R = R \ V E B 4 1 E C 5 1 P = P ∪ p E D 6 1 O = O ∪ < p, L (From=V).To, p.Dist+L.Dist> sort O Converges faster than Bellman-Ford O(M.logM) < O(N.M) NB: this removes loops! 5-11 S38.121/RKa s-01 Advantages of Link State Protocols include • Link State DBs converge quickly, no loops are formed • Metrics can be quite accurate. One protocol can easily support several metrics – Capacity, delay, cost, reliability. • Can maintain several routes to a destination. • Exterior routes can have their own representation. 5-12 S38.121/RKa s-01
Using several metrics requires • Metrics must be stored for each link ( L.et1, L.et2 ... ) • Computing separate Routing Tables for each metric ( P (et1), P (et2) ...) • Link protocol must carry all metrics • User packets must be marked with the required metric. • A Routing loop is possible if different nodes use different metrics for one user packet. 5-13 S38.121/RKa s-01 Spreading load to alternative equidistant paths improves network efficiency 1 2 A B C • Queues in nodes become shorter 3 4 5 • Average delay is decreased • End-to-end jitter decreases D E 6 • Less traffic to reroute under failure conditions – May change packet order because paths may have different delay (queue lengths in nodes) – Difficulty: existing traffic can not be pinned down to primary path so that only overload would take the alternative path --> stability is a problem –When are paths equidistant enough? 5-14 S38.121/RKa s-01
Rule A->Y...->X, if Y.et.X < A.et.X accepts only monotonic alternative routes E ={S=B}, R ={A, C, D, E}, P = ∅ This modified algorithm O ={<B,C,1>,<B,E,1>,<B,A,1>} sort finds also the alternative Return: paths. O = ∅ or P contains paths Yes O(1).m=inf R =unreachable nodes W = (p\V).to-node p= <B,C,1> ; O = O \ p; V=p.to-node =C Yes V ∈ E S.et.W < S.et.V E = E ∪ V, R = R \ V p is a feasible alter- P = P ∪ p native path to V O = O ∪ < p, L (From=V).To, p.Dist+L.Dist> sort O NB: this removes loops! 5-15 S38.121/RKa s-01 Link state protocol can describe several external routes with accurate metrics • DV-protocol capability to describe external routes is limited due to counting to infinity problem and due to complexity of Bellman-Ford algorithm (O(N**2) • Link state protocol is free of those limitations. SPF route computation converges as O(N.logN) - where N = nrof external routes • E.g. if there are 30 000 external routes =>10exp9 vs. 450 000 5-16 S38.121/RKa s-01
OSPF Protocol Principles 5-17 S38.121/RKa s-01 OSPF sees the network as a graph External dest Stub External External ntwrk dest dest OSPF router Transit ntwrk OSPF OSPF router router Stub ntwrk Summary Stub Stub ntwrk ntwrk Stub ntwrk ntwrk 5-18 S38.121/RKa s-01
OSPF makes a difference between a router and a host Uses IP sub-net mask and advertises only a single (sub)net OSPF router Host Host Host A B Z Stub network (aliverkko/sub-net) 5-19 S38.121/RKa s-01 OSPF supports Broadcast networks A B In a Broadcast network • each device can send to each other C D • one can send to all or to a N*(N-1)/2 adjacencies (known neighbors) sub-set of connected devices designated (backup) A B • If it has N routers, they have N*(N-1)/2 adjacencies and • each router would advertise C D N-1 routes to other routers Adjacencies are formed only with the +one stub network Designated router(A) (edusreititin) ==> • A must be selected using the Hello-protocol • Synchronization of Link DBs becomes simpler • Backup designated router (B) should be selected together with the Designated. 5-20 S38.121/RKa s-01
OSPF Flooding Protocol in a Broadcast network Router X, ... Designated Advert (->224.0.0.6 - all designated routers) Distribution (->224.0.0.5 - all OSPF routers) Backup designated stays ==> no need to process acks from all other as silent as possible routers in the sub-net 5-21 S38.121/RKa s-01 In non-BC nets OSPF works in the same way except that Bcasts are replaced by point-to-point messages Designated A B (backup) Router X, ... Designated Advertisement C D Distribution E F Permanent connection with designated Backup designated Permanent connection with backup designated NB: it makes sense to minimize permanent Dial-up connection with connections due to their cost other routers 5-22 S38.121/RKa s-01
Recommend
More recommend