1 / 25

CENG415 – Communication Networks

CENG415 – Communication Networks. Lectures 21 DHCP – Dynamic Host Configuration Protocol. Configuration of IP addresses. How is a host allocated a certain IP address? Need to satisfy uniqueness requirement Need to provide same network address with all other hosts in same network

umed
Download Presentation

CENG415 – Communication Networks

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CENG415 – Communication Networks Lectures 21 DHCP – Dynamic Host Configuration Protocol

  2. Configuration of IP addresses • How is a host allocated a certain IP address? • Need to satisfy uniqueness requirement • Need to provide same network address with all other hosts in same network • Manual configuration: ipconfig(Windows) or ifconfig (unix) • Requires system admin privileges • Error-prone • Dynamic configuration of IP addresses? • Simpler to manage, and also more efficient usage of the IP address space

  3. DHCP • DHCP server allocates an available IP address to a host, when the latter is connected to the network or booted • Usually, one DHCP server for each administrative domain • DHCP runs over UDP/IP • But how does the host know the DHCP server address? • Host first sends DHCP-DISCOVER to IP broadcast address (255.255.255.255) • Message can be received by DHCP server directly, or it may be forwarded there through DHCP relay (can be a router)

  4. DHCP • DHCP can be used for several other configuration operations • Router address • Computer name • DNS server addresses • DHCP server allocates IP addresses with certain lifetime • “Lease Time” • DHCP clients can renew addresses

  5. DHCP Transition Diagram

  6. DHCP Messages

  7. DHCP Messages

  8. Simplified DHCP interaction

  9. DHCP Header there are more than 100 options

  10. DHCP Header Fields • OpCode: 1 (Request), 2(Reply) • Hardware Type: 1 (pour Ethernet) • Hardware address length: 6 (for Ethernet) • Hop count: set to 0 by client • Transaction ID: Integer (used as ID for messages) • Seconds: Number of seconds since the client booted • Client IP address, Your IP address, server IP address, Gateway IP address, client hardware address, server host name, boot file name:The client will indicate the information it knows, the remaining fields stay empty.

  11. Message Types The message type is transmitted as an option.

  12. Options • DHCP can use the option field to transmit more configuration information: Subnet Mask, Name Server, Hostname, Domain Name, Default IP TTL, Broadcast Address, Static Route, Ethernet Encapsulation, X Window Manager, X Window Font, DHCP Msg Type, DHCP Renewal Time, DHCP Rebinding, SMTP-Server, Printer Name, …

  13. DHCP (Discover) The client searches for a DHCP Server 1 Client DHCP Server DHCP DISCOVER Broadcast IP source = 0.0.0.0 IP dest =255.255.255.255 Port UDP dest = 67 DHCP Fields Client IP Address = 0.0.0.0 Hardware Address = 08007. . .

  14. DHCP (Offer) server(s) respond(s) to client DHCP OFFER Broadcast DHCP Server Client 2 IP dest = 255.255.255.255 Port UDP dest = UDP Port 68 DHCP Fields Your IP Address = 131.107.7.29 Hardware Address = 08007… Subnet mask =…, Default gateway =… Lease time =… Renewal time =… DNS server =…

  15. DHCP (Request) The client accepts the received configuration / Server(s) respond(s) to client 3 DHCP REQUEST Broadcast Client DHCP Server IP source = 0.0.0.0 IP dest = 255.255.255.255 Port UDP dest = 67 Champs DHCP 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 = …

  16. DHCP (Ack) Server confirms the DHCP request and updates its table 4 DHCP Table 131.107.7.7 08004. . . 131.107.7.29 08007. . . DHCP ACK Broadcast DHCP Server Client 4 IP dest = 255.255.255.255 Port UDP des = 68 Champs DHCP IP Address = 131.107.7.29 Hardware Address = 08007… Subnet mask = … Default gateway = … Lease time = … Renewal time = … DNS server = …

  17. Gratuitous ARP The client needs to insure that no other stations have the same address. Client will send some ARP messages asking: who has my IP address? If no answer  perfect. 5 Client ARP REQUEST Broadcast Who has 131.107.7.29?

  18. Lease renew After a time equal to 50% of the lease time, client renews the lease using a DHCP Request. DHCP REQUEST Client DHCP Server IP source = 131.107.7.29 IP dest = 255.255.255.255 Port UDP dest = 67 DHCP Fields 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 = …

  19. Renew after reboot After a reboot the client renews the lease using DHCP Request. The client has only to check whether the previous received configuration still valid or not. DHCP REQUEST Broadcast Client DHCP Server IP source = 0.0.0.0 IP dest = 255.255.255.255 Port UDP dest = 67 DHCP Field 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 = …

  20. A B DHCP on a routed network A broadcast does not traverse a router ! ONLY one DHCP server for the company, not for each IP Network DHCP Server = 10.1.1.1 BOOTP/DHCP RELAY AGENT DHCP DISCOVER unicast DHCP DISCOVER Broadcast 10.2.2.1 1 Gateway IP = 10.2.2.1 2 DHCP Server 10.1.1.1 Client

  21. A B DHCP on a routed network DHCP Server = 10.1.1.1 BOOTP/DHCP RELAY AGENT DHCP OFFER unicast DHCP OFFER Broadcast 3 10.2.2.1 4 IP dest = 10.2.2.1 Port UDP dest= 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

  22. Windows Commands • Ipconfig /all • Ipconfig /renew • Ipconfig /release

  23. Scenario of station thatneeds an IP address MAC : Dst : FF:FF:FF:FF:FF:FF Src : 2F:6C:04:54:DD:03 IP : Dst : 255.255.255.255 Src : 0.0.0.0 UDP : Dst : 67 (DHCP server) Src : 68 (DHCP client) MAC : Dst : FF:FF:FF:FF:FF:FF Src : 3A:22:4C:67:EE:1C IP : Dst : 0.0.0.0 Src : 128.81.15.2 UDP : Dst : 68 (DHCP client) Src : 67 (DHCP server) 2F:6C:04:54:DD:03 3A:22:4C:67:EE:1C

  24. Broadcast Station A DHCP Server Bridge B1 Bridge B3 Bridge B2

  25. Station A obtains the config • Station A • IP address: 128.81.15.3 • Mask: 255.255.255.0 • Gateway : 128.81.15.1 • DNS : 128.81.16.24

More Related