Vous êtes sur la page 1sur 5

2/6/2015

TechnicalRelatedBlogs:HowDHCPworksandDHCPInterviewQuestionsandAnswers

How DHCP works and DHCP Interview Questions and Answers


HowDHCPWorks?
BeforelearningtheprocessthroughwhichDHCPachievesitsgoal,wefirsthaveto
understandthedifferentmessagesthatareusedintheprocess.

1.DHCPDISCOVER
ItisaDHCPmessagethatmarksthebeginningofaDHCPinteractionbetweenclient
andserver.Thismessageissentbyaclient(hostordeviceconnectedtoanetwork)
thatisconnectedtoalocalsubnet.Itsabroadcastmessagethatuses
255.255.255.255asdestinationIPaddresswhilethesourceIPaddressis0.0.0.0

2.DHCPOFFER
ItisDHCPmessagethatissentinresponsetoDHCPDISCOVERbyaDHCPserverto
DHCPclient.Thismessagecontainsthenetworkconfigurationsettingsfortheclient
thatsenttheDHCPDISCOVERmessage.

3.DHCPREQUEST
ThisDHCPmessageissentinresponsetoDHCPOFFERindicatingthattheclienthas
acceptedthenetworkconfigurationsentinDHCPOFFERmessagefromtheserver.

4.DHCPACK
ThismessageissentbytheDHCPserverinresponsetoDHCPREQUESTrecieved
fromtheclient.Thismessagemarkstheendoftheprocessthatstartedwith
DHCPDISCOVER.TheDHCPACKmessageisnothingbutanacknowledgementbythe
DHCPserverthatauthorizestheDHCPclienttostartusingthenetworkconfigurationit
receivedfromtheDHCPserverearlier.

5.DHCPNAK
ThismessageistheexactoppositetoDHCPACKdescribedabove.Thismessageis
sentbytheDHCPserverwhenitisnotabletosatisfytheDHCPREQUESTmessage
fromtheclient.

6.DHCPDECLINE
ThismessageissentfromtheDHCPclienttotheserverincasetheclientfindsthat
theIPaddressassignedbyDHCPserverisalreadyinuse.

7.DHCPINFORM
data:text/htmlcharset=utf8,%3Ch3%20class%3D%22posttitle%20entrytitle%22%20itemprop%3D%22name%22%20style%3D%22margin%3A%2020p

1/5

2/6/2015

TechnicalRelatedBlogs:HowDHCPworksandDHCPInterviewQuestionsandAnswers

ThismessageissentfromtheDHCPclientincasetheIPaddressisstatically
configuredontheclientandonlyothernetworksettingsorconfigurationsaredesired
tobedynamicallyacquiredfromDHCPserver.

8.DHCPRELEASE
ThismessageissentbytheDHCPclientincaseitwantstoterminatetheleaseof
networkaddressithasbeprovidedbyDHCPserver.

NowasweknowaboutthevariousDHCPmessages,itstimetogothroughthethe
completeDHCPprocesstogiveabetterIdeaofhowDHCPworks.Notethatthesteps
mentionedbelowassumethatDHCPfunctionalityisenabledbydefaultontheclient
side.
Herearethesteps:
Step1:Whentheclientcomputer(ordevice)bootsuporisconnectedtoa
network,aDHCPDISCOVERmessageissentfromtheclienttotheserver.Asthere
isnonetworkconfigurationinformationontheclientsothemessageissentwith
0.0.0.0assourceaddressand255.255.255.255asdestinationaddress.Ifthe
DHCPserverisonlocalsubnetthenitdirectlyreceivesthemessageorincaseitis
ondifferentsubnetthenarelayagentconnectedonclientssubnetisusedtopass
ontherequesttoDHCPserver.Thetransportprotocolusedforthismessageis
UDPandtheportnumberusedis67.Thecliententerstheinitializingstageduring
thisstep.
Step2:WhentheDHCPserverreceivestheDHCPDISCOVERrequestmessage
thenitreplieswithaDHCPOFFERmessage.Asalreadyexplained,thismessage
containsallthenetworkconfigurationsettingsrequiredbytheclient.Forexample,
theyaddrfieldofthemessagewillcontaintheIPaddresstobeassignedtoclient.
Similarlythethesubnetmaskandgatewayinformationisfilledintheoptionsfield.
Also,theserverfillsintheclientMACaddressinthechaddrfield.Thismessageis
sentasabroadcast(255.255.255.255)messagefortheclienttoreceiveitdirectly
orifDHCPserverisindifferentsubnetthenthismessageissenttotherelayagent
thattakescareofwhetherthemessageistobepassedasunicastorbroadcast.In
data:text/htmlcharset=utf8,%3Ch3%20class%3D%22posttitle%20entrytitle%22%20itemprop%3D%22name%22%20style%3D%22margin%3A%2020p

2/5

2/6/2015

TechnicalRelatedBlogs:HowDHCPworksandDHCPInterviewQuestionsandAnswers

thiscasealso,UDPprotocolisusedatthetransportlayerwithdestinationportas
68.Thecliententersselectingstageduringthisstep
Step3:TheclientformsaDHCPREQUESTmessageinreplytoDHCPOFFER
messageandsendsittotheserverindicatingitwantstoacceptthenetwork
configurationsentintheDHCPOFFERmessage.IfthereweremultipleDHCP
serversthatreceivedDHCPDISCOVERthenclientcouldreceivemultiple
DHCPOFFERmessages.But,theclientrepliestoonlyoneofthemessagesby
populatingtheserveridentificationfieldwiththeIPaddressofaparticularDHCP
server.AllthemessagesfromotherDHCPserversareimplicitlydeclined.The
DHCPREQUESTmessagewillstillcontainthesourceaddressas0.0.0.0asthe
clientisstillnotallowedtousetheIPaddresspassedtoitthroughDHCPOFFER
message.Thecliententersrequestingstageduringthisstep.
Step4:OncetheserverreceivesDHCPREQUESTfromtheclient,itsendsthe
DHCPACKmessageindicatingthatnowtheclientisallowedtousetheIPaddress
assignedtoit.Thecliententerstheboundstateduringthisstep.

TheConceptofLease
WithallthenecessaryinformationonhowDHCPworks,oneshouldalsoknowthatthe
IPaddressassignedbyDHCPservertoDHCPclientisonalease.Afterthelease
expirestheDHCPserverisfreetoassignthesameIPaddresstoanyotherhostor
devicerequestingforthesame.Forexample,keepingleasetime810hoursishelpful
incaseofPCsthatareshutdownattheendoftheday.So,leasehastoberenewed
fromtimetotime.TheDHCPclienttriestorenewtheleaseafterhalfoftheleasetime
hasexpired.ThisisdonebytheexchangeofDHCPREQUESTandDHCPACK
messages.Whiledoingallthis,thecliententerstherenewingstage.
DHCPInterviewQuestionsandAnswers

Whatisdhcp?
DynamicHostConfigurationProtocol(DHCP)isanetworkprotocolthat
enablesaservertoautomaticallyassignanIPaddresstoacomputer
fromadefinedrangeofnumbers(i.e.,ascope)configuredforagiven
network.
Whatisthedhcpprocessforclientmachine?
1.AuserturnsonacomputerwithaDHCPclient.
2.Theclientcomputersendsabroadcastrequest(calledaDISCOVER
orDHCPDISCOVER),lookingforaDHCPservertoanswer.
3.TherouterdirectstheDISCOVERpackettothecorrectDHCP
server.
4.TheserverreceivestheDISCOVERpacket.Basedonavailabilityand
usagepoliciessetontheserver,theserverdeterminesanappropriate
address(ifany)togivetotheclient.Theserverthentemporarily
reservesthataddressfortheclientandsendsbacktotheclientan
OFFER(orDHCPOFFER)packet,withthataddressinformation.The
serveralsoconfigurestheclient'sDNSservers,WINSservers,NTP
servers,andsometimesotherservicesaswell.
5.TheclientsendsaREQUEST(orDHCPREQUEST)packet,lettingthe
data:text/htmlcharset=utf8,%3Ch3%20class%3D%22posttitle%20entrytitle%22%20itemprop%3D%22name%22%20style%3D%22margin%3A%2020p

3/5

2/6/2015

TechnicalRelatedBlogs:HowDHCPworksandDHCPInterviewQuestionsandAnswers

serverknowthatitintendstousetheaddress.
6.TheserversendsanACK(orDHCPACK)packet,confirmingthatthe
clienthasbeengivenaleaseontheaddressforaserverspecified
periodoftime.
Whatisdhcpscope?
DHCPscopesareusedtodefinerangesofaddressesfromwhicha
DHCPservercanassignIPaddressestoclients.
Typesofscopesinwindowsdhcp?
NormalScopeAllowsA,BandCClassIPaddressrangestobe
specifiedincludingsubnetmasks,exclusionsandreservations.Each
normalscopedefinedmustexistwithinitsownsubnet.
MulticastScopeUsedtoassignIPaddressrangesforClassD
networks.Multicastscopesdonothavesubnetmasks,reservationor
otherTCP/IPoptions.
MulticastscopeaddressrangesrequirethataTimeToLive(TTL)value
bespecified(essentiallythenumberofroutersapacketcanpass
throughonthewaytoitsdestination).
SuperscopeEssentiallyacollectionofscopesgroupedtogethersuch
thattheycanbeenabledanddisabledasasingleentity.
WhatisAuthorizingDHCPServersinActiveDirectory?
IfaDHCPserveristooperatewithinanActiveDirectorydomain(and
isnotrunningonadomaincontroller)itmustfirstbeauthorized.
ThiscanbeachievedeitheraspartoftheDHCPServerrole
installation,orsubsequentlyusingeitherDHCPconsoleoratthe
commandpromptusingthenetshtool.
IftheDHCPserverwasnotauthorizedduringinstallation,invokethe
DHCPconsole(StartAllProgramsAdministrativeToolsDHCP),
rightclickontheDHCPtobeauthorizedandselectAuthorize.To
achievethesameresultfromthecommandprompt,enterthe
followingcommand:
netshdhcpserverserverIDinitiateauth
Intheabovecommandsyntax,serverIDisreplacedbytheIPaddress
orfullUNCnameofsystemonwhichtheDHCPserverisinstalled.
WhatportsareusedbyDHCPandtheDHCPclients?
RequestsareonUDPport68,ServerrepliesonUDP67.
BenefitsofusingDHCP
DHCPprovidesthefollowingbenefitsforadministeringyourTCP/IP
basednetwork:
Safeandreliableconfiguration.DHCPavoidsconfigurationerrors
causedbytheneedtomanuallytypeinvaluesateachcomputer.Also,
DHCPhelpspreventaddressconflictscausedbyapreviouslyassigned
IPaddressbeingreusedtoconfigureanewcomputeronthenetwork.
Reducesconfigurationmanagement.
UsingDHCPserverscangreatlydecreasetimespenttoconfiguring
andreconfiguringcomputersonyournetwork.Serverscanbe
configuredtosupplyafullrangeofadditionalconfigurationvalues
whenassigningaddressleases.ThesevaluesareassignedusingDHCP
options.Also,theDHCPleaserenewalprocesshelpsassurethatwhere
clientconfigurationsneedtobeupdatedoften(suchasuserswith
mobileorportablecomputerswhochangelocationsfrequently),these
changescanbemadeefficientlyandautomaticallybyclients
communicatingdirectlywithDHCPservers.
data:text/htmlcharset=utf8,%3Ch3%20class%3D%22posttitle%20entrytitle%22%20itemprop%3D%22name%22%20style%3D%22margin%3A%2020p

4/5

2/6/2015

TechnicalRelatedBlogs:HowDHCPworksandDHCPInterviewQuestionsandAnswers

ThefollowingsectioncoversissuesthataffecttheuseoftheDHCP
Serverservicewithotherservicesornetworkconfigurations.Using
DNSserverswithDHCPUsingRoutingandRemoteAccessserverswith
DHCPMultihomedDHCPservers.
DescribetheprocessofinstallingaDHCPserverinanAD
infrastructure?
OpenWindowsComponentsWizard.UnderComponents,scrolltoand
clickNetworkingServices.ClickDetails.UnderSubcomponentsof
NetworkingServices,clickDynamicHostConfigurationProtocol
(DHCP)andthenclickOK.
ClickNext.Ifprompted,typethefullpathtotheWindowsServer
2003distributionfiles,andthenclickNext.Requiredfilesarecopiedto
yourharddisk.
HowtoauthorizeaDHCPserverinActiveDirectoryOpen
DHCP?
Intheconsoletree,clickDHCP
.OntheActionmenu,clickManageauthorizedservers.
.TheManageAuthorizedServersdialogboxappears.ClickAuthorize.
.Whenprompted,typethenameorIPaddressoftheDHCPserverto
beauthorized,andthenclickOK.
WhatisDHCPINFORM?
DHCPInformisaDHCPmessageusedbyDHCPclientstoobtainDHCP
options.WhilePPPremoteaccessclientsdonotuseDHCPtoobtainIP
addressesfortheremoteaccessconnection,Windows2000and
Windows98remoteaccessclientsusetheDHCPInformmessageto
obtainDNSserverIPaddresses,WINSserverIPaddresses,andaDNS
domainname.
TheDHCPInformmessageissentaftertheIPCPnegotiationis
concluded.TheDHCPInformmessagereceivedbytheremoteaccess
serveristhenforwardedtoaDHCPserver.Theremoteaccessserver
forwardsDHCPInformmessagesonlyifithasbeenconfiguredwiththe
DHCPRelayAgent.
DescribetheintegrationbetweenDHCPandDNS?
Traditionally,DNSandDHCPservershavebeenconfiguredand
managedoneatatime.Similarly,changingauthorizationrightsfora
particularuseronagroupofdeviceshasmeantvisitingeachoneand
makingconfigurationchanges.
DHCPintegrationwithDNSallowstheaggregationofthesetasks
acrossdevices,enablingacompany'snetworkservicestoscaleinstep
withthegrowthofnetworkusers,devices,andpolicies,whilereducing
administrativeoperationsandcosts.Thisintegrationprovidespractical
operationalefficienciesthatlowertotalcostofownership.
CreatingaDHCPnetworkautomaticallycreatesanassociatedDNS
zone,forexample,reducingthenumberoftasksrequiredofnetwork
administrators.AndintegrationofDNSandDHCPinthesame
databaseinstanceprovidesunmatchedconsistencybetweenservice
andmanagementviewsofIPaddresscentricnetworkservicesdata

data:text/htmlcharset=utf8,%3Ch3%20class%3D%22posttitle%20entrytitle%22%20itemprop%3D%22name%22%20style%3D%22margin%3A%2020p

5/5

Vous aimerez peut-être aussi