Reputation: 41
This might be a dumb query but I am looking for confirmation.
I am planning to implement a DHCP server which is based on some typical customer requirements. I am a bit confused between using RAW sockets versus DGRAM sockets for this purpose. My understanding is the server can be implemented by a DGRAM socket assuming all the DHCP replies can be handled while the DHCP client needs a RAW socket because it does not have an IP address until the server provides one.
Is my understanding on these points correct?
Guys,
After digging further., Server is sending the DHCP OFFER Message which contains Client's Mac Address as one option (chaddr). AFAIK; server application using RAW Sockets only can get the MAC address of DHCP client Machine. Is there an possibility that., can we request the kernel(TCP/IP Stack) to pass the mac address to application running over DGRAM Sockets ?? Thanks for Your attention !!!
Upvotes: 0
Views: 2234
Reputation: 41
ok. After further Protocol analysis; dhcp client it-self is sending the mac address in DISCOVER Packet. Hence; No Need of RAW Socket & with DGRAM Socket itself we can implement the DHCP Server.
Upvotes: 0