chapter7_l2

52
1 Routing in packet switching networks Routing is a key function: determine a (best) path from any source to any destination There exist multiple paths Which path is best? Depend on objective: Minimize number of hops Minimize end-to-end delay Maximize available bandwidth Must have global knowledge about network state to perform this task

Transcript of chapter7_l2

1Routing in packet switching networksRouting is a key function: determine a (best) path from any source to any destinationThere exist multiple paths Which path is best!epend on ob"ecti#e:$%inimi&e number of hops$%inimi&e end'to'end delay$%aximi&e a#ailable bandwidth%ust ha#e global knowledge about network state to perform this task(1()*+,-./witch or router0ost1igure 23()An example of a packet-switch network4aths: 1')',5 1'*')',5 1'('+',5 6)7riteria for a good routing algorithm13 7orrectness: correct route and accurate deli#ery of packets(3 robustness: adapti#e to changes of network topology and #arying traffic load)3 7le#erness: ability to detour congestion links and determine the connecti#ity of the network3*3 8fficiency: rapid finding of the route and minimi&ation ofcontrol messages3*7lassification of routing algorithms/tatic #s3 dynamic:$/tatic: manually compute routes5 simple5 but not scalable and dynamic$!ynamic: automatic route computation5 adapti#e to dynamics of network but complicated7entrali&ed #s3 distributed$7entrali&ed: a center entity computes all routes and load the routes into all routers5 but not scalable$!istributed: routers exchange topology information and perform own computation of routes5 but inconsistent and loop routes39n datagram5 routing is based on packet by packet but in :75 routing is executed during setup+Routing tables/tore routing information5 being looked up to forward packets!ifferent networks ha#e different routing tables$!atagram: destination address ; next hop$:7: incoming :79 ; out'going :79 ; out'going port ink 1?) is shared by connection 1 and(>ink )?* is shared by connection ( and)Therefore the connection is called #irtual'circuit3Three connections: 13 /olid line: -1),. with local :79s 15(525=(3 !otted line: - 616)6* 6+6 ! with local :79s +5)5*5+5()3 !ashed line: 7 ''' (''' *''' )''' ,. with local :79s ,5)5(515+Reasons using local :79s rather than global :79s:13 searching for an a#ailable :79 is easier because of local uni@ueness(3 %ore a#ailable local :79s5 so there can ha#emore connections29ncoming Autgoingnode:7node :7-1 ) (-+ ) )) ( -1) ) -+9ncoming Autgoingnode:7node :71 ( , 21 ) * ** ( , 1, 2 1 (, 1 * (* * 1 )9ncoming Autgoingnode:7node :7) 2 .=) 1 .+.+)1.=)29ncoming Autgoingnode:7node :77, * )* ) 7,9ncoming Autgoingnode:7node :7( ) ) () * + +) ( ( )+ + ) *9ncoming Autgoingnode:7node :7* + !(!( * +Bode 1Bode (Bode )Bode *Bode ,Bode +1igure 23(+Routing table for virtual-circuit packet switching network.=1()*+,-./witch or router0ost1igure 23()An example of a datagram packet-switch network4aths: 1')',5 1'*')',5 1'('+',5 6C ( ( ) ) * * + ( , )Bode 1Bode (Bode )Bode *Bode ,Bode + 1 1 ( * * * + , , , 1 ) ( + ) ) * ) + +!estination Bext node 1 1 ) 1 * * + + , + 1 * ( ( ) * * * , , 1 1 ( ( ) ) + + , )!estination Bext node!estination Bext node!estination Bext node!estination Bext node!estination Bext node1igure 23(,Routing table for datagram packet switching network1D0ierarchical routing/i&e of routing tables will become extremely large when network increases/olution is: the hosts close to each other are assigned network addresses with the same prefixes3 9n a remote routing table5 all these hosts are treated as one address5 "ust one entry in the routing table3 (only in the local routing table5 these hosts are treatedseparately)3-ll packets towards to these hosts are forwarded to this area from remote area based on remote routing table and further forwards to the specific host based on local routing table3 Therefore hierarchical addressing311DDDD DDD1 DD1D DD11D1DD D1D1 D11D D11111DD 11D1 111D 11111DDD 1DD1 1D1D 1D11R1R(1( +*)DD 1 D1 ) 1D ( 11 )DD ) D1 * 1D ) 11 +(a)DDDD D111 1D1D 11D1DDD1 D1DD 1D11 111DDD1D D1D1 1DDD 1111DD11 D11D 1DD1 11DDR1R(1( +*)DDDD 1 D111 1 1D1D 1 DDD1 * D1DD * 1D11 * (b)1igure 23(20ierarchical routing table1(94 hierarchical addressing94 address E Betwork 9! ; 0ost 9!$0ost 9! E subnetwork 9! ; host 9!%oreo#er5supernetting (79!R''7lassless 9nter!omain Routing) is another type of hierarchical addressing in 941)0ow to compute routes dynamically.est path is based on different metrics: hops5 delay5 a#ailable bandwidth5 in general5 call them cost3 The best path is one with minimum cost or shortest path3The routing algorithm must be told which metric to useThe routers exchange (routing) information to obtain #alues of these metrics for different links3Fsing one of two types of typical routing algorithms to compute the best route$>ink state routing$!istance #ector routingRouting information exchange (and route computation) is the most important function behind networks e#en we do not feel it3 Af course5 this function should be efficient and not consume too much network bandwidth31*!istance #ector routing8#ery router maintains its distance #ector (!:) which records distance to each of other hosts38#ery router exchanges !: with its neighbors periodically3Whene#er a router recei#es a !: from its neighbor5 it checks whether new better routes through this neighbor can be found5 if yes5 modifies its !:31rom its !:5 a router can directly deri#e its routing table3!istance #ector routing uses .ellman'1ord algorithm1+>ink state routing8#ery router maintains its link state packet (>/4) which records the state information of links to all its neighbors3- router floods its >/4 to entire network5 i3e35 all routers5 (whene#er its link state changes)When a router recei#es >/4s from other routers5 it can construct a map of entire network and from the map5 compute shortest paths between any pair of host (using !i"kstra algorithm)5 thus5 deri#e its routing table31,1()*+,11()()+(*1igure 23(=- sample network with associated link costsBodes represent routersGswitches5 edges represent links5The #alue on a edge represents the cost of using that link30ere we assume eachlink is nondirected3 9f a link is directed5the cost can be assigned on each direction312.ellman'1ord algorithm4rinciple: if node B is in the shortest path from - to .5 then the path from - to B is also the shortest path and the path from B to . is also the shortest path3 /ee example1ormali&ation: $consider node i to a destination d.$ define Dj to be the current estimate of minimum cost from node j to destination d3 of course DdED3$ let Cij be the link cost from node i to node j . CiiED and CijE if i and j are not directly connected3$ DiEminHCij;DjI5 j i = minHCik;DkI5 k is is neighbor3 8xample-lgorithm (computing shortest path from nodes to destination d):13 9nitiali&ation: Di E 5i d5 and DdED(3 Fpdating: for each i d5 DiEminHCik;DkI5k isis neighbor )3 Repeat step ( until no more changes occur in the iteration31=1()*+,11()()+(*1igure 23(=/hortest pathprincipleWant to compute shortest path from ( ,59f was told that 1, is )5then (, #ia 1 is );)E, *, is )5(, #ia * is 1;)E* +, is ( (, #ia + is *;(E, therefore shortest path from (, is achie#ed if first go to *3 1C1()*+,11()()+(*1igure 23(=/hortest pathformali&ationWant to compute shortest path from ( ,5/uppose D1 E )5andC21 E ) D4 E )5C24 E 1 D5 E ( C25 E * therefore shortest path from (, is computed asD2 EminHC21D1! C24D4! C25D5" = minH);)5 1;)5 *;(I E*.ack(D1()*+,11()()+(*1igure 23(=/hortest pathcomputation to node , 9teration Bode 1Bode ( Bode )Bode *Bode +9nitial('15)('15)('15) ('15) ('15)1('15)('15)(,51)('15 ) (,5()(()5))(+5,) (,51)()5)) (,5())()5))(*5*)(,51)()5))(,5()*()5))(*5*)(,51)()5))(,5()1or each node i5 label it as (n!Di)where Di is the current minimum cost from i to the destination and n is the next node along the current shortest path3(11()*+,11(((1igure 23(CShortest path tree from all nodes to a destination((1()*+,11()()+(*1igure 23(= suppose for node(5 shortest paths to all other destinationsThe red lines indicate shortest paths from node ( to all other nodes3The distance #ector in node (:!estination distance next node1) 1)) * *1 * +* + ,* *The ro$ting table in node (:!estination next node1 1) * * * + + , *-nother #iew of shortest paths: from a node to all destination()1()*+,11()()+(*1igure 23(= 9nitial distance #ector in node (!estination distance next node1 ) 1 ) '1 *1 * +* + ,'10ow node ( computes shortest paths to all other destinationsRecei#e distance #ector from node *!estination distance1+ (1 )( +) , Bew distance #ector in node (!estination distance next node1 )1 ))* *1 * +* + ,'1-fter recei#ing distance #ectorfrom *5 node ( modifies its initial distance #ector (*1()*+,11()()+(*1igure 23(=0ow node ( computes shortest to all other destinationRecei#e distance #ectorfrom node + destinationdistance1 (* ) *) ,( Bew distance #ector in node (!estination distance next node1 ) 1 ))* *1 * +* + ,, +7urrent distance #ector in node (!estination distance next node1)1 ) )* *1 * +* + ,'1When recei#ing distance #ector from +5 modify its distance #ector(+1()*+,11()()+(*1igure 23(=0ow node ( computes shortest to all other destinationRecei#e distance #ector from node * !estination distance 1+ (1)( +),) Bew distance #ector in node (!estination distance next node1 ) 1 ))* *1 * +* + ,* *7urrent distance #ector in node (!estination distance next node1 ) 1 ))* *1 * +* + ,, +When recei#ing distance #ector from *5 modify its distance #ector again -t this time5 the distance #ector con#erges to stable state(,istributed implementation of !ellman-"ord algorithm1rom abo#e example5 it is clear that .ellman'1orm algorithm can be executed at e#ery node to compute the shortest path from the node to all other nodes (destinations)5 thus5 totally distributed3The prere@uisiteis that neighbors exchange distance #ectors periodically3Whene#er a node recei#es a distance #ector from its neighbor5 it checks whether there exists a new shortest path from this neighbor to a destination 5 if yes5 modify its distance #ector3The nodes will recei#e distance #ectors from its neighbors mutually5 their computations of shortest paths depend on each other5 i3e35 in a circular way3 0owe#er all of them will finally con#erge to the correct results3(2istributed implementation of !ellman-"ord algorithm#cont.$-part from periodical broadcast of distance #ector5triggered updates are also used5 which means that as soon as a node find its distance #ector is changed5 the node broadcasts its distance #ector31or each node i5 it uses the following e@uations to compute (or update) its distance #ector:$ DiiED$ Dij EminHCik ; DkjI5 k i where k is iJs neighbor39n our examples5 what we show is from multiple nodes to a specific destination3(=1igure 23(=1()*+,11()()+(*Recomputation of minimum cost when link breaksFpdateBode 1Bode ( Bode )Bode *Bode +.efore break()5))(*5*) (,51)()5))(,5() 1()5))(*5*) (*5+)()5))(,5() (()52)(*5*) (*5+)((5+)(,5() )()52)(*5,) (*52)((5+)(,5() *((5C)(*5,) (*52)(+5+)(,5() +((5C)(*5,) (*52)(+5+)(,5() e#entually con#erge-ssume: computation and transmission aresynchroni&ed3 (C) 1 ( *1 1 1(a)1igure 23)17ounting to infinity problem.efore link failure) 1 ( *1 1K(b)-fter link failureFpdate node1node ( node ).efore break((5))()5()(*51) -fter break ((5))()5()((5)) 1((5))()5*)((5)) (((5+)()5*)((5+) )((5+)()5,)((5+) *((52)()5,)((52) 66 66The recomputation keeps continuation until costs become #ery large5 and guess the destination is unreachable3 %o& to sol#e it'An the other hand5 if the broken link restored5 the recomputation will con#erge @uickly3Therefore5 good news tra#els @uickly5 but bad news tra#els slowly3)D/ome solutions to counting to infinity problem/plit'hori&on$%inimum cost to a gi#en destination is not sent to a neighbor if the neighbor is the next node along the shortest path3/plit hori&on with poisoned re#erse$%inimum cost to a destination is set to infinity if the neighbor is the next node along the shortest path before sending out the minimum costs3)1) 1 ( *1 1 1(a)1igure 23)1/plit hori&on with poisoned re#erse.efore link failure) 1 ( *1 1K(b)-fter link failureFpdate node1node ( node ).efore break((5))()5()(*51) -fter break ((5))()5()('15) 1((5))('15)('15) (('15)('15)('15) )(!i"kstraJs algorithm L link state routing/uppose the topology of a network (i3e35 a graph)is known5 !i"kstraJs algorithm will find the shortest paths from a node n to all other nodes as follows:$1ind the closest node (say n1) from node n5 which is a neighbor of n3 modify the costs of other nodes3$1ind the second closest node (say n2) from n5 which is a neighbor of n or n1. %odify the costs of other nodes3$1ind the third closest node(say n()from n5 which is a neighbor of n5 n15 or n23 %odify the costs of other nodes3 $660ow does a node get the network topology$8#ery node has a link state packet (>/4) which records its neighbors and the costs to these neighbors3 $8#ery node floods its >/4 to the entire network (all nodes) at beginning or whene#er link statuses change3$-ny node can construct the network topology after it recei#es all >/4s3))1()*+,11()()+(*1igure 23(=8xample: !i"kstraJs algorithm9teration B!(!) !* !+ !,9nitial H1I ) (+ 1 H15)I)(* )(H15(5)I )(* 2 )) H15(5)5,I )(* +)*H15(5)5*5,I )(* +)+ H15(5)5*5+5,I )(* +))*1()*+,1(()(1igure 23)(Shortest path tree from node % to other nodes after using i&kstra's algorithmRouting table from shortest path tree for node 1 !estinationnextnode cost (( ) )) ( *) * +) + ,) ))+1()*+,11()()+(*1igure 23(=>ink /tate 4ackets>/41: ((5))5 ()5()5(*5+) >/4(: (15))5(*51)5(+5*)>/4): (15()5(*5()5(,51)>/4*: (15+)5((51)5(+5))>/4+: ((5*)5(*5))5(,5()>/4,: ()51)5(+5()The >/4 of a node records its current neighbors and their currentcorresponding costs3 1rom >/4s5 a node can construct a map of the entire network3),7omparison of distance #ector and link state routings!istance #ector routing$!istance #ector records costs to all nodes$Beighbors exchange distance #ectors periodically.$The con#ergence will occur e#entually and slowly$4ackets may loop for a while during the process of con#ergence$React to link failure #ery slowly5 counting'to'infinity problem3 >ink state routing$>/4 records costs to neighbors3$1lood >/4 to entire network whene#er topology change$React to network failure fast$Too much flood when topology changes @uickly and consume network bandwidthBote: the route from source to destination is distributed and synthesi&ed by all nodes along the route)2Ather routing approaches ''flooding1looding$1orwards packets to all ports except the coming port$4acket e#entually arri#e at destination$Bo need for routing table5 #ery robust4roblem: may swamp network3/olutions:$Fsing TT> (Time'to'li#e)5 a small number in the packet5 e#ery router decreases it5 when reach D5 discards it$8ach router adds its identifier into the packet5 when sees it again5 discards it$8ach router records the source and se@uence number of a packet5 when sees again5 discards it$Menerally use in specific situation5 such as flood >/4s3)=Ather routing approaches $source routing/ource of a packet puts the entire route in the header of the packet9ntermediate nodes do not need routing ability but forward packets according the router in the headerBeed route disco#ery at first place3)C-T% #irtual'circuit networks 1ixed'length small cells: + byte header ; *= byte data E +) bytes3$/implify the implementation of -T% switches and make #ery high speed operation possible$%any functions can be implemented in hardware$-T% switches are #ery scalable5 such as 1D5DDD ports with each port running at 1+D%bps$/mall waiting time and delay$1iner degree of control-T% can operate o#er >-Bs as well as global backbone networks at the speeds from a few %bps to se#eral Mbps3No/ attributes allow -T% to carry #oice5 data5 and #ideo3-T% uses local :79s5 moreo#er5 it uses #irt$al path connection to bundling se#eral :7s with the common path together3 Therefore one more le#el multiplexing394 o#er -T% has been pro#en to be successful3*DTraffic management and No/4urpose of traffic management is to pro#ide No/3%echanisms:$7ontrol load on links and switches$/et priority and scheduling at routersGmultiplexersto pro#ide differentiated treatments to different packets3$4erform policing and shaping (admission control)$7ongestion control3 1or a packet5 we are interested in$8nd'to'end delay5 also "itter (#ariation of delay)$4acket loss*1-pproaches to traffic managementNueue strategies (control sharing of bandwidth among users):$191A (1irst 9n 1irst Aut):all arri#ing packets are put in a common @ueue and sent in the order of arri#al34ackets are discarded when @ueue (i3e35 buffer) is full at the time of arri#al4acket length5 @ueue si&e5 and interarri#al time affect the performance) high rate $ser &ill depri#e other $sers of transmitting packets3$191A with discard priority 4ackets are classified as different types5 only discard low priority packets3 $1air Nueues8#ery user flow has a logical @ueue5 all the @ueues shares bandwidth e@ually3$Weighted 1air Nueue8#ery user flow has a logical @ueue5 but each @ueue has a specific weight5@ueues shares bandwidth based on their weights3The weights may be based on types of traffic5 or how much payment3*(Random 8arly !etection (R8!)4roblem with fair @ueue: in core network5 too many flows at the same time and tracking the states of all flows is difficult3Ane solution is ha#ing a limited number of logical @ueues with each for a gi#en class of flows3 .ut the bad sender may hog the buffer resource3/o R8!: randomly drop packets before buffer o#erflows3$- higher rate source would suffer higher dropped packets3$ Two thresholds: minth and ma*th5 .elowminth! no drop5 1rom minth ma*th5 randomly drop arri#ing packets with increasing probability -bo#e ma*th5 drop all arri#ing packets3*)7ongestion control in packet switching networksWhen more incoming packets than out'going capacity5 buffer is needed9f the situation lasts too long5 buffer will be full5 packets be discarded5 congestion occurs3Retransmission of lostGdiscard packets worsen congestion-s a result5 the throughput will be #ery low3/ome ways are needed to control and sol#e congestion**7ongestion control in packet switching networks+$estion, is it -. to increase b$ffer si/e'Bot AO3 13.uffer is larger5 then waiting time is longer3 9t willcause time out and retransmit packets5 thus more congestion39f buffer si&e is infinite5 then packet can delay fore#er37ongestion control is a #ery hard problem3*+-pproaches to congestion controlApen'loop (pre#enti#e approaches):$9f a traffic flow will degrade the network performance and No/ can not be guaranteed5 then re"ect the traffic flow from the beginning3 7alled admission control3$0eaky b$cket traffic policing:-n admitted bad user may #iolate initial contact and pour too much traffic into networkThere is a b$cket which controls a constant rate flowing into network3The user packets are first pouredinto the bucket5 instead of to network3 Ance amount of packets into bucket excesses certain le#el5 the further packets will be tagged3 9f the bucket is full5 the extra packets will be discarded3 leaky bucket Whene#er congestion occurs5 the tagged packets will be discarded7lose'loop (after fact approaches):$-fter congestion occurred5 eliminate or reduce congestion3*,Water drains ata constant rate>eaky bucketWater pouredirregularly1igure 23+)Water abo#e threshold will be tagged*2Traffic policing #s3 traffic shaping4olicing: a process of monitoring and enforcing the traffic flow to not #iolate the agree upon contract (i3e35 maximum flow)$ >eaky bucket5 the bucket si&e determines maximum allowed flow3/haping: a process of altering a traffic flow to a#oid burst3$ >eaky bucket: #arying input to a bucket (buffer) but constant (smooth) output from the bucket (buffer)3 The bucket si&e determines the maximum burst3$ Token bucket: token bucket for tokens and buffer for packets tokens are generated at constant rate and put into token bucket3 When token bucket is full5 the new generated tokens are discarded3 When a packet comes5 $ if buffer is empty5 check whether there is tokens in token bucketP 9f has token5 the packet is transmitted without entering the buffer (remo#e one token also)5 P Atherwise5the packet enters the buffer$ Atherwise5 the packet enters the buffer 9f the buffer is not empty and the token bucket is not empty5 constantly take one packet at one time and transmit it (also remo#e one token)*=Incoming trafficShaped trafficSize NPacketServerFigure 7.58>eaky bucket traffic shaping*CIncoming trafficShaped trafficSize NSize KTokens arriveperiodicallyServerPacketTokenFigure 7.5Token bucket traffic shaping+D8nd'to'end #s3 hop'by'hop8nd'to'end: the destination notices the sender the congestion30op'by'hop: a node detecting congestion notices its upstream node to slow down5 which may detect congestion and notice its upstream node5 possible until the source30op'by'hop can react faster than end'to'end3+19mplicit #s3 explicit feedbackThe node detecting congestion can send an explicit message to notice the congestion3The explicit message may be sent as a separate packet or piggybacked39mplicit feedback rely on some surrogate information such as time out to deduce congestion3 +(7lose'loop control?T74 congestion controlT74 uses sliding'window for flow control$)d#ertised &indo& to tell sender how many bytes to send and guarantee the recei#er window ne#er o#erflow$0owe#er ad#ertised &indo& does not pre#ent buffers in routers o#erflow5 93e35 congestion3-nother window: congestion &indo& used by sender$/ender sends minHad#ertised &indo&5 congestion &indo&I$-t beginning5 the congestion &indo& is set to one maximum si&e segment3$Whene#er recei#ing a -7O5 sender increases congestion &indo& (double5 then linearly) $Whene#er time'out or a duplicate -7O is recei#ed5sender will reduce congestion &indo& (half5 then linearly)3