Question about DHCP and explanation in Cisco Press book
LBC90805
Member Posts: 247
in CCNA & CCENT
I've been reviewing exam material for the CCENT recently. I've been taking notes on just about everything in preparation for 640-822. In chapter 5 of the Cisco press book on the same subject, page 124 it states:
"Figure 5-15 shows a typical set of four messages used between a DHCP server to assign an IP address, as well as other information. Note that the first two messages are both IP broadcast messages."
On the following page, 125, it states the following:
1. DHCP Discover Message (LAN Broadcast)
2. DHCP Offer Message Directed to Client
3. DHCP Request Message Directed to Server
4. DHCP Acknowledgment Directed to Client
Now I'm a little confused! The paragraph on Page 124 and the figure 5-15 contradict each other. If the second message is "Directed to Client" doesn't that imply a Unicast and not a Broadcast as stated on Page 124?
Can anybody please clarify this for me?
"Figure 5-15 shows a typical set of four messages used between a DHCP server to assign an IP address, as well as other information. Note that the first two messages are both IP broadcast messages."
On the following page, 125, it states the following:
1. DHCP Discover Message (LAN Broadcast)
2. DHCP Offer Message Directed to Client
3. DHCP Request Message Directed to Server
4. DHCP Acknowledgment Directed to Client
Now I'm a little confused! The paragraph on Page 124 and the figure 5-15 contradict each other. If the second message is "Directed to Client" doesn't that imply a Unicast and not a Broadcast as stated on Page 124?
Can anybody please clarify this for me?
Comments
-
ajs1976 Member Posts: 1,945 ■■■■□□□□□□The client does not have an IP address at that point, so the message has to be sent as a broadcast.Andy
2020 Goals: 0 of 2 courses complete, 0 of 2 exams complete -
sprkymrk Member Posts: 4,884 ■■■□□□□□□□RFC 2131 wrote: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.
If the 'giaddr' field in a DHCP message from a client is non-zero,
the server sends any return messages to the 'DHCP server' port on the
BOOTP relay agent whose address appears in 'giaddr'. If the 'giaddr'
field is zero and the 'ciaddr' field is nonzero, then the server
unicasts DHCPOFFER and DHCPACK messages to the address in 'ciaddr'.
If 'giaddr' is zero and 'ciaddr' is zero, and the broadcast bit is
set, then the server broadcasts DHCPOFFER and DHCPACK messages to
0xffffffff. If the broadcast bit is not set and 'giaddr' is zero and
'ciaddr' is zero, then the server unicasts DHCPOFFER and DHCPACK
messages to the client's hardware address and 'yiaddr' address. In
all cases, when 'giaddr' is zero, the server broadcasts any DHCPNAK
messages to 0xffffffff.
It might depend on whether it is a new request or a renew request.All things are possible, only believe. -
Netwurk Member Posts: 1,155 ■■■■■□□□□□To explain a little further...
The client sends a broadcast looking for a DHCP server
The DHCP server sends a unicast message back to the client using its MAC address (an IP address is not needed to send a unicast reply)
The rest of the process, including the renew, will be done as unicast. -
Pash Member Posts: 1,600 ■■■■■□□□□□Download Wireshark and see for yourself. Seeing it happen is much better than reading about it.DevOps Engineer and Security Champion. https://blog.pash.by - I am trying to find my writing style, so please bear with me.
-
justin42279 Member Posts: 18 ■□□□□□□□□□I've been searching the internet looking for an exact answer, and I'm surprised at how much it varies.
According to Microsoft, all of the initial DHCP requests for a new IP are broadcasts.
According to Cisco, the DHCPDISCOVER is a broadcast, DHCPOffer is Unicast, DHCPRequest is Broadcast, and DHCPAK is unicast.
http://www.cisco.com/en/US/docs/ios/12_0t/12_0t1/feature/guide/Easyip2.html -
dtlokee Member Posts: 2,378 ■■■■□□□□□□Well, if you think about it until the process is complete the DHCP client does not have an IP address (it uses 0.0.0.0) so none of the packets in the initial request are sent as IP unicast. They can be sent as a L2 unicast by putting the specific host source and destination MAC addresses on the frame. The initial DHCPDISCOVER is sent as a broadcast frame with a source MAC address of the device sending it and a destination of FFFF.FFFF.FFFF (broadcast). After that all of the replies are sent as L2 unicast. The issue here is a brodcast will not cross a router so there must be a DHCP server on each subnet, or the routers must be configured to relay the DHCP messages.The only easy day was yesterday!