Wednesday, November 25, 2009

DHCP Continued.....What happens when your DSL modem connects to internet????

Lets go little in deep and dig what is happening when you try to connect to internet using a DSL modem.

For more understanding, I would recommend to spend few minutes to read the next paragraph, and then go ahead and watch the rest of the page about what is happening deep inside wire.


 Let me walk through the STEP BY STEP path taken by the dsl router before it opens for a full fledged internet access:

•    Firstly the modem will start sending DHCP request and wait for the DCHP offer from the server.

•    In the mean time the Ethernet card(MAC) will not be silent and it will keep on be flooding packets for knowing the MAC address for the immediate port.

•    Secondly there is one more thing happening at this time, the DSL modem will send an IGMPv2 join message to the ISP.

Before I complicate the process with introducing two new protocols let me explain the fact that the DSL modem does hell lot of background process before it acquires an IP for it.

•    The Netbios-ns protocol will use UDP: 137 and registers itself with the layer-2 network with the host name(Here if I connect my laptop with modem then the name would be my_laptop_kalyan, nothing but the name I gave for my laptop in windows).
•    Along side this, the SSDP (sinple service discovery protocol will get the services given by ISP, the main thing to be noted here is that the protocol does not need a defined static IP for this communication, it does with out IP), SSDP provides a mechanism which network clients can use to discover network services. Clients can use SSDP with little or no static configuration.

Ahh !!! Now we can see a reply from the dhcp server………..

•    The DHCP server will send dhcp offer containing the ip-address for the client.
•    The address will be registered and once again the ARP will be resolved for knowing MAC addresses(remember we can see frequent arp requests flowing in card, just because of the arp timeouts).

I hope I have explained the process at least to some level of accuracy, please feel free to comment and correct mistakes……. 

                  !!!!!!!!!Now lets go ahead and see how the packets look !!!!!!!!!!!!

1.    As soon as you turn on your modem you can see the DHCP REQUEST being sent for an ip address to the nearest DHCP Server(located most probably at your ISP).

Let’s go deep into the wire and see what happens at this stage,


Above we can infer,

1.    Ip address of client 0.0.0.0 unknown and that of dest:255.255.255.255 as broadcast.
2.    Dhcp sends an request from client using UDP Port: 68(src) and Port: 67(dst)
3.    dhcp msg type: Request
4.    There are many parameters requested by the boot protocol to the dhcp server, some of the main items to be kept in mind are,
1.    subnet mask
2.    domain name
3.    dns server
4.    nbns server
5.    vebdor specific information
6.    Static route


Sunday, November 22, 2009

Dynamic Host Control Protocol.....

POST 1:  Just a very small introduction about DHCP

The DHCP server manages a pool of IP addresses and information about client configuration parameters such as default gateway, domain name, the DNS servers, other servers such as time servers, and so forth. On receiving a valid request, the server assigns the computer an IP address, a lease (length of time the allocation is valid), and other IP configuration parameters, such as the subnet mask and the default gateway. The query is typically initiated immediately after booting, and must complete before the client can initiate IP-based communication with other hosts. Depending on implementation, the DHCP server may have three methods of allocating IP-addresses:
  • dynamic allocation: A network administrator assigns a range of IP addresses to DHCP, and each client computer on the LAN has its IP software configured to request an IP address from the DHCP server during network initialization. The request-and-grant process uses a lease concept with a controllable time period, allowing the DHCP server to reclaim (and then reallocate) IP addresses that are not renewed (dynamic re-use of IP addresses).
  • automatic allocation: The DHCP server permanently assigns a free IP address to a requesting client from the range defined by the administrator. This is like dynamic allocation, but the DHCP server keeps a table of past IP address assignments, so that it can preferentially assign to a client the same IP address that the client previously had.
  • static allocation: The DHCP server allocates an IP address based on a table with MAC address/IP address pairs, which are manually filled in (perhaps by a network administrator). Only requesting clients with a MAC address listed in this table will be allocated an IP address.

Bootp uses manual mapping of mac address-ip address. DHCP is introduced to overcome the issues with bootp.

Please add your comments and share extra information you have. So that it will be helpful for the other viewers....


Download the below setup to your pc and check how dhcp server works !!!!!
 

Sample Lab Environment illustration


In the above lab setup you can find,

Routers R5,4,3,2 are acting as PCs having two connections to each ethernet switch.Each PC will be having two ports expecting dhcp assigned address from dhcp_server_7200.
The dhcp_server_7200 is having two address pools with 10.0.0.0 network and 192.168.1.0 network
respectively.

Once the network is ON, each PC will be getting an ip address from each pool.
The 192.168.1.0 pool is having very less lease time of 10mins "0 0 10", so the server will always be busy reallocating the
address.

The setup is still open for many enhancements !!
1.DHCP Relay.
2.DHCP Accounting.

~Kalyan
kaprakashr@gmail.com'

Remember you should have GNS3 to use the setup, in the download link. 
Download Click




~Kalyan
kaprakashr@gmail.com'