ITD107 - Week 10 - DHCP.pptx
Document Details
Uploaded by JovialElectricOrgan792
Tags
Full Transcript
Introduction to Computer Networks DHCP How to Get IP Address Devices on a network can get an IP address in either two ways: Static IP assigned manually Dynamically using DHCP Dynamic Host Configuration Protocol (DHCP) is an application layer protocol used to dynamically assign an...
Introduction to Computer Networks DHCP How to Get IP Address Devices on a network can get an IP address in either two ways: Static IP assigned manually Dynamically using DHCP Dynamic Host Configuration Protocol (DHCP) is an application layer protocol used to dynamically assign an IP address to any device, or node, on a network so it can communicate using IP DHCP Server DHCP servers assign IP addresses to hosts This protocol gives us a much easier way to administrate by automatically providing IP information to hosts It works well in any network environment, from tiny to huge, and allows all types of hardware to be employed as a DHCP server, including routers. In small organizations or home network, routers can be configured to provide DHCP services without the need for dedicated server 4 DHCP Server The DHCPv4 server dynamically assigns, or leases, an IPv4 address from a pool of addresses for a limited period of time chosen by the server, or until the client no longer needs the address. Clients lease the information from the server for a defined period. Administrators configure DHCPv4 servers to set the leases to time out at different intervals. The lease is typically anywhere from 24 hours to a week or more. When the lease expires, the client must ask for another address, although the client is typically reassigned the same address. 5 DHCP client-server scenario DHCP server: 223.1.2.5 DHCP discover Arriving client Broadcast: is there a DHCP server out there? Unicast: I’m a DHCP DHCP offer server! Here’s an IP address you can use DHCP request Broadcast: OK. I would like to use this IP address! DHCP ACK Unicast: OK. You’ve got that IP address! 6 DHCP client-server scenario 1. The DHCP client broadcasts a DHCP Discover message looking for a DHCP server (Port 67). 2. The DHCP server that received the DHCP Discover message sends a unicast DHCP Offer message back to the host 3. The client then broadcasts to the server a DHCP Request message asking for the offered IP address and possibly other information. 4. The server finalizes the exchange with a unicast DHCP Acknowledgment message. 7 DHCP: example DHCP DHCP Connecting laptop will use DHCP DHCP UDP IP DHCP to get IP address, DHCP Eth address of first-hop router, Phy address of DNS server. DHCP DHCP REQUEST message DHCP DHCP 168.1.1.1 encapsulated in UDP, DHCP UDP encapsulated in IP, DHCP IP Eth encapsulated in Ethernet DHCP router with DHCP Phy server built into Ethernet frame broadcast (dest: router FFFFFFFFFFFF) on LAN, received at router running DHCP server Ethernet de-encapsulate to IP de-encapsulate UDP de- encapsulate to DHCP 8 DHCP: example DHCP DHCP DCP server formulates DHCP DHCP UDP ACK containing client’s IP DHCP IP address, IP address of first-hop Eth router for client, name & IP DHCP Phy address of DNS server Encapsulated DHCP server DHCP DHCP reply forwarded to client, de- DHCP DHCP UDP IP encapsulate up to DHCP at DHCP Eth router with DHCP client Phy server built into DHCP router Client now knows its IP address, name and IP address of DNS server, IP address of its first-hop router 9 DHCP: more than IP addresses DHCP can return more than just allocated IP address on subnet: Address of first-hop router for client Name and IP address of DNS sever Network mask (indicating network versus host portion of address) 10 Renew a Lease Prior to lease expiration, the client begins a two-step process to renew the lease with the DHCPv4 server, as shown in the figure: DHCP Request (DHCPREQUEST) The client sends a DHCPREQUEST message directly to the DHCPv4 server that originally offered the IPv4 address. If a DHCPACK is not received within a specified amount of time, the client broadcasts another DHCPREQUEST so that one of the other DHCPv4 servers can extend the lease DHCP Acknowledgment (DHCPACK) On receiving the DHCPREQUEST message, the server verifies the lease information by returning a DHCPACK. 11 DHCP Relay Agent In large network settings, network clients are not on the same subnet as servers providing services like DHCP server. Routers don’t propagate broadcast messages. Any network client attempting to acquire an IPv4 address from a DHCP server on other subnets using a broadcast message will fail DHCP relay agent is then used in this case DHCP relay agent relays DHCP messages between DHCP clients and DHCP servers on different IP networks 12 DHCP Relay Agent Router A is configured with the IP helper address command on interface E0 of the router. Whenever interface E0 receives a broadcast request, Router A will forward those requests as a unicast you can configure Router A to forward these requests and even use multiple DHCP servers for redundancy, if needed 13