 Hello and welcome to the lecture on dynamic host configuration protocol packet format learning outcome of the session by the end of the session student will be able to describe packet format of dynamic host configuration protocol used in computer networks during last lecture we have seen what is DHCP normally which kind of information is needed by the host to communicate over a computer network how DHCP work when client and server are on the same network and how DHCP works when client and server are on the different network and with the help of relay agent we have also seen what was the need of DHCP and one point to remember is the DHCP request message is generated by the client to the server and DHCP server respond to the DHCP message received with DHCP reply to start off with a packet format in figure one you can see the DHCP packet format the DHCP packet has different different 15 fields all together it has a maximum length of 300 bytes we will discuss each field in detail the first field is opcode or operation code field this is a 8-bit field this field defines the general category of the message the message could be a request message or reply message if this field contains a value 1 then the message is DHCP request generated by client and if this field contains value 2 then the message is reply from server to the client the next field is hardware type this field is also 8-bit field this field defines the type of physical network different physical networks are there like Ethernet, ArcNet and ATM this field contains value 1 if the hardware type is Ethernet the next field is hardware length this is also 8-bit field which defines the length of physical address in bytes for example if the network is Ethernet then as we know the hardware address of Ethernet network is of 48-bit means 6 bytes so this field will contain 6 the next field is hope count this is also 8-bit field this field defines the maximum number of hopes the packet can travel in the network the max count is set and as the packet travel from network to network this count is decremented by once once this count reaches 0 or becomes 0 the packet is discarded the next field is transaction ID this field is of 4 byte length this field carries an integer value this field is used to match a DHCP reply with respective DHCP request the server returns the save value in its reply it could be a case that DHCP client may generate multiple request messages this transaction ID field is used to identify or match the respective reply received to the respective DHCP request the next field in the packet is the number of seconds this is a 16-bit field this field indicates the number of seconds elapsed since the time client started to boot the next field is flag field this is a 2 byte or 16-bit field out of 16 bits only the leftmost bit with pink color shown in the figure number 2 is used and the rest of the 15 bits are set to 0 if this first leftmost bit is 1 then the message is forced broadcast from server to the client which is a forced reply if this field has value 0 then the message is a unicast reply from server to the client if the reply has to be unicast then the destination IP address field in the IP packet should be the address IP address of the respective client but as the client do not know its own IP address it may discard the packet however if we broadcast the IP datagram then every client will receive and process the packet the next field in the packet is client IP address as its name implies it contains the client IP address and this is 4 byte long field if client does not have this information means if client do not know its IP address this field has the value of 0 the next field is your IP address this is also 4 byte long field this field contains the client's IP address this field is always filled by the server only in the reply messages the next field is server IP address this is also 4 byte field this field contains the IP address of the DHCP server this field is also present only in the reply messages and filled by the server only the next field is gateway IP address this is also 4 byte field this field contains the IP address of a default router this field is also present only in reply messages and filled by the server only the next field is client hardware address this field contains the physical address of the client this physical hardware address of the client is explicitly supplied by the client in the request messages itself the next field is server name field this is a 64 byte long field this field is optionally filled by the server in the reply packets this field contains the domain name of the server with a null terminated string if server do not want to fill this field then this field must be filled with all the zeros the next field is boot file name this is a 128 byte long field this is also optionally filled by the server only in reply packets this field contains the full path name of the boot file terminated with null string this field is used by the client to retrieve the other booting information if the server does not want to fill this information in the field then the server must fill this field with all the zeros the next field is option this is a 64 byte long field this field is only present in reply messages this is not present in request messages once the client finishes reading the information then it looks for a magic cookie magic cookie is nothing but a number which is represented in dotted decimal format just like an IP address the magic cookie has a value 99 dot 130 dot 83 dot 99 if this magic cookie is present in the reply message then the next 60 bytes are options this option field is composed of three subfields the first field is tag field second is length field these two tag field and length field are one byte long each the next field is value field it has variable length the length field with a yellow color represented in figure number three defines the length of the value field it does not indicates the length of this whole message we have tabulated some tags and length and the value field options suppose if we have tag of zero then this zero tag is used for padding purpose which is used for alignment and which is just one byte long the tag 255 indicates the end of option field the vendor may use tag from 128 up to 254 supplies specific information of the vendor and the rest of the tags from 1 to 53 are used for different different purposes these are the references thank you