Tuesday, November 1, 2011

New device connects to a network..what's next?

 The following case is if the IP address is not statically assigned: 

      At first, this was a hard concept for me to understand.  It seems so simple, but it wasn't until a random day in the shower did it all click for me.  Say for instance you have machine A.  Machine A has no IP address, but has a MAC address (assuming).  Upon connecting to the network, machine A will broadcast a DHCPDISCOVER message.  If there is a DHCP server on the particular subnet, the DHCP will send a DHCPOFFER message.  This message contains the client's MAC address, the IP address that the server is offering, the subnet mask, the lease duration, and the IP address of the DHCP server making the offer.  While a machine can review multiple offers, it can only accept one.  After deciding on which DHCPOFFER to accept, the client will send out a broadcast DHCPREQUEST packet, which tells the DHCP servers not selected to return the offered addresses back to their pool.  This message is a broadcast versus unicast because the client still doesn't have an IP address.  Once the selected DHCP server receives the DHCPREQUEST, it will send a DHCPACK packet back to the client.  This packet includes the lease duration and any other configuration information that the client might have requested. At this point, the IP configuration process is completed.
     Now where this can become confusing, is when the DHCP server does not reside on the same subnet as the requesting client.  Obviously, if you were to have multiple subnets, having a DHCP server on every subnet becomes impractical.  To overcome this, we can use IP helper-addresses to essentially tell the forwarding router where the DHCP server resides.  Because DHCP clients use BOOTP packets that are broadcasted to all hosts(255.255.255.255) and it will be all dropped by the router. The "ip helper-address" command makes the router to forward BOOTP broadcast packets to the specific remote DHCP server.









In regards to the example on the left, we would need to implement the IP helper-address on Router A, because the subnet on which the DHCP server sits is on a different subnet, essentially invisible to the DHCP client. 





No comments:

Post a Comment