 Hello and welcome to the lecture on dynamic host configuration protocol. These are the learning outcomes. At the end of this session, student will be able to illustrate basics of dynamic host configuration protocol used in computer networks. Before starting this topic, try to recall basic terminologies used in protocols for host configuration like IP address, subnet mask and subnet. I hope you have recalled the terminologies. We'll start our lecture with a basic question that what is DHCP? The DHCP is dynamic host configuration protocol and is a client-server protocol designed to provide the four pieces of information for a diskless computer or a computer which is booted for the first time. Dynamic host configuration protocol is a client-server protocol that is automatically provides a host with its IP address and other related configuration information such as subnet mask and default gateway. DHCP is an internet engineering task force standard based on bootstrap protocol. Before DHCP became famous protocol for host configuration, some other protocols were used for this purpose. At the beginning of internet era, a protocol called reverse address resolution protocol was designed to provide the IP address for a booted computer. Reverse address resolution protocol maps a physical address to an IP address. However, reverse address resolution protocol can provide only one IP address of a computer. But a computer today needs additional information. Another protocol used before to DHCP other than reverse address resolution protocol is bootstrap protocol. Bootstrap protocol is a static configuration protocol. Static means there is a predetermined binding between physical address and the IP address of the client. Due to the predetermined binding between the physical address and IP address of the client, bootstrap protocol cannot handle situations when a host wants a temporary IP address and when a host moves from one network to another network until the binding is changed by the administrator. This gives rise to the need of a dynamic configuration protocol. Each computer which uses the TCP IP protocol suite needs to know its IP address and subnet mask. Most computers today need two other pieces of information along with IP address and subnet mask are the first piece of information is default router and the second piece of information is the address of the name server. In other words, the four pieces of information normally needed are the first is IP address of the computer, second is subnet mask of the computer, then third is the IP address of default router and the last piece of information is IP address of a name server. These four pieces of information can be stored in a configuration file and accessed by the computer during its bootstrap process. But what about a diskless workstation or a computer with a disk that is booted for the first time? In such cases, diskless computer, the operating system and the network software could be used to store the information related to this. However, the above information is not known to the manufacturer and thus cannot be stored in the ROM. The information is dependent on the individual configuration of the machine and defines the network to which the machine is connected. That is another reason why we need a dynamic configuration protocol. The DHCP client and server can be on the same network or they could be on the different network. We will see how the DHCP works when the server and the client are on the different network or are on the same network. We will discuss each situation separately. The administrator may put the client and the server on the same network as shown in the figure number 2. Here, please take a note that for the DHCP request, the client IP address is all zeros and the server IP address is all ones. In this case, the operation can be described as the DHCP server issues a passive open command on UDP port number 67 and waits for a client. A booted client issues an active open command on port number 68. The message is encapsulated in a UDP user datagram using destination port number 67 and the source port number 68. The UDP user datagram in turn is encapsulated in an IP datagram. Here, a question comes to mind that how a client can send an IP datagram when it knows neither its own IP address nor the server's IP address. Answer to this question is the client uses all zeros as the source address and all ones as the destination address. Then, the server responds with either a broadcast or a unicast message using UDP source port number 67 and destination port number 68. The response can be unicast because the server knows the IP address of the client. It also knows the physical address of the client which means it does not need the services of address resolution protocol for logical to physical address mapping. A client can be in one network and the server can be in another network which are separated by several other networks as shown in figure number three. And for this kind of situations, we are going to now see the operation of DHCP. However, there is one problem that must be resolved. The DHCP request is a broadcast because the client does not know the IP address of the server. It will broadcast the DHCP request. A broadcast IP datagram cannot pass through any router. A router receiving such a packet discards it. Recall that an IP address of all ones is a limited broadcast address. To solve this problem, there is a need for an intermediary. One of the hosts can be used as a relay. The host in this case is called as relay agent. The relay agent knows the unicast address of a DHCP server and listens for the broadcast messages on the port number 67. When it receives this type of packet, it encapsulates the message in a unicast datagram and sends the request to the DHCP server. The packet carrying a unicast destination address is routed by any router and reaches the DHCP server. The DHCP server knows that message comes from a relay agent because one of the fields in a request message defines the IP address of the relay agent. The relay agent after receiving the reply sends it to the DHCP client. These are the references.