HOW'S ROUTER WORKING? DHCP
Hello guys.
Today we're talkin' about DHCP protocol. Btw, our network can't work without it.
For now we're known that NAT routin' our packages between global and local networks. But how's computers and servers see each other in local network?
Let's talk about it!
I'll clarify again that all computers must have an address, u may know it already, but since networks are mutli-level - at each level their own IP addresses are distibuted.
How it's works?
U're runnin' ur router, installin' wireless network and connectin' to it with ur smartphone, for example.
So that get an IP address ur smartphone (or rather it DHCP client) sendin' an request on broadcast address (it known by netmask), DHCP server of ur router see and respond on that request. In that case, when DHCP server doesn't respond at all, your phone will be assigned a different address from your settings.
IN A MORE TECHNICAL PLANE
When u're set up ur router, u're installin' network (for example 192.168.1.1 with netmask 24) and maximum of addresses in ur network (for example from 2 to 10)
U're connectin' ur phone to the network:
1. Smartphone sendin' a request to broadcast address (in our case, it's 255.255.255.0).
2. DHCP server responsin' on it request on MAC address, and say that he've an free address, and sendin' settings into response.
3. Smartphone get that settings and sendin' response, when said that he's applyin' it.
4. DHCP server again confirm, that smarphone can take that address.
It usin' the BOOTP protocol of TCP/IP stack and UDP protocol for tranportation which works on 67 port number for server and 68 for client.
It usin' the BOOTP protocol of TCP/IP stack and UDP protocol for tranportation which works on 67 port number for server and 68 for client.
That's sequence can be different, so not every time we've only 4 requests. U can set ur server for 2 requests, u can do it as u want.
Four requests made for better security and stability of a network. Because of we've risk of distortion of address while it broadcast, or in a situation when two addresses are received from two DHCP servers, so that another DHCP server, in the absence of a response, marks the address as unused.
So here we've several variants of DHCP server work, right like with NAT case.
1. Fixed - it when we've strongly hardcoded one IP address for one MAC address.
2. Dynamic (it in our case, and, probably in ur network) - this is when our device can get any address of free addresses.
Btw, DHCP protocol workin' on client-server model of architecture.
Multi-vector architecture client-server - it's variety client-server architecture, which function of processin' of our data is moved to one or several servers :)
Our twitter: @derkodierer
Great article, explained a lot for me
ReplyDelete