TCPIP協(xié)議原理教學(xué)課件:Chapter 4 IP Addressing_第1頁
TCPIP協(xié)議原理教學(xué)課件:Chapter 4 IP Addressing_第2頁
TCPIP協(xié)議原理教學(xué)課件:Chapter 4 IP Addressing_第3頁
TCPIP協(xié)議原理教學(xué)課件:Chapter 4 IP Addressing_第4頁
TCPIP協(xié)議原理教學(xué)課件:Chapter 4 IP Addressing_第5頁
已閱讀5頁,還剩109頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、Chapter 4 IP AddressingIP address structureClassful addressingSpecial addressesPrivate addressesSubnetting and mask(子網(wǎng)與掩碼)Supernetting and Classless addressing(超網(wǎng)與無類型編址)7/15/20221IP AddressIP addressA universal(通用) identifierUnique(唯一): each address define one, and only one, connection to the Intern

2、et (地址唯一定義1個(gè)Internet連接)設(shè)備如果同時(shí)屬于多個(gè)Internet中的網(wǎng)絡(luò),那么在每一個(gè)網(wǎng)絡(luò)中,設(shè)備都應(yīng)該有對(duì)應(yīng)的IP地址 IP地址標(biāo)識(shí)設(shè)備的網(wǎng)絡(luò)位置(而不是表示設(shè)備,即不是設(shè)備的標(biāo)志)若某個(gè)設(shè)備通過2個(gè)網(wǎng)絡(luò)連接到Internet上,那么這個(gè)設(shè)備就應(yīng)具備2個(gè)地址建設(shè)北路一環(huán)路Network device7/15/20222Network idIP Address Structure32-bit binary addressHierarchical address(分層地址) (Compare: flat address,平面地址)32 bitsHost idHostxNET1N

3、ET2NET37/15/20223IP Address Space地址空間( Address Space ):the total number of addresses used by the Protocol如何確定地址空間?If protocol uses N bits address: Address Space = 2N例如:IPv4,32 bits address, Address Space = 232 實(shí)際地址數(shù)值遠(yuǎn)小于該值?!7/15/20224IP Address NotationDotted-decimal notation(點(diǎn)分十進(jìn)制記法)8 bits10101100 0

4、0000110 01111010 110011008 bits8 bits8 bits1726122204.1 0 1 0 1 1 0 0128二進(jìn)制數(shù)權(quán)值加權(quán)結(jié)果+17264321684211280320840027262524232221207/15/20225IP Address NotationHexadecimal Notation(十六進(jìn)制記法):每4bit 1個(gè)十六進(jìn)制數(shù)字32 bit 8個(gè)十六進(jìn)數(shù)字例:10000001 00001011 00001011 11101111 8 1 0 B 0 B E F點(diǎn)分十進(jìn)制記法:易讀,簡潔十六進(jìn)制記法:網(wǎng)絡(luò)編程中應(yīng)用0X7/15/2022

5、6Binary DecimalBinary DecimalDecimal Binary100111026 + 23 + 22 + 21 = 64 + 8 + 4 + 2 = 786078391994210quotientremainder01110017/15/202278位二進(jìn)制數(shù)十進(jìn)制數(shù) (0 255)8 bits8位二進(jìn)制數(shù)對(duì)應(yīng)的十進(jìn)制數(shù)范圍1個(gè)字節(jié) 00000000 11111111 0 2557/15/20228二進(jìn)制 十六進(jìn)制 十進(jìn)制十六進(jìn)制二進(jìn)制012345678910(A)11(B)12(C)13(D)14(E)15(F)0000000100100011010001010110

6、0111100010011010101111001101111011118 bits441100121012 * 16 + 10 = 202101011001010二進(jìn)制十六進(jìn)制十進(jìn)制7/15/20229十進(jìn)制 十六進(jìn)制 二進(jìn)制十六進(jìn)制二進(jìn)制012345678910(A)11(B)12(C)13(D)14(E)15(F)00000001001000110100010101100111100010011010101111001101111011111100 1010CA202161216423210商余數(shù)十進(jìn)制十六進(jìn)制二進(jìn)制7/15/202210ExampleChange the followi

7、ng IP address from binary notation to dotted-decimal notation.10000001 00001011 00001011 11101111Solution: 129.11.11.239Change the following IP address from dotted-decimal notation to binary notation.111.56.45.78Solution: 01101111 00111000 00101101 01001110Change the following IP addresses from bina

8、ry notation to hexadecimal notation.10000001 00001011 00001011 11101111Solution: 0X810B0BEF or 810B0BEF167/15/202211Chapter 4 IP AddressingIP address structureClassful addressingSpecial addressesPrivate addressesSubnetting and mask(子網(wǎng)與掩碼)Supernetting and Classless addressing(超網(wǎng)與無類型編址)7/15/202212Addr

9、ess spaceClassful IPIP address space is divided into 5 classes:A、B、C、D、E Occupation of the address spaceBCDEA7/15/202213Address SpaceClass地址空間Percentage(%)A231=2,147,483,64850B230=1,073,741,82425C229=536,870,91212.5D228=268,435,4566.25E228=268,435,4566.257/15/202214如何分辨地址類型?Classful address is divid

10、ed into Netid(網(wǎng)絡(luò)標(biāo)識(shí)): to indicate the network Hostid (主機(jī)標(biāo)識(shí)): to indicate the host on the networkThe length of theses part depends on the class of the addressNetidHostid7/15/202215Classful IPClass AClass BClass CClass DClass E121811bits110NetidHostid1724bits0NetidHostid114161bits10NetidHostid12411bits

11、1110Multicast124bits1111Reserved for future use11110.0.0.0 127.255.255.255128.0.0.0 191.255.255.255192.0.0.0 223.255.255.255224.0.0.0 239.255.255.255240.0.0.0 255.255.255.255Net=27,Host=224Net=214,Host=216Net=221,Host=287/15/202216A 類地址A類地址適應(yīng)于大型網(wǎng)絡(luò)理論上,全網(wǎng)最多允許有27個(gè)這種大型網(wǎng)絡(luò)每個(gè)A類地址:最多允許224臺(tái)主機(jī)幾乎沒有這樣的網(wǎng)絡(luò)存在!地址范圍

12、Netid 0 字節(jié)1字節(jié)2字節(jié)3字節(jié)4Hostid 00000000全0 01111111全10.0.0.0 127.255.255.2557/15/202217B 類地址B類地址適應(yīng)于中型網(wǎng)絡(luò)理論上,全網(wǎng)最多允許有214 個(gè)這種中型網(wǎng)絡(luò)每個(gè)網(wǎng)絡(luò)最多允許216 臺(tái)主機(jī)這樣的網(wǎng)絡(luò)不少地址范圍字節(jié)1字節(jié)2字節(jié)3字節(jié)4128.0.0.0 191.255.255.255NetidHostid 10全0 10000000 00000000全1 10111111 111111117/15/202218C 類地址C類地址適應(yīng)于小型網(wǎng)絡(luò)理論上,全網(wǎng)最多允許有221個(gè)這種小型網(wǎng)絡(luò)每個(gè)網(wǎng)絡(luò)最多允許28臺(tái)主機(jī)這樣

13、的網(wǎng)絡(luò)最多地址范圍字節(jié)1字節(jié)2字節(jié)3字節(jié)4192.0.0.0 223.255.255.255NetidHostid1101111111111011111 11111111 111111110000000011000000 00000000 000000007/15/202219D 類和E 類地址D類地址范圍字節(jié)1字節(jié)2字節(jié)3字節(jié)4 224.0.0.0 239.255.255.255多播地址111011100000 00000000 00000000 0000000011101111 11111111 11111111 11111111E類地址范圍 240.0.0.0 255.255.255.2

14、55保留以后使用111111110000 00000000 00000000 0000000011111111 11111111 11111111 111111117/15/202220Recognizing ClassesIn binary notationKey: the first few bits In dotted-decimal notationKey: the first byte01011011101111First byteSecond byteThird byteFourth byte0 to 127128 to 191192 to 223224 to 239240 to

15、255Class AClass BClass CClass DClass E7/15/202221提取 Netid(Hostid)首先根據(jù)IP地址判斷地址的類型 Recognizing Classes根據(jù)地址類型,進(jìn)一步確定Netid(或者Hostid)7/15/202222Exercises確定一個(gè)IP地址的類提取 Netid 和 Hostid0 . 0 . 0 . 0128 . 0 . 0 . 0192 . 0 . 0 . 0224 . 0 . 0 . 0240 . 0 . 0 . 0Class AClass BClass CClass DClass E127 . 255 . 255 .

16、255191 . 255 . 255 . 255223 . 255 . 255 . 255239 . 255 . 255 . 255255 . 255 . 255 . 2550128127191192223224239240255Example: 142.34.2.17, 208.57.128.30, 238.6.0.1NoNo標(biāo)識(shí)網(wǎng)絡(luò)連接7/15/202223 Exercises: Solution142.34.2.17二進(jìn)制10 001110 . 00100010 . 00000010 . 00010001十進(jìn)制142:(128, 191) Class BNet id = 142 . 34

17、Host id = 2 . 17B類Net idHost id7/15/202224 Exercises: Solution(cont.)208.57.128.30十進(jìn)制208 192, 223 Class CNet id = 208 . 57 . 128Host id = 30238.6.0.1十進(jìn)制238 224, 239 Class DNet id:無Host id:無7/15/202225Classes and BlocksEach class is divided into a fixed number of blocks (塊)with each block having a fi

18、xed size.分類地址按照地址塊進(jìn)行分配In class A, B, C: Each Netid blockThe number of blocksThe address space of each blockThe special block一個(gè)地址塊:具有相同網(wǎng)絡(luò)標(biāo)識(shí)的地址集合7/15/202226Blocks in class A7/15/202227Blocks in class C7/15/202228Classes and Blocks塊數(shù)每一塊的地址空間The special blockTo be designed forClass A28-1=12822416,777,21

19、63 blocksLarge organizationClass B216-2=1628421665,53616 blocksMiddle organizationClass C224-3=2,097blocksSmall organizationClass D1Class E17/15/202229Classes and BlocksNotes:Millions of class A addresses are wastedMany class B addresses are wastedThe number of addresses in a class C bl

20、ock is smaller than the needs of most organizationsClass D addresses are used for multicasting there is only one block in this class.Class E addresses are reserved for special purposes; most of the block is wasted7/15/202230Chapter 4 IP AddressingIP address structureClassful addressingSpecial addres

21、sesPrivate addressesSubnetting and mask(子網(wǎng)與掩碼)Supernetting and Classless addressing(超網(wǎng)與無類型編址)7/15/202231Special AddressesSpecial AddressNetidHostidSource or DestinationNetwork addressSpecificAll 0sNoneDirect broadcast addressSpecificAll 1sDestinationLimited broadcast addressAll 1sAll 1sDestinationTh

22、is host on this networkAll 0sAll 0sSourceSpecific host on this networkAll 0sSpecificDestinationLoopback address127anyDestination7/15/202232Network Address網(wǎng)絡(luò)地址SpecificAll 0sNetidHostid 123.50.16.90123.0.0.0123.65.7.34123.90.123.4Class A216.45.7.0216.45.7.64Class C216.45.7.20216.45.7.126149.14.0.0149.

23、14.27.8Class B149.14.45.9149.14.67.64標(biāo)識(shí)網(wǎng)絡(luò)7/15/202233網(wǎng)絡(luò)地址是地址塊的第一個(gè)地址,指派給某個(gè)組織的地址“組織”而非Internet連接 不能用作IP地址分配從網(wǎng)絡(luò)地址就可以自動(dòng)推導(dǎo)出地址范圍7/15/202234Direct broadcast address直接廣播地址(A,B,C類)216.45.7.20216.45.7.0216.45.7.64216.45.7.126149.14.27.8149.14.0.0149.14.67.64149.14.45.9Destination216.45.7.255SpecificAll 1sNetid

24、Hostid NetidHostidDestination216.45.7.255標(biāo)識(shí)對(duì)特定網(wǎng)絡(luò)的廣播7/15/202235Limited broadcast address受限廣播地址216.45.7.20216.45.7.0216.45.7.64216.45.7.126149.14.27.8149.14.0.0149.14.67.64149.14.45.9255.255.255.255Destination255.255.255.255Destination255.255.255.255Destination255.255.255.255blocked標(biāo)識(shí)對(duì)當(dāng)前網(wǎng)絡(luò)的廣播7/15/2022

25、36This host on this network這個(gè)網(wǎng)絡(luò)上的這個(gè)主機(jī)? . ? . ? . ?216.45.7.0216.45.7.1260 . 0 . 0 . 0Source:0.0.0.0Destination:255.255.255.255Bootstrap Server(DHCP Server)7/15/202237Specific host on this network這個(gè)網(wǎng)絡(luò)上的特定主機(jī)216.45.7.20216.45.7.0216.45.7.64216.45.7.126Destination0 . 0 . 0 . 64SpecificAll 0sNetidHostid

26、Destination0 . 0 . 0 . 64HostidNetid7/15/202238Loopback address回送地址216.45.7.20216.45.7.0127 . X . Y . ZProcess 1Process 2TCP or UDPIPDestination127 . X . Y . ZNetwork Access測(cè)試本機(jī)器軟件7/15/202239Chapter 4 IP AddressingIP address structureClassful addressingSpecial addressesPrivate addressesSubnetting an

27、d mask(子網(wǎng)與掩碼)Supernetting and Classless addressing(超網(wǎng)與無類型編址)7/15/202240Private Address(專用地址)For private use: the private address are not recognizes globally.To be used in isolation (隔離使用)in connection with network address translation techniquesClassNetIDBlocksA10.1B172.16172.3116C192.168.0192.168.25

28、52567/15/202241IP地址分配Internet編址管理機(jī)構(gòu)IANA(Internet Assigned Number Authority)ICANN(Internet Corporation For Assigned Names and Numbers)ICANN大型ISP大型ISP本地ISP本地ISP單位個(gè)人7/15/202242Number of Networks and Hosts網(wǎng)絡(luò)信息中心為每個(gè)網(wǎng)絡(luò)分配唯一的net id該網(wǎng)絡(luò)的管理機(jī)構(gòu)為運(yùn)行TCP/IP的主機(jī)和路由器分配網(wǎng)內(nèi)唯一的host idClassNetwork #Host # per networkA27-2 =

29、 126224-2 = 16777214B214 = 16384216-2 = 65534C221 = 209715228-2 = 2547/15/202243專用網(wǎng)絡(luò)地址分配全網(wǎng)唯一本網(wǎng)唯一全網(wǎng)不唯一Private network(私有網(wǎng),專用網(wǎng))不需接入Internet,但需要用TCP/IP通信Private network Addressing Scheme申請(qǐng)使用A、B、C類地址不申請(qǐng),直接使用A、B、C類地址不申請(qǐng),直接使用私有地址7/15/202244Multihomed DevicesMultihomed host(多接口主機(jī))Can be attached to one or

30、more networksOne interface one IP addressRouter(路由器)Must connect to more than one networksOne interface one IP address205.67.7.0123.0.0.0141.14.0.0123.5.16.90141.14.22.9123.7.9.11141.14.6.80205.67.71.2設(shè)備有一個(gè)Internet連接就應(yīng)改有一個(gè)對(duì)應(yīng)的IP地址7/15/202245Unicast, Multicast, and Broadcast AddressUnicast(單播)Unicast

31、Communication:one-to-one,individual source to individual destination addressEvery node in the Internet must has at least one unique unicast addressUnicast address belongs to Classes A, B, or CMulticast(多播)Multicast Communication:one-to-many, individual source to a group of destinationsA node in the

32、Internet can has one or more multicast addressTo be used only as destination addressMulticast address is a class D address, and defines a groupID7/15/202246Unicast, Multicast, and Broadcast AddressBroadcast(廣播)Broadcast Communication:one-to-all,only at local levelBroadcast addressTo be used only as

33、destination addressLimited broadcast address, direct broadcast address7/15/202247Sample Internet222.13.16.0220.3.6.0201.2.5.0124.0.0.0134.18.0.0129.8.0.0222.13.16.3222.13.16.1222.13.16.23129.8.14.12129.8.0.1220.3.6.1220.3.6.2134.18.1.1134.18.1.7134.18.6.1134.18.4.9201.2.5.1201.2.5.2124.42.51.45124.4

34、2.5.45124.42.33.777/15/202248思考路由器的一個(gè)接口接在兩個(gè)IP網(wǎng)上的可能性路由器的多個(gè)接口接在一個(gè)IP網(wǎng)上的可能性可能不可能Net 1Net 2 IP分組的選路:基于IP網(wǎng)絡(luò)的選路IP地址 網(wǎng)絡(luò)層,標(biāo)識(shí)網(wǎng)絡(luò)連接邏輯而非物理7/15/202249Chapter 4 IP AddressingIP address structureClassful addressingSpecial addressesPrivate addressesSubnetting and mask(子網(wǎng)與掩碼)Supernetting and Classless addressing(超網(wǎng)與無

35、類型編址)7/15/202250Subnetting(子網(wǎng)) & Mask分類地址的缺陷Fixed size of three types of networksC類:少于255臺(tái)主機(jī)的網(wǎng)絡(luò)B類:介于25565535臺(tái)主機(jī)的網(wǎng)絡(luò)A類:超過65535臺(tái)主機(jī)的網(wǎng)絡(luò)A large waste in address space只有兩、三臺(tái)主機(jī)的網(wǎng)絡(luò),也至少要用256個(gè)IP地址A、B類浪費(fèi)嚴(yán)重,少有達(dá)上萬臺(tái)主機(jī)的大型IP網(wǎng)絡(luò)Solution:Subnetting 子網(wǎng)劃分 Supernetting 超網(wǎng)劃分(Classless IP addressing)7/15/202251SubnettingSub

36、netting (子網(wǎng)劃分)A given IP network is divided into a set of subnets(子網(wǎng))多個(gè)物理網(wǎng)共享同一個(gè)IP前綴Two-level hierarchy Three-level hierarchy32 bitsNet idHost idSubnet idHost idphysical network子網(wǎng)physical networkvariableRFC 950an organization( a site)場(chǎng)所子網(wǎng):就是“大網(wǎng)化成若干小網(wǎng)”host主機(jī)7/15/202252Why Subnetting?7/15/202253 Mask(掩

37、碼)Subnetting更適應(yīng)于物理網(wǎng)的實(shí)際大小不能再用首字節(jié)判定網(wǎng)絡(luò)大小(HostID)字節(jié)邊界沒有意義,僅用在點(diǎn)分十進(jìn)制表示法中Mask(掩碼):Identify the size of a network or a subnet規(guī)模32-bit binary number,掩碼與IP地址逐位執(zhí)行“AND”(與運(yùn)算)操作得到網(wǎng)絡(luò)地址1:Netid(網(wǎng)絡(luò))or Netid + Subnetid(子網(wǎng))0:Hostid(主機(jī))11001010 01110011 00001100 10000000202.115.12.12811111111 11111111 11111111 000000001

38、1111111 11111111 11111111 11000000MaskNet idSubnet idHost id給出1個(gè)IP地址,通過掩碼可以確定網(wǎng)絡(luò)地址這對(duì)于路由器很重要7/15/202254Key TermsNetworkPhysical network:LAN、WAN OSIs L1 & L2IP network OSIs L3網(wǎng)絡(luò)(Major network): class A, B, and C子網(wǎng)(Subnet)Mask子網(wǎng)掩碼(Subnet mask):Net id + Subnet id都為1默認(rèn)掩碼(Default mask):Net id為1NetworkMask7

39、/15/202255子網(wǎng)中的特殊地址:子網(wǎng)網(wǎng)絡(luò)地址,子網(wǎng)廣播地址Not all 0s or 1sNot all 0s or 1sNet idHost idSubnet idNet idHost idNot all 0s or 1sNet id + Subnet idHost idNot all 0s or 1sNot all 0s or 1s理論上實(shí)際上Subnet addressSubnet broadcastaddressNetwork addressNetwork broadcast address對(duì)一個(gè)地址塊劃分子網(wǎng),第一個(gè)子網(wǎng)與最后一個(gè)子網(wǎng)是特殊子網(wǎng),理論上不能分配,原因是:第一個(gè)子

40、網(wǎng)的子網(wǎng)地址與地址塊首地址相同;最后一個(gè)子網(wǎng)的廣播地址與地址塊的廣播地址相同7/15/202256Key Terms (cont.)網(wǎng)絡(luò)號(hào) vs. 網(wǎng)絡(luò)地址網(wǎng)絡(luò)號(hào)(Net id):IP地址的一個(gè)組成部分網(wǎng)絡(luò)地址(Net address):一個(gè)IP地址子網(wǎng)號(hào) vs. 子網(wǎng)地址子網(wǎng)號(hào)(Subnet id):IP地址的一個(gè)組成部分子網(wǎng)地址(Subnet address):一個(gè)IP地址主機(jī)號(hào) vs. 主機(jī)地址主機(jī)號(hào)(Host id):IP地址的一個(gè)組成部分主機(jī)地址(Host address):一個(gè)IP地址7/15/202257Key Terms (cont.)IP地址:網(wǎng)絡(luò)地址(Network add

41、ress)特定 Net id全0 Subnet id + 全0 Host id子網(wǎng)地址(Subnet address)特定(Net id + Subnet id)全0 Host id主機(jī)地址(Host address)特定(Net id + Subnet id)+ 特定 Host id全1 網(wǎng)絡(luò)廣播地址全1 子網(wǎng)廣播地址直接廣播地址7/15/202258Contiguous vs. Noncontiguous MaskNoncontiguous Maskex:11111101 11101110 11110111 011111100、1 混雜在一起使網(wǎng)絡(luò)構(gòu)成和路由選擇變得復(fù)雜 不實(shí)用Contig

42、uous Maskex:11111111 11111111 11111111 11000000推薦使用7/15/202259Mask PresentationDecimal point notation255.255.255.192Netid + Subnetid = 26 bits,Hostid = 6 bitsBit-count notationThe number of bit 1Netid SubNetid例:202.x.y.z/26 24 + 2172.1.x.y/19 16 + 3用網(wǎng)絡(luò)(含子網(wǎng))地址和掩碼表示一個(gè)網(wǎng)絡(luò)202.115.12.64 255.255.255.192202

43、.115.12.64/26128,192,224,240,248,252,254,255/1, /2, /3, /4, /5, /6, /7, /8prefix(前綴)7/15/202260Network and Subnet PresentationMajor network(A、B、C類網(wǎng)絡(luò))20.0.0.0 255.0.0.0 20.0.0.0/8160.2.0.0 255.255.0.0 160.2.0.0/16200.15.12.0 255.255.255.0 200.15.12.0/24Subnet20.1.0.0 255.255.0.0 20.1.0.0/16160.2.4.0

44、255.255.252.0 160.2.4.0/22200.15.12.64 255.255.255.192 200.15.12.64/267/15/202261AND operationNetwork address = IP address AND MaskNetwork broadcast address = Network address | MaskAddress range = Network address,Network broadcast addressEx:IP address = 143.6.12.55,Mask = 255.255.248.0Network addres

45、s = Network broadcast address = Address range = 143.6.12.55 AND 255.255.248.0 =143.6.8.0 | 0.0.7.255 143.6.8.0,Total:2048143.6.8.0143.6.15.255 143.6.12.5511111111 11111111 11111000 00000000Mask10001111 00000110 00001100 00110111143.6.8.011001000 00000110 00001000 0000000000000000 00000000 00000111 1

46、1111111Mask143.6.15.25510001111 00000110 00001111 111111117/15/202262足夠的信息給定一個(gè)IP地址和掩碼,希望獲得足夠網(wǎng)絡(luò)信息:網(wǎng)絡(luò)地址該網(wǎng)絡(luò)的地址空間網(wǎng)絡(luò)中的特殊IP地址7/15/202263有關(guān)子網(wǎng)的計(jì)算(1)給定IP地址與掩碼,確定子網(wǎng)地址:方法1(Straight Method):二進(jìn)制地址與掩碼做“AND”運(yùn)算方法2(Short-Cut Method):若掩碼中的字節(jié)是“255”,復(fù)制地址中對(duì)應(yīng)字節(jié)若掩碼中的字節(jié)是“0”,將對(duì)應(yīng)地址字節(jié)設(shè)為0若掩碼中的字節(jié)非上述兩種情況,將對(duì)應(yīng)地址字節(jié)和掩碼寫成二進(jìn)制記法,執(zhí)行“AND

47、”運(yùn)算方法3:最快速,要求掌握!例:已知IP地址:201.70.64.122 / 27,確定子網(wǎng)地址主機(jī)數(shù)2(3227)25323 122/32 4 所在子網(wǎng)是3號(hào)子網(wǎng),地址是201.70.64.(323)201.70.64.967/15/202264Example:Short-Cut Method 7/15/202265有關(guān)子網(wǎng)的計(jì)算(2)給定IP地址,確定子網(wǎng)數(shù)默認(rèn)掩碼和子網(wǎng)掩碼找出:子網(wǎng)掩碼比默認(rèn)掩碼增加的1的個(gè)數(shù)n1 Subnetid的位數(shù)子網(wǎng)數(shù)2n1給定IP地址,確定子網(wǎng)地址個(gè)數(shù)(子網(wǎng)地址空間的大小)掩碼中0的個(gè)數(shù)n2子網(wǎng)地址數(shù) = 2n2注意:特殊地址(子網(wǎng)地址和子網(wǎng)廣播地址)7/

48、15/202266再看“確定子網(wǎng)地址”第三種方法規(guī)則:(子)網(wǎng)絡(luò)地址值是該網(wǎng)絡(luò)地址數(shù)目的整數(shù)倍原因:網(wǎng)絡(luò)地址HostID全為0計(jì)算方法:1、確定Host ID的個(gè)數(shù)n2、IP子網(wǎng)中IP地址個(gè)數(shù) NIP = 2n, 3、子網(wǎng)地址中子網(wǎng)id所在字節(jié)值 = n x NIP例:已知IP地址201.70.64.193/26,確定子網(wǎng)地址Host ID為32266子網(wǎng)地址個(gè)數(shù)為:2664193落在643192,255,所以子網(wǎng)地址為201.70.64.1927/15/202267有關(guān)子網(wǎng)的計(jì)算(3)確定子網(wǎng)的地址范圍找到子網(wǎng)地址(即子網(wǎng)的首地址)子網(wǎng)中最后一個(gè)地址子網(wǎng)地址(子網(wǎng)地址空間數(shù)目1)例:已知IP

49、地址:201.70.64.60 / 27,確定該地址所屬子網(wǎng)的地址范圍子網(wǎng)地址:201.70.64.32最后一個(gè)地址:201.70.64.(32 + 31) 201.70.64.63地址范圍: 201.70.64.32 201.70.64.637/15/202268Exercises1最小的IP子網(wǎng)的掩碼是多少?Solution:理解:每個(gè)IP子網(wǎng)的地址空間包含:特殊地址(子網(wǎng)地址和子網(wǎng)廣播)主機(jī)地址最小IP子網(wǎng) 應(yīng)該有主機(jī)地址 子網(wǎng)地址空間為4 255.255.255.2522個(gè)特殊地址1個(gè)路由器+1個(gè)主機(jī)7/15/202269Exercises2分別以255.255.255.224和255

50、.255.255.248為掩碼值時(shí),以下IP地址中哪些是子網(wǎng)地址?哪些是子網(wǎng)廣播地址?哪些是主機(jī)地址?X.Y.Z.0,X.Y.Z.8,X.Y.Z.15,X.Y.Z.31,X.Y.Z.96128,192,224,240,248,252,254,255/1, /2, /3, /4, /5, /6, /7, /827, 26, 25, 24, 23, 22, 21, 0IP地址 與 掩碼 確定一個(gè)IP網(wǎng)絡(luò)7/15/202270SolutionX.Y.Z.0, X.Y.Z.8, X.Y.Z.15, X.Y.Z.31, X.Y.Z.96 00000000 00001000 00001111 000111

51、11 01100000255.255.255.224 (38)327224: 11100000子網(wǎng)地址: X.Y.Z.0, X.Y.Z.96子網(wǎng)廣播地址: X.Y.Z.31主機(jī)地址: X.Y.Z.8, X.Y.Z.15子網(wǎng)中IP地址個(gè)數(shù) = 28325 = 320 = 0 x 32, 96 = 3 x 3231 = 1 x 32 - 17/15/202271Solution(cont.)X.Y.Z.0, X.Y.Z.8, X.Y.Z.15, X.Y.Z.31, X.Y.Z.96255.255.255.248248: 11111000子網(wǎng)地址: X.Y.Z.0, X.Y.Z.8, X.Y.Z.9

52、6子網(wǎng)廣播地址: X.Y.Z.15, X.Y.Z.31主機(jī)地址: 無子網(wǎng)中IP地址個(gè)數(shù) = 23 = 87/15/202272Using IP AddressWhere am I,位置What size is this network網(wǎng)絡(luò)大小Where can I go outside路徑7/15/202273有關(guān)子網(wǎng)的計(jì)算(4)子網(wǎng)設(shè)計(jì)( Subnetting )步驟(定長掩碼) :決定子網(wǎng)數(shù)確定子網(wǎng)掩碼找出每個(gè)子網(wǎng)的地址范圍7/15/202274Subnetting Example 1某公司分到 地址201.70.64.0 (class C),該公司需要6個(gè)子網(wǎng)。試設(shè)計(jì)子網(wǎng)方案Soluti

53、on :子網(wǎng)數(shù)目必須是2整數(shù)次方:22 6 23 Subnetid:3位由于是C類地址,所以子網(wǎng)掩碼: 24327位255.255.255.224 或者 /27Hostid:835位,子網(wǎng)地址空間25327/15/202275Example 1:確定各子網(wǎng)的地址范圍7/15/202276Subnetting Example 2一個(gè)具有A類地址的組織需要至少1000個(gè)子網(wǎng),試找出子網(wǎng)掩碼和每個(gè)子網(wǎng)的配置。分析至少需要1000個(gè)子網(wǎng)理論上,考慮全0和全1的subnet id,至少1002個(gè)子網(wǎng)29(512) 1002 210(1024),子網(wǎng)位數(shù) = 10A類地址主機(jī)位數(shù) = A類網(wǎng)主機(jī)位數(shù) 10

54、 = 24 10 = 14255.255.192.0MaskNet idHost id11111111 11111111 11000000 00000000Subnet id將host id中的某些0 改為17/15/202277Range of Addresses in Example 27/15/202278Discussion地址類別Net id 位數(shù)子網(wǎng)數(shù) Subnet id 位數(shù)主機(jī)數(shù) Host id 位數(shù)地址類別 Net id 位數(shù)主機(jī)數(shù) Host id 位數(shù)子網(wǎng)數(shù) Subnet id 位數(shù)# Net id + # Subnet id + # Host id = 32A類:# Ne

55、t id = 8,# Subnet id + # Host id = 24B類:# Net id = 16,# Subnet id + # Host id = 16C類:# Net id = 24,# Subnet id + # Host id = 87/15/202279Subnetting Example 3一個(gè)具有A類地址的組織的每個(gè)子網(wǎng)最多需要分配1000個(gè)IP地址,試找出子網(wǎng)掩碼。分析最多需要分配1000個(gè)IP地址考慮全0和全1的Host id,至少要1002個(gè)IP地址29(512) 1002 210(1024),主機(jī)位數(shù) = 10A類地址Subnet id = A類網(wǎng)主機(jī)位數(shù) 10

56、 = 24 10 = 14255.255.252.0MaskNet idHost id11111111 11111111 11111100 00000000Subnet id7/15/202280Discussion子網(wǎng)數(shù)量 Subnet id 位數(shù)是否考慮全0 和全1 的Subnet id,根據(jù)題目要求考慮:實(shí)際子網(wǎng)數(shù) + 2不考慮:實(shí)際子網(wǎng)數(shù)主機(jī)數(shù)量 Host id 位數(shù)必須考慮全0 和全1 的Host id 實(shí)際主機(jī)數(shù)(主機(jī)地址數(shù))+ 2 理論 實(shí)際區(qū)分:主機(jī)地址 vs. IP地址7/15/202281子網(wǎng)劃分方法Fix length subnetting(定長子網(wǎng)劃分)共享同一IP網(wǎng)絡(luò)

57、前綴(Net id + Subnet id)的子網(wǎng)大小相同劃分依據(jù):子網(wǎng)數(shù)量與子網(wǎng)內(nèi)主機(jī)數(shù)量折中特點(diǎn):劃分簡單,地址分配較浪費(fèi)Variable length subnetting(變長子網(wǎng)劃分)共享同一IP網(wǎng)絡(luò)前綴(Netid)的子網(wǎng)大小不同劃分依據(jù):子網(wǎng)內(nèi)的主機(jī)數(shù)量特點(diǎn):靈活、高效利用地址空間變長子網(wǎng)掩碼(Variable-Length Subnet Mask,VLSM)7/15/202282Subnetting Example 4每個(gè)物理網(wǎng)絡(luò)所需的IP地址數(shù)量Net 1 =Net 2 = 3 + 3 + 2 = 8Net 3 = 50 + 1 + 2 = 53Net 4 = 40 + 1

58、+ 2 = 43Net 5 = 60 + 1 + 2 = 63Net 1Net 2Net 3Net 4Net 525臺(tái)主機(jī)3臺(tái)主機(jī)40臺(tái)主機(jī)60臺(tái)主機(jī)50臺(tái)主機(jī)25+ 3+ 2= 30本子網(wǎng)內(nèi)主機(jī)數(shù) + 本子網(wǎng)內(nèi)路由器接口數(shù) + 27/15/202283Example 4 定長劃分依據(jù):子網(wǎng)數(shù)5Subnetid 3bit主機(jī)數(shù)63 Hostid 6bit結(jié)論:至少是B類地址塊Mask =每個(gè)IP子網(wǎng)的實(shí)際IP數(shù)量:64IP地址總空間: 5 * 64 = 320Net 1Net 2Net 3Net 4Net 5308436353255.255.255.192假設(shè)使用B類地址塊 Net 1: 12

59、9.1.0.0/26Net 2: 129.1.0.64/26 Net 3: 129.1.0.128/26Net 4: 129.1.0.192/26 Net 5: 129.1.1.0/267/15/202284Example 3 變長劃分Net 1 Mask =Net 2 Mask = Net 3 Mask =Net 4 Mask = Net 5 Mask =IP地址總空間: 32+8+64+64+64 = 232Net 1Net 2Net 3Net 4Net 5308436353/(32-5)=/27/ (32-3)=/29/(32-6)=/26/26/26Net 1: 211.1.0.0/2

60、7Net 2: 211.1.0.32/29 Net 4: 211.1.0.128/26Net 3: 211.1.0.64/26Net 5: 211.1.0.192/26VLSM7/15/202285Discussion 1Net 1(/27):211.1.0.0/27211.1.0.0 211.1.0.31Net 2(/29):211.1.0.32 211.1.0.39Net 3(/26):211.1.0.64 211.1.0.127Net 4(/26):211.1.0.128/26211.1.0.128 211.1.0.191Net 5(26):211.1.0.192/26211.1.0.1

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論