Questions about DHCP

shushshush Posts: 10Member ■□□□□□□□□□
Hi,
There is something about DHCP that i can't understand.
I was told that the PC asks for an ip address by sending a broadcast(and then the router continues the proccess. From to this point i understand it).
My problem is with the beginning - how can the pc send a messege without having an ip? even if he has mac address, he stills need an ip.
And also, what would be the ip source and the ip destination in this broadcast frame? i know that there is broadcast messege layer 2 and 3, but still I can't understand how would look in this case.
When a PC wants to discover another PC(or any other network device), he sends an arp request, but he can only send it when he already has its ip, so i can't undertand how this proccess (the dhcp proccess- not the arp!)starts and ends without having ip of anyone.
Also a broadcast address in layer 3 is the last ip of a network, so how can the pc know what is its network id before he recives the ip address?
I hope you understand all my questions and help me with them.

Comments

  • networker050184networker050184 Posts: 11,962Mod Mod
    The host generating the discover uses 0.0.0.0 as the source and 255.255.255.255 as the dest IPs. Remember switching within an L2 segment does not use IPs, it uses MACs.
    An expert is a man who has made all the mistakes which can be made.
  • shushshush Posts: 10Member ■□□□□□□□□□
    But if there is no switch in my network? if it's just one PC that connected to router? I know that for one PC i won't need a dhcp server, but it stills need to works somehow also in this situation. So my question is how it works?
  • networker050184networker050184 Posts: 11,962Mod Mod
    A PC directly connected to a router is still a single L2 segment. Nothing changes.
    An expert is a man who has made all the mistakes which can be made.
  • shushshush Posts: 10Member ■□□□□□□□□□
    ok, and when the router gets the packet from the PC with the addresses 0.0.0.0 and 255.255.255.255, how it knows that it is a dhcp request?
  • networker050184networker050184 Posts: 11,962Mod Mod
    Same way any other application knows what packet belongs to it. Port/protocol numbers, then message format coded into the application.
    An expert is a man who has made all the mistakes which can be made.
  • shushshush Posts: 10Member ■□□□□□□□□□
    I think I'm starting to get it, so thank you very much.
    I just need to understand one more thing. When the dhsp send the reply messege with the ip to the router,the router need to send it to the computer that asked for this ip. So does the sedning proccess from the router to the PC done by the mac table?
  • shortstop20shortstop20 Posts: 161Member ■■■□□□□□□□
    The router would send the DHCP offer as a unicast frame with a source IP of the DHCP server and a destination of 255.255.255.255. This would be encapsulated with a layer two frame with the source MAC of the router and the destination MAC of FF-FF-FF-FF-FF-FF, a broadcast.

    This ensures that the client machine receives the offer.

    This link provides some very in depth specifics.

    Understanding and Troubleshooting DHCP in Catalyst Switch or Enterprise Networks - Cisco
    CCNA Security - 6/11/2018
    CCNP TShoot - 3/7/2018
    CCNP Route - 1/31/2018
    CCNP Switch - 12/10/2015
    CCNA R/S - 1/14/2015
  • networker050184networker050184 Posts: 11,962Mod Mod
    You got it pretty much.
    An expert is a man who has made all the mistakes which can be made.
  • shushshush Posts: 10Member ■□□□□□□□□□
    Thank you both! :)
Sign In or Register to comment.