推荐给好友 上一篇:第八课:子网划分分析   下一篇:第六课:IP协议中的子网划分——基本概念

第七课:子网掩码及其作用

Protocols,Lesson7:SubnetmasksandtheireffectThereareafewdifferentwaystoapproachsubnetting,anditcangetconfusingbecauseofthecomplexityofsomesubnetsandtheflexibilitytheyoffer.ForthisreasonIcreatedthislittleparagraphtoletyouknowhowwearegoingtoapproachandlearnsubnetting.Wearegoingtoanalyzethecommonsubnetmasksforeachclass,givingdetailedexamplesformostofthemandallowingyouto"see"howeverythingiscalculatedandunderstandthedifferenteffectsasubnetmaskcanhaveasyouchangeit.Onceyouhavemasteredthis,youcanthengoonandcreateyourcustomsubnetmasksusinganytypeofclass.

Defaultsubnetmasksofeachclass

Bynowyoushouldhavesomeideawhatthesubnetmaskdoesandhowit'susedtopartitionanetwork.WhatyouneedtokeepinmindisthateachclasshasitsDEFAULTsubnetmask,whichwecanchangetosuitourneeds.Ihavealreadymentionedthisinthepreviouspage,butweneedtolookintoitinabitmoredetail.Thepicturebelowshowsourthreenetworkclasseswiththeirrespectivedefaultsubnetmasks:

TheeffectofasubnetmaskonanIPaddress

IntheIPclassespageweanalyzedandshowedhowanIPaddressconsistsoftwoparts,1)ThenetworkIDand2)ThehostID.ThisruleappliesforallIPaddressesthatusethedefaultsubnetmask,sowecallthemclassfulIPaddresses.Wecanseethisonceagaininthepicturebelow,wheretheIPaddressisanalyzedinbinary,becausethisisthewayyoushouldworkwhendealingwithsubnetmasks:

WearelookingatanIPaddresswithitssubnetmaskforthefirsttime.Whatwehavedoneistakethedecimalsubnetmaskandconvertedittobinary,alongwiththeIPaddress.Itisessentialtoworkinbinarybecauseitmakesthingsclearerandwecanavoidmakingsillymistakes.Theones(1)inthesubnetmask"lock"or,ifyoulike,definethenetworkIDportion.IfwechangeanybitwithinthenetworkIDoftheIPaddress,thenweimmediatelymovetoadifferentnetwork.Sointhisexample,wehavea24bitsubnetmask.NOTE:AllclassCclassfulIPaddresseshavea24bitsubnetmask(255.255.255.0).AllclassBclassfulIPaddresseshavea16bitsubnetmask(255.255.0.0).AllclassAclassfulIPaddresseshavean8bitsubnetmask(255.0.0.0).Ontheotherhand,theuseofanIPaddresswithasubnetmaskotherthanthedefaultresultsinthestandardhostbits(theBitsusedtoidentifytheHOSTID)beingdividedintotwoparts:asubnetIDandHostID.ThesetypesofIPaddressesarecalledclasslessIPaddresses.Inordertounderstandwhata"classlessIPaddress"iswithoutgettingconfused,wearegoingtotakethesameIPaddressasabove,andmakeitaclasslessIPaddressbychangingthedefaultsubnetmask:

LookingatthepictureaboveyouwillnownoticethatwehaveasubnetID,somethingthatdidn'texistbefore.Asthepictureexplains,wehaveborrowedthreebitsfromthehostIDandusedthemtocreateasubnetID.EffectivelywepartitionedourclassCnetworkintosmallernetworks.Ifyou'rewonderinghowmanysmallernetworks,you'llfindtheansweronthenextpage.IpreferthatyouunderstandingeverythinghereratherthanblastingyouwithmoresubnetID's,bitsandalltherest:)

Summary

InthispagewesawthedefaultsubnetmaskofeachclassandalsointroducedtheclassfulandclasslessIPaddresses,whicharearesultofusingvarioussubnetmasks.WhenweuseIPaddresseswiththeirdefaultsubnetmasks,e.g.192.168.0.10isaclassCIPaddresssothedefaultsubnetmaskwouldbe255.255.255.0,thentheseare"classfulIPaddresses."Ontheotherhand,classlessIPaddresseshavetheirsubnetmaskmodifiedinawaysothatthereisa"subnetID".ThissubnetIDiscreatedbyborrowingbitsfromthehostIDportion.Thepicturebelowshowsusbothexamples:

Ihopethatyouhaveunderstoodthenewconceptsandmaterialonthispage.Nextwearegoingtotalkaboutsubnetbits,learnhowtocalculatehowmanybitscertainsubnetmasksareandseethedifferentandmostusedsubnetmasksavailable.Ifyouthinkyoumighthavenotunderstoodafewsectionsthroughoutthispage,Iwouldsuggestyoureaditoncemore:)

TAG:

我来说两句