Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
51
Добавлен:
11.04.2015
Размер:
22.9 Mб
Скачать

196

Understanding IPv6, Second Edition

 

 

 

 

A

 

 

 

 

 

 

Get first Prefix

 

 

 

 

 

 

Information option.

 

 

 

 

 

 

 

 

 

Neighbor

 

 

 

 

 

 

Advertisement

Yes

Do not initialize

 

 

 

 

response

 

stateless address.

 

 

 

 

received?

 

 

 

Is On-Link

Yes

Add prefix to

 

 

 

 

flag set to 1?

 

prefix list.

No

 

 

 

 

 

 

 

 

 

 

 

 

Initialize stateless

 

 

 

 

 

 

address.

 

 

 

No

 

 

 

 

 

 

 

 

 

Are there

 

 

 

Is Autonomous

No

 

more Prefix

No

 

 

 

Information

B

 

flag set to 1?

 

 

 

 

 

 

options to

 

 

 

 

 

 

 

 

 

 

 

 

process?

 

 

 

Yes

 

 

Yes

 

 

 

Derive stateless address:

 

Go to next Prefix

 

 

 

Prefix:[interface ID]

 

 

Information option.

 

 

 

Send multicast Neighbor

 

 

 

 

 

Solicitation with Target

 

 

 

 

 

 

Address set to derived

 

 

 

 

 

 

stateless address.

 

 

 

 

 

Figure 8-3 The address autoconfiguration process for a host (Part 2)

DHCPv6

DHCPv6 is defined in RFC 3315 to provide stateful address configuration or stateless configuration settings for IPv6 hosts. An IPv6 host uses a configuration protocol, such as DHCPv6, based on the following flags in the Router Advertisement message sent by a neighboring router:

Managed Address Configuration flag This is also known as the M flag. When set to 1, this flag instructs the host to use a configuration protocol to obtain stateful addresses.

Other Stateful Configuration flag This is also known as the O flag. When set to 1, this flag instructs the host to use a configuration protocol to obtain other configuration settings.

Chapter 8 Address Autoconfiguration

197

The combinations of the values of the M and O flags are the following:

Both M and O flags are set to 0 This combination corresponds to a network without a DHCPv6 infrastructure. Hosts use router advertisements for non-link-local addresses, and they use other methods (such as manual configuration) to configure other settings.

Both M and O flags are set to 1 In this combination, DHCPv6 is used for both addresses and other configuration settings. This combination is known as DHCPv6 stateful, in which a DHCPv6 server is assigning stateful addresses to IPv6 hosts.

The M flag is set to 0, and the O flag is set to 1

In this combination, DHCPv6 is used

 

only for other configuration settings. Neighboring routers are configured to advertise

 

non-link-local address prefixes from which IPv6 hosts derive stateless addresses. This

 

combination is known as DHCPv6 stateless, in which a DHCPv6 server is not assigning

 

stateful addresses to IPv6 hosts, but stateless configuration settings.

The M flag is set to 1, and the O flag is set to 0

In this combination, DHCPv6 is used

 

for address configuration but not for other settings. Because IPv6 hosts typically need to

be configured with other settings, such as the IPv6 addresses of Domain Name System (DNS) servers, this is an unlikely combination.

Like DHCP for IPv4, the components of a DHCPv6 infrastructure consist of DHCPv6 clients that request configuration, DHCPv6 servers that provide configuration, and DHCPv6 relay agents that relay messages between clients and servers when clients are on subnets that do not include a DHCPv6 server.

More Info You can configure an IPv6 router running Windows Server 2008 or Windows Vista to set the M flag to 1 in router advertisements with the netsh interface ipv6 set interface InterfaceNameOrIndex managedaddress=enabled command. Similarly, you can set the O flag to 1 in router advertisements with the netsh interface ipv6 set interface InterfaceNameOrIndex otherstateful=enabled command. For more information about configuring an IPv6 router running Windows Server 2008 or Windows Vista, see Chapter 10, “IPv6 Routing.”

DHCPv6 Messages

As in DHCP for IPv4, DHCPv6 messages are User Datagram Protocol (UDP) messages. DHCPv6 clients listen for DHCP messages on UDP port 546. DHCPv6 servers and relay agents listen for DHCPv6 messages on UDP port 547. The structure for DHCPv6 messages is much simpler than for DHCP for IPv4, which had its historical origins in the BOOTP protocol to support diskless workstations. Figure 8-4 shows the structure of DHCPv6 messages sent between client and server.

198 Understanding IPv6, Second Edition

Msg-Type

Transaction-ID

Options

• • •

Figure 8-4 DHCPv6 messages between client and server

The following list describes the fields in a DHCPv6 message:

Msg-Type This 1-byte field indicates the type of DHCPv6 message. See Table 8-1.

Transaction-ID This 3-byte field is determined by a client and used to group the messages of a DHCPv6 message exchange together. DHCPv6 servers copy the value of the Transaction-ID field from request messages to their corresponding reply messages.

Options This variable-sized field contains one or more options that are used to contain client and server identification information, stateful IPv6 addresses, and other configuration settings.

Table 8-1 lists the DHCPv6 message types defined in RFC 3315.

Table 8-1

DHCPv6 Message Types

 

 

 

 

 

 

 

 

 

Equivalent DHCP for

Msg-Type

Message

Description

IPv4 Message

1

Solicit

Sent by a client to locate servers.

DHCPDiscover

 

 

 

 

2

Advertise

Sent by a server in response to

DHCPOffer

 

 

a Solicit message to indicate

 

 

 

availability.

 

 

 

 

 

3

Request

Sent by a client to request

DHCPRequest

 

 

addresses or configuration

 

 

 

settings from a specific server.

 

 

 

 

 

4

Confirm

Sent by a client to all servers

DHCPRequest

 

 

to determine if a client’s

 

 

 

configuration is valid for

 

 

 

the connected link.

 

 

 

 

 

5

Renew

Sent by a client to a specific

DHCPRequest

 

 

server to extend the lifetimes of

 

 

 

assigned addresses and obtain

 

 

 

updated configuration settings.

 

 

 

 

 

6

Rebind

Sent by a client to any server

DHCPRequest

 

 

when a response to the Renew

 

 

 

message is not received.

 

 

 

 

 

7

Reply

Sent by a server to a specific

DHCPAck

 

 

client in response to a Solicit,

 

 

 

Request, Renew, Rebind,

 

Information-Request, Confirm,

Release, or Decline message.

 

 

Chapter 8 Address Autoconfiguration

199

Table 8-1

DHCPv6 Message Types

 

 

 

 

 

 

 

 

 

 

Equivalent DHCP for

Msg-Type

Message

Description

IPv4 Message

 

8

Release

Sent by a client to indicate that

DHCPRelease

 

 

 

the client is no longer using an

 

 

 

 

assigned address.

 

 

 

 

 

 

 

9

Decline

Sent by a client to a specific

DHCPDecline

 

 

 

server to indicate that the

 

 

 

 

assigned address is already in use.

 

 

 

 

 

 

 

10

Reconfigure

Sent by a server to a client to

N/A

 

 

 

indicate that the server has

 

 

 

 

new or updated configuration

 

 

 

 

settings. The client then

 

 

 

 

sends either a Renew or

 

 

 

 

Information-Request message.

 

 

 

 

 

 

 

11

Information-Request

Sent by a client to request

DHCPInform

 

 

 

configuration settings (but not

 

 

 

 

addresses).

 

 

 

 

 

 

 

12

Relay-Forward

Sent by a relay agent to

N/A

 

 

 

forward a message to a server.

 

 

 

 

The Relay-Forward contains a

 

 

 

 

client message encapsulated as

 

 

 

 

the DHCPv6 Relay-Message

 

 

 

 

option.

 

 

 

 

 

 

 

13

Relay-Reply

Sent by a server to send a

N/A

 

 

 

message to a client through

 

 

 

 

a relay agent. The Relay-Reply

 

 

contains a server message encapsulated as the DHCPv6 Relay-Message option.

DHCPv6 options are formatted in type-length-value (TLV) format. Figure 8-5 shows the structure of DHCPv6 options.

Option-Code

Option-Len

Option-Data

• • •

Figure 8-5 DHCPv6 options

The following list describes the fields in a DHCPv6 option:

Option-Code This 2-byte field indicates the type of DHCPv6 option.

Option-Len This 2-byte field indicates the length of the Option-Data field in bytes.

Option-Data This variable-sized field contains the data for the option.

200 Understanding IPv6, Second Edition

There is a separate message structure for the messages exchanged between relay agents and servers to record additional information, such as the subnet from which the message originated so that the DHCPv6 server can determine the appropriate subnet prefix to assign to the client. Figure 8-6 shows the structure of DHCPv6 messages sent between relay agents and servers.

Msg-Type

Hop-Count

Link-Address

Peer-Address

Options

• • •

Figure 8-6 DHCPv6 messages between relay agent and server

The following list describes the additional fields in the DHCPv6 messages between relay and server:

Hop-Count This 1-byte field indicates the number of relay agents that have received the message. A receiving relay agent can discard the message if it exceeds a configured maximum hop count.

Link-Address This 16-byte field contains a non-link-local address that is assigned to an interface of the relay agent that is connected to the subnet on which the client is located. From the Link-Address field, the server can determine the correct address IPv6 scope from which to assign an address.

Peer-Address This 16-byte field contains the IPv6 address of the client that originally sent the message or the previous relay agent that relayed the message.

Beyond the Peer-Address field are DHCPv6 options that include the Relay Message option, which contains the message being relayed, and other relay options. The Relay Message option provides an encapsulation of the DHCPv6 messages being exchanged between the client and the server.

Because there are no broadcast addresses defined for IPv6, the use of the limited broadcast address for some DHCP for IPv4 messages has been replaced with the use of the All_DHCP_Relay_Agents_and_Servers address of FF02::1:2 for DHCPv6. For example, a DHCPv6 client attempting to discover the location of the DHCPv6 server on the network sends a Solicit message from its link-local address to FF02::1:2. If there is a DHCPv6 server on the host’s subnet, it receives the Solicit message and sends an appropriate reply. More typically, a DHCPv6 relay agent on the host’s subnet receives the Solicit message and forwards it to a DHCPv6 server.

Соседние файлы в папке Lecture 2_10