Presentation is loading. Please wait.

Presentation is loading. Please wait.

Net 431 D: ADVANCED COMPUTER NETWORKS

Similar presentations


Presentation on theme: "Net 431 D: ADVANCED COMPUTER NETWORKS"— Presentation transcript:

1 Net 431 D: ADVANCED COMPUTER NETWORKS
Networks and Communication Department Lecture 6: DHCP

2 Outlines What is DHCP BOOTP VS DHCP Why use DHCP Benefits of DHCP
DHCP architecture How DHCP works DHCP message DHCP relay agent Preventing address conflict 20-Sep-18 Networks and Communication Department

3 What Is DHCP? Dynamic Host Configuration Protocol (DHCP) is a client/server protocol that automatically provides an Internet Protocol (IP) host with its IP address and other related configuration information such as the subnet mask and default gateway. DHCP allows hosts to obtain required TCP/IP configuration information from a DHCP server. 20-Sep-18 Networks and Communication Department

4 20-Sep-18 Networks and Communication Department

5 BOOTP VS DHCP BOOTP is not a dynamic configuration protocol. When a client requests its IP address, the BOOTP server consults a table that matches the physical address of the client with its IP address. This implies that the binding between the physical address and the IP address of the client already exists. (The binding is predetermined) 20-Sep-18 Networks and Communication Department

6 BOOTP VS DHCP However, what if a host moves from one physical network to another? What if a host wants a temporary IP address? BOOTP cannot handle these situations because the binding between the physical and IP addresses is static and fixed in a table until changed by the administrator. BOOTP is a static configuration protocol. DHCP provides static and dynamic address allocation that can be manual or automatic. 20-Sep-18 Networks and Communication Department

7 Why use DHCP? Every device on a TCP/IP-based network must have a unique unicast IP address to access the network and its resources. Without DHCP, IP addresses for new computers or computers that are moved from one subnet to another must be configured manually; IP addresses for computers that are removed from the network must be manually reclaimed. 20-Sep-18 Networks and Communication Department

8 Why use DHCP? With DHCP, this entire process is automated and managed centrally. The DHCP server maintains a pool of IP addresses and leases an address to any DHCP- enabled client when it starts up on the network. Because the IP addresses are dynamic (leased) rather than static (permanently assigned), addresses no longer in use are automatically returned to the pool for reallocation. The network administrator establishes DHCP servers that maintain TCP/IP configuration information and provide address configuration to DHCP-enabled clients in the form of a lease offer. 20-Sep-18 Networks and Communication Department

9 Benefits of DHCP Reliable IP address configuration. DHCP minimizes configuration errors caused by manual IP address configuration, such as typographical errors, or address conflicts caused by the assignment of an IP address to more than one computer at the same time. Reduced network administration. DHCP includes the following features to reduce network administration: Centralized and automated TCP/IP configuration. The ability to define TCP/IP configurations from a central location. The ability to assign a full range of additional TCP/IP configuration values by means of DHCP options. The efficient handling of IP address changes for clients that must be updated frequently, such as those for portable computers that move to different locations on a wireless network. The forwarding of initial DHCP messages by using a DHCP relay agent, which eliminates the need for a DHCP server on every subnet. 20-Sep-18 Networks and Communication Department

10 DHCP Architecture The DHCP architecture consists of DHCP clients, DHCP servers, and DHCP relay agents on a network. The clients interact with servers using DHCP messages in a DHCP conversation to obtain and renew IP address leases. 20-Sep-18 Networks and Communication Department

11 DHCP Server The DHCP server stores the configuration information in a database that includes: Valid TCP/IP configuration parameters for all clients on the network. Valid IP addresses, maintained in a pool for assignment to clients, as well as excluded addresses. Reserved IP addresses associated with particular DHCP clients. This allows consistent assignment of a single IP address to a single DHCP client. The lease duration, or the length of time for which the IP address can be used before a lease renewal is required. Note: excluded address are reserved for printers, DNS servers…etc. 20-Sep-18 Networks and Communication Department

12 DHCP Client A DHCP-enabled client, upon accepting a lease offer, receives: A valid IP address for the subnet to which it is connecting. Requested DHCP options, which are additional parameters that a DHCP server is configured to assign to clients. Some examples of DHCP options are Router (default gateway), DNS Servers, and DNS Domain Name. 20-Sep-18 Networks and Communication Department

13 How DHCP Works DHCP provides an automated way to distribute and update IP addresses and other configuration information on a network. A DHCP server provides this information to a DHCP client through the exchange of a series of messages, known as the DHCP conversation or the DHCP transaction. If the DHCP server and DHCP clients are located on different subnets, a DHCP relay agent is used to facilitate the conversation. 20-Sep-18 Networks and Communication Department

14 20-Sep-18 Networks and Communication Department

15 20-Sep-18 Networks and Communication Department

16 DHCP messages The following list includes the four types of messages that can be sent between DHCP clients and servers. DHCPDiscover Broadcast by a DHCP client when it first attempts to connect to the network. The DHCPDiscover message requests IP address information from a DHCP server. DHCPOffer Broadcast by each DHCP server that receives the client DHCPDiscover message and has an IP address configuration to offer to the client. The DHCPOffer message contains an unleased IP address and additional TCP/IP configuration information, such as the subnet mask and default gateway. More than one DHCP server can respond with a DHCPOffer message 20-Sep-18 Networks and Communication Department

17 DHCP messages DHCPRequest Broadcast by a DHCP client after it selects a DHCPOffer. The DHCPRequest message contains the IP address from the DHCPOffer that it selected. If the client is renewing or rebinding to a previous lease, this packet might be unicast directly to the server. DHCPAck Broadcast by a DHCP server to a DHCP client acknowledging the DHCPRequest message. At this time, the server also forwards any options. Upon receipt of the DHCPAck, the client can use the leased IP address to participate in the TCP/IP network 20-Sep-18 Networks and Communication Department

18 DHCPv4 Message Format DHCPv4 Message Format

19 DHCPv4 Message Format The figure shows the format of a DHCPv4 message. The fields are as follows: Operation (OP) Code - Specifies the general type of message. A value of 1 indicates a request message; a value of 2 is a reply message. Hardware Type - Identifies the type of hardware used in the network. For example, 1 is Ethernet, 15 is Frame Relay, and 20 is a serial line. Hardware Address Length - Specifies the length of the address. Hops - Controls the forwarding of messages. Set to 0 by a client before transmitting a request. Transaction Identifier - Used by the client to match the request with replies received from DHCPv4 servers. Seconds - Identifies the number of seconds elapsed since a client began attempting to acquire or renew a lease. Used by DHCPv4 servers to prioritize replies when multiple client requests are outstanding. Flags - Used by a client that does not know its IPv4 address when it sends a request. Only one of the 16 bits is used, which is the broadcast flag. A value of 1 in this field tells the DHCPv4 server or relay agent receiving the request that the reply should be sent as a broadcast. 20-Sep-18 Networks and Communication Department

20 DHCPv4 Message Format Client IP Address - Used by a client during lease renewal when the address of the client is valid and usable, not during the process of acquiring an address. The client puts its own IPv4 address in this field if and only if it has a valid IPv4 address while in the bound state; otherwise, it sets the field to 0. Your IP Address - Used by the server to assign an IPv4 address to the client. Server IP Address - Used by the server to identify the address of the server that the client should use for the next step in the bootstrap process, which may or may not be the server sending this reply. The sending server always includes its own IPv4 address in a special field called the Server Identifier DHCPv4 option. Gateway IP Address - Routes DHCPv4 messages when DHCPv4 relay agents are involved. The gateway address facilitates communications of DHCPv4 requests and replies between the client and a server that are on different subnets or networks. Client Hardware Address - Specifies the physical layer of the client. Server Name - Used by the server sending a DHCPOFFER or DHCPACK message. The server may optionally put its name in this field. This can be a simple text nickname or a DNS domain name, such as dhcpserver.pnu.edu.sa. Boot Filename - Optionally used by a client to request a particular type of boot file in a DHCPDISCOVER message. Used by a server in a DHCPOFFER to fully specify a boot file directory and filename. DHCP Options - Holds DHCP options, including several parameters required for basic DHCP operation. This field is variable in length. Both client and server may use this field. 20-Sep-18 Networks and Communication Department

21 DHCP Relay Agent 20-Sep-18 Networks and Communication Department
Here, enable the router to be the dhcp relay agent, by enabling helper address of the DHCP server in the interface configuration. 20-Sep-18 Networks and Communication Department

22 DHCP Relay Agent Relay agents are used to forward requests and replies between clients and servers when they are not on the same physical subnet. When a DHCP client requests information, the DHCP Relay Agent forwards the request to the list of DHCP servers specified when the DHCP Relay Agent is started. relay agents receive broadcast DHCP messages and then generate a new unicast DHCP message to send out on another interface. 20-Sep-18 Networks and Communication Department

23 Preventing address conflicts
DHCP has both server-side and client-side conflict detection to prevent duplicate IP addresses on your network. Client conflict detection Client computers automatically check to determine if an IP address is already in use before using it. After the DHCP client receives a lease from the DHCP server, the client sends an Address Resolution Protocol (ARP) request to the address that it has been assigned. If a reply to the ARP request is received, the client has detected a conflict and sends a DHCPDecline message to the DHCP server. The DHCP server attaches a BAD_ADDRESS value to the IP address in the scope for the length of the lease. The client then begins the lease process again, and is offered the next available address in the scope. 20-Sep-18 Networks and Communication Department

24 Preventing address conflicts
Server conflict detection To detect conflicts, the DHCP server pings (sends an ICMP Echo message to) an IP address before offering that address to clients in a new lease. The DHCP server only pings addresses that have not been successfully and previously leased. If a client requests a lease on an IP address that it already had or is requesting a renewal, the DHCP server does not ping the IP address. If a response to the ping is received, a conflict is registered and that address is not offered to clients requesting a lease from the server. The DHCP server then attaches a BAD_ADDRESS value to that IP address in the scope. The DHCP server then tries to lease the next available address. 20-Sep-18 Networks and Communication Department

25 Q & A 20-Sep-18 Networks and Communication Department


Download ppt "Net 431 D: ADVANCED COMPUTER NETWORKS"

Similar presentations


Ads by Google