chapter 8: the dynamic host configuration protocol2profs.net/steve/cisntwk413/ppts/ch08.pdf · the...

45
Guide to TCP/IP, Third Edition Chapter 8: The Dynamic Host Configuration Protocol 1 Protocol

Upload: others

Post on 27-Jun-2020

34 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

Guide to TCP/IP, Third Edition

Chapter 8:pThe Dynamic Host Configuration

Protocol

1

Protocol

Page 2: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceObjectives

• Understand the basic services DHCP offers to its clients and explain its backgroundclients and explain its background

• Understand the specifics of IP address management using DHCPg g

• Explain the DHCP Discovery, renewal, and release processesU d t d th b i DHCP k t t t • Understand the basic DHCP packet structure and types of DHCP messages in use

2IP Addressing and Related Topics 2

Page 3: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceObjective (continued)

• Describe broadcast and unicast addressingD ib l t i ti• Describe relay agent communications

• Discuss Microsoft DHCP scopes and classes• Use DHCP troubleshooting utilities• Use DHCP troubleshooting utilities

3IP Addressing and Related Topics 3

Page 4: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceIntroducing DHCP

• DHCP Service that provides a way for client computer to – Service that provides a way for client computer to request IP address assignment

– Delivers necessary configuration information to clients – Traces its origins back to an earlier protocol named

BOOTP– Servers can manage one or more ranges of IP

addresses

4IP Addressing and Related Topics 4

Page 5: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceHow DHCP Works

• When TCP/IP is configured on client computer The Obtain an IP address automatically option is the – The Obtain an IP address automatically option is the only necessary set-up element

• Next time workstation attempts to access network– It broadcasts a DHCP address request to the network

because it has no IP address• All DHCP servers present on same broadcast

domainR i t d d b k th t – Receive request and send back message that indicates a willingness to grant an address lease

5IP Addressing and Related Topics 5

Page 6: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceHow DHCP Works (continued)

• Client Accepts address lease offer and sends packet to server – Accepts address lease offer and sends packet to server that extended offer

• In reply– Server proffers an IP address for a specific period of

time that the client uses thereafter• When half the lease period expiresWhen half the lease period expires

– Client attempts to renew the lease

6IP Addressing and Related Topics 6

Page 7: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

7IP Addressing and Related Topics 7

Page 8: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceThe Role of Leases

• Leases “Loans” of an address for a specific amount of time– “Loans” of an address for a specific amount of time

• Leases that range from one to three weeks – Typical on networks in which machines seldom move yp

and the workforce is stable• Lease periods

Average between one and three days for networks on – Average between one and three days for networks on which roving workers come and go regularly

• Lease periods of four to eight hours – Common on ISP networks

8IP Addressing and Related Topics 8

Page 9: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceDHCP Software Elements

• DHCP clientEnabled at client machine when you select the Obtain – Enabled at client machine when you select the Obtain an IP address automatically option

• DHCP server– Manages address pools and configuration data

• DHCP relay agentIntercepts address requests on local cable segment – Intercepts address requests on local cable segment

– Repackages requests as a unicast to one or more DHCP servers

9IP Addressing and Related Topics 9

Page 10: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceDHCP Lease Types

• Manual address leaseAdministrator assigns an IP address manually – Administrator assigns an IP address manually

• DHCP server – Assigns addresses for specific periods of timeg p p

10IP Addressing and Related Topics 10

Page 11: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceMore About DHCP Leases

• How DHCP integrates with DNSServer addresses are advertised using DNS– Server addresses are advertised using DNS

– All address updates must be entered manually– Client addresses usually come into play only when

• e-mail addresses of the form [email protected] must be resolved

11IP Addressing and Related Topics 11

Page 12: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

Understanding IP Address Management with DHCPManagement with DHCP

• DHCP Discovery– Occurs when DHCP client broadcasts a request for an – Occurs when DHCP client broadcasts a request for an

IP address• DHCP Discovery

Relies on an initial DHCP broadcast– Relies on an initial DHCP broadcast• DHCP servers

– PING an address before offering it to the client• Windows clustering

– Allows two or more servers to be managed as a single system

12IP Addressing and Related Topics 12

Page 13: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceDHCP Address Discovery

• Uses four packetsDHCP Discover packet– DHCP Discover packet

– DHCP Offer packet– DHCP Request packet– DHCP Acknowledgment packet

13IP Addressing and Related Topics 13

Page 14: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

14IP Addressing and Related Topics 14

Page 15: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceThe Discover Packet

• During DHCP Discovery processClient broadcasts Discover packet that identifies – Client broadcasts Discover packet that identifies client’s hardware address

– Header containsS IP dd 0 0 0 0 • Source IP address 0.0.0.0

• Preferred address– Typically the last address the client usedyp y

15IP Addressing and Related Topics 15

Page 16: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceThe Offer Packet

• Send by DHCP server to offer IP address to DHCP clientclient

• Offer packet – Includes IP address that is offered to the client and, – Sometimes, answers to the requested options in the

DHCP Discover packet

16IP Addressing and Related Topics 16

Page 17: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

17IP Addressing and Related Topics 17

Page 18: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceThe Request Packet

• Once Offer packet is receivedClient can either accept offer by issuing a DHCP – Client can either accept offer by issuing a DHCP Request packet, or

– Reject offer by sending a DHCP Decline packet• Typically

– Client sends a Decline only if it receives more than one Offer

18IP Addressing and Related Topics 18

Page 19: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceThe Acknowledgment Packet

• Sent from server to client to indicate the completion of the four packet DHCP Discovery completion of the four-packet DHCP Discovery process

• Response p– Contains answers to any configuration options

requested by client in the previous Request packet

19IP Addressing and Related Topics 19

Page 20: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceThe Address Renewal Process

• When DHCP client receives an address from a DHCP serverDHCP server– Client also receives a lease time and notes the time

that the address was received• Lease time

– Defines how long the client can keep the address• In middle of the lease period• In middle of the lease period

– Client starts a renewal process

20IP Addressing and Related Topics 20

Page 21: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceThe Renewal Time (T1)

• T1Defined as the time that the client tries to renew its – Defined as the time that the client tries to renew its network address

• The Renewal packet– Is unicast directly to the DHCP server

• Default value for T10 5 * duration of lease (i e lease time)– 0.5 duration_of_lease (i.e., lease time)

21IP Addressing and Related Topics 21

Page 22: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceThe Rebinding Time (T2)

• The time that client begins to Broadcast a renewal request for an extended lease – Broadcast a renewal request for an extended lease time from another DHCP server

• DHCP specification, RFC 2131, defines default value for T2 as– 0.875 * duration_of_lease

22IP Addressing and Related Topics 22

Page 23: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

23IP Addressing and Related Topics 23

Page 24: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

24IP Addressing and Related Topics 24

Page 25: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

The DHCP Address Release ProcessProcess

• Client should release its address by Sending a DHCP Release packet to the server – Sending a DHCP Release packet to the server

• DHCP Release packet– Sent over UDP– DHCP server does not send any acknowledgment

• If client does not send the DHCP Release packetDHCP t ti ll l th dd t th – DHCP server automatically releases the address at the lease expiration time

25IP Addressing and Related Topics 25

Page 26: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceDHCP Packet Structures

• FieldsOperation Code (OPCODE) or Message Type Field– Operation Code (OPCODE) or Message Type Field

– Hardware Type Field– Hardware Length Field– Hops Field– Transaction ID Number Field– Seconds Since Boot or Seconds Elapsed FieldSeconds Since Boot or Seconds Elapsed Field– Flags Field

26IP Addressing and Related Topics 26

Page 27: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

DHCP Packet Structures (continued)(continued)

• FieldsClient IP Address Field– Client IP Address Field

– Your IP Address Field– Server IP Address Field– Gateway or Relay Agent IP Address Field– Client Hardware Address Field– Server Host Name FieldServer Host Name Field– Boot File Field

27IP Addressing and Related Topics 27

Page 28: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

28IP Addressing and Related Topics 28

Page 29: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

29IP Addressing and Related Topics 29

Page 30: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

DHCP Option 53: Message TypeType

• Only DHCP option required in all DHCP packetsI di t l f DHCP • Indicates general purpose of any DHCP message

• DHCP boot sequence uses these message types:DHCP boot sequence uses these message types:– DHCP MessageType 1: Discover (client to server)– DHCP MessageType 2: Offer (server to client)

DHCP M T 3 R t ( li t t )– DHCP MessageType 3: Request (client to server)– DHCP MessageType 5: ACK (server to client)

30IP Addressing and Related Topics 30

Page 31: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

31IP Addressing and Related Topics 31

Page 32: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

Broadcast and UNICAST in DHCPDHCP

• DHCP clients Must broadcast service requests until they obtain IP – Must broadcast service requests until they obtain IP addresses

• DHCP clients – Use unicast addressing after they obtain an address for

a local DHCP server or relay agent• DHCP servers DHCP servers

– Examine DHCP packets coming from clients

32IP Addressing and Related Topics 32

Page 33: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

33IP Addressing and Related Topics 33

Page 34: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

Communications with a DHCP Relay AgentRelay Agent

• DHCP boot up process rRelies heavily on broadcasts but most routers do not – Relies heavily on broadcasts, but most routers do not forward broadcasts

• Relay agent function – Typically loaded on a router connected to the

segment containing DHCP clients• Relay agent device Relay agent device

– Configured with the address of the DHCP server– Can communicate using unicast packets directly with

that serverthat server

34IP Addressing and Related Topics 34

Page 35: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

35IP Addressing and Related Topics 35

Page 36: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

36IP Addressing and Related Topics 36

Page 37: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

Microsoft DHCP Scopes and ClassesClasses

• Address scopesDefine a set of addresses that a DHCP server can – Define a set of addresses that a DHCP server can assign to clients

• Superscopes– A collection of scopes that contain sets of non-

consecutive IP addresses

37IP Addressing and Related Topics 37

Page 38: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

Setting up a Simple DHCP ServerServer

• Field values in the Dynamic Pool SettingsIP Assigned From– IP Assigned From

– The Range of Pool (1-255):– SubMask– Gateway– Wins

38IP Addressing and Related Topics 38

Page 39: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

Setting up a Simple DHCP Server (continued)Server (continued)

• Field values in the Dynamic Pool SettingsDNS– DNS

– Domain Name– Lease Time (60 – 31536000 sec)– Status

39IP Addressing and Related Topics 39

Page 40: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

40IP Addressing and Related Topics 40

Page 41: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceTroubleshooting DHCP

• One good way to troubleshoot DHCPUse a protocol analyzer such as Ethereal– Use a protocol analyzer, such as Ethereal

• Analyzer – Can display the sequence of messages that occurs on p y q g

a network• Commands to release and/or renew an IP

addressaddress– ipconfig /release– ipconfig /renew

41IP Addressing and Related Topics 41

Page 42: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11Performance

42IP Addressing and Related Topics 42

Page 43: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceSummary

• DHCP Provides a way for computers to obtain usable unique – Provides a way for computers to obtain usable, unique IP addresses and necessary TCP/IP configurations

• From the administrative side– DHCP makes it easy to define and manage pools of IP

addresses• DHCP’s origins DHCP s origins

– Lie in an earlier TCP/IP Application layer protocol, called BOOTP

43IP Addressing and Related Topics 43

Page 44: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceSummary (continued)

• DHCP – Supports manual or static address allocation– Supports manual or static address allocation

• When a DHCP client starts– It begins the process of DHCP Discovery, during which

the client receives an IP address and leasethe client receives an IP address and lease• DHCP

– Supports a variety of message types and options– Only MessageType 53 (DHCP Message) is mandatory

for any given DHCP message

44IP Addressing and Related Topics 44

Page 45: Chapter 8: The Dynamic Host Configuration Protocol2profs.net/steve/CISNTWK413/PPTs/ch08.pdf · The Dynamic Host Configuration Protocol 1. CISNTWK-11 Objectives Performance ... How

CISNTWK-11PerformanceSummary (continued)

• Because DHCP can ferry a surprisingly large range of configuration informationrange of configuration information– The protocol makes use of several message options

• A protocol analyzer is especially effective when p y p ydiagnosing DHCP difficulties

45IP Addressing and Related Topics 45