CH 18
CH 18
CHAPTER 18
Host Configuration: DHCP
Exercises
1. The minimum length of a DHCP packet is 236 (without the option field). The max-
imum is 300 bytes (with the option field).
3. Figure 18.E3 shows an example of the padding option. The option section starts
with the cookie (90.130.83.99) followed by the subnet mask option (included to
show the use of the padding option. We also need the end of list option (tag 255).
Figure 18.E3 Solution to Exercise 3
Base header
(236 bytes)
99.130.83.99
1 4 Subnet mask
Subnet mask 0 255
Padding option
4. Figure 18.E4 shows an example of the end of list option. The option section starts
with the cookie (90.130.83.99) followed by the subnet mask and time of day
options. We need three padding options and one end of list option.
1
Chapter18.fm Page 2 Saturday, June 13, 2009 6:10 PM
Base header
(236 bytes)
99.130.83.99
1 4 Subnet mask
Subnet mask 0 0
2 4 Time of day
Time of day 0 255
End-of-list option
5. The second field is 16 bits long. It can store up to 216 1 = 65,535 seconds.
6. Figure 18.E6 shows the solution. The left section shows the DHCP request packet
and its encapsulation in UDP and IP (parts a, b, and c). The right section shows the
reply DHCP packet and its capsulation in UDP and IP (parts d, e, and f).
Figure 18.E6 Solution to Exercise 4
IP header
Identification 0 0 Identification 0 0
TTL 17 Header checksum TTL 17 Header checksum
68 0x00000000 67 68 Server IP address 67
0xFFFFFFFF Client IP address
68 67 67 68
UDP
52 Checksum 52 Checksum
Code: 1 1 6 Hop count Code: 2 1 6 Hop count
Transaction ID Transaction ID
No. of seconds 0 No. of seconds 0
0 0
DHCP packet
0 0
0 0
0 0
0x00112115 0x00112115
0xEA21 0xEA21
Server name Server name
7.
A newly added host needs to know its subnet mask because this allows the host to
find out which subnet it is on.
8. A newly added host needs to know the address of a router in order to send a mes-
sage outside of its own local network.
9. A newly added host needs to know the address of a name server in order to resolve
a domain name to an IP address.
10. DHCP needs the services of TFTP because the DHCP packet is of a set size and
format. If a DHCP client needs more information than a packet can hold, the client
must retrieve the information using some other method.
Chapter18.fm Page 3 Saturday, June 13, 2009 6:10 PM
11. See Figure 18.E11. We assume that the server is 4 hops away. We also use transac-
tion ID of 1456. The messages between the client and the relay agent are broad-
cast. The messages between the relay agent and the server are unicast.
Figure 18.E11 Solution to Exercise 11
1 2
Internet
4
3
1 2
1 1 6 1 1 1 6 4
1456 1456
No. of seconds No. of seconds
0 0
0 0
0 142.53.19.25
0 198.42.65.40
Rest of the packet Rest of the packet
4 3
2 1 6 1 2 1 6 4
1456 1456
No. of seconds No. of seconds
198.42.65.23 198.42.65.23
198.42.65.23 198.42.65.40
142.53.19.25 142.53.19.25
198.42.65.40 198.42.65.40
Rest of the packet Rest of the packet