IPv4 Quick Guide

Embed Size (px)

DESCRIPTION

internet protocol

Citation preview

  • 5/2/2015 IPv4QuickGuide

    http://www.tutorialspoint.com/cgibin/printpage.cgi 1/16

    http://www.tutorialspoint.com/ipv4/ipv4_quick_guide.htm Copyrighttutorialspoint.com

    IPV4QUICKGUIDE

    IPV4OVERVIEW

    Thiseraissaidtobetheeraofcomputers.Computershavesignificantlychangedlivesandthewayweusedtolive.Acomputingdevicewhenconnectedtoothercomputingdevice enablesustosharedataandinformationatlightningfastspeed.

    WhatisNetwork?

    ANetworkintheworldofcomputersissaidtobeacollectionofinterconnectedhosts,viasomesharedmediawhichcanbewiredorwireless.Acomputernetworkenablesitshoststoshareandexchangedataandinformationoverthemedia.NetworkcanbeaLocalAreaNetworkspannedacrossanofficeorMetroAreaNetworkspannedacrossacityorWideAreaNetworkwhichcanbespannedacrosscitiesandprovinces.

    ComputernetworkcanbeassimpleastwoPCsconnectedtogetherviaasinglecoppercableoritcanbegrownuptothecomplexitywhereeverycomputerinthisworldisconnectedtoeveryother,theInternet.Anetworkthenincludesmoreandmorecomponentstoreachitsultimategoalofdataexchange.Belowisabriefdescriptionofthecomponentsinvolvedincomputernetwork:

    HostsHostsaresaidtobesituatedatultimateendofthenetwork,i.e.ahostisasourceofinformationandanotherhostwillbethedestination.Informationflowsendtoendbetweenhosts.AhostcanbeausersPC,aninternetServer,adatabaseserveretc.

    MediaIfwired,thenitcanbecoppercable,fiberopticcable,coaxialcableorifwireless,itcanbefreetoairradiofrequencyorsomespecialwirelessband.Wirelessfrequenciescanbeusedtointerconnectremotesitestoo.

    HubAhubisamultiportrepeateranditisusedtoconnecthostsinaLANsegment.Becauseoflowthroughputshubsarenowrarelyused.HubworksonLayer1 ofOSIModel.

    SwitchASwitchisamultiportbridgeandisusedtoconnecthostsinaLANsegment.SwitchesaremuchfasterthanHubsandoperateonwirespeed.SwitchworksonLayer2 butLayer3 switchesarealsoavailable.

    RouterArouterisLayer3 devicewhichmakesroutingdecisionsforthedata/informationsentforsomeremotedestination.RoutersmakethecoreofanyinterconnectednetworkandtheInternet.

    GatewaysAsoftwareorcombinationofsoftwareandhardwareputtingtogetherworksforexchangingdataamongnetworkswhichareusingdifferentprotocolsforsharingdata.

    FirewallSoftwareorcombinationofsoftwareandhardware,usedtoprotectusersdatafromunintendedrecipientsonthenetwork/internet.

    Allcomponentsinanetworkultimatelyservethehosts.

    HostAddressing

    Communicationbetweenhostscanhappenonlyiftheycanidentifyeachotheronthenetwork.Inasinglecollisiondomain hostscancommunicatedirectlyviaMACaddress.

    MACaddressisafactorycoded48bitshardwareaddresswhichcanalsouniquelyidentifyahostintheworld.Butifahostwantstocommunicatewitharemotehost,i.e.notinthesamesegmentorlogicallynotconnected,thensomemeansofaddressingisrequiredtoidentifytheremotehostuniquely.Alogical

    /

    $5/%(5!.

    0%*'5!.

    !03+.'5!.

    !03+.'5!.

    3$!.!!2!.5,'!0/!*0+*0$!/!#)!*05+*!$+/0%/$!. 5!2!.5+0$!.$+/0

  • 5/2/2015 IPv4QuickGuide

    http://www.tutorialspoint.com/cgibin/printpage.cgi 2/16

    addressisgiventoallhostsconnectedtoInternetandthislogicaladdressiscalledInternetProtocolAddress.

    IPV4OSIMODEL

    InternationalStandardOrganizationhasawelldefinedModelforCommunicationSystemsknownasOpenSystemInterconnection,orOSIModel.Thislayeredmodelisaconceptualizedviewofhowonesystemshouldcommunicatewiththeother,usingvariousprotocolsdefinedineachlayer.Further,eachlayerisdesignatedtoawelldefinedpartofcommunicationsystem.Forexample,thePhysicallayerdefinesallthecomponentsofphysicalnature,i.e.wires,frequencies,pulsecodes,voltagetransmissionetc.ofacommunicationsystem.

    OSIModelhasfollowingsevenlayers:

    ApplicationLayer :Thisiswheretheuserapplicationsitswhoneedstotransferdatabetweenoramonghosts.Forexample:HTTP,filetransferapplication andelectronicmailetc.

    PresentationLayer :Thislayerhelpstounderstanddatarepresentationinoneformonahosttootherhostintheirnativerepresentation.Datafromthesenderisconvertedtoonthewiredata andatthereceiversenditisconvertedtothenativerepresentationofthereceiver.

    SessionLayer :Thislayerprovidessessionmanagementcapabilitiesbetweenhosts.Forexampleifsomehostneedsapasswordverificationforaccessandifcredentialsareprovidedthenforthatsessionpasswordverificationdoesnothappenagain.Thislayercanassistinsynchronization,dialogcontrolandcriticaloperationmanagement .

    TransportLayer :Thislayerprovidesendtoenddatadeliverybetween/amonghosts.ThislayertakesdatafromabovelayerandbreaksitintosmallerunitscalledSegmentsandthengivesittoNetworklayerfortransmission.

    NetworkLayer :Thislayerhelpstouniquelyidentifyhostsbeyondthesubnetsanddefinesthepathwhichthepacketswillfolloworberoutedtoreachthedestination.

    DataLinkLayer :Thislayertakestherawtransmissiondata from

    5!.

    5!.

    #!*!.(/0* . "+.)0

    5!.

    !# *+*(%*!*'0.*/0%+*

    5!.

    5!.

    5!. /%#*(,1(/!/!0

  • 5/2/2015 IPv4QuickGuide

    http://www.tutorialspoint.com/cgibin/printpage.cgi 3/16

    PhysicalLayerandmakesDataFramesandsendsthattoupperlayerandviceversa.Thislayeralsochecksanytransmissionerrorsandsortitoutaccordingly.

    PhysicalLayer :Thislayerdealswithhardwaretechnologyandactualcommunicationmechanismlikesignaling,voltage,cabletypeandlengthetc.

    NetworkLayer

    Thenetworklayerisresponsibleforcarryingdatafromonehosttoanother.Itprovidesmeanstoallocatelogicaladdressestohostsandidentifythemuniquelyusingthesame.NetworklayertakesdataunitsfromTransportLayerandcutsthemintosmallerunitcalledDataPacket.

    Networklayerdefinesthedatapath,thepacketsshouldfollowtoreachthedestination.Routersworkonthislayerandprovidesmechanismtoroutedatatoitsdestination.

    IPV4TCP/IPMODEL

    MajorlyoftheinternetusesaprotocolsuitecalledtheInternetProtocolSuitealsoknownasTCP/IPprotocolsuite.Thissuiteisacombinationofprotocolswhichencompassesanumberofdifferentprotocolsfordifferentpurposeandneed.BecausethetwomajorprotocolsinthissuitesareTCP

    andIP ,thisiscommonlytermedasTCP/IPProtocolsuite.Thisprotocolsuitehasitsownreferencemodelwhichitfollowsovertheinternet.IncontrastwithOSImodel,thismodelofprotocolscontainslesslayers.

    [ComparativedepictionofOSIandTCP/IPReferenceModels]

    Thismodelisindifferenttotheactualhardwareimplementation,i.e.PhysicallayerofOSIModel.Thisiswhythismodelcanbeimplementedonalmostallunderlyingtechnologies.TransportandInternetlayerscorrespondstothesamepeerlayers.AllthreetoplayersofOSIModelarecompressedtogetherinsingleApplicationlayerofTCP/IPModel.

    InternetProtocolVersion4

    InternetProtocolisoneofthemajorprotocolinTCP/IPprotocolssuite.ThisprotocolworksatNetworklayerofOSImodelandatInternetlayerofTCP/IPmodel.Thusthisprotocolhastheresponsibilityof

    5!.

    .*/)%//%+*+*0.+(.+0++( *0!.*!0.+0++(

    2

  • 5/2/2015 IPv4QuickGuide

    http://www.tutorialspoint.com/cgibin/printpage.cgi 4/16

    identificationofhostsbasedupontheirlogicaladdressesandtoroutedatabetween/amongthemovertheunderlyingnetwork.

    IPprovidesamechanismtouniquelyidentifyhostbyIPaddressingscheme.IPusesbesteffortdelivery,i.e.itdoesnotguaranteethatpacketswouldbedeliveredtodestinedhostbutitwilldoitsbesttoreachthedestination.InternetProtocolversion4uses32bitlogicaladdress.

    IPV4PACKETSTRUCTURE

    InternetProtocolbeingalayer3protocol takesdataSegmentsfromlayer4 anddividesitintowhatscalledpacket.IPpacketencapsulatesdataunitreceivedfromabovelayerandaddsitsownheaderinformation.

    TheencapsulateddataisreferredtoasIPPayload.IPheadercontainsallthenecessaryinformationtodeliverthepacketattheotherend.

    IPheaderincludesmanyrelevantinformationincludingVersionNumber,which,inthiscontext,is4.Otherdetailsareasfollows:

    Version:Versionno.ofInternetProtocolused

    IHL:InternetHeaderLength,LengthofentireIPheader

    DSCP:DifferentiatedServicesCodePoint,ThisisTypeofService.

    ECN:ExplicitCongestionNotification,carriesinformationaboutthecongestionseenintheroute.

    TotalLength:LengthofentireIPPacket

    Identification:IfIPpacketisfragmentedduringthetransmission,allthefragmentscontainsameidentificationno.toidentifyoriginalIPpackettheybelongto.

    .*/,+.0

    !# 2

    %*(1 %*#$! !.* 5(+

  • 5/2/2015 IPv4QuickGuide

    http://www.tutorialspoint.com/cgibin/printpage.cgi 5/16

    Flags:Asrequiredbythenetworkresources,ifIPPacketistoolargetohandletheseflagstellthatiftheycanbefragmentedornot.Inthis3bitflag,theMSBisalwayssetto0.

    FragmentOffset:ThisoffsettellstheexactpositionofthefragmentintheoriginalIPPacket.

    TimetoLive:Toavoidloopinginthenetwork,everypacketissentwithsomeTTLvalueset,whichtellsthenetworkhowmanyrouters thispacketcancross.Ateachhop,itsvalueisdecrementedbyoneandwhenthevaluereacheszero,thepacketisdiscarded.

    Protocol:TellstheNetworklayeratthedestinationhost,towhichProtocolthispacketbelongsto,i.e.thenextlevelProtocol.ForexampleprotocolnumberofICMPis1,TCPis6andUDPis17.

    HeaderChecksum:Thisfieldisusedtokeepchecksumvalueofentireheaderwhichisthenusedtocheckifthepacketisreceivederrorfree.

    SourceAddress:32bitaddressoftheSender ofthepacket.

    DestinationAddress:32bitaddressoftheReceiver ofthepacket.

    Options:Thisisoptionalfield,whichisusedifthevalueofIHLisgreaterthan5.TheseoptionmaycontainvaluesforoptionssuchasSecurity,RecordRoute,TimeStampetc.

    IPV4ADDRESSING

    IPv4supportsthreedifferenttypeofaddressingmodes:

    UnicastAddressingMode:

    Inthismode,dataissentonlytoonedestinedhost.TheDestinationAddressfieldcontains32bitIPaddressofthedestinationhost.Hereclientsendsdatatothetargetedserver:

    BroadcastAddressingMode:

    Inthismodethepacketisaddressedtoallhostsinanetworksegment.TheDestinationAddressfieldcontainsspecialbroadcastaddressi.e.255.255.255.255.Whenahostseesthispacketonthenetwork,itisboundtoprocessit.Hereclientsendspacket,whichisentertainedbyalltheServers:

    $+,/

    +./+1.!

    +. !/0%*0%+*

  • 5/2/2015 IPv4QuickGuide

    http://www.tutorialspoint.com/cgibin/printpage.cgi 6/16

    MulticastAddressingMode:

    Thismodeisamixofprevioustwomodes,i.e.thepacketsentisneitherdestinedtoasinglehostnorallthehostonthesegment.Inthispacket,theDestinationAddresscontainsspecialaddresswhichstartswith224.x.x.xandcanbeentertainedbymorethanonehost.

    HereaserversendspacketswhichisentertainedbymorethanoneServers.EverynetworkhasoneIPaddressreservedfornetworknumberwhichrepresentsthenetworkandoneIPaddressreservedforBroadcastAddress,whichrepresentsallthehostinthatnetwork.

    HierarchicalAddressingScheme

    IPv4useshierarchicaladdressingscheme.AnIPaddresswhichis32bitsinlength,isdividedintotwoorthreepartsasdepicted:

  • 5/2/2015 IPv4QuickGuide

    http://www.tutorialspoint.com/cgibin/printpage.cgi 7/16

    AsingleIPaddresscancontaininformationaboutthenetworkanditssubnetworkandultimatelythehost.ThisschemeenablesIPAddresstobehierarchicalwhereanetworkcanhavemanysubnetworkswhichinturncanhavemanyhosts.

    SubnetMask

    The32bitIPaddresscontainsinformationaboutthehostanditsnetwork.Itisverynecessarytodistinguishtheboth.Forthis,routersuseSubnetMask,whichisaslongasthesizeofthenetworkaddressintheIPaddress.SubnetMaskisalso32bitslong.IftheIPaddressinbinaryisANDedwithitsSubnetMask,theresultyieldstheNetworkaddress.Forexample,saytheIPAddress192.168.1.152andtheSubnetMaskis255.255.255.0then

    ThiswaySubnetMasthelpsextractNetworkIDandHostfromanIPAddress.Itcanbeidentifiednowthat192.168.1.0istheNetworknumberand192.168.1.152isthehostonthatnetwork.

    BinaryRepresentation

    Thepositionalvaluemethodisthesimplestformofconvertingbinaryfromdecimalvalue.IPaddressis32bitvaluewhichisdividedinto4octets.Abinaryoctetcontains8bitsandthevalueofeachbitcanbedeterminedbythepositionofbitvalue'1'intheoctet.

    Positionalvalueofbitsisdeterminedby2raisedtopower ,thatisthevalueofabit1atposition6is261thatis25thatis32.Thetotalvalueoftheoctetisdeterminedbyaddingupthepositionalvalueofbits.Thevalueof11000000is128+64=192.SomeExamplesareshowninthetablebelow:

    ,+/%0%+*

  • 5/2/2015 IPv4QuickGuide

    http://www.tutorialspoint.com/cgibin/printpage.cgi 8/16

    IPV4ADDRESSCLASSES

    InternetProtocolhierarchycontainsseveralclassesofIPAddressestobeusedefficientlyinvarioussituationaspertherequirementofhostspernetwork.Broadly,IPv4Addressingsystemisdividedinto5classesofIPAddresses.Allthe5classesareidentifiedbythefirstoctetofIPAddress.

    InternetCorporationforAssignedNamesandNumbersresponsibleforassigningIPaddresses.

    Thefirstoctetreferredhereistheleftmostofall.TheoctetsnumberedasfollowsdepictingdotteddecimalnotationofIPAddress:

  • 5/2/2015 IPv4QuickGuide

    http://www.tutorialspoint.com/cgibin/printpage.cgi 9/16

    Numberofnetworksandnumberofhostsperclasscanbederivedbythisformula:

    WhencalculatinghostsIPaddresses,2IPaddressesaredecreasedbecausetheycannotbeassignedtohostsi.e.thefirstIPofanetworkisnetworknumberandthelastIPisreservedforBroadcastIP.

    ClassAAddress

    Thefirstbitofthefirstoctetisalwayssetto0 .Thusthefirstoctetrangesfrom1127,i.e.

    ClassAaddressesonlyincludeIPstartingfrom1.x.x.xto126.x.x.xonly.TheIPrange127.x.x.xisreservedforloopbackIPaddresses.

    ThedefaultsubnetmaskforClassAIPaddressis255.0.0.0whichimpliesthatClassAaddressingcanhave126networks(272)and16777214hosts(2242).

    ClassAIPaddressformatthus,is0NNNNNNN.HHHHHHHH.HHHHHHHH.HHHHHHHH

    ClassBAddress

    AnIPaddresswhichbelongstoclassBhasthefirsttwobitsinthefirstoctetsetto10,i.e.

    ClassBIPAddressesrangefrom128.0.x.xto191.255.x.x.ThedefaultsubnetmaskforClassBis255.255.x.x.

    ClassBhas16384(214)Networkaddressesand65534(2162)Hostaddresses.

    ClassBIPaddressformatis,10NNNNNN.NNNNNNNN.HHHHHHHH.HHHHHHHH

    ClassCAddress

    ThefirstoctetofClassCIPaddresshasitsfirst3bitssetto110,thatis

    ClassCIPaddressesrangefrom192.0.0.xto192.255.255.x.ThedefaultsubnetmaskforClassBis

    6!.+

  • 5/2/2015 IPv4QuickGuide

    http://www.tutorialspoint.com/cgibin/printpage.cgi 10/16

    255.255.255.x.

    ClassCgives2097152(221)Networkaddressesand254(282)Hostaddresses.

    ClassCIPaddressformatis110NNNNN.NNNNNNNN.NNNNNNNN.HHHHHHHH

    ClassDAddress

    VeryfirstfourbitsofthefirstoctetinClassDIPaddressesaresetto1110,givingarangeof

    ClassDhasIPaddressragefrom224.0.0.0to239.255.255.255.ClassDisreservedforMulticasting.Inmulticastingdataisnotdestinedforaparticularhost,that'swhythereisnoneedtoextracthostaddressfromtheIPaddress,andClassDdoesnothaveanysubnetmask.

    ClassEAddress

    ThisIPClassisreservedforexperimentalpurposesonlylikeforR&DorStudy.IPaddressesinthisclassrangesfrom240.0.0.0to255.255.255.254.LikeClassD,thisclasstooisnotequippedwithanysubnetmask.

    IPV4SUBNETTING

    EachIPclassisequippedwithitsowndefaultsubnetmaskwhichboundsthatIPclasstohaveprefixednumberofNetworksandprefixednumberofHostspernetwork.ClassfulIPaddressingdoesnotprovideanyflexibilityofhavinglessnumberofHostsperNetworkormoreNetworksperIPClass.

    CIDRorClasslessInterDomainRoutingprovidestheflexibilityofborrowingbitsofHostpartoftheIPaddressandusingthemasNetworkinNetwork,calledSubnet.Byusingsubnetting,onesingleClassAIPaddressescanbeusedtohavesmallersubnetworkswhichprovidesbetternetworkmanagementcapabilities.

    ClassASubnets

    InClassA,onlythefirstoctetisusedasNetworkidentifierandrestofthreeoctetsareusedtobeassignedtoHosts .TomakemoresubnetinClassA,bitsfromHostpartareborrowedandthesubnetmaskischangedaccordingly.

    Forexample,ifoneMSB isborrowedfromhostbitsofsecondoctetandaddedtoNetworkaddress,itcreatestwoSubnets(21=2)with(2232)8388606HostsperSubnet.

    TheSubnetmaskischangedaccordinglytoreflectsubnetting.GivenbelowisalistofallpossiblecombinationofClassAsubnets:

    %! +/0/,!.!03+.'

    +/0%#*%"%*0%0

  • 5/2/2015 IPv4QuickGuide

    http://www.tutorialspoint.com/cgibin/printpage.cgi 11/16

    Incaseofsubnettingtoo,theveryfirstandlastIPaddressofeverysubnetisusedforSubnetNumberandSubnetBroadcastIPaddressrespectively.BecausethesetwoIPaddressescannotbeassignedtohosts,Subnettingcannotbeimplementedbyusingmorethan30bitsasNetworkBitswhichprovideslessthantwohostspersubnet.

    ClassBSubnets

    ByDefault,usingClassfulNetworking,14bitsareusedasNetworkbitsproviding(214)16384Networksand(2161)65534Hosts.ClassBIPAddressescanbesubnettedthesamewayasClassAaddresses,byborrowingbitsfromHostbits.BelowisgivenallpossiblecombinationofClassBsubnetting:

  • 5/2/2015 IPv4QuickGuide

    http://www.tutorialspoint.com/cgibin/printpage.cgi 12/16

    ClassCSubnets

    ClassCIPaddressesnormallyassignedtoaverysmallsizenetworkbecauseitonlycanhave254hostsinanetwork.GivenbelowisalistofallpossiblecombinationofsubnettedClassBIPaddress:

    IPV4VARIABLELENGTHSUBNETMASKING

    InternetServiceProvidersmayfaceasituationwheretheyneedtoallocateIPsubnetsofdifferentsizesaspertherequirementofcustomer.OnecustomermayaskClassCsubnetof3IPaddressesandanothermayaskfor10IPs.ForanISP,itisnotfeasibletodividetheIPaddressesintofixedsizesubnets,ratherhemaywanttosubnetthesubnetsinsuchawaywhichresultsinminimumwastageofIPaddresses.

    Forexample,anadministratorhave192.168.1.0/24network.Thesuffix/24tellsthenumberofbitsusedfornetworkaddress.Heishavingthreedifferentdepartmentswithdifferentnumberofhosts.Salesdepartmenthas100computers,Purchasedepartmenthas50computers,Accountshas25computersandManagementhas5computers.InCIDR,thesubnetsareoffixedsize.Usingthesamemethodologytheadministratorcannotfulfillalltherequirementsofthenetwork.

    ThefollowingprocedureshowshowVLSMcanbeusedinordertoallocatedepartmentwiseIPaddressesasmentionedintheexample.

    ,.+*+1*! / /(/$

  • 5/2/2015 IPv4QuickGuide

    http://www.tutorialspoint.com/cgibin/printpage.cgi 13/16

    Step1

    MakealistofSubnetspossible.

    Step2

    SorttherequirementsofIPsindescendingorder .

    Sales100

    Purchase50

    Accounts25

    Management5

    Step3

    AllocatethehighestrangeofIPstothehighestrequirement,solet'sassign192.168.1.0/25toSalesdepartment.ThisIPsubnetwithNetworknumber192.168.1.0has126validHost

    IPaddresseswhichsatisfytherequirementofSalesDepartment.ThesubnetMaskusedforthissubnethas10000000asthelastoctet.

    Step4

    Allocatethenexthighestrange,solet'sassign192.168.1.128/26 toPurchasedepartment.ThisIPsubnetwithNetworknumber192.168.1.128has62validHostIPAddresseswhichcanbeeasilyassignedtoallPurchasedepartment'sPCs.Thesubnetmaskusedhas11000000inthelastoctet.

    Step5

    Allocatethenexthighestrange,i.e.Accounts.Therequirementof25IPscanbefulfilledwith192.168.1.192/27 IPsubnet,whichcontains30validhostIPs.ThenetworknumberofAccountsdepartmentwillbe192.168.1.192.Thelastoctetofsubnetmaskis11100000.

    Step6

    AllocatenexthighestrangetoManagement.TheManagementdepartmentcontainsonly5computers.Thesubnet192.168.1.224/29withMask255.255.255.248hasexactly6validhostIPaddresses.SothiscanbeassignedtoManagement.Thelastoctetofsubnetmaskwillcontain11111000.

    ByusingVLSM,theadministratorcansubnettheIPsubnetsuchawaythatleastnumberofIPaddressesarewasted.EvenafterassigningIPstoeverydepartment,theadministrator,inthisexample,stillleftwithplentyofIPaddresseswhichwasnotpossibleifhehasusedCIDR.

    IPV4RESERVEDADDRESSES

    %#$!/00++3!/0

  • 5/2/2015 IPv4QuickGuide

    http://www.tutorialspoint.com/cgibin/printpage.cgi 14/16

    TherearefewReservedIPv4addressspaceswhichcannotbeusedontheinternet.TheseaddressesservespecialpurposeandcannotberoutedoutsideLocalAreaNetwork.

    PrivateIPAddresses

    EveryclassofIP, A,B&C hassomeaddressesreservedasPrivateIPaddresses.TheseIPscanbeusedwithinanetwork,campus,companyandareprivatetoit.TheseaddressescannotberoutedonInternetsopacketscontainingtheseprivateaddressesaredroppedbytheRouters.

    Inordertocommunicatewithoutsideworld,Internet,theseIPaddressesmusthavetobetranslatedtosomepublicIPaddressesusingNATprocessorWebProxyservercanbeused.

    ThesolepurposetocreateseparaterangeofprivateaddressesistocontrolassignmentofalreadylimitedIPv4addresspool.ByusingprivateaddressrangewithinLAN,therequirementofIPv4addresseshasgloballydecreasedsignificantly.IthasalsohelpeddelayingtheIPv4addressexhaustion.

    IPclass,whileusingprivateaddressrange,canbechosenasperthesizeandrequirementoftheorganization.LargerorganizationmaychooseclassAprivateIPaddressrangewheresmallermayoptforclassC.TheseIPaddressescanbefurthersubnettedbeassignedtodepartmentswithinanorganization.

    LoopbackIPAddresses

    TheIPaddressrange127.0.0.0127.255.255.255isreservedforloopbacki.e.aHostsselfaddress.Alsoknownaslocalhostaddress.ThisloopbackIPaddressismanagedentirelybyandwithintheoperatingsystem.Usingloopbackaddresses,enabletheServerandClientprocessesonasinglesystemtocommunicatewitheachother.Whenaprocesscreatesapacketwithdestinationaddressasloopbackaddress,theoperatingsystemloopsitbacktoitselfwithouthavinganyinterferenceofNIC.

    Datasentonloopbackisforwardbytheoperatingsystemtoavirtualnetworkinterfacewithinoperatingsystem.Thisaddressismostlyusedfortestingpurposeslikeclientserverarchitectureonasinglemachine.Otherthanthat,ifahostmachinecansuccessfullyping127.0.0.1oranyIPfromloopbackrange,impliesthattheTCP/IPsoftwarestackonthemachineissuccessfullyloadedandworking.

    LinklocalAddresses

    IncaseoftheHostisnotabletoacquireanIPaddressfromDHCPserverandithasnotbeenassignedanyIPaddressmanually,thehostcanassignitselfanIPaddressfromarangeofreservedLinklocaladdresses.Linklocaladdressrangeis169.254.0.0169.254.255.255.

    AssumeanetworksegmentwhereallsystemsareconfiguredtoacquireIPaddressesfromaDHCPserverconnectedtothesamenetworksegment.IftheDHCPserverisnotavailable,nohostonthesegmentwillbeabletocommunicatetoanyother.Windows ,andMacOS supportthisfunctionalityofselfconfigurationofLinklocalIPaddress.InabsenceofDHCPserver,everyhostmachinerandomlychoosesanIPaddressfromtheabovementionedrangeandthencheckstoascertainbymeansofARP,ifsomeotherhostalsohasnotconfiguredhimselfwiththesameIPaddress.Onceallhostareusinglinklocaladdressesofsamerange,theycancommunicatetoeachother.

    TheseIPaddressescannothelpsystemtocommunicatewhentheydonotbelongtothesamephysicalorlogicalsegment.TheseIPsarealsonotroutable.

    IPV4EXAMPLE

    ThissectiontellshowactualcommunicationhappensontheNetworkusingInternetProtocolversion4.

    +.(0!. +.(0!.

  • 5/2/2015 IPv4QuickGuide

    http://www.tutorialspoint.com/cgibin/printpage.cgi 15/16

    Packetflowinnetwork

    AllthehostsinIPv4environmentareassigneduniquelogicalIPaddresses.Whenahostwantstosendsomedatatoanotherhostonthenetwork,itneedsthephysical addressofthedestinationhost.TogettheMACaddress,thehostbroadcastsARPmessageandaskstogivetheMACaddresswhoeveristheownerofdestinationIPaddress.AllthehostonthatsegmentreceivesARPpacketbutonlythehostwhichhasitsIPmatchingwiththeoneinARPmessage,replieswithitsMACaddress.OncethesenderreceivestheMACaddressofreceivingstation,dataissentonthephysicalmedia.

    Incase,theIPdoesnotbelongtothelocalsubnet.ThedataissenttothedestinationbymeansofGatewayofthesubnet.Tounderstandthepacketflowwemustfirstunderstandfollowingcomponents:

    MACAddress:MediaAccessControlAddressis48bitfactoryhardcodedphysicaladdressofnetworkdevicewhichcanuniquelybeidentified.Thisaddressisassignedbydevicemanufacturers.

    AddressResolutionProtocol:AddressResolutionProtocolisusedtoacquiretheMACaddressofahostwhoseIPaddressisknown.ARPisaBroadcastpacketwhichisreceivedbyallthehostinthenetworksegment.ButonlythehostwhoseIPismentionedinARPrespondstoitprovidingitsMACaddress.

    ProxyServer:ToaccessInternet,networksusesProxyServerwhichhasapublicIPassigned.AllPCsrequestProxyServerforaServeronInternet,ProxyServeronbehalfofPCsendstherequesttoserverandwhenitreceivesresponsefromtheServer,theProxyServerforwardsittotheclientPC.ThisisawaytocontrolInternetaccessincomputernetworksandithelpstoimplementwebbasedpolicies.

    DynamicHostControlProtocol:DHCPisaservicebywhichahostisassignedIPaddressfromapredefinedaddresspool.DHCPserveralsoprovidesnecessaryinformationsuchasGatewayIP,DNSServerAddress,leaseassignedwiththeIPetc.ByusingDHCPservicesnetworkadministratorcanmanageassignmentofIPaddressesatease.

    DomainNameSystem:ThisisverylikelythatauserdoesnotknowtheIPaddressofaremoteServerhewantstoconnectto.Butheknowsthenameassignedtoitforexample,tutorialpoints.com.WhentheusertypesinthenameofremoteserverhewantstoconnecttothelocalhostbehindthescreenssendsaDNSquery.DomainNameSystemisamethodtoacquiretheIPaddressofthehostwhoseDomainNameisknown.

    NetworkAddressTranslation:AlmostallPCsinacomputernetworkareassignedprivateIPaddresseswhicharenotroutableonInternet.AssoonasarouterreceivesanIPpacketwithprivateIPaddressitdropsit.InordertoaccessServersonpublicprivateaddress,computernetworksuseanaddresstranslationservice,whichtranslatesbetweenpublicandprivateaddresses,calledNetworkAddressTranslation.WhenaPCsendsanIPpacketoutofaprivatenetwork,NATchangestheprivateIPaddresswithpublicIPaddressandviceversa.

    Wecannowdescribethepacketflow.Assumethatauserwantstoaccesswww.TutorialsPoint.comfromherpersonalcomputer.SheishavinginternetconnectionfromherISP.Thefollowingstepswillbetakenbythesystemtohelpherreachdestinationwebsite.

    Step:1AcquiringanIPAddress

    WhenusersPCbootsup,itsearchesforaDHCPservertoacquireanIPaddress.Forthesame,PCsendsaDHCPDISCOVERbroadcastwhichisreceivedbyoneormoreDHCPserversonthesubnetandtheyallrespondwithDHCPOFFERwhichincludesallthenecessarydetailslikeIP,subnet,Gateway,DNSetc.PCsendsDHCPREQUESTpacketinordertorequesttheofferedIPaddress.Finally,DHCPsendsDHCPACKpackettotellPCthatitcankeeptheIPforsomegivenamountoftimeakaIPlease.

    AlternativelyaPCcanbeassignedanIPaddressmanuallywithouttakinganyhelpfromDHCPServer.WhenaPCiswellconfiguredwithIPaddressdetails,itcannowspeaktoothercomputersallovertheIPenablednetwork.

    Step:2DNSquery

  • 5/2/2015 IPv4QuickGuide

    http://www.tutorialspoint.com/cgibin/printpage.cgi 16/16

    Whenauseropensawebbrowserandtypeswww.tutorialpoints.comwhichisadomainnameandaPCdoesnotunderstandhowtocommunicatewiththeserverusingdomainnames.PCsendsaDNSqueryoutonthenetworkinordertoobtaintheIPaddresspertainingtothedomainname.ThepreconfiguredDNSserverrespondsthequerywithIPaddressofthedomainnamespecified.

    Step:3ARPrequest

    ThePCfindsthatthedestinationIPaddressdoesnotbelongtohisownIPaddressrangeandithastoforwardtherequesttotheGateway.GatewayinthisscenariocanbearouteroraProxyServer.ThoughGatewaysIPaddressisknowntotheclientmachinebutcomputersdonotexchangedataonIPaddressesrathertheyneedmachineshardwareaddresswhichisLayer2factorycodedMACaddress.ToobtaintheMACaddressoftheGatewaytheclientPCbroadcastsanARPrequestsaying"WhoownsthisIPaddress?"TheGatewayinresponsetotheARPquerysendsitMACaddress.UponreceivingMACaddressPCsendsthepacketstoGateway.

    AnIPpackethasbothsourceanddestinationaddressesandthisconnectshostwitharemotehostlogically.WhereasMACaddresseshelpssystemsonasinglenetworksegmenttotransferactualdata.ThisisimportantthatsourceanddestinationMACaddresseschangeastheytravelacrosstheInternet

    butsourceanddestinationIPaddressneverchanges.

    IPV4SUMMARY

    TheInternetProtocolversion4wasdesignedtobeallocatedtoapprox.4.3billionaddresses.AtthebeginningofInternetthiswasconsideredamuchwideraddressspaceforwhichtherewasnothingtoworryabout.

    ThesuddengrowthinInternetusersanditswidespreadusehasexponentiallyincreasethenumberofdeviceswhichneedsrealanduniqueIPtobeabletocommunicate.Gradually,anIPisrequiredbyalmosteverydigitalequipmentwhichweremadetoeasehumanlife,suchasMobilePhones,Carsandotherelectronicdevices.Thenumberofdevices expandedthedemandforextraIPaddresses,whichwerenotconsideredearlier.

    AllocationofIPv4isgloballymanagedbyInternetAssignedNumbersAuthority undercoordinationwithInternetCorporationforAssignedNamesandNumbers .IANAworkscloselywithRegionalInternetRegistries,whichinturnsareresponsibleforefficientlydistributeIPaddressintheirterritories.TherearefivesuchRIRexist.AccordingtoIANAreports,alltheIPv4addressblockshavebeenallocated.Tocopeupwiththesituation,asanearlystepsthefollowingpracticeswerebeingdone:

    PrivateIPs:FewblocksofIPsweredeclaredforprivateusewithinaLANsothattherequirementforpublicIPaddressescanbereduced.

    NAT:NetworkaddresstranslationisamechanismbywhichmultiplePCs/hostswithprivateIPaddressesareenabledtoaccessusingoneorfewpublicIPaddresses.

    UnusedPublicIPswerereclaimedbyRIRs.

    InternetProtocolv6

    IETF hasredesignedIPaddressesandtomitigatethedrawbacksofIPv4.ThenewIPaddresshasversion6andis128bitaddress,bywhicheverysingleinchoftheearthcanbegivenmillionsofIPaddresses.

    TodaymajorityofdevicesrunningonInternetareusingIPv4anditisnotpossibletoshiftthemtoIPv6incomingdays.TherearemechanismprovidedbyIPv6,bywhichIPv4andIPv6cancoexistunlesstheInternetentirelyshiftstoIPv6:

    DualIPStack

    Tunneling

    NATProtocolTranslation

    /!#)!*05/!#)!*0

    +0$!.0$*+),10!./.+10!./

    2

    *0!.*!0*#%*!!.%*#/'+.!

    0+* 0+