What is the use of magic cookie in dhcp options

kalyanasundaram S s.kalyanasundaram at inbox.com
Thu Jun 22 05:43:56 UTC 2006


>       Can anyone tell me the use of the MAGIC COOKIE options in the dhcp options.

well you might give a read on some book and after go through rfcs, look at the the packet format

   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     op (1)    |   htype (1)   |   hlen (1)    |   hops (1)    |
   +---------------+---------------+---------------+---------------+
   |                            xid (4)                            |
   +-------------------------------+-------------------------------+
   |           secs (2)            |           flags (2)           |
   +-------------------------------+-------------------------------+
   |                          ciaddr  (4)                          |
   +---------------------------------------------------------------+
   |                          yiaddr  (4)                          |
   +---------------------------------------------------------------+
   |                          siaddr  (4)                          |
   +---------------------------------------------------------------+
   |                          giaddr  (4)                          |
   +---------------------------------------------------------------+
   |                                                               |
   |                          chaddr  (16)                         |
   |                                                               |
   |                                                               |
   +---------------------------------------------------------------+
   |                                                               |
   |                          sname   (64)                         |
   +---------------------------------------------------------------+
   |                                                               |
   |                          file    (128)                        |
   +---------------------------------------------------------------+
   |                                                               |
   |                          options (variable)                   |
   +---------------------------------------------------------------+

in this the last field is options.. but the whole thing is not aligned, it is just bundle of hexadecimal bytes. nothing else... we need to identify in the bundle where the option field exist.
few previous fields have dynamic length too. So it is very difficult or rather not possible to find out the options field .
so again look at the option
   |                                                               |
   |                          file    (128)                        |
   +---------------------------------------------------------------+
   |                                                               |
   |        99,130,83,99,53,1,3,50,4,192,170,12,25,225               |
   +---------------------------------------------------------------+

now this 99,130,83,99( in 0x 63,82,53,63) while parsing the pocket if the sequnce comes it means all the comming bytes has the option field..
99,130,83,99  --- start of option field.
then again 53 - Message type op code
            1 - length of the option value 
            3 - option value
 again     50 - requested ip addred option..it goes like this.. but where to end?
the final (255) says here option field ends... is that clear enough..

DHCWG is  working for a new format to avoid some of existing problem...(i am not sure how far it has gone)..

> The question i am asking may be silly but still please kindly send me
Thats fine, me to is new to this place, but here people are pretty cool.. 

> the solution to this question.What would be this value. it will be the
> same value for all the vendor's who develop the DHCP client.

This is same for the client and server and whichever follows the RFC (BOOTP-RFC951, BOOTP extensions-RFC1048,2132 and the dhcp options)

If i am wrong plz somebody correct me...

i have got this frm the book
The DHCP hand Book
  Understanding, Deployment, and Managing Automated Configuration Services
by Ralph Droms, Ted Lemon
you too try it out..

regards
-"kalyan"



More information about the dhcp-users mailing list