~:: kalyan ::~

What is DHCP?

Seems to be very basic question. Ofcourse it is.

DHCP stands for Dynamic Host Configuration Protocol.
This DHCP server helps network administrator by sharing their work. It is designed for that. There is something called BOOTP (BootStrap Protocol).
In the earlier if a new computer or printer is added to network, you have to call helpdesk and the engineer comes and set the things(IP,Subnetmask,router,dns,…) in your computer and he will make a entry on server host table and add an entry to DNS. Then you are ready to work.

How that helps? Assume you have the IP address 1.2.3.4 and you are browsing net and requesting for wordpress.com.
You type http://wordpress.com(assume 72.232.101.43) , the request goes to dns says that “Hi i am 1.2.3.4 convert wordpress.com to IP and give the same to me”.
DNS does that. Then your browser send a request to webserver which is existing on the target IP.

How the request is being sent to that specified address?

It does not sent straigt away to him. Because he has no context with him. He tells to router that i need to have these detail from him (72.232.101.43).
Then the real algorithm starts. It will reach the nearest router(or some othere based on the implementation). A path will be defined from 1.2.3.4 and 72.232.101.43 say like A is nearer to you and B is nearer to A and C is to B and D is nearer to C as well as 72.232.101.43. So your request will go to A then B then C then D and it gets returned in the reverse order. How the path is built and how it gets is all up to TCP/IP protocol.

Lets look with the example of a village. Your name is 1.2.3.4 and 72.232.101.43 is your friend and residing in other village in other country. I wanted to write a letter to you.
How i know where to give the letter. So i write a letter and put in my village’s post box. Then my village post master(router,A) takes that and send to nearest town(B) which has the facility to forward. From there another post master pass that letter to nearest city (C) which has the faciility to forward to next country. From that city the letter is passed to another country’s city(D) from there nearest town(E) and from their the letter passed to 72.232.101.43.
The post master at D does not know who is 72.232.101.43. But he knows that the post master E will be having idea of who is 72.232.101.43. So he passed to him. Then E passed the letter to him.

This is all TCP/IP stuff. Lets not go deeply into that. Well, we will consider the village again. There will be a head always for the village.
The village head manages the entire village. He should be knowing all the persons in the village. The Manager is DHCP in our case. When ever a baby
borns on your village or somebody migrate to that village, he only assign the name for the new person and note it in the registry about your detail.
Assume your village is very small. It can accomadate only 30 persons. You need to get the permission and get assigned a name for you till then you wont be
able to send or receive any letter from anybody. So getting name is must.
The DHCP is designed for two reason. One is automation and other is reusability of IPs. I could say.

Assume everyday averagly ten people comes in and ten people goes out. Everybody has to go to village head or he has to come to everybody to update the
information. If only ten people then it is ok assume two hundred people everyday gets changed. (Does it make sense now!). So how to solve this.
It is solved in this way.

If a person comes newly to the village ?

  • He shouts in walky-talky hey i am new to this village, the village heads please reply to me {DHCPDiscover}.
    Note this point i said village heads. We will discuss latter regardig that.

  • Now again the village head replies “hey, i am there” {DHCPOffer} in walky talky.

  • Again new person says in walky i am new to this place can you give me a name.{DHCPRequest} One clarrification here the village head replied to him then, why cant the new person talk to the head separatly. Because already i said until u have a name for you, you wont be able to send or receive anythinng personally. So shouting at walky-talky continues. Here there is a possibily that the new person had some name (eg:z) in his old village. He loved that name. There is a possibilty to request for the same name. If possible the village head agrees for that.

  • Now the village head check for the availability of a new name. If one exist he give to that person. else check for dead entries. Somebody might got a name but not using that. So verify with him that still he is alive if not give that unused nameto him {DHCPAcknowledgement}

  • In the previous paragraph i told if the new person like his old name (Z) and wanted to keep the same. So he send request to Village head {DHCPResuqst}. But unfortunatly the village has the name sequence like AA,BB,CC, so Z cant have the same name in that case the village head send a negative reply {DHCPNACKnowledgement}, so that he agrees to get a new name for him.

  • There is another situation. While the village head verifying the availability of a name that specific guy did not reply to him due to some problem. So if a same name assigend to two persons?. So when getting the same the new person will check anybody is there already with the same name. If then he tells to the head {DHCPDECLINE} and request for new name.

  • If anybody is going out of village he personally inform to village head i am leaving this village. So that village head can reuse his name to somebody else. {DHCPRelease}

Reuse of name {IP Address}:

Assume yesterday there were 25 persons in your village and today 10 moved to other village. So now you have 15 empty places to occupy.
But you have 5 remaning names only. (confusing!) Assume you can allocate only alphapets for name. So A.B.C.D.. Z you have assigend.
Now U,V,W,X,Y,Z are gone away. Now you have 6 empty places but the village head can’t say there is no name so no place for new persons.
He know that from U-Z are free. So he checks are they available is there any free name to use.If there is no free name check for unused one.
So what is says the set of name is defined already. A range for name is defined {Address Range} .

Relay Agent

who is he?
Suppose there is a possiblity that two villages are managed by single village head. So a new person comes to village1 and village head resided in village2.
So the new person shouts at walky-talky but it is made only for village1 so village head will not be able to hear from him.
To solve this person a volunteer from village1 will take care this work. When ever he recevives the request from the new person, he talks to the village head.
See now this time the Agent talk to village head personally. He does need to shout because he has a name for him so he can talk to the head personally.
And shout back the reply from head to his village village1. Becuase he does pass the information to new person. The Relay Agent need not be a router.

There are lot of things happening here in the same way. 🙂

2 Comments »

  1. very interesting, but I don’t agree with you
    Idetrorce

    Comment by Idetrorce — December 16, 2007 @ 4:19 am

  2. don’t agree what?

    Comment by skalyanasundaram — December 16, 2007 @ 12:23 pm


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.