Computer Networking Lecture 8


1College of Software,NKU Computer Networking Lecture 8 Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 2College of Software,NKU Chapter 4: Network Layer Chapter goals: n understand principles behind network layer services: n dealing with scale n how a router works n routing (path selection) n advanced topics: IPv6, mobility n Instantiation and implementation in the Internet Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 3College of Software,NKU Chapter 4: Network Layer n 4. 1 Introduction n 4.2 Virtual circuit and datagram networks n 4.3 What’s inside a router n 4.4 IP: Internet Protocol n 4.5 Routing algorithms n 4.6 Routing in the Internet n 4.7 Broadcast and multicast routing Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 4College of Software,NKU Key Network-Layer Functions n 把报文从发送端传送到接 收端 n network layer protocols in every host, router n forwarding:将packet由 router的input送到合适 的output n routing:决定packet从发 送端到接收端所经过的路 径 n Routing algorithms Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 5College of Software,NKU Connection setup n 3rd important function in some network architectures: n ATM, frame relay, X.25 n Before datagrams flow, two hosts and intervening routers establish virtual connection n Routers get involved n Network and transport layer service: n Network: between two hosts n Transport: between two processes Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 6College of Software,NKU Network service model Q: What service model for “channel” transporting datagrams from sender to rcvr? Example services for individual datagrams: n guaranteed delivery n Guaranteed delivery with less than 40 msec delay Example services for a flow of datagrams: n In-order datagram delivery n Guaranteed minimum bandwidth to flow n Restrictions on changes in inter-packet spacing Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 7College of Software,NKU 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 Congestion feedback no (inferred via loss) no congestion no congestion yes no Guarantees ? Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 8College of Software,NKU 4.2 Network layer service n Datagram network provides network-layer connectionless service n VC network provides network-layer connection service n Analogous to the transport-layer services, but: n Service: host-to-host n No choice: network provides one or the other n Implementation: in the core Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 9College of Software,NKU Virtual circuits n call每次数据传送必须有 设定路径 的动作:VC setup,data transfer, Virtual-circuit teardown n 每个packet都带有VC identifier n 连接上的每个 router对每条路径维护其当前的连线 状态 n 需要分配router的资源给每个VC “source-to-dest path behaves much like telephone circuit” n performance-wise n network actions along source-to-dest path Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 10College of Software,NKU Virtual circuits n Packet switches along the path between the two end systems are involved in VC setup n used in ATM, frame-relay n not used in today’s Internet application transport network data link physical application transport network data link physical 1. Initiate call 2. incoming call 3. Accept call4. Call connected 5. Data flow begins 6. Receive data Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 11College of Software,NKU VC implementation A VC consists of: 1. Path from source to destination 2. VC numbers, one number for each link along path 3. Entries in forwarding tables in routers along path n Packet belonging to VC carries a VC number. n VC number must be changed on each link. n New VC number comes from forwarding table Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 12College of Software,NKU VC implementation : example R1 R2 R3 R4 1 2 3 1 2 3 AB Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 13College of Software,NKU Datagram networks: the Internet model n no call setup at network layer n only the two end systems are aware of the transport-layer connection n routers: no state about end-to-end connections n packets forwarded using destination host address application transport network data link physical application transport network data link physical 1. Send data 2. Receive data Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 14College of Software,NKU Forwarding table Destination Address Range Link Interface 11001000 00010111 00010000 00000000 through 0 11001000 00010111 00010111 11111111 11001000 00010111 00011000 00000000 through 1 11001000 00010111 00011000 11111111 11001000 00010111 00011001 00000000 through 2 11001000 00010111 00011111 11111111 otherwise 3 Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 15College of Software,NKU Longest prefix matching Prefix Match Link Interface 11001000 00010111 00010 0 11001000 00010111 00011000 1 11001000 00010111 00011 2 otherwise 3 DA: 11001000 00010111 00011000 10101010 Examples: DA: 11001000 00010111 00010110 10100001 Which interface? Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 16College of Software,NKU Datagram or VC network Internet n data exchange among computers n “elastic” service, no strict timing req. n “smart” end systems (computers) n adapt, perform control, error recovery n simple inside network, complexity at “edge” n many link types n different characteristics n uniform service difficult ATM n evolved from telephony n “dumb” end systems Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 17College of Software,NKU 4.3 Router Architecture Overview Two key router functions: n run routing algorithms/protocol (RIP, OSPF, BGP) n forwarding datagrams from incoming to outgoing link Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 18College of Software,NKU Input Port Functions Decentralized switching: n given datagram dest., lookup output port using forwarding table in input port memory n goal: complete input port processing at line speed n queuing: if datagrams arrive faster than forwarding rate into switch fabric Physical layer: bit-level reception Data link layer: e.g., Ethernet Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 19College of Software,NKU Three types of switching fabrics Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 20College of Software,NKU Output Ports n Buffering required when datagrams arrive from fabric faster than the transmission rate n Scheduling discipline chooses among queued datagrams for transmission Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 21College of Software,NKU Output port queueing n buffering when arrival rate via switch exceeds output line speed n queueing (delay) and loss due to output port buffer overflow! Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 22College of Software,NKU Input Port Queuing n Fabric slower than input ports combined -> queueing may occur at input queues n Head-of-the-Line (HOL) blocking: queued datagram at front of queue prevents others in queue from moving forward n queueing delay and loss due to input buffer overflow! Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 23College of Software,NKU 4.4 The Internet Network layer Three major components: Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 24College of Software,NKU IP datagram format 32 bits ver Datagram length data 16-bit identifier Internet checksumtime to live 32 bit source IP address head. len Type of service Flgs Upper layer 32 bit destination IP address Options (if any) n 20 bytes of TCP n 20 bytes of IP n = 40 bytes + app layer overhead Fragment offset Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 25College of Software,NKU IP Fragmentation & Reassembly n MTU n largest possible link-level frame n different link types, different link-layer protocols,with different MTUs n large IP datagram are divided (“fragmented”) within network n one datagram becomes several datagrams n “reassembled” only at final destination n IP header bits used to identify, order related fragments reassembly Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 26College of Software,NKU IP Fragmentation & Reassembly ID =x offset =0 fragflag =0 length =4000 ID =x offset =0 fragflag =1 length =1500 ID =x offset =185 fragflag =1 length =150 0 ID =x offset =370 fragflag =0 length =1040 One large datagram becomes several smaller datagrams Example n 4000 byte datagram n MTU = 1500 bytes n Identifier: created by sender, all fragments have the same identification number as the original datagram n Flag = 1 more fragment n Flag = 0 the last fragment n Offset: byte number of the 1st byte of the fragment Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 27College of Software,NKU IP Addressing: introduction n IP address: 32-bit identifier for host, router interface n interface: connection between host/router and physical link 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.3.2223.1.3.1 223.1.3.27 n router’s typically have multiple interfaces n host may have multiple interfaces n IP addresses associated with each interface Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 28College of Software,NKU IP Addressing: subnet n IP address: n network part n host part n What’s a subnet ? n device interfaces with same network part of IP address n can physically reach each other without intervening router 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2223.1.3.1 223.1.3.27 network consisting of 3 IP networks LAN Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 29College of Software,NKU Subnet How to find the subnet? n Detach each interface from router, host n create “islands of isolated networks 223.1.1.1 223.1.1.3 223.1.1.4 223.1.2.2223.1.2.1 223.1.2.6 223.1.3.2223.1.3.1 223.1.3.27 223.1.1.2 223.1.7.0 223.1.7.1 223.1.8.0223.1.8.1 223.1.9.1 223.1.9.2 How many subnets? Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 30College of Software,NKU Class-ful addressing 0network hostA 10 network hostB 110 network hostC 1110 multicast addressD class 1.0.0.0 to 127.255.255.255 128.0.0.0 to 191.255.255.255 192.0.0.0 to 223.255.255.255 224.0.0.0 to 239.255.255.255 32 bits given notion of “network”, let’s re-examine IP addresses: Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 31College of Software,NKU IP addressing: CIDR CIDR: Classless InterDomain Routing n subnet portion of address of arbitrary length n address format: a.b.c.d/x, where x is # bits in subnet portion of address 11001000 00010111 00010000 00000000 subnet part host part 200.23.16.0/23 Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 32College of Software,NKU IP addresses: how to get one? Q: How does host get IP address? n hard-coded by system admin in a file n Wintel: control-panel->network- >configuration->tcp/ip->properties n UNIX: /etc/rc.config n DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server n “plug-and-play” (more in next chapter) Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 33College of Software,NKU IP addresses: how to get one? Q: How does network get subnet part of IP addr? A: gets allocated portion of its provider ISP’s address space 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 Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 34College of Software,NKU Hierarchical addressing & route aggregationn 层次编址可以高效地发布路由信息 n Route aggregation:使用单一的网络前缀发布多个网络 Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 35College of Software,NKU Route aggregation Organization 1 脱离 Fly-By-Night-ISP 加入 ISPs-R-Us 200.23.18.0/23 Ì 200.23.16.0/20 Þ use longest prefix matching Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 36College of Software,NKU IP addressing: the last word... Q: How does an ISP get block of addresses? A: ICANN: Internet Corporation for Assigned Names and Numbers n allocates addresses n manages DNS n assigns domain names, resolves disputes Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 37College of Software,NKU ICMP: Internet Control Message Protocol n used by hosts & routers to communicate network-level information n error reporting: unreachable host, network, port, protocol n echo request/reply (used by ping) n network-layer “above” IP: n ICMP msgs carried in IP datagrams n ICMP message: type, code plus first 8 bytes of IP datagram causing error Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 38College of Software,NKU ICMP: Internet Control Message Protocol Type Code description 0 0 echo reply (ping) 3 0 dest. network unreachable 3 1 dest host unreachable 3 2 dest protocol unreachable 3 3 dest port unreachable 3 6 dest network unknown 3 7 dest host unknown 4 0 source quench (congestion control) 8 0 echo request (ping) 9 0 route advertisement 10 0 router discovery 11 0 TTL expired 12 0 bad IP header Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 39College of Software,NKU Tracert and ICMP Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 40College of Software,NKU NAT: Network Address Translation n Motivation: local network uses just one IP address as far as outside word is concerned: n no need to be allocated range of addresses from ISP: - just one IP address is used for all devices n can change addresses of devices in local network without notifying outside world n can change ISP without changing addresses of devices in local network n devices inside local net not explicitly addressable, visible by outside world (a security plus). Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 41College of Software,NKU NAT: Network Address Translation n Implementation: NAT router must: n outgoing datagrams: replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #). . . remote clients/servers will respond using(NAT IP address, new port #) as destination address. n remember (in NAT translation table) every (source IP address, port #) to(NAT IP address, new port #) translation pair n incoming datagrams: replace (NAT IP address, new port #) in destination fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only. 42College of Software,NKU 10.0.0.1 S: 10.0.0.1, 3345 D: 128.119.40.186, 80 110.0.0.4 138.76.29.7 1: host 10.0.0.1 sends datagram to 128.119.40, 80 NAT translation table WAN side addr LAN side addr 138.76.29.7, 5001 10.0.0.1, 3345 …… …… S: 128.119.40.186, 80 D: 10.0.0.1, 3345 4 S: 138.76.29.7, 5001 D: 128.119.40.186, 802 2: NAT router changes datagram source addr, updates table S: 128.119.40.186, 80 D: 138.76.29.7, 5001 3 3: Reply arrives dest. address: 138.76.29.7, 5001 NAT: example 10.0.0.2 10.0.0.3 4: NAT router changes datagram dest addr from 138.76.29.7, 5001 to 10.0.0.1, 3345 Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only.
还剩41页未读

继续阅读

下载pdf到电脑,查找使用更方便

pdf的实际排版效果,会与网站的显示效果略有不同!!

需要 5 金币 [ 分享pdf获得金币 ] 0 人已下载

下载pdf

pdf贡献者

huangyali2

贡献于2015-04-10

下载需要 5 金币 [金币充值 ]
亲,您也可以通过 分享原创pdf 来获得金币奖励!
下载pdf