版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、数据通信基础第19章 (网络互联)Internetworking20120331Network LayerPART IV20120331Position of network layer20120331Network layer dutiesDatalink layer data frames through single physical networkNetwork layer data packets between multiple networks - the Inter-network layerMake many networks look like one large netw
2、orkUnique address for every host on the internetDetermine best route to destination (routers)Organise data into packets, add addressing info., etc.Split large packets into smaller ones (routers)20120331ChaptersChapter 19 Host-to-Host DeliveryChapter 20 Network Layer ProtocolsChapter 21 Unicast and M
3、ulticast Routing Protocols20120331Figure 24-1An Internet According to TCP/IPREVIEW20120331Figure 24-2TCP/IP and the OSI ModelREVIEW20120331Chapter 19Host-to-Host Delivery:主机到主机的传送Internetworking, 网络互联Addressing, 编址and Routing 路由2012033119.1 InternetworksNeed For Network LayerInternet As A Packet-Swi
4、tched Network分组交换网 - individual packets take their own route (and must contain their own addressing)Internet As A Connectionless Network无连接网 - no permanent connection made between source and destination existence of destination not checked in advance20120331Figure 19.1 InternetworkSourceDestinationS
5、witch or Router20120331Figure 19.2 Links in an internetworkHop-to-hop: from one node to another20120331Figure 19.3 Network layer in an internetworkHost-to-host: from source to destination20120331Figure 19.4 Network layer at the source20120331Figure 19.5 Network layer at a router20120331Figure 19.6 N
6、etwork layer at the destination20120331Figure 19.7 SwitchingPermanent connection during transfer, like switched telephone data does not include addressing infoSame route defined for all packets for duration of messageEach independent packet has addresses attached- Route not predetermined电路交换虚电路方式数据包
7、方式20120331Figure 19.8 Datagram approach20120331Switching at the network layer in the Internet is done using the datagram approach to packet switching.Note:20120331Communication at the network layer in the Internet is connectionless. Note:2012033119.2 AddressingInternet AddressClassful Addressing 有分类
8、的编址Supernetting 超网编址Subnetting 子网编址Classless Addressing 无分类的编址Dynamic Address ConfigurationNetwork Address Translation20120331An IP address is a 32-bit address.Note:NOTE: It is BIT, not BYTENOTE: 32 bits = 4 Bytes1 Byte = 8 BitsThere are TWO parts in IP address: Netid (network ID网络号) and Hostid (Hos
9、t ID主机号)20120331The IP addresses are unique and universal.Note:20120331Figure 19.9 Dotted-decimal notationDotdecimalPurpose of Use: Convenient for human being to remember IP address.NOTE: The maximum of each number should be 255.点分十进制表示方式20120331The binary, decimal, and hexadecimal number systems ar
10、e reviewed in Appendix B.Note:How to convert:From Binary to Decimal: Weighted SumFrom Decimal to Binary: Long Division20120331Example 1Change the following IP addresses from binary notation to dotted-decimal notation.a.10000001 00001011 00001011 11101111b.11111001 10011011 11111011 00001111SolutionW
11、e replace each group of 8 bits with its equivalent decimal number (see Appendix B) and add dots for separation:a.129.11.11.239b.249.155.251.1520120331Example 2Change the following IP addresses from dotted-decimal notation to binary notation.a.111.56.45.78b.75.45.34.78SolutionWe replace each decimal
12、number with its binary equivalent (see Appendix B):a.01101111 00111000 00101101 01001110b.01001011 00101101 00100010 01001110 20120331In classful addressing, the address space is divided into five classes: A, B, C, D, and E.Note:20120331Figure 19.10 Finding the class in binary notation这张表非常重要2012033
13、1Figure 19.11 Finding the address class 20120331Example 3Find the class of each address:a.00000001 00001011 00001011 11101111b.11110011 10011011 11111011 00001111SolutionSee the procedure in Figure 19.11. a.The first bit is 0; this is a class A address.b.The first 4 bits are 1s; this is a class E ad
14、dress. 20120331Figure 19.12 Finding the class in decimal notation 0d = 0 0000000b; 127d = 0 1111111b;128d = 10 000000b; 191d = 10 111111b;192d = 110 00000b; 223d = 110 11111b;这张表非常实用20120331Example 4Find the class of each address:a.227.12.14.87b.252.5.15.111c.134.11.78.56Solutiona.The first byte is
15、227 (between 224 and 239); the class is D.b.The first byte is 252 (between 240 and 255); the class is E.c.The first byte is 134 (between 128 and 191); the class is B.20120331Figure 19.13 Netid and hostid20120331Figure 19.14 Blocks in class A20120331Millions of class A addresses are wasted.Note:20120
16、331Figure 19.15 Blocks in class B20120331Many class B addresses are wasted.Note:20120331The number of addresses in class C is smaller than the needs of most organizations.Note:20120331Figure 19.16 Blocks in class C20120331Figure 19.17 Network address20120331In classful addressing, the network addres
17、s is the one that is assigned to the organization. Note:The network address is one specific IP address, but it represents a group of IP addresses from one organization. Network address = NetID + 0(HostID)20120331Example 5Given the address 23.56.7.91, find the network address.SolutionThe class is A.
18、Only the first byte defines the netid. We can find the network address by replacing the hostid bytes (56.7.91) with 0s. Therefore, the network address is 23.0.0.0. 20120331Example 6Given the address 132.6.17.85, find the network address.SolutionThe class is B. The first 2 bytes defines the netid. We
19、 can find the network address by replacing the hostid bytes (17.85) with 0s. Therefore, the network address is 132.6.0.0.20120331Example 7Given the network address 17.0.0.0, find the class.SolutionThe class is A because the netid is between 0-127. (because the netid is only 1 byte.)20120331A network
20、 address is different from a netid. A network address has both netid and hostid, with 0s for the hostid.Note:Netid0(hostid)20120331Figure 19.18 Sample internete.g. T1 lineToken Ring NetworkClass B EthernetClass A Ethernet Network20120331IP addresses are designed with two levels of hierarchy.The neti
21、d is the first level this unique number identifies the networkThe hostid is the second level this defines the host on that network. A hostid is not uniqueNote:20120331Figure 19.19 A network with two levels of hierarchy Class B networkNetid = 141.14Network address = 141.14.0.0Hostid = 192.2IP address
22、 = 141.14.192.2This router looks for packetsWith address 141.14.X.XWhere X = dont care20120331Figure 19.20 A network with three levels of hierarchy (subnetted)This router looks for 141.14.64.X20120331Figure 19.21 Addresses in a network with and without subnetting20120331Figure 19.22 Hierarchy concep
23、t in a telephone numberA router which connects to the internet will look for all packets with destination address 141.14.X.X (first layer)A subnet router on network 141.14.192.0 will look for all packets with subnet id = 192 (middle layer)Host 141.14.192.2 will read all packets with hostid = 2NetidH
24、ostidSubnet id20120331Table 19.1 Default masksClassIn BinaryIn Dotted-DecimalUsing SlashA11111111 00000000 00000000 00000000255.0.0.0/8B11111111 11111111 00000000 00000000255.255.0.0/16C11111111 111111111 11111111 00000000255.255.255.0/24A mask is a binary number used to select certain sections of a
25、n IP address. When the mask is ANDed with the IP address, the sections where the mask bits=1 are extracted, and the remainder is set to zero (since anything ANDed with zero = 0). A class B default mask will thus extract the first 16 bits of an IP address (the netid)Routers use masks to extract routi
26、ng information20120331The network address can be foundby applying the default mask to anyaddress in the block (including itself).It retains the netid of the block and sets the hostid to 0s.Note:网络地址 20120331Example 8A router outside the organization receives a packet with destination address 190.240
27、.7.91. Show how it finds the network address to route the packet.SolutionThe router follows three steps:The router looks at the first byte of the address to find the class. It is class B. The default mask for class B is 255.255.0.0. The router ANDs this mask with the address to get 190.240.0.0. The
28、router looks in its routing table to find out how to route the packet to this destination. Later, we will see what happens if this destination does not exist.20120331Figure 19.23 Subnet maskThe subnet mask will extract both the netid and the subnet id20120331Example 9A router inside the organization
29、 receives the same packet with destination address 190.240.33.91. Show how it finds the subnetwork address to route the packet.SolutionThe router follows three steps:The router must know the mask. We assume it is /19, as shown in Figure 19.23. The router applies the mask to the address, 190.240.33.9
30、1. The subnet address is 190.240.32.0. The router looks in its routing table to find how to route the packet to this destination. Later, we will see what happens if this destination does not exist. 20120331Class C addresses only support 256 hosts (strictly 254). Organisations can supernet several cl
31、ass C addresses to form one larger block. External routers then need to look for a range of netids, rather than just one.Note:20120331Private IP addresses within a network are often not permanently assigned to individual hosts (since addresses are in short supply, and not all hosts will be active).
32、A process of Dynamic Host Configuration automatically leases temporary IP addresses to hosts using DHCP 动态主机配置协议(P = protocol)Note:20120331Each host must have:IP addressSubnet maskIP address of nearest router (gateway)IP address of name server DHCP takes care of all this automaticallyNote:20120331Ta
33、ble 19.2 Default masksRangeTotal10.0.0.0 to 10.255.255.255224172.16.0.0 to 172.31.255.255220192.168.0.0 to 192.168.255.255216Private IP addresses 专用的IP地址The above IP address ranges NEVER appear on the Internet, and are ignored by routers. They are for private (internal) IP networks within organisati
34、ons they are not unique, since they are used over and over again within each organisation. The University uses these addresses for all its PCs (hosts)20120331Figure 19.25 IPconfigipconfig is a DOS (command line) based utility for establishing the IP address of a host. Run ProgramsAccessoriesCommand
35、prompt, and enter ipconfigExample session:20120331Figure 19.25 NATNetwork Address Translation (NAT 网络地址转换) is the process of converting a private address into a global (assigned) Internet address. Host 172.18.3.1 sends a request out to the internet. The source address must be modified by the router
36、before it sends it out onto the internet, since 172.x.x.x addresses arent allowed the NAT router substitutes its own address as the source172.18.3.120120331Figure 19.26 Address translationWhen the reply comes back (addressed to 200.24.5.8), the NAT router must then substitute the original host addre
37、ss as the destination within the private networkHow does the router know which private address to substitute for 200.24.5.8 ?20120331Figure 19.27 Translation20120331Figure 19.26 Address translationProblem: What if 2 hosts in a private network using NAT want to connect to the same site over the same
38、period, e.g. Google? How can the translation table reflect access to the same destination from different sources?Solution: Have a pool of global addresses for the NAT router this allows multiple access of the same destination bound to different addresses. Each global router address will be assigned
39、to one host request. Clearly, there is still a limit, depending on the size of the pool of global addresses available.20120331Figure 19.26 Address translationProblem: NAT works because the (private) host initiates the request. How can an external host (e.g. an email server) initiate a request to sen
40、d an email to a private host?How can an external host (e.g. a browser) request a page from an internal server with a private address?Solution: It cannot !NAT only allows requests to be initiated in an outgoing direction. No external host can ever know the address of an internal host. Even if it gues
41、sed an address, the internet will not forward a packet with a private address on it.20120331Table 19.3 Five-column translation tablePrivate AddressPrivate PortExternalAddressExternal PortTransportProtocol172.18.3.1140025.8.3.280TCP172.18.3.2140125.8.3.280TCP.An alternative way to identify hosts whic
42、h contact the same server is to keep a record of the TCP port number used by the host on the private address. The combination of private_address:port_number (called a socket see TCP notes) could be unique on that network.2012033119.3 RoutingRouting TechniquesStatic Versus Dynamic RoutingRouting Tabl
43、e for Classful AddressingRouting Table for Classless Addressing路由表20120331Figure 19.28 Next-hop routingThe next hop scheme is simpler. Changes in router/link availability can be catered for at each router, rather than needing to be done at the source. Scheme (a) - source routing is impossible on the
44、 Internet20120331Figure 19.29 Network-specific routingInternet routing is really about getting to the right network. Routing tables based on networks rather than individual hosts are sufficient, and much simpler20120331Figure 19.30 Host-specific routingA routing table can have specific entries added
45、. Occasionally, there is a need to specify a specific route to a particular host, e.g. a network administrator may wish to check a specific router/route20120331Figure 19.31 Default routingThe default route entry defines a route for all packets except for those destined for N220120331Static and Dynam
46、ic Routing TablesOn a small internet, an administrator may use static routing tables which are entered manually and do not change, e.g. company internal network, or the Internet in the 1970s On the Internet today, routing tables are updated dynamically according to conditions on links and routers. T
47、hese dynamic updates are done using protocols as RIP, OSPF or BGP. These protocols were developed as the Internet grew in size and complexityInternet Routers nowadays are based on very powerful computers with huge routing tables.20120331Figure 19.32 Classful addressing routing tableClassful routing
48、tables are relatively simple, since there are only a few types of netid/hostid combinations: A, B or C. Such tables may contain host specific and default entries, alongside class A, B or C entries.Four columns is a minimum, since the mask, destination, next hop address and interface (output port num
49、ber) need to be known for each entry 20120331Example 10Using the table in Figure 19.32, the router receives a packet for destination 192.16.7.1. For each row, the mask is applied to the destination address until a match with the destination address is found. In this example, the router sends the pac
50、ket through interface m0 (host specific).NNNm0m1m2interfacesIncoming Packet20120331Example 11Using the table in Figure 19.32, the router receives a packet for destination 193.14.5.22. For each row, the mask is applied to the destination address until a match with the next-hop address is found. In this example, the router sends the packet through interface m2 (network specific).Example 12Using the table in Figure 19.32, the router receives a packet fo
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- GB 48147.3-2026矿山隐蔽致灾因素普查规范第3部分:金属非金属矿山及尾矿库
- 2026年11月02日 茂名市茂南区考试中心 瓦克化学 化工材料专员 15人
- 吉林省长春市榆树市部分学校2026-2027学年八年级上学期开学考试语文试卷(含答案)
- 贵州省六盘水市盘州市2025-2026学年大象版四年级上学期期末考试科学试卷(有答案)
- 福建省厦门市第六中学2026-2027学年高三上学期9月阶段性测试物理试卷(含答案)
- 2026高一年级立德树人德育实践课件:德育工作的精细化管理
- 中医内分泌护理汇报
- 2026干部职工秋冬季如何保护心脑血管课件
- 2026新学期乡村学校年级组长专题培训课件:立德树人五育并举
- 2026新学期全体师生换季健康防护指南专题培训课件
- 220kV输电线路事故应急预案
- 2025年进城选调教师考试试题及答案
- 互联网创新创业大赛团队建设
- 《变频技术及应用(三菱)(第三版)》中职全套教学课件
- 总账管理系统初始化
- 移动式升降工作平台(登高车)安全管理培训课件
- 百年风华:《天边有颗闪亮的星》教学课件 2025-2026学年人音版(简谱)(2024)初中音乐八年级上册
- 会计基础知识必背100题(含答案解析)
- GB/T 30312-2025浸胶纱线、线绳和帘线热收缩试验方法
- GB/T 2423.21-2025环境试验第2部分:试验方法试验M:低气压
- 环卫作业车辆维修保养项目方案投标文件(技术方案)
评论
0/150
提交评论