Share via


4 Protocol Examples

The message exchanges described for DHCPv4 are specified in [RFC2131] section 3. Message exchanges for DHCPv6 are specified in [RFC3315]. The message sequences and the operation of DHCPv4 (as specified in [RFC2131] section 4.1) and DHCPv6 (as specified in [RFC3315]) are unchanged by this extension.

In this example, an administrator wants to prevent clients from using NetBIOS over TCP/IP on the local network.

  1. The administrator configures the DHCPv4 server to send Vendor-specific Option number 1 with option value as 2, as specified in section 2.2.2.1, to the DHCPv4 clients.


    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    1
    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    2
    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    3
    0


    1

    Vendor-specific Option
    Code = 0x01

    Vendor-specific Option
    Length = 0x04

    Vendor-specific Option Data = 0x0000

    0x0002

  2. The DHCPv4 client joins the network and sends a DHCPDISCOVER message that includes a Vendor Class Identifier Option. For instance, the DHCPv4 client sends the vendor class as "MSFT 5.0".


    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    1
    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    2
    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    3
    0


    1

    Option Code = 0x3C

    Option Length = 0x08

    Value = "MS"

    "FT5"

    ".0"

  3. The DHCPv4 server ignores the Vendor Class Identifier Option and responds with a DHCPOFFER message. It does not include any option defined in this specification in the DHCPOFFER message. The DHCPv4 client accepts the offer by sending a DHCPREQUEST message again that includes the Vendor Class Identifier Option as before.

  4. The DHCPv4 server recognizes the value in the Vendor Class Identifier Option in the DHCPv4 message from the client and sends a DHCPACK message that includes Vendor-specific Option number 1 as previously shown.

  5. The DHCPv4 client will receive this Vendor-specific Option from the DHCPv4 server and disable the use of NetBIOS over TCP/IP.

In another example, an administrator wants DHCPv4 clients on the local network to release the DHCPv4 address lease when the machine is shut down.

  1. The administrator can configure the DHCPv4 server to send Vendor-specific Option number 2 with value 1, as described in section 2.2.2.2, to the DHCPv4 clients.


    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    1
    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    2
    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    3
    0


    1

    Vendor-specific Option Code = 0x02

    Vendor-specific Option Length = 0x04

    Vendor-specific Option Data = 0x0000

    0x0001

  2. The DHCPv4 client joins the network and sends a DHCPDISCOVER message that includes a Vendor Class Identifier Option. For instance, the DHCPv4 client can send the vendor class as "MSFT 5.0".

  3. The DHCPv4 server ignores the Vendor Class Identifier Option and responds with a DHCPOFFER message. It does not include any option defined in this specification in the DHCPOFFER message. The DHCPv4 client accepts the offer by sending a DHCPREQUEST message again that includes a Vendor Class Identifier Option as before.

  4. The DHCPv4 server recognizes the value in the Vendor Class Identifier Option in the DHCPv4 message from the client and sends a DHCPACK message that includes Vendor-specific Option number 2 as previously shown.

  5. The DHCPv4 client will receive this Vendor-specific Option from the DHCPv4 server and release its DHCPv4 address lease when the machine is shut down.

In another example, an administrator wants to change the router metric used by DHCPv4 clients connecting to the local network.

  1. The administrator configures the DHCPv4 server to send Vendor-specific Option number 3 with the desired routing metric (say 10), as specified in section 2.2.2.3, to the DHCPv4 clients.


    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    1
    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    2
    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    3
    0


    1

    Vendor-specific Option Code = 0x03

    Vendor-specific Option Length = 0x04

    Vendor-specific Option Data = 0x0000

    0x000A

  2. The DHCPv4 client joins the network and sends a DHCPDISCOVER message that includes a Vendor Class Identifier Option with, for example, the value "MSFT 5.0".

  3. The DHCPv4 server ignores the Vendor Class Identifier Option and responds with a DHCPOFFER message. It does not include any option defined in this specification in the DHCPOFFER message. The DHCPv4 client accepts the offer by sending a DHCPREQUEST message again that includes a Vendor Class Identifier Option as before.

  4. The DHCPv4 server recognizes the Vendor Class Identifier Option in the DHCPv4 message from the client and sends a DHCPACK message that includes Vendor-specific Option number 3 as shown previously.

  5. The DHCPv4 client will receive this Vendor-specific Option from the DHCPv4 server and use the appropriate router-metric value (in this example, 10) as specified by the DHCPv4 server on that network interface.

If an administrator wants to send Vendor-specific Information to clients through DHCPv6 on the local network, this can be done based on the vendor class identifier.

  1. The administrator configures the DHCPv6 server to send the desired information to clients if the vendor-class identifier received from the client is "MSFT 5.0" as described previously.

  2. The DHCPv6 client joins the local network and sends a DHCPv6 Solicit message that includes a Vendor Class Option (section 2.2.5). For instance, the DHCPv6 client sends the vendor-class data as "MSFT 5.0".


    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    1
    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    2
    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    3
    0


    1

    Option_Code = 0x0010

    Option_Length = 0x000E

    Enterprise_Number = 0x00000137

    Vendor_Class_Data_Length = 0x0008

    Data String = "MS"

    "FT 5"

    ".0"

  3. The DHCPv6 server ignores the Vendor Class Option and responds with a DHCPv6 Advertise message. The DHCPv6 client accepts the offer by sending a DHCPv6 Request message, again including a Vendor Class Option as before.

  4. The DHCPv6 server interprets the vendor-class identifier sent by the DHCPv6 client in the DHCPv6 Request message and sends the appropriate standard options to the DHCPv6 client in the DHCPv6 Reply message. Depending on the DHCPv6 server configuration, the option values selected by the server for inclusion in the Reply message are based on the Vendor Class Option value sent by the client in the Request message.

  5. The DHCPv6 client receives and applies the option information sent by the DHCPv6 server.

In another example, an administrator wants to send specific information to DHCPv4 clients on the local network when the administrator sends the DHCPv4 message as a BOOTP message.

  1. In this case, the administrator can configure the DHCPv4 server to look for the User-Class option containing a User-Class subpacket with the value "BOOTP" (as described in section 2.2.6) in the DHCPv4 message sent by the DHCPv4 client. If the message contains this user-class subpacket, the DHCPv4 server is configured to respond with the desired information that the administrator wants to send to the DHCPv4 client.


    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    1
    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    2
    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    3
    0


    1

    Option Code = 0x4D

    Option Length = 0x06

    Value Length = 0x05

    Value = "B"

    "OOTP"

  2. DHCPv4 clients that send a DHCPv4 message as a BOOTP message (see [RFC1534] section 2) will include a User Class Option in the message containing the User Class subpacket with the value "BOOTP" as previously shown. Thus, if the DHCPv4 server is configured as explained previously, the DHCPv4 client will receive the desired information in the response from the server.

As an example of the use of the Microsoft Classless Static Route Option, see the examples on pages 4 and 5 of [RFC3442], with the only difference being that the code used for this option is 249 instead of option code 121, used in [RFC3442].

In another example, say that an administrator wants to send Vendor-specific Information through DHCPv4 to a DHCPv4 client on the local network as DHCPv4 Vendor-Specific Information Option 43 (0x2B). However, this information, when encapsulated in Option 43 as per [RFC2132], is 600 bytes, exceeding the 255-byte limit of a DHCPv4 option length.

  1. The administrator configures the DHCPv4 server to send Vendor-specific Options to the client.

  2. The DHCPv4 client joins the network and sends a DHCPDISCOVER message that includes a Vendor Class Identifier Option with, for example, the value "MSFT 5.0".

  3. The DHCPv4 server ignores the Vendor Class Identifier Option and responds with a DHCPOFFER message. It does not include any option defined in this specification in the DHCPOFFER message. The DHCPv4 client accepts the offer by sending a DHCPREQUEST message again, including the Vendor Class Identifier Option as before.

  4. The DHCPv4 server recognizes the value in the Vendor Class Identifier Option in the DHCPv4 message from the client and sends a DHCPACK message that includes the Vendor-Specific Information option with the desired value as configured by the administrator, while formatting it as described in section 2.2.9, by sending Option 43 (0x2B) of size 255 bytes, followed by Option 250 with the next 255 bytes, and then again Option 250 with the remaining 90 bytes.

    0

    1

    2

    3

    4

    5

    6

    7

    8

    9

    1

    0

    1

    2

    3

    4

    5

    6

    7

    8

    9

    2

    0

    1

    2

    3

    4

    5

    6

    7

    8

    9

    3

    0

    1

    DHCPv4 Option Code = 0x2B

    Length = 0xFF

    First 255 bytes of option data

    ...

    ...

    DHCPv4 Option Code 250 – Long Options Packet = 0x2B

    Length = 0xFF

    ...

    Second 255 bytes (bytes 256-510) of option data

    ...

    ...

    DHCPv4 Option Code 250 – Long Options Packet = 0xFA

    Length = 0x5A

    Last 90 bytes of option data

    ...

  5. DHCPv4 clients on the local network that initiate a DHCPv4 transaction with the preceding server will thus receive the configured Vendor-specific Information that exceeds 255 bytes. Similarly, standard option values that exceed 255 bytes can also be sent to clients by formatting the options as described in section 2.2.9.

The following example demonstrates the use of User Class option when a user wants to see all User Classes configured on DHCPv4 server by an administrator.

  1. The administrator configures a User Class on the DHCPv4 server with name as "test", description as "desc" and binarydata as "123".

  2. When a DHCPv4 client gets connected in this network, the client gets the IP and other configuration information from the DHCPv4 server.

  3. The user instructs the DHCPv4 client in an implementation-specific manner to retrieve all User Classes on the DHCPv4 server. The DHCPv4 client sends a DHCPINFORM packet containing the Option 55 to theDHCPv4 server requesting Option 77, shown as follows.


    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    1
    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    2
    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    3
    0


    1

    Option Code = 55

    Option Length = 1 byte

    Option Requested = 77

  4. In the reply to the DHCPINFORM packet, the server sends DHCPACK with the Option 77 record in it. The format of the option record is as follows.


    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    1
    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    2
    0


    1


    2


    3


    4


    5


    6


    7


    8


    9

    3
    0


    1

    Option Code = 77

    Option Length = 30 bytes

    User Class Binary Data Length = 3

    '1'

    '2'

    '3'

    '\0' (Padding)

    User Class Name Length = 10 (0x0A)

    '\0'

    'T'

    '\0'

    'E'

    '\0'

    'S'

    '\0'

    'T'

    '\0'

    '\0'

    User Class Description Length = 10 (0x0A)

    '\0'

    'D'

    '\0'

    'E'

    '\0'

    'S'

    '\0'

    'C'

    '\0'

    '\0'