Top Banner
م ج ن پ ل ص ف که ب ش ه لای
64

فصل پنجم

Jan 01, 2016

Download

Documents

artaxiad-jacobs

فصل پنجم. لایه شبکه. network data link physical. network data link physical. network data link physical. network data link physical. network data link physical. network data link physical. network data link physical. network data link physical. network data link - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

4-2

applicationtransportnetworkdata linkphysicalapplicationtransportnetworkdata linkphysicalnetworkdata linkphysicalnetworkdata linkphysicalnetworkdata linkphysicalnetworkdata linkphysicalnetworkdata linkphysicalnetworkdata linkphysicalnetworkdata linkphysicalnetworkdata linkphysicalnetworkdata linkphysicalnetworkdata linkphysicalnetworkdata linkphysical LAN . WAN

: -

. ( ): ( ) : . . . TDMFDM . . connection oriented

. . .

. (Connectionless) on demand ( ) . . (Delay)8 : .:

ABC100 Mb/sEthernet1.5 Mb/s

DEstatistical multiplexingqueue of packetswaiting for outputlink (VC) 85

10 85 IP Router))

11 85 (Network) ( Backbone) : ( ) (( Subnet :

12 85 IP: IP .

13 IP:

85 IP

15 85 Version IP

4 Version= 0100 IP 6 IP IHL (IP Header Length) 32 IHP 5 16 85 Type of sevice 8 P2P1P0DTR-- : IP 1 17 85 Total Length 16 IP ( ) IP 65535 Identification 16 18 85 Fragment Offset) DF (( Dont Fragment: IP

) MF (More Fragment ):MF=0 : IP MF=1 :

) Fragment offset 13 819219 85 Time To Live 8 IP IP = 255 8 20 85 Header Ckecksum 16 IP : Header Checksum 21 85 Source Address 32

Destination Address 32 IP

22 85 Option 40 23 85 ( , , ) IP IP 32 IP

24 85 32 IP : / / A IP E D C B25 8515 A = 0 7 = IP 3 127 128-2 ()

0Network ID = 7 Bit0 NetworkHost ID032 bits26 85 NetworkHost ID B = 10 14 = =

Network ID = 14 BitHost ID Network ID1032 bits27 85 C IP = 110 21 = 8 = Network IDHost ID11032 bits28 851110Multicast Address32 bits D = 111028 = ( ) = 29 85 E = 11110 Unused Address Space1111032 bits30 85 IP . 0.0.0.0 255 NetID. 255.255.255.255 .XX.YY.ZZ127 0. HostID31 85

0.0.0.0: IP . 0. HostID : . NetID HostID .

32 85 255.255.255.255: . 255 NetID. : . 127.xx.yy.zz : .

33 IP: subnet: ( ) host: ( )Subnet subnet IP . .

223.1.1.1223.1.1.2223.1.1.3223.1.1.4223.1.2.9

223.1.2.2223.1.2.1

223.1.3.2223.1.3.1223.1.3.27 subnetLANSubnet Subnet subnet:223.1.1.0/24223.1.2.0/24223.1.3.0/24223.1.9.0/24223.1.7.0/24223.1.8.0/24

223.1.1.1223.1.1.3223.1.1.4

223.1.2.2223.1.2.1223.1.2.6

223.1.3.2223.1.3.1223.1.3.27223.1.1.2223.1.7.0223.1.7.1223.1.8.0223.1.8.1223.1.9.1223.1.9.2 IP subnet 8 16 24 .: C host . B host IP . 2000 host C B 63000 .

CIDR: Classless InterDomain Routing subnet IP . : a.b.c.d/x x subnet .

CIDR11001000 00010111 00010000 00000000subnetparthostpart200.23.16.0/23: ISP .

IP ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20

Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23 Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23 Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23 ... .. . .Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23

. .

.

: ) ) /

Link State (LS) ( ) Distance Vector

Network Layer4-44Routing and Forwarding1230111value in arrivingpackets headerrouting algorithmlocal forwarding tableheader valueoutput link01000101011110013221Network Layer4-45 uyxwvz2213112535Graph: G = (N,E)

N = set of routers = { u, v, w, x, y, z }

E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }Network Layer4-46 : uyxwvz2213112535 c(x,x) = (x,x) : c(u,w)=5 1 .Cost of path (x1, x2, x3,, xp) = c(x1,x2) + c(x2,x3) + + c(xp-1,xp) : u z : . (Flooding) .

Selective Flooding

BCDEANetwork Layer4-49 (Link State)C(x,y): x y. x y .D(v): vP(v): vN: .

(Dijkstra): . . forwarding . (iterative): k k .Network Layer4-50Dijsktras Algorithm1 Initialization: 2 N' = {u} 3 for all nodes v 4 if v adjacent to u 5 then D(v) = c(u,v) 6 else D(v) = 7 8 Loop 9 find w not in N' such that D(w) is a minimum 10 add w to N' 11 update D(v) for all v adjacent to w and not in N' : 12 D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N' Network Layer4-51Dijkstras algorithm: exampleStep012345N'uuxuxyuxyvuxyvwuxyvwzD(v),p(v)2,u2,u2,uD(w),p(w)5,u4,x3,y3,yD(x),p(x)1,uD(y),p(y)2,xD(z),p(z) 4,y4,y4,yuyxwvz2213112535Network Layer4-52Dijkstras algorithm: example (2) uyxwvzResulting shortest-path tree from u:vxywz(u,v)(u,x)(u,x)(u,x)(u,x)destinationlinkResulting forwarding table in u:Network Layer4-53 :n N .n(n+1)/2O(n2)

When the LS algorithm is next run, node C determines (based on the link costs shown in Figure 4.2-2a) that the clockwise path to A has a cost of 1, while the counterclockwise path to A (which it had been using) has a cost of 1+e. Hence C's least cost path to A is now clockwise. Similarly, B determines that its new least cost path to A is also clockwise, resulting in the routing and resulting path costs shown in Figure 4.2-2b. When the LS algorithm is run next, nodes B, C and D all detect that a zero cost path to A in the counterclockwise direction and all route their traffic to the counterclockwise routes. The next time the LS algorithm is run, B, C, and D all then route their traffic to the clockwise routes. What can be done to prevent such oscillations in the LS algorithm? One solution would be to mandate that link costs not depend on the amount of traffic carried -- an unacceptable solution since one goal of routing is to avoid highly congested (e.g., high delay) links. Another solution is to insure that all routers do not run the LS algorithm at the same time. This seems a more reasonable solution, since we would hope that even if routers run the LS algorithm with the same periodicity, the execution instants of the algorithm would not be the same at eachnode. Interestingly, researchers have recently noted that routers in the Internet can self-synchronize among themselves [Floyd 1994], i.e., even though they initially execute the algorithm with the same period but at different instants of time, the algorithm execution instants can eventually become, and remain, synchronized at the routers. One way to avoid such self-synchronization is to purposefully introduce randomization into the period between execution instants of the algorithm at each node. 53Network Layer4-54 (Link State) A

Network Layer4-55 - :

dx(y): x y

dx(y) = min {c(x,v) + dv(y) }

v x .vNetwork Layer4-56 - uyxwvz2213112535 :dv(z) = 5, dx(z) = 3, dw(z) = 3du(z) = min { c(u,v) + dv(z), c(u,x) + dx(z), c(u,w) + dw(z) } = min {2 + 5, 1 + 3, 5 + 3} = 4 x next-hop z forwarding u . :Network Layer4-57 Dx(y): x y:c(x,v) x . x .Dx = [Dx(y): y N ] x . v x :Dv = [Dv(y): y N ]

Network Layer4-58 :

. x - .Dx(y) minv{c(x,v) + Dv(y)} for each node y N .Network Layer4-59 : : . : .Distance Vector Algorithm (5)wait for (change in local link cost or msg from neighbor)

recompute estimates

if DV to any dest has changed, notify neighbors

Each node:Network Layer4-60x y zxyz0 2 7fromcost tofromfromx y zxyz0fromcost tox y zxyzcost tox y zxyz710cost to2 0 1 2 0 17 1 0timexz127ynode x tablenode y tablenode z tableDx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} = min{2+0 , 7+1} = 2Dx(z) = min{c(x,y) + Dy(z), c(x,z) + Dz(z)} = min{2+1 , 7+0} = 332 Network Layer4-61x y zxyz0 2 7fromcost tofromfromx y zxyz0 2 3fromcost tox y zxyz0 2 3fromcost tox y zxyzcost tox y zxyz0 2 7fromcost tox y zxyz0 2 3fromcost tox y zxyz0 2 3fromcost tox y zxyz0 2 7fromcost tox y zxyz710cost to2 0 1 2 0 17 1 02 0 17 1 02 0 13 1 02 0 13 1 02 0 13 1 02 0 13 1 0timexz127ynode x tablenode y tablenode z tableDx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} = min{2+0 , 7+1} = 2Dx(z) = min{c(x,y) + Dy(z), c(x,z) + Dz(z)} = min{2+1 , 7+0} = 3Network Layer4-62 : : . . .goodnews travelsfastxz1450y1 t0 y . t1 z y . . t2 y z . y z .

Network Layer4-63Distance Vector: link cost changesLink cost changes:good news travels fast bad news travels slow - count to infinity problem!44 iterations before algorithm stabilizes: see textPoisoned reverse: If Z routes through Y to get to X :Z tells Y its (Zs) distance to X is infinite (so Y wont route to X via Z)will this completely solve count to infinity problem?xz1450y60Network Layer4-64 : Distance Vector