operazioni messaggi dhcpSalve a tutti, scrivo per chiarire un comportamento del DHCP in relazione ai messaggi Unicast o Broadcast nelle fasi DHCPoffer e DHCPack. L'RFC 2131 - Dynamic Host Configuration Protocol, stabilisce effettivamente che durante lo scambio
di tali messaggi il client, ancora sprovvisto della configurazione IP necessaria al corretto funzionameto dello stack protocollare TCP/IP, faccia un uso creativo del software TCP/IP ed inoltri al livello IP qualunque pacchetto ricevuto verso l'indirizzo hardware del client (ovvero il DHCP server utilizzerà l'indirizzo IP contenuto nell'offerta vera e propria - livello applicativo, campo YIADDR - anche come destinazione a layer 3. Il client dal canto suo, riconoscendosi come destinazione a layer 2 praticamente dovrebbe ignorare il check a layer 3). Cito il passaggio:


In the case of a client using DHCP for initial configuration (before the client's TCP/IP software has been completely configured), DHCP requires creative use of the client's TCP/IP software and liberal interpretation of RFC 1122. The TCP/IP software SHOULD accept and forward to the IP layer any IP packets delivered to the client's hardware address before the IP address is configured; DHCP servers and BOOTP relay agents may not be able to deliver DHCP messages to clients that cannot accept hardware unicast datagrams before the TCP/IP software is configured.To work around some clients that cannot accept IP unicast datagrams before the TCP/IP software is configured as discussed in the previous paragraph, DHCP uses the 'flags' field [21].


Tuttavia, poichè i client potrebbero non essere in grado di svolgere l'operazione appena descritta, si è lasciata la possibilità di utilizzare comunque il Broadcast. Se il client non fosse dunque in grado di gestire tale operazione, in fase di DHCPdiscover ha la possibilità si settare un particolare bit nel campo flag del messaggio, il bit del broadcast, indicando al server la volontà di ricevere sia DHCPoffer che DHCPack (come pure DHCPnack in caso di rifiuto) in Broadcast. Ovviamente, tale broadcast sarà sia di layer 3 che di layer 2 (255.255.255.255 - FFFF:FFFF:FFFF). Riporto anche qui l'RFC:

Normally, DHCP servers and BOOTP relay agents attempt to deliver DHCPOFFER, DHCPACK and DHCPNAK messages directly to the client using unicast delivery.  The IP destination address (in the IP header) is set to the DHCP 'yiaddr' address and the link-layer destination address is set to the DHCP 'chaddr' address.  Unfortunately, some client implementations are unable to receive such unicast IP datagrams until the implementation has been configured with a valid IP address (leading to a deadlock in which the client's IP address cannot be delivered until the client has been configured with an IP address).A client that cannot receive unicast IP datagrams until its protocol software has been configured with an IP address SHOULD set the BROADCAST bit in the 'flags' field to 1 in any DHCPDISCOVER or DHCPREQUEST messages that client sends.  The BROADCAST bit will provide a hint to the DHCP server and BOOTP relay agent to broadcast any messages to the client on the client's subnet.  A client that can receive unicast IP datagrams before its protocol software has been configured SHOULD clear the BROADCAST bit to 0. The BOOTP clarifications document discusses the ramifications of the use of the BROADCAST bit [21].

Info: Nell'IOS Cisco, qualora un'interfaccia di un router fosse settata come DHCP client, si potrebbe forzare l'utilizzo dei messaggi unicast con il comando globale no ip dhcp-client broadcast-flag



jpJody Palombi

E' un istruttore Cisco, specializzato in tecnologie di Routing & Switching e Service Provider. Appassionato di Networking e tecnologia in generale, ama condividere le proprie conoscenze, ed ha scelto per tale motivo la carriera di formatore. Attualmente è in possesso delle certificazioni industriali Cisco CCENT, CCNA, CCNP Enterprise, CCNP Collaboration e CCNP Service Provider.
Logo IpCert piramide

Contatti

     328 37 84 030
   0775 16 26 500
   [email protected]

RICHIESTA INFORMAZIONI


DEMO GRATUITA CORSO CCNA

Puoi richiedere l'accesso alle prime 3 ore di lezioni e al materiale didattico del corso CCNA online, senza costi e senza alcun vincolo di acquisto.


Vuoi attivare la DEMO e ricevere via mail le credenziali di accesso?