Day6 CN-ARP and DHCP Protocol #100DaysofHacking
Day1 : Installing Kali Linux
Day 2: Navigating Linux
Day3: Computer Networking
Day4: Network Topologies
Day5: Subnetting
Github: 100DaysofHacking
Hello Everyone, This is Ayush if you haven’t read the previous blog then please read it by clicking on above link in which we have discussed important concepts which is necessary for further blogs.
Now today in this blog we are gonna talk about two important protocols ARP and DHCP.
Till now we have seen basics of computer networking, different network topologies, subnetting and one thing is clear that in a network there are two identifiers IP and MAC Address which identify any device on a network.
ARP: Address Resolution Protocol
ARP: ARP stands for Address Resolution Protocol which is used to associate device MAC address with IP address.
Suppose you are sending data from your computer to another computer on your network and the message is first sent to the switch and then switch forwards it to the destination , so here switch takes decision on MAC address not on IP address. (Data which comes to switch contains both IP and MAC)
In above case sender knows both the IP address and MAC address, now let’s see another scenario, suppose sender doesn’t know the MAC address of receiver, so in this case what will happen ????
In this case sender will broadcast an ARP request to all devices within LAN asking devices who has assigned the destination IP address. So, only the device who has the particular IP address will respond with his/her MAC address.

In the above image you can see Sender 34.40.21.17 is asking for the MAC address of 34.40.21.20 and then 34.40.21.20 is responding with his MAC address. So in this way ARP protocol works.
Once Device will receive the MAC address then it’ll store in the ARP-Cache.
ARP-Cache is a collection of ARP entries that are created when IP address is resolved to the MAC address. Whenever we try to send packet/data to IP address first system for MAC address in the arp-cache store. If their is no entry then further action takes place which we saw above.
To see ARP-Cache, you can enter:
For windows:
arp -a
One more thing whenever sender broadcasts the message for MAC it’s called ARP-Request and whenever receiver sends his MAC to sender then it’s called ARP-Reply
Simulation:
Now in the above video you can see PC1 wants to send message to PC2 but PC1 hasn’t any arp entry so it sends broadcast message to everyone and then PC2 responds with his/her MAC address and then MAC address is added in the AP table, after that for every communication PC1 doesn’t do broadcast.
I hope concept of ARP is clear now after watching above video . Now moving forward let’s talk about DHCP.
DHCP: Dynamic Host Configuration
DHCP stands for Dynamic Host Configuration.
DHCP is configured as an IP service on network to automatically provide an available IP address to client devices.
With the help of DHCP, network administrator no need to assign IP manually.
Working:
When a device connects to a network if it has not already been manually assigned an IP address, it sends out a request (DHCP Discover) to see if any DHCP servers are on the network. The DHCP server then replies back with an IP address the device could use (DHCP Offer). The device then sends a reply confirming it wants the offered IP Address (DHCP Request), and then lastly, the DHCP server sends a reply acknowledging this has been completed, and the device can start using the IP Address (DHCP ACK).
Discover: Finds DHCP Server in network
Offer: Gives , IP address to client.
Request: Confirmation
ACK: Device can start using IP address

Now I hope both ARP and DHCP is clear to you.
Thank you for your time for reading this, if you have any doubt then please respond on this blog.
Thank You and Happy Hacking !