Automatic IP Address Assignment: How DHCP Works

Automatic IP Address Assignment: How DHCP Works



Explains the concept of DHCP, an application-layer protocol that your own computer probably uses to get an IP address from your network.

Here’s a list of the sections in this video and their time codes:
00:14 – A world without DHCP
01:26 – DHCP to the rescue
02:15 – The four-step process

My DHCP video was originally uploaded on September 7th 2013, but I made a new version after an attentive viewer pointed out some inaccuracies.

== Further reading ==
Can I have multiple DHCP servers on one network?

How can IP conflicts be resolved?

The fine print: in some cases DHCP offer and ACK messages are unicast

34 thoughts on “Automatic IP Address Assignment: How DHCP Works

  1. What if in case of multiple DHCP servers, all provide one same IP to the host. Host selects one of them then how to find out from which DHCP that IP has been taken?

  2. dude u really make a great videos . Your teaching method is really awesome .
    Dude come on, make some more .Where are you?

  3. I am not sure if anyone still is responding here or not, but why is it that the Request and Ack steps are broadcast? Why can't the client make not of DHCP IP from Offer step and then send a unicast message to DHCP server only. I understand that DHCP server might still not have the IP address of client and that can still be a broadcast but the Request can be unicast. Isn't it? Also a continuation: When DHCP sends the offer message as a broadcast or Ack message as a broadcast, I know that other clients in the network discard that message. But how do they discard it? What is the parameter based on which they decide that it is of no use for them?

  4. We want to use this video for a college course in Computer Studies at Santa Rosa Junior College. Would you please grant us permission to caption the video so it has punctuation and clear sentences? If you turn on Community Contributions in YouTube, we could add the better captions to these videos. Alternatively, we can send you a corrected caption file that you can upload in YouTube. One more option is to use a site such as Amara.org that will embed the video and give us an interface to overlay the video with the better caption file.

    All of these options leave the control in your hands. If you take down the video, it will no longer appear in the course, we will just be embedding from YouTube, not downloading the video.

  5. When we say join the network does it stay the same after the first time it gets on the network, or is there a new ip address assigned everytime a computer hops on the internet or is it the first time you connect to a wifi password and router?

  6. And what's about if there are multiple machines trying to connect to one DHCP server in one moment? If the DHCP server broadcasts a new IP address, multiple computers can send a DHCP request…
    By the way, is it possible that after a machine answers it doesn't want to use an IP address after the DHCP offer?

  7. Note: 0 0.0.0 stands for the zero network (local network that is not forwarded by routers). 255.255.255.255 allows all devices connected to the local network to accept UDP datagrams. Before packages become packages (network layer) they are called segments or datagrams. (Depending on which protocol is used on the transport layer, TCP or UDP) DHCP uses UDP as is it a stateless protocol and does not require a connection. Hope this helps.

  8. Wow just frigging wow .why doesnt everybody explain it like that,the teacher?😢😢 .God bless you sir , thank you thank you .

  9. why should the client broad cast when it can know about the ip address of server during request?. i mean server knows its ip address right? it can just send it to client. plz replay fast

  10. Hi @PieterExplainsTech I watch all of your videos and all of them are very good and well explained. I wonder why you didn't continue to add more videos? I only saw few of them. I hope to watch more of your contents about computer networking. Thanks!

  11. Totally awesome. I need a bit of a help. I need to hook up my laptop (running ubuntu) with a raspberry pi (running ubuntu, not raspbian) only with an Ethernet cable. I have a DHCP server running on my laptop, which means I only need to add a DHCP client on my Rpi and add it to startup application list, right? If there's a better way with given limitations (only ethernet cable), Can you please tell me?

  12. If the offer UDP packet contains the router IP, why does the the host still broadcast the request instead of sending it directly to that IP?

Leave a Reply

Your email address will not be published. Required fields are marked *