Presentation is loading. Please wait.

Presentation is loading. Please wait.

第四章 IP地址 子网划分 VLSM CIDR Purpose: This chapter reviews the physical layer and describes how to cable various network devices. Timing: This chapter takes.

Similar presentations


Presentation on theme: "第四章 IP地址 子网划分 VLSM CIDR Purpose: This chapter reviews the physical layer and describes how to cable various network devices. Timing: This chapter takes."— Presentation transcript:

1 第四章 IP地址 子网划分 VLSM CIDR Purpose: This chapter reviews the physical layer and describes how to cable various network devices. Timing: This chapter takes approximately 1 hour to present. Note: This section has a cabling laboratory exercise at the end. Contents: Objectives—This section explains what the student will be able to do at the end of this chapter. TCP/IP Overview—This section describes the TCP/IP protocol stack. TCP/IP Application Layer Overview—This section describes the application protocols. TCP/IP Transport Layer Overview—This section describes TCP and UDP. TCP/IP Internet Layer Overview—This section describes IP and other Internet layer protocols. TCP/IP Address Overview—This section describes IP addressing. Configuring IP Addresses—This section describes how to address an IOS device with IP Interconnecting Networks—This section describes how to interconnect separate VLANs and WANs With TCP/IP. Written Exercise—This section has students work with IP addresses in binary format.

2 本章目标 通过本章学习,您应该掌握以下内容: 掌握IP地址分类,子网掩码的作用,识别网络标识号、主机标识号,子网的数目、主机的数目,
掌握VLSM和CIDR的概念 Purpose: This figure states the chapter objectives. Emphasize: Read or state each objective so each student has a clear understanding of the chapter objectives.

3 十进制和二进制的转换 = 128 = 192 = 224 = 240 = 248 = 252 = 254 = 255 Purpose: This figure explains how subnet masks are converted to decimal addresses. Emphasize: Review binary-to-decimal conversion, bit weighting, and conversion. Explain logical AND. One possible explanation of logical AND follows: We will need to be able to perform a logical AND on the binary numbers. Just take two binary numbers and place one above the other. The ones in the bottom are like a pipe—the number above it just drops through. The zeros are like a clogged pipe, so nothing comes out in the answer. Presenting a truth table will help some students understand. You might need to give more than one explanation. Note: You might want to hand out a binary-to-decimal conversion sheet if you have not already done so. We have not included one in the lab section. It is more useful to have one that is on a separate page from the labs.

4 255 255 255 IP 地 址 255 32 bits Dotted Decimal Network Host Maximum
Layer 1 of 3: Purpose: This figure show the general format of an IP address. In layer 1, the address is 32 bits with a network and host portion.

5 IP 地 址 32 bits Dotted Decimal Network Host 255 255 255 255 Maximum 1 8 9 16 17 24 25 32 Layer 3 of 3: In layer 2, one can convert the address to binary. Binary

6 IP 地 址 32 bits Dotted Decimal Network Host 255 255 255 255 Maximum 1 8 9 16 17 24 25 32 Layer 3 of 3: In layer 3, an example of dotted-decimal format and binary are displayed. Emphasize: IP address format is dotted-decimal. Dotted-decimal makes it easy to work with IP addresses. However, in this course we will work with the addresses on the bit level, so we will convert these addresses into binary, make changes to them, and convert them back. The central authority for addresses is the Internet Assigned Numbers Authority. Note: This most common form of addressing reflects the widely used IP version 4. Faced with the problem of depleting available addresses, Internet Engineering Task Force (IETF) work is under way for a backward-compatible next generation of IP (IPng, also called IP 6). IP 6 will offer expanded routing and addressing capabilities with 128-bit addresses rather than the 32-bit addressing shown on the graphic. Addresses from both IP versions will coexist. Initial occurrences will probably be at locations with address translator software and firewalls. Binary 172 16 122 204 Example Decimal Example Binary

7 IP 地址分类 Class A: Class B: Class C: Class D: 多播地址 Class E: 科研用 8 bits
Network Host Network Host Network Host Purpose: This graphic describes the three most common classes of IP address. Emphasize: Discuss classes of addresses. Each address contains information about the network number and the host number of the device. Class A addresses are for very large organizations. Class B addresses are for smaller organizations, and Class C addresses for even smaller ones. As the number of networks grows, classes may eventually be replaced by another addressing mechanism, such as classless interdomain routing (CIDR). RFC 1467, Status of CIDR Deployment in the Internet, presents information about CIDR. RFC 1817, CIDR and Classful Routing, also presents CIDR information.

8 IP 地址分类 Class A: Class B: Class C: Class D: 1 8 9 16 17 24 25 32 Bits:
0NNNNNNN Host Host Host Class A: 范围 (1-126) 1 8 9 16 17 24 25 32 Bits: 10NNNNNN Network Host Host Class B: Emphasize: Highlight the fixed values that start each class address. The first octet rule states that when an address falls into a specified range, it belongs to a certain class. Students should soon be able to recognize the address class of any IP address on sight. Note: If time or interest permits, you can use the initial bit patterns in the first octet and show how a class of IP network derives the range of network numbers for that IP address class. 范围 ( ) 1 8 9 16 17 24 25 32 Bits: 110NNNNN Network Network Host Class C: 范围 ( ) 1 8 9 16 17 24 25 32 Bits: 1110MMMM Multicast Group Multicast Group Multicast Group Class D: 范围 ( )

9 特殊IP地址 一些特殊的IP 地址: 1.IP 地址127.0.0.1:本地回环(loopback)测试地址
2.广播地址: 3.IP 地址 :代表任何网络 4.节点号全为1:代表该网段的所有主机 广播地址TCP/IP 协议规定,主机号部分各位全为1 的IP 地址用于广播.所谓广播地址指同时 向网上所有的主机发送报文,也就是说,不管物理网络特性如何,Internet 网支持广播传输.如 就是B 类地址中的一个广播地址,你将信息送到此地址,就是将信息送给网络号为 的所有主机.

10 私有IP地址 私有IP地址: 1.A 类地址中:10.0.0.0 到10.255.255.255
2.B 类地址中: 到 3.C 类地址中: 到

11 计算可用的主机地址 网络 主机 N 1 2 3 ... ... ... Purpose: This figure explains how to calculate the number of available hosts in a network. Emphasize: 2N-2 is the calculation to determine available hosts. N is the number of binary digits in the host field. Subtract 2 because a host cannot be all 0s or 1s. The same principal applies when determining the number of available networks. 65534 65535 65536 - 2 2N-2 = = 65534 65534

12 IP地址分类练习 地址 类别 网络 主机 Layer 1 of 2: Purpose: This exercise verifies that the students understand IP address classes, network numbers, and host numbers. Give the students time to list the address class, network, and host number for each IP address in the table. Review the correct answers interactively. The answers are given in the following figure.

13 IP地址分类练习 (答案) 地址 类别 网络 主机 10.2.1.1 A 10.0.0.0 0.2.1.1 128.63.2.100 B
Layer 2 of 2: Purpose: This answers to the exercise are given in the figure. Note: Students can also find the answers to this exercise in the “Answers” appendix. C C B Nonexistent

14 子网划分的好处 1.缩减网络流量 2.优化网络性能 3.简化管理 4.更为灵活地形成打覆盖范围的网络

15 不设子网的地址 Purpose: This figure explains what networks look like without subnets. Without subnets, use of network addressing space is inefficient. The Class B network is like a highway with no exits—there is no place to exit, so all of the traffic is in one line. …... 网络

16 设置子网的地址 Purpose: This figure describes network structure when subnets are used. Emphasize: The host bits of an IP address can be subdivided into a subnetwork section and a host section. The subnetwork section in this example is the full third octet. Point out the difference in the addressing between the previous slide and this slide. A subnetted address space is like a highway with exits. A network device uses a subnet mask to determine what part of the IP address is used for the network, the subnet, and the device ID. A subnet mask is a 32-bit value containing a number of one bits for the network and subnet ID and a number of zero bits for the host ID. Given its own IP address and subnet mask, a device can determine if an IP packet is destined for 1) a device on its own subnet, 2) a device on a different subnet on its own network, or 3) a device on a different network. A device can determine what class of address the device has been assigned from its own IP address. The subnet mask then tells the device where the boundary is between the subnet ID and the host ID. 网络

17 缺省情况下的子网掩码 缺省情况下子网未划分 网络 主机 网络号 172.16.2.160 10101100 00010000
Purpose: This graphic explains how routers use addresses that have no subnet mask. Emphasize: Explain how masking works at the bit level. Zero bits mask host information. Note: This is an easy place to lose students. At this point, they need to learn several abstract mathematical concepts before we can show them how to lay out an IP-addressed network. To the novice these techniques may seem unrelated, making the presentation confusing. To a more experienced audience, these techniques will be familiar. 网络号 172 16 缺省情况下子网未划分

18 子网地址 E1 E0 Layer 1 of 2: Purpose: This figure shows what would happen if there were no subnetting. Emphasize: If networks could not be broken down into more granular, subnetworks few networks could exist, each with a capacity for many hosts. 新路由表 172.16 . 2 . 160 网络 端口 网络 主机 E0 E1

19 子网地址 E1 E0 Layer 1 of 2: Emphasize: By turning on more bits in the mask, we reserve some bits as network information and can use these bits to describe subnetworks. Describe how the router makes use of this technique. Point out that there is more information in the routing table now. Note: As you enter the discussion about subnet masks, a question might arise about whether it is legal to define a discontiguous subnet mask. A discontiguous subnet mask consists of intervening zeros, as in , rather than all ones followed by zeros, as in The question has two answers. According to RFC 950 that describes IP, a discontiguous subnet mask is legal. However, the hardware expense to produce an interface that supports discontiguous masking is cost-prohibitive. Thus in practice it is not supported on most vendors’ equipment, including Cisco. Also, discontiguous masking has no benefit, and it is much more difficult to maintain a network based on this design. Later RFCs make noncontiguous subnet masks illegal because they are incompatible with future addressing schemes such as CIDR. 新路由表 172.16 . 2 . 160 网络 端口 网络 子网 主机 E0 E1

20 子网掩码 172 16 255 255 255 Network Host IP Address Network Host
IP Address Network Host Default Subnet Mask 255 255 A:/8 > /8 > /16 “/16” 表示子网掩码有16位. Network Subnet Host 8-bit Subnet Mask 255 “/24”表示子网掩码有24位.

21 利用子网掩码划分子网 扩展了8位地址的网络 网络 子网 主机 网络号 172.16.2.160 10101100 00010000
Purpose: This figure shows how the router determines an address when subnetting is used. Emphasize: This example makes a Class B address space look like a collection of Class C address spaces. Now the logical AND allows us to extract the subnet number as well as the assigned network number. An exercise follows that tests the students’ understanding of subnet masks. 128 192 224 240 248 252 254 255 网络号 172 16 2 扩展了8位地址的网络

22 利用子网掩码划分子网 扩展了10位地址的网络 网络 子网 主机 网络号 172.16.2.160 10101100 00010000
Purpose: This figure shows how the router determines an address when subnetting is used. Emphasize: This example is different from the previous example in that the the subnet and host are divided within an octet. Transition: An exercise follows that tests the students’ understanding of subnet masks. 128 192 224 240 248 252 254 255 128 192 224 240 248 252 254 255 网络号 172 16 2 128 扩展了10位地址的网络

23 子网划分的核心思想 “借用”主机位来“制造”新的“网络”

24 划分子网方法 划分子网方法: 1.你所选择的子网掩码将会产生多少个子网?:2 的x 次方(x 代表掩码位数)
2.每个子网能有多少主机?: 2 的y 次方-2(y 代表主机位数) 3.有效子网是?:有效子网号= 进制的子网掩码(结果叫做block size 或base number) 4.每个子网的广播地址是?:广播地址=下个子网号-1 5.每个子网的有效主机分别是?:忽略子网内全为0 和全为1 的地址剩下的就是有效主机地址. 最后有效1 个主机地址=下个子网号-2(即广播地址-1)

25 C类地址子网划分例子 网络地址192.168.10.0;子网掩码255.255.255.192(/26) 1.子网数=2*2=4
2.主机数=2 的6 次方-2=62 3. 有效子网?:block size= =64; 所以第一个子网为 , 第二个为 ,最后一个为 4.广播地址:下个子网-1.所以第一个子网的广播地址是 ,第二个是 ,最后一个是 5.有效主机范围是:第一个子网的主机地址是 到 ;第二个是 到 ;最后一个是 到

26 B类地址子网划分例子1 例子1:网络地址:172.16.0.0;子网掩码255.255.192.0(/18) 1.子网数=2*2=4
2.主机数=2 的14 次方-2=16382 3.有效子网?:block size= =64;所以第一个子网为 ,第二个为 ,最后1 个为 4.广播地址:下个子网-1.所以第一个子网的广播地址是 ,第二个为 ,最后一个为 5.有效主机范围是:第一个子网的主机地址是 到 ;第二个是 到 ;最后一个是 到

27 B类地址子网划分例子2 B 类地址例子2:网络地址:172.16.0.0;子网掩码255.255.255.224(/27)
2.主机数=2 的5 次方-2=30 3. 有效子网?:block size= =32; 所以第一个子网为 , 第二个为 ,最后一 个为 4.广播地址:下个子网-1.所以第一个子网的广播地址是 ,第二个为 ,最后一个为 5.有效主机范围是:第一个子网的主机地址是 到 ;第二个是 到 最后1 个是 到

28 变长子网掩码(VLSM) 变长子网掩码(Variable-Length Subnet Masks,VLSM)的出现是打破传统的以类(class)为标准的地址划分方法,是为了缓解IP 地址紧缺而产生的 作用:节约IP 地址空间;减少路由表大小. 注意事项:使用VLSM 时,所采用的路 由协议必须能够支持它,这些路由协议包括RIPv2,OSPF,EIGRP 和BGP.

29 VLSM预备知识-前缀 地址范围: 192.168.1.64 - 192.168.1.79 前缀长度为/28 192.168.1.64/28
第四个8位位组 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79

30 VLSM的实现(1)

31 需求 1.D 需要2 个VLAN,然后每个VLAN 容纳200 个用户.
2.A,B 和C 连接3 个以太网,分别用1 个24 口的交换机相连 D—S0— /24 D—S0— /24 A—E0— /27 B—E0— /27 C—E0— /27

32 VLSM的实现(2)

33 VLSM的实现(3)

34 VLSM的实现(4)

35 VLSM的实现(5)

36 VLSM的实现(6)

37 无类域间路由 (CIDR) CIDR的概念:忽略A、B、C类网络的规则,定义前缀相同的一组网络为一个块,即一条路由条目。(如: /8)

38 CIDR的优点 减少了网络数目,缩小了路由选择表 从网络流量、CPU和内存方面说,开销更低 对网络进行编址时,灵活性更大

39 CIDR例子

40 CIDR计算方法

41 本章总结 通过本章学习,您应该掌握以下内容: 掌握IP地址分类,子网掩码的作用,识别网络标识号、主机标识号,子网的数目、主机的数目,
掌握VLSM和CIDR的概念 Purpose: This figure states the chapter objectives. Emphasize: Read or state each objective so each student has a clear understanding of the chapter objectives.


Download ppt "第四章 IP地址 子网划分 VLSM CIDR Purpose: This chapter reviews the physical layer and describes how to cable various network devices. Timing: This chapter takes."

Similar presentations


Ads by Google