230 likes | 451 Views
DHCP. Dynamic Host Configuration Protocol. Agenda. Introduction BOOTP Packet Format DHCP. Introduction – RARP is limited. RARP only returns IP address Does not cross routers Difficult to program Need for mask Need for default gateway Need for DNS server Need for. IP
E N D
DHCP Dynamic Host Configuration Protocol
Agenda • Introduction • BOOTP Packet Format • DHCP
Introduction – RARP is limited • RARP only returns IP address • Does not cross routers • Difficult to program Need for mask Need for default gateway Need for DNS server Need for ...
IP Header UDP Header BOOTP request/reply BOOTP Packet Format IP datagram UDP datagram 20 bytes 8 bytes 300 bytes
BOOTP Header Opcode (1=request, 2=reply) Hardware type 1=Ethernet Hardware Address length Hop count Transaction ID Number of seconds (Unused) 300 bytes Client IP address Your IP address Server IP address Gateway IP address Client hardware address Server hostname Boot filename Vendor specific information
UDP Port numbers • Client uses port 68 • Server uses port 67
DHCP – Dynamic host configuration protocol • Extension of BOOTP • Provides TCP/IP configuration parameters • RFC 2131
DHCP – DHCP Discover The Client is looking for available DHCP servers 1 Client DHCP SERVER DHCP DISCOVER Broadcast Source IP Address = 0.0.0.0 Destination IP Address = 255.255.255.255 UDP port 67 Client IP Address = 0.0.0.0 Hardware Address = 08007. . . ... ...
DHCP – DHCP Offer The servers response to the clients DHCP OFFER DHCP OFFER Broadcast DHCP SERVER Client 2 Destination IP Address = 255.255.255.255 UDP Port 68 Your IP Address = 131.107.7.29 Hardware Address = 08007. . . Subnet mask Default gateway Lease time Renewal time DNS server WINS server
DHCP – DHCP REQUEST Intends to accept the parameters 3 DHCP REQUEST Broadcast Client DHCP SERVER Source IP Address = 0.0.0.0 Destination IP Address = 255.255.255.255 UDP port 67 Client IP Address = 131.107.7.29 Server IP Address = 131.107.7.1 Hardware Address = 08007. . . Subnet mask Default gateway Lease time Renewal time DNS server WINS server
DHCP – DHCP ACK The servers confirms the DHCP REQUEST + updates his database 4 DHCP Table 131.107.7.7 08004. . . 131.107.7.29 08007. . . DHCP ACK Broadcast DHCP SERVER Client 4 UDP Port 68 IP Address = 131.107.7.29 Hardware Address = 08007. . . Subnet mask Default gateway Lease time Renewal time DNS server WINS server
DHCP – Gratuitous ARP Client checks for unique IP address 5 Client ARP REQUEST Broadcast IP Address = 131.107.7.29 Hardware Address = 08007. . .
DHCP – Renewing the Lease After T1 (= 0,5 x LT) the client will renew the lease By issuing a DHCP REQUEST DHCP REQUEST Client DHCP SERVER Source IP Address = 131.107.7.29 Destination IP Address = 255.255.255.255 UDP port 67 Client IP Address = 131.107.7.29 Server IP Address = 131.107.7.1 Hardware Address = 08007. . . Subnet mask Default gateway Lease time Renewal time DNS server WINS server
DHCP – Renewing the Lease after REBOOT After REBOOT the client will renew the lease By issuing a DHCP REQUEST DHCP REQUEST Broadcast Client DHCP SERVER Source IP Address = 0.0.0.0 Destination IP Address = 255.255.255.255 UDP port 67 Client IP Address = 131.107.7.29 Server IP Address = 131.107.7.1 Hardware Address = 08007. . . Subnet mask Default gateway Lease time Renewal time DNS server WINS server
A B DHCP on a routed network • Broadcast does not cross routers ! IP helper address = 10.1.1.1 BOOTP/DHCP RELAY AGENT DHCP DISCOVER unicast DHCP DISCOVER Broadcast 10.2.2.1 1 Gateway IP address = 10.2.2.1 2 DHCP Server 10.1.1.1 Client
A B DHCP on a routed network • Broadcast does not cross routers ! IP helper address = 10.1.1.1 BOOTP/DHCP RELAY AGENT DHCP OFFER unicast DHCP OFFER Broadcast 3 10.2.2.1 4 Destination IP Address = 10.2.2.1 UDP Port 67 Your IP Address = 10.2.2.7 Server IP Address = 10.1.1.1 Gateway IP Address = 10.2.2.1 Hardware Address = 08007. . . Subnet mask Default gateway Lease time ... DHCP Server 10.1.1.1 Client
DHCP Commands • WIN NT/2K • ipconfig /release • ipconfig /renew • WIN95 • winipcfg
DHCP • DHCPNACK • The server.to.clientcommunication, refusingthe request forconfiguration parameter. • DHCPDECLINE • The client.to.servercommunication, indicatingthat the network address isalready in use. (arp) • DHCPRELEASE • The client.to.servercommunication,relinquishing networkaddress and cancelingremaining lease.