中科大計(jì)算機(jī)網(wǎng)絡(luò)05課件_第1頁(yè)
中科大計(jì)算機(jī)網(wǎng)絡(luò)05課件_第2頁(yè)
中科大計(jì)算機(jī)網(wǎng)絡(luò)05課件_第3頁(yè)
中科大計(jì)算機(jī)網(wǎng)絡(luò)05課件_第4頁(yè)
中科大計(jì)算機(jī)網(wǎng)絡(luò)05課件_第5頁(yè)
已閱讀5頁(yè),還剩47頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

Chapter5Objectives

Uponcompletionyouwillbeableto:IPAddresses:

ClasslessAddressing

UnderstandtheconceptofclasslessaddressingBeabletofindthefirstandlastaddressgivenanIPaddressBeabletofindthenetworkaddressgivenaclasslessIPaddressBeabletocreatesubnetsfromablockofclasslessIPaddressesUnderstandaddressallocationandaddressaggregation1TCP/IPProtocolSuite5.1VARIABLE-LENGTHBLOCKSInclasslessaddressingvariable-lengthblocksareassignedthatbelongtonoclass.Inthisarchitecture,theentireaddressspace(2^32addresses)isdividedintoblocksofdifferentsizes.Thetopicsdiscussedinthissectioninclude:Restrictions可以解決很多問(wèn)題,整個(gè)體系能夠工作得有些限制FindingtheBlock尋找地址塊GrantedBlock分配到的地址塊2TCP/IPProtocolSuiteFigure5.1

Variable-lengthblocks可變長(zhǎng)度塊不同大小的地址塊塊地址數(shù):一個(gè)地址塊中的地址數(shù)必須是2的整數(shù)次冪開(kāi)始地址:開(kāi)始地址必須能被地址數(shù)整除3TCP/IPProtocolSuiteWhichofthefollowingcanbethebeginningaddressofablockthatcontains16addresses?a.205.16.37.32 b.190.16.42.44

c.17.17.33.80 d.123.45.24.52Example1Solution

Onlytwoareeligible(aandc).Theaddress205.16.37.32iseligiblebecause32isdivisibleby16.Theaddress17.17.33.80iseligiblebecause80isdivisibleby16.4TCP/IPProtocolSuiteWhichofthefollowingcanbethebeginningaddressofablockthatcontains256addresses?a.205.16.37.32 b.190.16.42.0

c.17.17.32.0 d.123.45.24.52Example2Solution

Inthiscase,theright-mostbytemustbe0.AswementionedinChapter4,theIPaddressesusebase256arithmetic.Whentheright-mostbyteis0,thetotaladdressisdivisibleby256.Onlytwoaddressesareeligible(bandc).5TCP/IPProtocolSuiteWhichofthefollowingcanbethebeginningaddressofablockthatcontains1024addresses?a.205.16.37.32 b.190.16.42.0

c.17.17.32.0 d.123.45.24.52Example3Solution

Inthiscase,weneedtochecktwobytesbecause

1024=4×256.Theright-mostbytemustbedivisibleby256.Thesecondbyte(fromtheright)mustbedivisibleby4.Onlyoneaddressiseligible(c).6TCP/IPProtocolSuiteFigure5.2

Formatofclasslessaddressingaddressn的意義:表示該地址塊中的每一個(gè)地址都有n個(gè)比特是相同的(從左至右,稱(chēng)地址前綴)無(wú)分類(lèi)標(biāo)志斜線記法也叫CIDR

記法7TCP/IPProtocolSuiteTable5.1Prefixlengths8TCP/IPProtocolSuiteClassfuladdressingisaspecialcaseofclasslessaddressing.Note:9TCP/IPProtocolSuiteWhatisthefirstaddressintheblockifoneoftheaddressesis167.199.170.82/27?Example4Addressinbinary:101001111100011110101

Keeptheleft27bits:101001111100011110101010

01000000

ResultinCIDRnotation:167.199.170.64/27Solution

Theprefixlengthis27,whichmeansthatwemustkeepthefirst27bitsasisandchangetheremainingbits(5)to0s.Thefollowingshowstheprocess:10TCP/IPProtocolSuiteWhatisthefirstaddressintheblockifoneoftheaddressesis140.120.84.24/20?Example5SeeNextSlideSolution

Figure5.3showsthesolution.Thefirst,second,andfourthbytesareeasy;forthethirdbytewekeepthebitscorrespondingtothenumberof1sinthatgroup.Thefirstaddressis140.120.80.0/20.11TCP/IPProtocolSuiteFigure5.3

Example512TCP/IPProtocolSuiteFindthefirstaddressintheblockifoneoftheaddressesis140.120.84.24/20.Example6SeeNextSlideSolution

Thefirst,second,andfourthbytesareasdefinedinthepreviousexample.Tofindthethirdbyte,wewrite84asthesumofpowersof2andselectonlytheleftmost4(mis4)asshowninFigure5.4.Thefirstaddressis140.120.80.0/20.13TCP/IPProtocolSuiteFigure5.4

Example614TCP/IPProtocolSuiteFindthenumberofaddressesintheblockifoneoftheaddressesis140.120.84.24/20.Example7Solution

Theprefixlengthis20.Thenumberofaddressesintheblockis232?20or212or4096.Notethat

thisisalargeblockwith4096addresses.15TCP/IPProtocolSuiteUsingthefirstmethod,findthelastaddressintheblockifoneoftheaddressesis140.120.84.24/20.Example8SeeNextSlideSolution

Wefoundinthepreviousexamplesthatthefirstaddressis140.120.80.0/20andthenumberofaddressesis4096.Tofindthelastaddress,weneedtoadd4095(4096?1)tothefirstaddress.16TCP/IPProtocolSuiteTokeeptheformatindotted-decimalnotation,weneedtorepresent4095inbase256(seeAppendixB)anddothecalculationinbase256.Wewrite4095as15.255.Wethenaddthefirstaddresstothisnumber(inbase255)toobtainthelastaddressasshownbelow:Example8(Continued)

140.120.80.0

15.255

-------------------------

140.120.95.255Thelastaddressis140.120.95.255/20.17TCP/IPProtocolSuiteUsingthesecondmethod,findthelastaddressintheblockifoneoftheaddressesis140.120.84.24/20.Example9SeeNextSlideSolution

Themaskhastwenty1sandtwelve0s.Thecomplementofthemaskhastwenty0sandtwelve1s.Inotherwords,themaskcomplementis0011111111

or0.0.15.255.Weaddthemaskcomplementtothebeginningaddresstofindthelastaddress.18TCP/IPProtocolSuite

140.120.80.0

0.0.15.255

----------------------------

140.120.95.255Example9(Continued)Weaddthemaskcomplementtothebeginningaddresstofindthelastaddress.Thelastaddressis140.120.95.255/20.19TCP/IPProtocolSuiteFindtheblockifoneoftheaddressesis190.87.140.202/29.Example10SeeNextSlideSolution

Wefollowtheprocedureinthepreviousexamplestofindthefirstaddress,thenumberofaddresses,andthelastaddress.Tofindthefirstaddress,wenoticethatthemask(/29)hasfive1sinthelastbyte.Sowewritethelastbyteaspowersof2andretainonlytheleftmostfiveasshownbelow:20TCP/IPProtocolSuite202 ?128+64+0+0+8+0+2+0Theleftmost5numbersare?128+64+0+0+8Thefirstaddressis190.87.140.200/29Example10(Continued)Thenumberofaddressesis232?29or8.Tofindthelastaddress,weusethecomplementofthemask.Themaskhastwenty-nine1s;thecomplementhasthree1s.Thecomplementis0.0.0.7.Ifweaddthistothefirstaddress,weget190.87.140.207/29.Inotherwords,thefirstaddressis190.87.140.200/29,thelastaddressis190.87.140.207/20.Thereareonly8addressesinthisblock.21TCP/IPProtocolSuiteShowanetworkconfigurationfortheblockinthepreviousexample.Example11SeeNextSlideSolution

Theorganizationthatisgrantedtheblockinthepreviousexamplecanassigntheaddressesintheblocktothehostsinitsnetwork.However,thefirstaddressneedstobeusedasthenetworkaddressandthelastaddressiskeptasaspecialaddress(limitedbroadcastaddress).Figure5.5showshowtheblockcanbeusedbyanorganization.Notethatthelastaddressendswith207,whichisdifferentfromthe255seeninclassfuladdressing.22TCP/IPProtocolSuiteFigure5.5

Example1123TCP/IPProtocolSuiteInclasslessaddressing,thelastaddressintheblockdoesnotnecessarilyendin255.Note:24TCP/IPProtocolSuiteInCIDRnotation,theblockgrantedisdefinedbythefirstaddressandtheprefix(前綴)length.Note:25TCP/IPProtocolSuite5.2SUBNETTINGWhenanorganizationisgrantedablockofaddresses,itcancreatesubnetstomeetitsneeds.Theprefixlengthincreasestodefinethesubnetprefixlength.Thetopicsdiscussedinthissectioninclude:FindingtheSubnetMaskFindingtheSubnetAddressesVariable-LengthSubnets26TCP/IPProtocolSuiteInfixed-lengthsubnetting,thenumberofsubnetsisapowerof2.Note:27TCP/IPProtocolSuiteAnorganizationisgrantedtheblock130.34.12.64/26.Theorganizationneeds4subnets.Whatisthesubnetprefixlength?Example12Solution

Weneed4subnets,whichmeansweneedtoaddtwomore1s(log24=2)tothesiteprefix.Thesubnetprefixisthen/28.28TCP/IPProtocolSuiteWhatarethesubnetaddressesandtherangeofaddressesforeachsubnetinthepreviousexample?Example13SeeNextSlideSolution

Figure5.6showsoneconfiguration.29TCP/IPProtocolSuiteFigure5.6

Example1330TCP/IPProtocolSuiteThesitehas232?26=64addresses.Eachsubnethas232–28=16addresses.Nowletusfindthefirstandlastaddressineachsubnet.Example13(Continued)SeeNextSlide1.Thefirstaddressinthefirstsubnetis130.34.12.64/28,usingtheprocedureweshowedinthepreviousexamples.Notethatthefirstaddressofthefirstsubnetisthefirstaddressoftheblock.Thelastaddressofthesubnetcanbefoundbyadding15(16?1)tothefirstaddress.Thelastaddressis130.34.12.79/28.31TCP/IPProtocolSuiteExample13(Continued)2.Thefirstaddressinthesecondsubnetis130.34.12.80/28;itisfoundbyadding1tothelastaddressoftheprevioussubnet.Againadding15tothefirstaddress,weobtainthelastaddress,130.34.12.95/28.3.Similarly,wefindthefirstaddressofthethirdsubnettobe130.34.12.96/28andthelasttobe130.34.12.111/28.4.Similarly,wefindthefirstaddressofthefourthsubnettobe130.34.12.112/28andthelasttobe130.34.12.127/28.32TCP/IPProtocolSuiteAnorganizationisgrantedablockofaddresseswiththebeginningaddress14.24.74.0/24.Thereare232?24=256addressesinthisblock.Theorganizationneedstohave11subnetsasshownbelow:

a.twosubnets,eachwith64addresses.

b.twosubnets,eachwith32addresses.

c.threesubnets,eachwith16addresses.

d.foursubnets,eachwith4addresses.Designthesubnets.Example14SeeNextSlideForOneSolution33TCP/IPProtocolSuiteFigure5.7

Example1434TCP/IPProtocolSuite1.Weusethefirst128addressesforthefirsttwosubnets,eachwith64addresses.Notethatthemaskforeachnetworkis/26.Thesubnetaddressforeachsubnetisgiveninthefigure.2.Weusethenext64addressesforthenexttwosubnets,eachwith32addresses.Notethatthemaskforeachnetworkis/27.Thesubnetaddressforeachsubnetisgiveninthefigure.Example14(Continuted)SeeNextSlide35TCP/IPProtocolSuite3.Weusethenext48addressesforthenextthreesubnets,eachwith16addresses.Notethatthemaskforeachnetworkis/28.Thesubnetaddressforeachsubnetisgiveninthefigure.4.Weusethelast16addressesforthelastfoursubnets,eachwith4addresses.Notethatthemaskforeachnetworkis/30.Thesubnetaddressforeachsubnetisgiveninthefigure.Example14(Continuted)36TCP/IPProtocolSuiteAsanotherexample,assumeacompanyhasthreeoffices:Central,East,andWest.TheCentralofficeisconnectedtotheEastandWestofficesviaprivate,point-to-pointWANlines.Thecompanyisgrantedablockof64addresseswiththebeginningaddress70.12.100.128/26.Themanagementhasdecidedtoallocate32addressesfortheCentralofficeanddividestherestofaddressesbetweenthetwooffices.Figure5.8showstheconfigurationdesignedbythemanagement.Example15SeeNextSlide37TCP/IPProtocolSuiteFigure5.8

Example1538TCP/IPProtocolSuiteThecompanywillhavethreesubnets,oneatCentral,oneatEast,andoneatWest.Thefollowingliststhesubblocksallocatedforeachnetwork:Example15(Continued)SeeNextSlidea.TheCentralofficeusesthenetworkaddress70.12.100.128/27.Thisisthefirstaddress,andthemask/27showsthatthereare32addressesinthisnetwork.Notethatthreeoftheseaddressesareusedfortheroutersandthecompanyhasreservedthelastaddressinthesub-block.Theaddressesinthissubnetare70.12.100.128/27to70.12.100.159/27.NotethattheinterfaceoftherouterthatconnectstheCentralsubnettotheWANneedsnoaddressbecauseitisapoint-to-pointconnection.39TCP/IPProtocolSuiteExample15(Continued)SeeNextSlideb.TheWestofficeusesthenetworkaddress70.12.100.160/28.Themask/28showsthatthereareonly16addressesinthisnetwork.Notethatoneoftheseaddressesisusedfortherouterandthecompanyhasreservedthelastaddressinthesub-block.Theaddressesinthissubnetare70.12.100.160/28to70.12.100.175/28.NotealsothattheinterfaceoftherouterthatconnectstheWestsubnettotheWANneedsnoaddressbecauseitisapoint-to-pointconnection.40TCP/IPProtocolSuiteExample15(Continued)c.TheEastofficeusesthenetworkaddress70.12.100.176/28.Themask/28showsthatthereareonly16addressesinthisnetwork.Notethatoneoftheseaddressesisusedfortherouterandthecompanyhasreservedthelastaddressinthesub-block.Theaddressesin.thissubnetare70.12.100.176/28to70.12.100.191/28.NotealsothattheinterfaceoftherouterthatconnectstheEastsubnettotheWANneedsnoaddressbecauseitisapoint-to-pointconnection.41TCP/IPProtocolSuite5.3ADDRESSALLOCATIONAddressallocationistheresponsibilityofaglobalauthoritycalledtheInternetCorporationforAssignedNamesandAddresses(ICANN).ItusuallyassignsalargeblockofaddressestoanISPtobedistributedtoitsInternetusers.42TCP/IPProtocolSuiteAnISPisgrantedablockofaddressesstartingwith190.100.0.0/16(65,536addresses).TheISPneedstodistributetheseaddressestothreegroupsofcustomersasfollows:Example16SeeNextSlidea.Thefirstgrouphas64customers;eachneeds256addresses.

b.Thesecondgrouphas128customers;eachneeds128addresses

c.Thethirdgrouphas128customers;eachneeds64addresses.43TCP/IPProtocolSuiteDesignthesubblocksandfindouthowmanyaddressesarestillavailableaftertheseallocations.Example16(Continued)SeeNextSlideSolution

Figure5.9showsthesituation.44TCP/IPProtocolSuiteFigure5.9

Example1645TCP/IPProtocolSuiteGroup1

Forthisgroup,eachcustomerneeds256addresses.Thismeansthesuffixlengthis8(28=256).Theprefixlengthisthen32?8=24.Theaddressesare:Example16(Continued)SeeNextSlide1stC

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(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)論