Below is a dump of a typical opening packet in a DHCP exchange. Byte counts run along the left column, with the contents displayed in hexadecimal on the right, 16 bytes per line.
0x0000: ffff ffff ffff 001e e586 027a 0800 4500
0x0010: 011a 0003 0000 6411 55d1 0000 0000 ffff
0x0020: ffff 0044 0043 0106 6e71 0101 0600 0000
0x0030: 0017 0000 0000 0000 0000 0000 0000 0000
0x0040: 0000 0000 0000 001e e586 027a 0000 0000
0x0050: 0000 0000 0000 0000 0000 0000 0000 0000
0x0060: 0000 0000 0000 0000 0000 0000 0000 0000
0x0070: 0000 0000 0000 0000 0000 0000 0000 0000
0x0080: 0000 0000 0000 0000 0000 0000 0000 0000
0x0090: 0000 0000 0000 0000 0000 0000 0000 0000
0x00a0: 0000 0000 0000 0000 0000 0000 0000 0000
0x00b0: 0000 0000 0000 0000 0000 0000 0000 0000
0x00c0: 0000 0000 0000 0000 0000 0000 0000 0000
0x00d0: 0000 0000 0000 0000 0000 0000 0000 0000
0x00e0: 0000 0000 0000 0000 0000 0000 0000 0000
0x00f0: 0000 0000 0000 0000 0000 0000 0000 0000
0x0100: 0000 0000 0000 0000 0000 0000 0000 0000
0x0110: 0000 0000 0000 6382 5363 3501 0137 0801
0x0120: 0f03 0610 1182 83ff
This is an Ethernet frame (p.364) beginning with the destination address at byte 0x0000. The Ethernet payload contains an IPv4 datagram (p.563), which contains a UDP datagram (p.738), which contains a DHCP datagram (p.540).
The IPv4 header begins at byte 14, the UDP header at byte 34, and the DHCP header at byte 42 (0x0101).
In a file called README.txt
decode and label the sections of the DHCP packet in the dump, particularly the DHCP Options payload.
Beginning with the Embedded Xinu Net Playground tarball or your own prior COSC 3250 - Operating Systems project code, add a shell command dhcpsnoop
that captures packets from the Ethernet interface and decodes DHCP packets to the terminal.
For a passing grade, you should at least decode the fields in figure 18.25 and 18.26 in your textbook. Higher grades will go to more complete implementations that decode all of the options regularly seen on the Xinu LAN in the lab, and points may be awarded for easy of use.
Note that our next assignment will be to construct a DHCP client, so the completeness of this dhcpsnoop
utility will help you to troubleshoot your own packets in the next assignment.
[Revised 2014 Aug 25 20:57 DWB]