Download 9781133019862_PPT_ch07

Document related concepts

Wake-on-LAN wikipedia , lookup

I²C wikipedia , lookup

Lag wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

Zero-configuration networking wikipedia , lookup

Dynamic Host Configuration Protocol wikipedia , lookup

Transcript
Guide to TCP/IP
Fourth Edition
Chapter 7:
IP Address Autoconfiguration
Objectives
• Explain the basic services that DHCP/DHCPv6
offers to its clients and explain its background
• Explain the specifics of IP/IPv6 address
management using DHCP/DHCPv6
• Explain the DHCP Discovery, renewal, and release
processes
• Explain the basic DHCP/DHCPv6 packet structure
and types of DHCP/DHCPv6 messages in use
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
2
Objective (cont'd.)
• Describe broadcast and unicast addressing for
IPv4 as well as multicast addressing for IPv6
• Describe relay agent communications for both IPv4
and IPv6
• Discuss Microsoft DHCP scopes and classes IPv4
and differences in IPv6 scope configuration
• Use DHCP/DHCPv6 troubleshooting utilities
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
3
Understanding Autoaddressing
• DHCP
– Considered the most common form of address
autoconfiguration
• Automatic Private IP Addressing (APIPA)
– Introduced by Microsoft a few years after DHCP
– Requires no addressing servers
• DHCPv6
– A more robust and controllable system for address
autoconfiguration
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
4
Introducing Dynamic Host
Configuration Protocol
• DHCP
– 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
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
5
How DHCP Works
• When TCP/IP is configured on client computer
– 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
domain
– Receive request and send back message that
indicates a willingness to grant an address lease
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
6
How DHCP Works (cont'd.)
• Client
– 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 expires
– Client attempts to renew the lease
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
7
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
8
Role of Leases
• Leases
– “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 and the workforce is stable
• Lease periods
– 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
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
9
DHCP Software Elements
• DHCP client
– Enabled at client machine when you select the
Obtain an IP address automatically option
• DHCP server
– Manages address pools and configuration data
• DHCP relay agent
– Intercepts address requests on local cable segment
– Repackages requests as a unicast to one or more
DHCP servers
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
10
DHCP Lease Types
• Manual address lease
– Administrator assigns an IP address manually
• Dynamic address lease
– DHCP server assigns addresses for specific periods
of time
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
11
More About DHCP Leases
• How DHCP integrates with 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
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
12
IPv4 Autoconfiguration
• Two types of IPv4 address autoconfiguration
mechanisms
– DHCP
– Automatic Private IP Addressing (APIPA)
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
13
Automatic Private IP Addressing
(APIPA)
• Dynamic configuration of IPv4 link-local addresses
• Address block 169.254.0.0/16
– Reserved for this use
• Used by interfaces as a failover mechanism to selfassign an IPv4 address
• APIPA address will not allow routed
communications to hosts on other networks
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
14
Understanding IP Address
Management with DHCP
• DHCP Discovery
– Occurs when DHCP client broadcasts a request for
an IP address
– 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
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
15
DHCP Address Discovery
• Uses four packets
–
–
–
–
DHCP Discover packet
DHCP Offer packet
DHCP Request packet
DHCP Acknowledgment packet
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
16
DHCP Address Discovery (cont’d.)
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
17
Discover Packet
• During DHCP Discovery process
– Client broadcasts Discover packet that identifies
client’s hardware address
– Header contains
• Source IP address 0.0.0.0
• Preferred address
– Typically the last address the client used
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
18
Offer Packet
• Send by DHCP server to offer IP address to DHCP
client
• Offer packet
– Includes IP address that is offered to the client
– Sometimes, answers to the requested options in the
DHCP Discover packet
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
19
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
20
Request Packet
• Once Offer packet is received
– 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
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
21
Acknowledgment Packet
• Sent from server to client to indicate the completion
of the four-packet DHCP Discovery process
• Response
– Contains answers to any configuration options
requested by client in the previous Request packet
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
22
Address Renewal Process
• When DHCP client receives an address from a
DHCP 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
– Client starts a renewal process
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
23
Renewal Time (T1)
• T1
– 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 T1
– 0.5 * duration_of_lease (i.e., lease time)
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
24
Rebinding Time (T2)
• Time that client begins to:
– 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
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
25
Rebinding Time (T2) (cont’d.)
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
26
Rebinding Time (T2) (cont’d.)
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
27
DHCP Address Release Process
• Client should release its address by
– 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 packet:
– DHCP server automatically releases the address at
the lease expiration time
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
28
DHCP Packet Structures
• Fields
–
–
–
–
–
–
–
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 Field
Flags Field
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
29
DHCP Packet Structures (cont'd.)
• Fields
–
–
–
–
–
–
–
–
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 Field
Boot File Field
DHCP Option field
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
30
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
31
DHCP Option 53: Message Type
• Only DHCP option required in all DHCP packets
• Indicates general purpose of any DHCP message
• DHCP boot sequence uses these message types:
–
–
–
–
DHCP Message Type 1: Discover (client to server)
DHCP Message Type 2: Offer (server to client)
DHCP Message Type 3: Request (client to server)
DHCP Message Type 5: ACK (server to client)
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
32
DHCP Option 53: Message Type
(cont’d.)
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
33
Broadcast and Unicast in DHCP
• DHCP clients
– 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
– Examine DHCP packets coming from clients
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
34
Broadcast and Unicast in DHCP
(cont’d.)
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
35
Communications with a DHCP Relay
Agent
• DHCP boot up process
– 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
– Configured with the address of the DHCP server
– Can communicate using unicast packets directly with
that server
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
36
Communications with a DHCP Relay
Agent (cont’d.)
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
37
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
38
IPv6 Autoconfiguration
• Two basic approaches to IPv6 autoconfiguration
• Stateless autoconfiguration
– Simply presents required router configuration
information to all comers
• Stateful autoconfiguration
– DHCPv6 server must maintain awareness of the
status or state of its pool of available addresses
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
39
Types of IPv6 Autoconfiguration
• Stateless address autoconfiguration
– ND protocol allows routers to be configured to
present the minimum information a host needs when
joining a network link
• Stateful address autoconfiguration
– DHCPv6 is much like DHCPv4 under IPv4
– Both rely on dedicated servers to hold databases of
information about hosts and their IP and other
configuration parameters
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
40
Types of IPv6 Autoconfiguration
(cont’d.)
• Combination of stateful and stateless address
autoconfiguration
– Referenced as DHCPv6 stateless
– Routers on the local link can be configured to
provide pointers to DHCPv6 servers
– Router provides the network prefix, and DHCPv6
server provides the DNS server information
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
41
Functional States of an IPv6
Autoconfigured Address
• Tentative addresses
– Occur as a node initializes an interface on an IPv6
network segment or link
• Valid addresses
– Usable based on the Valid Lifetime field in the Prefix
Information option of an RA or the Valid Lifetime field
in the DHCPv6 IA Address option
• Preferred addresses
– Usable based on the Preferred Lifetime field in the
Prefix Information option of an RA or the Preferred
Lifetime field in the DHCPv6 IA Address option
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
42
Functional States of an IPv6
Autoconfigured Address (cont’d.)
• Deprecated addresses
– Allow nodes to continue to function while they renew
the lease on their addresses
• Invalid addresses
– Cannot be used as either the source or destination
address when the valid lifetime expires
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
43
Node Interface Identifiers
• Node interface identifiers (IDs)
– Used to ensure that the IPv6 address is unique
among all other IPv6 addresses
– Generally 64 bits long
• Three most common sources
– Modified EUI-64 format
– Random number generator to create a 64-bit
number
– Cryptographically Generated Addresses (CGA)
process
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
44
Node Interface Identifiers (cont’d.)
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
45
Node Interface Identifiers (cont’d.)
• RFC 4941
– Node using SLAAC will compute an additional IPv6
address known as the “temporary” address
• Temporary address
– Assigned “preferred” status
– Used for all outbound communications from the
node
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
46
DHCPv6
• DHCPv6
– Defined in RFC 3315
– Uses UDP ports 546 and 547
• DHCPv6 uses two specific multicast addresses:
– FF02::1:2
– FF05::1:3
• DHCP Unique Identifier (DUID) methods
– DUID-LLT
– DUID-EN
– DUID-LL
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
47
DHCPv6 (cont’d.)
• Numerous DHCPv6 message types
– Occur between nodes, servers, and relay agents
• DHCPv6 Stateful Message Exchange
–
–
–
–
–
–
Host sends a Router Solicitation
Router replies with a Router Advertisement
Host sends a Solicit message
DHCPv6 server replies with an Advertise message
Host sends a Request message
DHCPv6 server sends the host a Reply message
with an IPv6 address
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
48
DHCPv6 (cont’d.)
• DHCPv6 Stateless Message Exchange
–
–
–
–
Host sends a Router Solicitation
Router replies with a Router Advertisement
Host sends an Information-Request message
DHCPv6 server sends the host a Reply message
with the other available configuration options
• DHCPv6 Relay Message Exchange
– Host sends a Router Solicitation
– Router replies with a Router Advertisement
– Host sends a Solicit message
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
49
DHCPv6 (cont’d.)
• DHCPv6 Relay Message Exchange (cont’d.)
– Router relay-forwards Solicit message to server
– DHCPv6 server relay-replies router with an
Advertise message
– Router replies with Advertise message to the host
– Host sends a Request message
– Router relay-forwards Request message to server
– DHCPv6 server relay-replies router with a Reply
message with IPv6 address and other options
– Router replies with the Reply message to the host
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
50
IPv6 Autoconfiguration Process
• Basic steps
– Node creates an interface ID
– FE80:: is prepended to the interface ID
– Node sends NS message with its link-local address
as the destination
– If an NA is not received, then the address is
considered unique
– Host sends an RS to the all-routers multicast
address FF02::2
– If an RA is not received, the host starts the stateful
autoconfiguration process
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
51
IPv6 Autoconfiguration Process
(cont’d.)
• Basic steps (cont’d.)
– If an RA is received, host examines the RA message
looking for variables and flags
– If L flag is set to “on,” host adds the network prefix to
its prefix cache
– If A flag is set to “on,” then two IPv6 addresses are
created
– Host sends an NS message with its global unicast
address as the destination
– If an NA is not received, the address is considered
unique
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
52
IPv6 Autoconfiguration Process
(cont’d.)
• Basic steps (cont’d.)
– If M flag is set to “on,” start the stateful
autoconfiguration process
– If O flag is set to “on,” start the stateful
autoconfiguration process
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
53
Autoconfiguration in Microsoft
Windows Operating Systems
• Basic guidelines:
– Link-local address will be generated using a RNG
– If A flag is set to “on” in an RA, the global unicast
address will be generated
– If A flag is set to “on” in an RA, a temporary global
unicast address will be generated
– OS sends the RS to find any on-link routers
– If no RAs are received, OS starts stateful address
process
– Manually configuring an IPv6 address does not
disable IPv6 address autoconfiguration
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
54
Microsoft Windows Server 2008 DHCP
Scopes
• Address scopes
– Define a set of addresses that a DHCP server can
assign to clients
• Superscopes
– A collection of scopes that contain sets of nonconsecutive IP addresses
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
55
Setting Up A Simple DHCP Server
• Source of information
– D-Link Xtreme N Gigabit Router (model number
DIR-655)
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
56
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
57
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
58
Troubleshooting DHCP
• One good way to troubleshoot DHCP/DHCPv6
– Use a protocol analyzer, such as Wireshark
• Analyzer
– Can display the sequence of messages that occurs
on a network
• Commands to release and/or renew an IP address
–
–
–
–
ipconfig /release
ipconfig /renew
ipconfig /release6
ipconfig /renew6
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
59
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
60
Summary
• DHCP
– 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
– Lie in an earlier TCP/IP Application layer protocol,
called BOOTP
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
61
Summary (cont'd.)
• DHCP
– Supports manual or dynamic address allocation
• When a DHCP client starts
– It begins the process of DHCP Discovery, during
which the 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
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
62
Summary (cont'd.)
• Because DHCP can ferry a surprisingly large range
of configuration information
– The protocol makes use of several message options
• A protocol analyzer is especially effective when
diagnosing DHCP/DHCPv6 difficulties
• Clients supporting IPv6 have new operations for
address autoconfiguration
• DHCPv6 operates much like DHCP for IPv4
• DHCPv6 is a completely new service, compared to
DHCP’s origins
© 2013 Course Technology/Cengage Learning. All Rights Reserved.
63