四川大学计算机网络课件5.ppt_第1页
四川大学计算机网络课件5.ppt_第2页
四川大学计算机网络课件5.ppt_第3页
四川大学计算机网络课件5.ppt_第4页
四川大学计算机网络课件5.ppt_第5页
已阅读5页,还剩143页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Network Layer,4-1,Chapter 4Network Layer,A note on the use of these ppt slides: Were making these slides freely available to all (faculty, students, readers). Theyre in PowerPoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously

2、 represent a lot of work on our part. In return for use, we only ask the following: If you use these slides (e.g., in a class) in substantially unaltered form, that you mention their source (after all, wed like people to use our book!) If you post any slides in substantially unaltered form on a www

3、site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material. Thanks and enjoy! JFK/KWR All material copyright 1996-2010 J.F Kurose and K.W. Ross, All Rights Reserved,Computer Networking: A Top Down Approach 5th edition. Jim Kurose, Kei

4、th RossAddison-Wesley, April 2009.,Network Layer,4-2,Chapter 4: Network Layer,Chapter goals: understand principles behind network layer services: network layer service models forwarding versus routing how a router works routing (path selection) broadcast, multicast instantiation, implementation in t

5、he Internet,Network Layer,4-3,Chapter 4: Network Layer,4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 Whats inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing ICMP IPv6,4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the I

6、nternet RIP OSPF BGP 4.7 Broadcast and multicast routing,Network Layer,4-4,Network layer,transport segment from sending to receiving host on sending side encapsulates segments into datagrams on rcving side, delivers segments to transport layer network layer protocols in every host, router router exa

7、mines header fields in all IP datagrams passing through it,Network Layer,4-5,Two Key Network-Layer Functions,forwarding: move packets from routers input to appropriate router output routing: determine route taken by packets from source to dest. routing algorithms,analogy: routing: process of plannin

8、g trip from source to dest forwarding: process of getting through single interchange,Network Layer,4-6,Interplay between routing and forwarding,Network Layer,4-7,Connection setup,3rd important function in some network architectures: ATM, frame relay, X.25 before datagrams flow, two end hosts and int

9、ervening routers establish virtual connection routers get involved network vs transport layer connection service: network: between two hosts (may also involve intervening routers in case of VCs) transport: between two processes,Network Layer,4-8,Network service model,Q: What service model for “chann

10、el” transporting datagrams from sender to receiver?,example services for individual datagrams: guaranteed delivery guaranteed delivery with less than 40 msec delay,example services for a flow of datagrams: in-order datagram delivery guaranteed minimum bandwidth to flow restrictions on changes in int

11、er-packet spacing,Network Layer,4-9,Network layer service models:,Network Architecture Internet ATM ATM ATM ATM,Service Model best effort CBR VBR ABR UBR,Bandwidth none constant rate guaranteed rate guaranteed minimum none,Loss no yes yes no no,Order no yes yes yes yes,Timing no yes yes no no,Conges

12、tion feedback no (inferred via loss) no congestion no congestion yes no,Guarantees ?,Network Layer,4-10,Chapter 4: Network Layer,4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 Whats inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing ICMP IPv6,4.5 Routing algor

13、ithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF BGP 4.7 Broadcast and multicast routing,Network Layer,4-11,Network layer connection and connection-less service,datagram network provides network-layer connectionless service VC network provides network-layer

14、connection service analogous to the transport-layer services, but: service: host-to-host no choice: network provides one or the other implementation: in network core,Network Layer,4-12,Virtual circuits,call setup, teardown for each call before data can flow each packet carries VC identifier (not des

15、tination host address) every router on source-dest path maintains “state” for each passing connection link, router resources (bandwidth, buffers) may be allocated to VC (dedicated resources = predictable service),“source-to-dest path behaves much like telephone circuit” performance-wise network acti

16、ons along source-to-dest path,Network Layer,4-13,VC implementation,a VC consists of: path from source to destination VC numbers, one number for each link along path entries in forwarding tables in routers along path packet belonging to VC carries VC number (rather than dest address) VC number can be

17、 changed on each link. New VC number comes from forwarding table,Network Layer,4-14,VC Forwarding table,Forwarding table in northwest router:,Routers maintain connection state information!,Network Layer,4-15,Virtual circuits: signaling protocols,used to setup, maintain teardown VC used in ATM, frame

18、-relay, X.25 not used in todays Internet,1. Initiate call,2. incoming call,3. Accept call,4. Call connected,5. Data flow begins,6. Receive data,Network Layer,4-16,Datagram networks,no call setup at network layer routers: no state about end-to-end connections no network-level concept of “connection”

19、packets forwarded using destination host address packets between same source-dest pair may take different paths,1. Send data,2. Receive data,Network Layer,4-17,Datagram Forwarding table,1,2,3,IP destination address in arriving packets header,routing algorithm,local forwarding table,dest address,outp

20、ut link,address-range 1 address-range 2 address-range 3 address-range 4,3 2 2 1,Network Layer,4-18,Datagram Forwarding table,Destination Address Range 11001000 00010111 00010000 00000000 through 11001000 00010111 00010111 11111111 11001000 00010111 00011000 00000000 through 11001000 00010111 0001100

21、0 11111111 11001000 00010111 00011001 00000000 through 11001000 00010111 00011111 11111111 otherwise,Link Interface 0 1 2 3,Q: but what happens if ranges dont divide up so nicely?,Network Layer,4-19,Longest prefix matching,Destination Address Range 11001000 00010111 00010* * 11001000 00010111 000110

22、00 * 11001000 00010111 00011* * otherwise,DA: 11001000 00010111 00011000 10101010,Examples:,DA: 11001000 00010111 00010110 10100001,Which interface?,Which interface?,when looking for forwarding table entry for given destination address, use longest address prefix that matches destination address.,Lo

23、ngest prefix matching,Link interface 0 1 2 3,Network Layer,4-20,Datagram or VC network: why?,Internet (datagram) data exchange among computers “elastic” service, no strict timing req. “smart” end systems (computers) can adapt, perform control, error recovery simple inside network, complexity at “edg

24、e” many link types different characteristics uniform service difficult,ATM (VC) evolved from telephony human conversation: strict timing, reliability requirements need for guaranteed service “dumb” end systems telephones complexity inside network,Network Layer,4-21,Chapter 4: Network Layer,4. 1 Intr

25、oduction 4.2 Virtual circuit and datagram networks 4.3 Whats inside a router? 4.4 IP: Internet Protocol Datagram format IPv4 addressing ICMP IPv6,4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF BGP 4.7 Broadcast and multicast routing,Networ

26、k Layer,4-22,Router Architecture Overview,two key router functions: run routing algorithms/protocol (RIP, OSPF, BGP) forwarding datagrams from incoming to outgoing link,Network Layer,4-23,line termination,link layer protocol (receive),lookup, forwarding queueing,Input Port Functions,Decentralized sw

27、itching: given datagram dest., lookup output port using forwarding table in input port memory goal: complete input port processing at line speed queuing: if datagrams arrive faster than forwarding rate into switch fabric,Physical layer: bit-level reception,Data link layer: e.g., Ethernet see chapter

28、 5,switch fabric,Network Layer,4-24,Switching fabrics,transfer packet from input buffer to appropriate output buffer switching rate: rate at which packets can be transfer from inputs to outputs often measured as multiple of input/output line rate N inputs: switching rate N times line rate desirable

29、three types of switching fabrics,memory,memory,bus,crossbar,Network Layer,4-25,Switching Via Memory,First generation routers: traditional computers with switching under direct control of CPU packet copied to systems memory speed limited by memory bandwidth (2 bus crossings per datagram),Network Laye

30、r,4-26,Switching Via a Bus,datagram from input port memory to output port memory via a shared bus bus contention: switching speed limited by bus bandwidth 32 Gbps bus, Cisco 5600: sufficient speed for access and enterprise routers,bus,Network Layer,4-27,Switching Via An Interconnection Network,overc

31、ome bus bandwidth limitations Banyan networks, crossbar, other interconnection nets initially developed to connect processors in multiprocessor advanced design: fragmenting datagram into fixed length cells, switch cells through the fabric. Cisco 12000: switches 60 Gbps through the interconnection ne

32、twork,Network Layer,4-28,Output Ports,buffering required when datagrams arrive from fabric faster than the transmission rate scheduling discipline chooses among queued datagrams for transmission,line termination,link layer protocol (send),switch fabric,Network Layer,4-29,Output port queueing,bufferi

33、ng when arrival rate via switch exceeds output line speed queueing (delay) and loss due to output port buffer overflow!,Network Layer,4-30,How much buffering?,RFC 3439 rule of thumb: average buffering equal to “typical” RTT (say 250 msec) times link capacity C e.g., C = 10 Gpbs link: 2.5 Gbit buffer

34、 recent recommendation: with N flows, buffering equal to,Network Layer,4-31,Input Port Queuing,fabric slower than input ports combined - queueing may occur at input queues queueing delay and loss due to input buffer overflow! Head-of-the-Line (HOL) blocking: queued datagram at front of queue prevent

35、s others in queue from moving forward,output port contention: only one red datagram can be transferred.lower red packet is blocked,one packet time later: green packet experiences HOL blocking,switch fabric,switch fabric,Network Layer,4-32,Chapter 4: Network Layer,4. 1 Introduction 4.2 Virtual circui

36、t and datagram networks 4.3 Whats inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing ICMP IPv6,4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF BGP 4.7 Broadcast and multicast routing,Network Layer,4-33,The Internet Ne

37、twork layer,Host, router network layer functions:,Transport layer: TCP, UDP,Link layer,physical layer,Network layer,Network Layer,4-34,Chapter 4: Network Layer,4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 Whats inside a router 4.4 IP: Internet Protocol Datagram format IPv4 address

38、ing ICMP IPv6,4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF BGP 4.7 Broadcast and multicast routing,Network Layer,4-35,IP datagram format,how much overhead with TCP? 20 bytes of TCP 20 bytes of IP = 40 bytes + app layer overhead,Network L

39、ayer,4-36,IP Fragmentation Value: 445747E2445749F244574092; IP Address: 26; IP Address: 42; IP Address: 46 Option: (t=15,l=20) Domain Name = .,reply,Message type: Boot Request (1) Hardware type: Ethernet Hardware address length: 6 Hops: 0 Transaction ID: 0 x6b3a11b7 Sec

40、onds elapsed: 0 Bootp flags: 0 x0000 (Unicast) Client IP address: () Your (client) IP address: () Next server IP address: () Relay agent IP address: () Client MAC address: Wistron_23:68:8a (00:16:d3:23:68:8a) Server host name not given Boot

41、 file name not given Magic cookie: (OK) Option: (t=53,l=1) DHCP Message Type = DHCP Request Option: (61) Client identifier Length: 7; Value: 010016D323688A; Hardware type: Ethernet Client MAC address: Wistron_23:68:8a (00:16:d3:23:68:8a) Option: (t=50,l=4) Requested IP Address = 01 Option

42、: (t=12,l=5) Host Name = nomad Option: (55) Parameter Request List Length: 11; Value: 010F03062C2E2F1F21F92B 1 = Subnet Mask; 15 = Domain Name 3 = Router; 6 = Domain Name Server 44 = NetBIOS over TCP/IP Name Server ,request,Network Layer,4-52,IP addresses: how to get one?,Q: How does network get sub

43、net part of IP addr? A: gets allocated portion of its provider 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

44、00010111 00010100 00000000 /23 . . . . Organization 7 11001000 00010111 00011110 00000000 /23,Network Layer,4-53,Hierarchical addressing: route aggregation,“Send me anything with addresses beginning /20”,Fly-By-Night-ISP,Organization 0,Organization 7,Internet,Organiz

45、ation 1,ISPs-R-Us,“Send me anything with addresses beginning /16”,Organization 2,Hierarchical addressing allows efficient advertisement of routing information:,Network Layer,4-54,Hierarchical addressing: more specific routes,ISPs-R-Us has a more specific route to Organization 1,“Send me an

46、ything with addresses beginning /20”,Fly-By-Night-ISP,Organization 0,Organization 7,Internet,Organization 1,ISPs-R-Us,“Send me anything with addresses beginning /16 or /23”,Organization 2,Network Layer,4-55,IP addressing: the last word.,Q: How does an ISP get block of

47、 addresses? A: ICANN: Internet Corporation for Assigned Names and Numbers allocates addresses manages DNS assigns domain names, resolves disputes,Network Layer,4-56,NAT: Network Address Translation,,,,,,local network (e.g., home network) 10.0.0/24,rest of I

48、nternet,Datagrams with source or destination in this network have 10.0.0/24 address for source, destination (as usual),All datagrams leaving local network have same single source NAT IP address: , different source port numbers,Network Layer,4-57,NAT: Network Address Translation,Motivation

49、: local network uses just one IP address as far as outside world is concerned: range of addresses not needed from ISP: just one IP address for all devices can change addresses of devices in local network without notifying outside world can change ISP without changing addresses of devices in local ne

50、twork devices inside local net not explicitly addressable, visible by outside world (a security plus).,Network Layer,4-58,NAT: Network Address Translation,Implementation: NAT router must: outgoing datagrams: replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port

51、#) . . . remote clients/servers will respond using (NAT IP address, new port #) as destination addr. remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair incoming datagrams: replace (NAT IP address, new port #) in dest fields of every

52、 incoming datagram with corresponding (source IP address, port #) stored in NAT table,Network Layer,4-59,NAT: Network Address Translation,,,,,,NAT translation table WAN side addr LAN side addr,, 5001 , 3345 ,3: Reply arrives dest. address

53、: , 5001,4: NAT router changes datagram dest addr from , 5001 to , 3345,Network Layer,4-60,NAT: Network Address Translation,16-bit port-number field: 60,000 simultaneous connections with a single LAN-side address! NAT is controversial: routers should only process up to

54、layer 3 violates end-to-end argument NAT possibility must be taken into account by app designers, e.g., P2P applications address shortage should instead be solved by IPv6,Network Layer,4-61,NAT traversal problem,client wants to connect to server with address server address local to

55、 LAN (client cant use it as destination addr) only one externally visible NATed address: solution 1: statically configure NAT to forward incoming connection requests at given port to server e.g., (, port 2500) always forwarded to port 25000,,,NAT route

56、r,,Client,?,Network Layer,4-62,NAT traversal problem,solution 2: Universal Plug and Play (UPnP) Internet Gateway Device (IGD) Protocol. Allows NATed host to: learn public IP address () add/remove port mappings (with lease times) i.e., automate static NAT port map configuration,

57、,,NAT router,,IGD,Network Layer,4-63,NAT traversal problem,solution 3: relaying (used in Skype) NATed client establishes connection to relay External client connects to relay relay bridges packets between to connections,,Client,1. connection to relay initiated b

58、y NATed host,2. connection to relay initiated by client,3. relaying established,Network Layer,4-64,Chapter 4: Network Layer,4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 Whats inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing ICMP IPv6,4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF BGP 4.7 Broadcast and multicast routing,Network Layer,4-65,ICMP: Internet Control Message Protocol,used by hosts = if not direct nei

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论