-1

I run a Mac and release/renew my IP with:

sudo ipconfig set en0 DHCP

In wireshark I get the following with udp.port==67 as filter:

http://i.imgur.com/uyLBTmQ.png?1

Why are the messages sent from my computer broadcasted, but the server send them directly to me. The litterature I have say everything is broadcasted. Why isn't that the case here?

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972

1 Answers1

4

DHCP requests are broadcast traffic. Your PC has no idea what DHCP server is available on your local subnet, so it has to broadcast a request for an IP. Any available DHCP server will then respond directly to your workstation with an offer of an IP. Your workstation with then officially request the IP from the DHCP server. Finally the server will accept the request and assign the IP to your workstation.

This process is outlined in the following steps:

  1. Discover
  2. Offer
  3. Request
  4. Acknowledge

To answer your question in the comment, the server can communicate with the workstation via the workstation's MAC address at Layer 2. Until it receives an IP, the workstation will use an IP of 0.

However, the traffic is sent to the workstation's MAC (which is sent from the workstation in the original broadcast discocver message).

You can see this in your wireshark trace. Devices on the local subnet use the MAC addresses for communication.

from RFC2131:

DHCP messages broadcast by a client prior to that client obtaining its IP address must have the source address field in the IP header set to 0.

HostBits
  • 11,796
  • 1
  • 25
  • 39
  • How come the server can send messages directly to the client when it doesn't have an IP? My book say server messages are broadcasted as well. – Francis9910 Mar 13 '13 at 10:40
  • DHCP-server sends frames to MAC-address, which is the source MAC-address in discover packet. – gevial Mar 13 '13 at 12:50
  • 1. Traffic is sent to the MAC address... not the IP address. 2. The client MAC address is in the DHCP broadcast from the client, so the server knows where to send the return traffic. – joeqwerty Mar 13 '13 at 12:52
  • Your book is wrong. Simple as that. – Rob Moir Mar 13 '13 at 13:43
  • Shouldn't the client be able to send DHCP Request using the DHCP servers MAC address, instead of broadcasting it? Also what IP-address does the DHCP server put in IP datagram destination? – Francis9910 Mar 13 '13 at 13:53
  • @Francis9910 I think you should read the RFC2131 linked above. – HostBits Mar 13 '13 at 14:00
  • Let me see if I got this right. If all IP-addresses in DHCP discover is set to 0 and the broadcast bit is not set, the server unicasts it's responses to clients MAC address and the destination IP is yiaddr that the server set. – Francis9910 Mar 13 '13 at 14:54