




已阅读5页,还剩77页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
4: Network Layer,4a-1,Chapter 4: Network Layer,Chapter goals: understand principles behind network layer services:routing (path selection)dealing with scalehow a router worksadvanced topics: IPv6, multicastinstantiation and implementation in the Internet,Overview:network layer servicesrouting principle: path selectionhierarchical routingIPInternet routing protocols reliable transferintra-domaininter-domainwhats inside a router?IPv6multicast routing,4: Network Layer,4a-2,Network layer functions,transport packet from sending to receiving hosts network layer protocols in every host, routerthree important functions:path determination: route taken by packets from source to dest. Routing algorithmsswitching: move packets from routers input to appropriate router outputcall setup: some network architectures require router call setup along path before data flows,4: Network Layer,4a-3,Network service model,Q: What service model for “channel” transporting packets from sender to receiver?guaranteed bandwidth?preservation of inter-packet timing (no jitter)?loss-free delivery?in-order delivery?congestion feedback to sender?,?,?,?,virtual circuitor datagram?,The most important abstraction provided by network layer:,service abstraction,4: Network Layer,4a-4,Virtual circuits,call setup, teardown for each call before data can floweach packet carries VC identifier (not destination host OD)every router on source-dest path s maintain “state” for each passing connectiontransport-layer connection only involved two end systemslink, router resources (bandwidth, buffers) may be allocated to VCto get circuit-like perf.,“source-to-dest path behaves much like telephone circuit”performance-wisenetwork actions along source-to-dest path,4: Network Layer,4a-5,Virtual circuits: signaling protocols,used to setup, maintain teardown VCused in ATM, frame-relay, X.25not used in todays Internet,1. Initiate call,2. incoming call,3. Accept call,4. Call connected,5. Data flow begins,6. Receive data,4: Network Layer,4a-6,Datagram networks: the Internet model,no call setup at network layerrouters: no state about end-to-end connectionsno network-level concept of “connection”packets typically routed using destination host IDpackets between same source-dest pair may take different paths,1. Send data,2. Receive data,4: Network Layer,4a-7,Network layer service models:,NetworkArchitectureInternetATMATMATMATM,ServiceModelbest effortCBRVBRABRUBR,Bandwidthnoneconstantrateguaranteedrateguaranteed minimumnone,Lossnoyesyesnono,Ordernoyesyesyesyes,Timingnoyesyesnono,Congestionfeedbackno (inferredvia loss)nocongestionnocongestionyesno,Guarantees ?,Internet model being extented: Intserv, DiffservChapter 6,4: Network Layer,4a-8,Datagram or VC network: why?,Internetdata exchange among computers“elastic” service, no strict timing req. “smart” end systems (computers)can adapt, perform control, error recoverysimple inside network, complexity at “edge”many link types different characteristicsuniform service difficult,ATMevolved from telephonyhuman conversation: strict timing, reliability requirementsneed for guaranteed service“dumb” end systemstelephonescomplexity inside network,4: Network Layer,4a-9,Routing,Graph abstraction for routing algorithms:graph nodes are routersgraph edges are physical linkslink cost: delay, $ cost, or congestion level,Goal: determine “good” path(sequence of routers) thru network from source to dest.,“good” path:typically means minimum cost pathother defs possible,4: Network Layer,4a-10,Routing Algorithm classification,Global or decentralized information?Global:all routers have complete topology, link cost info“link state” algorithmsDecentralized: router knows physically-connected neighbors, link costs to neighborsiterative process of computation, exchange of info with neighbors“distance vector” algorithms,Static or dynamic?Static: routes change slowly over timeDynamic: routes change more quicklyperiodic updatein response to link cost changes,4: Network Layer,4a-11,A Link-State Routing Algorithm,Dijkstras algorithmnet topology, link costs known to all nodesaccomplished via “link state broadcast” all nodes have same infocomputes least cost paths from one node (source”) to all other nodesgives routing table for that nodeiterative: after k iterations, know least cost path to k dest.s,Notation:c(i,j): link cost from node i to j. cost infinite if not direct neighborsD(v): current value of cost of path from source to dest. Vp(v): predecessor node along path from source to v, that is next vN: set of nodes whose least cost path definitively known,4: Network Layer,4a-12,Dijsktras Algorithm,1 Initialization: 2 N = A 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v) 6 else D(v) = infty 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,4: Network Layer,4a-13,Dijkstras algorithm: example,Step012345,start NAADADEADEBADEBCADEBCF,D(B),p(B)2,A2,A2,A,D(C),p(C)5,A4,D3,E3,E,D(D),p(D)1,A,D(E),p(E)infinity2,D,D(F),p(F)infinityinfinity4,E4,E4,E,4: Network Layer,4a-14,Dijkstras algorithm, discussion,Algorithm complexity: n nodeseach iteration: need to check all nodes, w, not in Nn*(n+1)/2 comparisons: O(n*2)more efficient implementations possible: O(nlogn)Oscillations possible:e.g., link cost = amount of carried traffic,1,1+e,e,0,e,1,1,0,0,0,2+e,1+e,1,0,0,initially, recomputerouting, recompute, recompute,4: Network Layer,4a-15,Distance Vector Routing Algorithm,iterative:continues until no nodes exchange info.self-terminating: no “signal” to stopasynchronous:nodes need not exchange info/iterate in lock step!distributed:each node communicates only with directly-attached neighbors,Distance Table data structure each node has its ownrow for each possible destinationcolumn for each directly-attached neighbor to nodeexample: in node X, for dest. Y via neighbor Z:,4: Network Layer,4a-16,Distance Table: example,loop!,loop!,4: Network Layer,4a-17,Distance table gives routing table,ABCD,A,1D,5D,4D,4,Outgoing link to use, cost,destination,Distance table,Routing table,4: Network Layer,4a-18,Distance Vector Routing: overview,Iterative, asynchronous: each local iteration caused by: local link cost change message from neighbor: its least cost path change from neighborDistributed:each node notifies neighbors only when its least cost path to any destination changesneighbors then notify their neighbors if necessary,Each node:,4: Network Layer,4a-19,Distance Vector Algorithm:,1 Initialization: 2 for all adjacent nodes v: 3 D (*,v) = infty /* the * operator means for all rows */ 4 D (v,v) = c(X,v) 5 for all destinations, y 6 send min D (y,w) to each neighbor /* w over all Xs neighbors */,X,X,X,w,At all nodes, X:,4: Network Layer,4a-20,Distance Vector Algorithm (cont.):,8 loop 9 wait (until I see a link cost change to neighbor V 10 or until I receive update from neighbor V) 11 12 if (c(X,V) changes by d) 13 /* change cost to all dests via neighbor v by d */ 14 /* note: d could be positive or negative */ 15 for all destinations y: D (y,V) = D (y,V) + d 16 17 else if (update received from V wrt destination Y) 18 /* shortest path from V to some Y has changed */ 19 /* V has sent a new value for its min DV(Y,w) */ 20 /* call this received new value is newval */ 21 for the single destination y: D (Y,V) = c(X,V) + newval 22 23 if we have a new min D (Y,w)for any destination Y 24 send new value of min D (Y,w) to all neighbors 25 26 forever,w,X,X,X,X,X,w,w,4: Network Layer,4a-21,Distance Vector Algorithm: example,4: Network Layer,4a-22,Distance Vector Algorithm: example,4: Network Layer,4a-23,Distance Vector: link cost changes,Link cost changes:node detects local link cost change updates distance table (line 15)if cost change in least cost path, notify neighbors (lines 23,24),algorithmterminates,“goodnews travelsfast”,4: Network Layer,4a-24,Distance Vector: link cost changes,Link cost changes:good news travels fast bad news travels slow - “count to infinity” problem!,algorithmcontinueson!,4: Network Layer,4a-25,Distance Vector: poisoned 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?,algorithmterminates,4: Network Layer,4a-26,Comparison of LS and DV algorithms,Message complexityLS: with n nodes, E links, O(nE) msgs sent each DV: exchange between neighbors onlyconvergence time variesSpeed of ConvergenceLS: O(n*2) algorithm requires O(nE) msgsmay have oscillationsDV: convergence time variesmay be routing loopscount-to-infinity problem,Robustness: what happens if router malfunctions?LS: node can advertise incorrect link costeach node computes only its own tableDV:DV node can advertise incorrect path costeach nodes table used by others error propagate thru network,4: Network Layer,4a-27,Hierarchical Routing,scale: with 50 million destinations:cant store all dests in routing tables!routing table exchange would swamp links!,administrative autonomyinternet = network of networkseach network admin may want to control routing in its own network,Our routing study thus far - idealization all routers identicalnetwork “flat” not true in practice,4: Network Layer,4a-28,Hierarchical Routing,aggregate routers into regions, “autonomous systems” (AS)routers in same AS run same routing protocol“intra-AS” routing protocolrouters in different AS can run different intra-AS routing protocol,special routers in ASrun intra-AS routing protocol with all other routers in ASalso responsible for routing to destinations outside ASrun inter-AS routing protocol with other gateway routers,4: Network Layer,4a-29,Intra-AS and Inter-AS routing,Gateways:perform inter-AS routing amongst themselvesperform intra-AS routers with other routers in their AS,inter-AS, intra-AS routing in gateway A.c,network layer,link layer,physical layer,a,b,a,C,A,B,d,4: Network Layer,4a-30,Intra-AS and Inter-AS routing,Host h2,Hosth1,Intra-AS routingwithin AS A,Intra-AS routingwithin AS B,Well examine specific inter-AS and intra-AS Internet routing protocols shortly,4: Network Layer,4a-31,The Internet Network layer,Host, router network layer functions:,Transport layer: TCP, UDP,Link layer,physical layer,Networklayer,4: Network Layer,4a-32,IP Addressing: introduction,IP address: 32-bit identifier for host, router interface interface: connection between host, router and physical linkrouters typically have multiple interfaceshost may have multiple interfacesIP addresses associated with interface, not host, router,,,,, = 11011111 00000001 00000001 00000001,223,1,1,1,4: Network Layer,4a-33,IP Addressing,IP address: network part (high order bits)host part (low order bits) Whats a network ? (from IP address perspective)device interfaces with same network part of IP addresscan physically reach each other without intervening router,,,,,,,,,,7,network consisting of 3 IP networks(for IP addresses starting with 223, first 24 bits are network address),LAN,4: Network Layer,4a-34,IP Addressing,How to find the networks?Detach each interface from router, hostcreate “islands of isolated networks,,,,,,,,,,,,,,Interconnected system consistingof six networks,4: Network Layer,4a-35,IP Addresses,0,network,host,A,B,C,D,class, to55, to55, to55, to55,32 bits,given notion of “network”, lets re-examine IP addresses:,“class-full” addressing:,4: Network Layer,4a-36,IP addressing: CIDR,classful addressing: inefficient use of address space, address space exhaustione.g., class B net allocated enough addresses for 65K hosts, even if only 2K hosts in that networkCIDR: Classless InterDomain Routingnetwork portion of address of arbitrary lengthaddress format: a.b.c.d/x, where x is # bits in network portion of address,4: Network Layer,4a-37,IP addresses: how to get one?,Hosts (host portion):hard-coded by system admin in a fileDHCP: Dynamic Host Configuration Protocol: dynamically get address: “plug-and-play”host broadcasts “DHCP discover” msgDHCP server responds with “DHCP offer” msghost requests IP address: “DHCP request” msgDHCP server sends address: “DHCP ack” msg,4: Network Layer,4a-38,IP addresses: how to get one?,Network (network portion):get allocated portion of ISPs address space:,ISPs block 11001000 00010111 00010000 00000000 /20 Organization 0 11001000 00010111 00010000 00000000 /23 Organization 1 11001000 00010111 00010010 00000000 /23 Organization 2 11001000 00010111 00010100 00000000 /23 . . . .Organization 7 11001000 00010111 00011110 00000000 /23,4: Network Layer,4a-39,Hierarchical addressing: route aggregation,“Send me anythingwith addresses beginning /20”,Fly-By-Night-ISP,Organization 0,Organization 7,Internet,Organization 1,ISPs-R-Us,“Send me anythingwith addresses beginning /16”,Organization 2,Hierarchical addressing allows efficient advertisement of routing information:,4: Network Layer,4a-40,Hierarchical addressing: more specific routes,ISPs-R-Us has a more specific route to Organization 1,“Send me anythingwith addresses beginning /20”,Fly-By-Night-ISP,Organization 0,Organization 7,Internet,Organization 1,ISPs-R-Us,“Send me anythingwith addresses beginning /16or /23”,Organization 2,4: Network Layer,4a-41,IP addressing: the last word.,Q: How does an ISP get block of addresses?A: ICANN: Internet Corporation for Assigned Names and Numbersallocates addressesmanages DNSassigns domain names, resolves disputes,4: Network Layer,4a-42,Getting a datagram from source to dest.,IP datagram:,datagram remains unchanged, as it travels source to destinationaddr fields of interest here,routing table in A,4: Network Layer,4a-43,Getting a datagram from source to dest.,Starting at A, given IP datagram addressed to B:look up net. address of Bfind B is on same net. as Alink layer will send datagram directly to B inside link-layer frameB and A are directly connected,miscfields,,,data,4: Network Layer,4a-44,Getting a datagram from source to dest.,Starting at A, dest. E:look up network address of EE on different networkA, E not directly attachedrouting table: next hop router to E is link layer sends datagram to router inside link-layer framedatagram arrives at continued.,miscfields,,,data,4: Network Layer,4a-45,Getting a datagram from source to dest.,Arriving at 223.1.4, destined for look up network address of EE on same network as routers interface router, E directly attachedlink layer sends datagram to inside link-layer frame via interface datagram arrives at ! (hooray!),miscfields,,,data,4: Network Layer,4b-46,IP datagram format,ver,length,32 bits,data (variable length,typically a TCP or UDP segment),16-bit identifier,Internet checksum,time tolive,32 bit source IP address,IP protocol versionnumber,header length (bytes),max numberremaining hops(decremented at each router),forfragmentation/reassembly,total datagramlength (bytes),upper layer protocolto deliver payload to,head.len,type ofservice,“type” of data,flgs,fragment offset,upper layer,32 bit destination IP address,Options (if any),E.g. timestamp,record routetaken, pecifylist of routers to visit.,4: Network Layer,4b-47,IP Fragmentation & Reassembly,network links have MTU (max.transfer size) - largest possible link-level frame.different link types, different MTUs large IP datagram divided (“fragmented”) within netone datagram becomes several datagrams“reassembled” only at final destinationIP header bits used to identify, order related fragments,fragmentation: in: one large datagramout: 3 smaller datagrams,reassembly,4: Network Layer,4b-48,IP Fragmentation and Reassembly,One large datagram becomesseveral smaller datagrams,4: Network Layer,4b-49,ICMP: Internet Control Message Protocol,used by hosts, routers, gateways to communication network-level informationerror reporting: unreachable host, network, port, protocolecho request/reply (used by ping)network-layer “above” IP:ICMP msgs carried in IP datagramsICMP message: type, code plus first 8 bytes of IP datagram causing error,Type Code description0 0 ec
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
评论
0/150
提交评论