- Основы DHCP (протокол динамического конфигурирования узлов) DHCP (Dynamic Host Configuration Protocol) Basics
- Дополнительные сведения More Information
- DHCPDISCOVER DHCPDISCOVER
- дхкпоффер DHCPOFFER
- DHCPREQUEST DHCPREQUEST
- ТРАНСЛИРУЕТ DHCPACK
- DHCP (Dynamic Host Configuration Protocol) Basics
- More Information
- DHCPDISCOVER
- DHCPOFFER
- DHCPREQUEST
- DHCPACK
Основы DHCP (протокол динамического конфигурирования узлов) DHCP (Dynamic Host Configuration Protocol) Basics
Протокол DHCP — это стандартный протокол, определяемый RFC 1541 (который заменяется RFC 2131), позволяющий серверу динамически распределять IP-адреса и сведения о конфигурации клиентам. Dynamic Host Configuration Protocol (DHCP) is a standard protocol defined by RFC 1541 (which is superseded by RFC 2131) that allows a server to dynamically distribute IP addressing and configuration information to clients. Как правило, DHCP-сервер предоставляет клиенту по крайней мере следующие основные сведения: Normally the DHCP server provides the client with at least this basic information:
IP-адрес IP Address
Маска подсети Subnet Mask
Также могут быть предоставлены сведения о Гатевайосер по умолчанию, такие как адреса серверов службы доменных имен (DNS) и адреса серверов WINS. Default GatewayOther information can be provided as well, such as Domain Name Service (DNS) server addresses and Windows Internet Name Service (WINS) server addresses. Системный администратор настраивает DHCP-сервер с параметрами, которые анализируются на клиенте. The system administrator configures the DHCP server with the options that are parsed out to the client.
Дополнительные сведения More Information
Функции DHCP-клиента предоставляются в следующих продуктах Майкрософт: The following Microsoft products provide DHCP client functionality:
Windows NT Server версии 3,5, 3,51 и 4,0 Windows NT Server versions 3.5, 3.51, and 4.0
Windows NT Workstation версии 3,5, 3,51 и 4,0 Windows NT Workstation versions 3.5, 3.51, and 4.0
Windows 95 Windows 95
Microsoft Network Client версии 3,0 для MS-DOS Microsoft Network Client version 3.0 for MS-DOS
Клиент Microsoft LAN Manager версии 2.2 c для MS-DOS Microsoft LAN Manager Client version 2.2c for MS-DOS
Microsoft TCP/IP-32 для Windows для рабочих групп версии 3,11, 3.11 a и 3.11 b Microsoft TCP/IP-32 for Windows for Workgroups versions 3.11, 3.11a, and 3.11b
Разные DHCP-клиенты поддерживают различные параметры, которые они могут получить от DHCP-сервера. Different DHCP clients support different options that they can receive from the DHCP server.
Следующие операционные системы Microsoft Server предоставляют функции DHCP-сервера: The following Microsoft server operating systems provide DHCP server functionality:
Windows NT Server версии 3,5 Windows NT Server version 3.5
Windows NT Server версии 3,51 Windows NT Server version 3.51
Windows NT Server версии 4,0 Windows NT Server version 4.0
Когда клиент инициализируется в первый раз после настройки на получение данных DHCP, он инициирует диалог с сервером. When a client is initialized for the first time after it is configured to receive DHCP information, it initiates a conversation with the server.
Ниже приведена сводная таблица диалога между клиентом и сервером, за которой следует описание процесса на уровне пакета: Below is a summary table of the conversation between client and server, which is followed by a packet-level description of the process:
Ниже приведен подробный диалог между клиентом DHCP и DHCP-сервером. The detailed conversation between DHCP client and DHCP server is as follows:
DHCPDISCOVER DHCPDISCOVER
Клиент отправляет пакет DHCPDISCOVER. The client sends a DHCPDISCOVER packet. Ниже приведен фрагмент записи сетевого монитора, в которой показаны IP-и DHCP-части пакета DHCPDISCOVER. The following is an excerpt from a network monitor capture showing the IP and DHCP portions of a DHCPDISCOVER packet. В разделе IP-адреса можно увидеть адрес назначения 255.255.255.255, а исходный адрес — 0.0.0.0. In the IP section, you can see the Destination address is 255.255.255.255 and the Source address is 0.0.0.0. Раздел DHCP идентифицирует пакет как пакет обнаружения и идентифицирует клиент в двух местах, используя физический адрес сетевой карты. The DHCP section identifies the packet as a Discover packet and identifies the client in two places using the physical address of the network card. Обратите внимание, что значения в полях ЧАДДР и DHCP: Client identifier идентичны. Note the values in the CHADDR field and the DHCP: Client Identifier field are identical.
дхкпоффер DHCPOFFER
DHCP-сервер отвечает, отправляя пакет ДХКПОФФЕР. The DHCP server responds by sending a DHCPOFFER packet. В разделе IP фрагмента записи ниже исходный адрес теперь является IP-адресом сервера DHCP, а адресом назначения является широковещательный адрес 255.255.255.255. In the IP section of the capture excerpt below, the Source address is now the DHCP server IP address, and the Destination address is the broadcast address 255.255.255.255. Раздел DHCP определяет пакет как предложение. The DHCP section identifies the packet as an Offer. Поле ИАДДР заполняется IP-адресом, который сервер предлагает клиенту. The YIADDR field is populated with the IP address the server is offering the client. Обратите внимание, что поле ЧАДДР по-прежнему содержит физический адрес запрашивающего клиента. Note the CHADDR field still contains the physical address of the requesting client. Кроме того, в разделе поля параметров DHCP можно найти различные параметры, отправляемые сервером вместе с IP-адресом. Also, we see in the DHCP Option Field section the various options being sent by the server along with the IP address. В этом случае сервер отправляет маску подсети, шлюз по умолчанию (маршрутизатор), время аренды, адрес WINS-сервера (служба имен NetBIOS) и тип узла NetBIOS. In this case the server is sending the Subnet Mask, Default Gateway (Router), Lease Time, WINS server address (NetBIOS Name Service), and the NetBIOS Node Type.
DHCPREQUEST DHCPREQUEST
Клиент отвечает на ДХКПОФФЕР, отправляя DHCPREQUEST. The client responds to the DHCPOFFER by sending a DHCPREQUEST. В разделе IP-адресов записи ниже исходный адрес клиента по-прежнему равен 0.0.0.0, а место назначения пакета по-прежнему 255.255.255.255. In the IP section of the capture below, the Source address of the client is still 0.0.0.0 and the Destination for the packet is still 255.255.255.255. Клиент оставляет 0.0.0.0, так как клиент не получал проверку с сервера, что его можно использовать в предложенном адресе. The client retains 0.0.0.0 because the client hasn’t received verification from the server that it’s okay to start using the address offered. Назначением по-прежнему выполняется вещание, так как может быть получен ответ от нескольких DHCP-серверов и может храниться резервирование для предложения, сделанного клиентом. The Destination is still broadcast, because more than one DHCP server may have responded and may be holding a reservation for an Offer made to the client. Это позволяет другим DHCP-серверам понять, что они могут освободить свои предложенные адреса и вернуть их в доступные пулы. This lets those other DHCP servers know they can release their offered addresses and return them to their available pools. Раздел DHCP идентифицирует пакет как запрос и проверяет предложенный адрес с помощью поля DHCP: запрошенный адрес. The DHCP section identifies the packet as a Request and verifies the offered address using the DHCP: Requested Address field. В поле Идентификатор сервера DHCP: отображается IP-адрес DHCP-сервера, предоставляющего аренду. The DHCP: Server Identifier field shows the IP address of the DHCP server offering the lease.
ТРАНСЛИРУЕТ DHCPACK
DHCP-сервер отвечает на DHCPREQUEST с помощью DHCPACK, тем самым завершая цикл инициализации. The DHCP server responds to the DHCPREQUEST with a DHCPACK, thus completing the initialization cycle. Исходный адрес — это IP-адрес сервера DHCP, а адрес назначения по-прежнему — 255.255.255.255. The Source address is the DHCP server IP address, and the Destination address is still 255.255.255.255. Поле ИАДДР содержит адрес клиента, а поля ЧАДДР и DHCP: Client identifier являются физическим адресом сетевой карты в запрашивающем клиенте. The YIADDR field contains the client’s address, and the CHADDR and DHCP: Client Identifier fields are the physical address of the network card in the requesting client. Раздел параметров DHCP определяет пакет как подтверждение. The DHCP Option section identifies the packet as an ACK.
Если у клиента ранее был назначен IP-адрес DHCP и он перезапущен, клиент будет запрашивать ранее арендованный IP-адрес в специальном пакете DHCPREQUEST. If the client has previously had a DHCP assigned IP address and it is restarted, the client will specifically request the previously leased IP address in a special DHCPREQUEST packet. Адрес источника — 0.0.0.0, а местом назначения — широковещательный адрес 255.255.255.255. The Source address is 0.0.0.0 and the Destination is the broadcast address 255.255.255.255. Клиенты Майкрософт заполнят поле параметра DHCP DHCP: запрошенный адрес с ранее назначенным адресом. Microsoft clients will populate the DHCP Option Field DHCP: Requested Address with the previously assigned address. Строго совместимые с RFC клиенты заполняют поле ЦИАДДР с запрошенным адресом. Strictly RFC compliant clients will populate the CIADDR Field with the address requested. Сервер Microsoft DHCP будет принимать либо. The Microsoft DHCP server will accept either.
На этом этапе сервер может не отвечать на запросы. At this point, the server may or may not respond. Поведение DHCP-сервера Windows NT зависит от используемой версии операционной системы, а также от других факторов, таких как ограничение области. The behavior of the Windows NT DHCP server depends on the version of the operating system being used as well as other factors such as superscoping. Если сервер определяет, что клиент по-прежнему может использовать этот адрес, он будет либо в автоматическом режиме, либо на подтверждение DHCPREQUEST. If the server determines that the client can still use the address, it will either remain silent or ACK the DHCPREQUEST. Если сервер определяет, что у клиента не может быть адреса, он будет передавать НАКК. If the server determines that the client cannot have the address, it will send a NACK.
После этого клиент начнет процесс обнаружения, но пакет DHCPDISCOVER по-прежнему будет пытаться арендовать тот же адрес. The client will then begin the discover process, but the DHCPDISCOVER packet will still attempt to lease the same address. Во многих случаях клиент ТС получает один и тот же адрес, но не может. In many instances, tth client will get the same address but may not.
Сведения о DHCP, получаемые клиентом с DHCP-сервера, будут связаны со временем аренды. DHCP information obtained by the client from a DHCP server will have a lease time associated with it. Время аренды определяет, как долго клиент может использовать сведения, назначенные службой DHCP. The lease time defines how long the client can use the DHCP-assigned information. Когда аренда достигает определенных вех, клиент попытается обновить свои данные DHCP. When the lease reaches certain milestones, the client will attempt to renew its DHCP information.
Для просмотра сведений о IP-адресе в клиенте Windows или Windows для рабочих групп используйте служебную программу IPCONFIG. To view IP information on a Windows or Windows for Workgroups client, use the IPCONFIG utility. Если клиент является Windows 95, используйте WINIPCFG. If the client is Windows 95, use WINIPCFG.
DHCP (Dynamic Host Configuration Protocol) Basics
Dynamic Host Configuration Protocol (DHCP) is a standard protocol defined by RFC 1541 (which is superseded by RFC 2131) that allows a server to dynamically distribute IP addressing and configuration information to clients. Normally the DHCP server provides the client with at least this basic information:
Default GatewayOther information can be provided as well, such as Domain Name Service (DNS) server addresses and Windows Internet Name Service (WINS) server addresses. The system administrator configures the DHCP server with the options that are parsed out to the client.
More Information
The following Microsoft products provide DHCP client functionality:
Windows NT Server versions 3.5, 3.51, and 4.0
Windows NT Workstation versions 3.5, 3.51, and 4.0
Microsoft Network Client version 3.0 for MS-DOS
Microsoft LAN Manager Client version 2.2c for MS-DOS
Microsoft TCP/IP-32 for Windows for Workgroups versions 3.11, 3.11a, and 3.11b
Different DHCP clients support different options that they can receive from the DHCP server.
The following Microsoft server operating systems provide DHCP server functionality:
Windows NT Server version 3.5
Windows NT Server version 3.51
Windows NT Server version 4.0
When a client is initialized for the first time after it is configured to receive DHCP information, it initiates a conversation with the server.
Below is a summary table of the conversation between client and server, which is followed by a packet-level description of the process:
The detailed conversation between DHCP client and DHCP server is as follows:
DHCPDISCOVER
The client sends a DHCPDISCOVER packet. The following is an excerpt from a network monitor capture showing the IP and DHCP portions of a DHCPDISCOVER packet. In the IP section, you can see the Destination address is 255.255.255.255 and the Source address is 0.0.0.0. The DHCP section identifies the packet as a Discover packet and identifies the client in two places using the physical address of the network card. Note the values in the CHADDR field and the DHCP: Client Identifier field are identical.
DHCPOFFER
The DHCP server responds by sending a DHCPOFFER packet. In the IP section of the capture excerpt below, the Source address is now the DHCP server IP address, and the Destination address is the broadcast address 255.255.255.255. The DHCP section identifies the packet as an Offer. The YIADDR field is populated with the IP address the server is offering the client. Note the CHADDR field still contains the physical address of the requesting client. Also, we see in the DHCP Option Field section the various options being sent by the server along with the IP address. In this case the server is sending the Subnet Mask, Default Gateway (Router), Lease Time, WINS server address (NetBIOS Name Service), and the NetBIOS Node Type.
DHCPREQUEST
The client responds to the DHCPOFFER by sending a DHCPREQUEST. In the IP section of the capture below, the Source address of the client is still 0.0.0.0 and the Destination for the packet is still 255.255.255.255. The client retains 0.0.0.0 because the client hasn’t received verification from the server that it’s okay to start using the address offered. The Destination is still broadcast, because more than one DHCP server may have responded and may be holding a reservation for an Offer made to the client. This lets those other DHCP servers know they can release their offered addresses and return them to their available pools. The DHCP section identifies the packet as a Request and verifies the offered address using the DHCP: Requested Address field. The DHCP: Server Identifier field shows the IP address of the DHCP server offering the lease.
DHCPACK
The DHCP server responds to the DHCPREQUEST with a DHCPACK, thus completing the initialization cycle. The Source address is the DHCP server IP address, and the Destination address is still 255.255.255.255. The YIADDR field contains the client’s address, and the CHADDR and DHCP: Client Identifier fields are the physical address of the network card in the requesting client. The DHCP Option section identifies the packet as an ACK.
If the client has previously had a DHCP assigned IP address and it is restarted, the client will specifically request the previously leased IP address in a special DHCPREQUEST packet. The Source address is 0.0.0.0 and the Destination is the broadcast address 255.255.255.255. Microsoft clients will populate the DHCP Option Field DHCP: Requested Address with the previously assigned address. Strictly RFC compliant clients will populate the CIADDR Field with the address requested. The Microsoft DHCP server will accept either.
At this point, the server may or may not respond. The behavior of the Windows NT DHCP server depends on the version of the operating system being used as well as other factors such as superscoping. If the server determines that the client can still use the address, it will either remain silent or ACK the DHCPREQUEST. If the server determines that the client cannot have the address, it will send a NACK.
The client will then begin the discover process, but the DHCPDISCOVER packet will still attempt to lease the same address. In many instances, tth client will get the same address but may not.
DHCP information obtained by the client from a DHCP server will have a lease time associated with it. The lease time defines how long the client can use the DHCP-assigned information. When the lease reaches certain milestones, the client will attempt to renew its DHCP information.
To view IP information on a Windows or Windows for Workgroups client, use the IPCONFIG utility. If the client is Windows 95, use WINIPCFG.