Understanding DHCP: The Invisible Hand Behind Your Network Connections

SATYASATYA
3 min read

In this blog, we'll dive into what a DHCP server is, how the DHCP protocol works, and why understanding it is crucial. This curiosity began when I met a boy whose inquisitive mind sparked my interest in exploring new dimensions of technology.

Function

The Dynamic Host Configuration Protocol (DHCP) is used to automatically assign IP addresses and other network settings to devices on a network. When you connect your computer to a network, it acts as a DHCP client, requesting an IP address from the DHCP server.

Assignment Process

The DHCP server maintains a pool of available IP addresses. When your computer connects to the network, it sends a request to the DHCP server, which assigns an available IP address from its pool for a specified lease period.

Generally, the lease time is in <uint32> format, which when converted, typically equals 24 hours.

Are the DHCP Server's IP and Your Computer's IP the Same?

No.

Why Are the DHCP Server's IP and Your Computer's IP Different?

  • DHCP Server: It has a static IP address. This is necessary because devices on the network need a consistent address to request IP configuration from. If the DHCP server's IP changed dynamically, it would be difficult for devices to locate and request an IP address from it.

  • Computer's IP: The IP assigned to your computer can change dynamically. This is because the DHCP server leases IP addresses for a limited time. When the lease expires, the IP address can be reassigned to another device, ensuring efficient use of available addresses.

How to Get Your DHCP, IP, and Other Details

ipconfig getifaddr en0

ipconfig getpacket en0

The output will include the following details:

Server_identifier (IP) => IP of DHCP
yiaddr => IP of your device
lease_time (uint32) => Lease time of the assigned IP
chaddr => Device address

Does My Computer's IP Change When I Switch Wi-Fi Networks?

Yes, your computer's IP will change when you switch from one Wi-Fi network to another. Each network usually has its own DHCP server that assigns IP addresses.

Where Is the DHCP Server Actually Running?

DHCP can run on routers, network servers, or even your Internet Service Provider (ISP).

If My IP Changes, How Can People Track Me?

IP Address Tracking: When you connect to the internet, your device sends data packets that include your IP address. This allows servers to know where to send responses back to your device.

  • Every time you visit a website or send data, your IP is logged by the server and potentially by your ISP.

Tracing Across Different Networks: If not by IP, you can be tracked through your MAC address, cookies, tracking data, or via legal requests to ISPs and network providers to obtain IP address logs.

Protecting Your Privacy

  • Use a VPN: A Virtual Private Network will mask your IP address by routing your internet traffic through a VPN server.

  • Private Browsing: While this reduces stored data, it does not protect against IP address tracking.


If you enjoyed this explanation or found it helpful, don't forget to like, comment, and share.
Subscribe for more insightful content!

0
Subscribe to my newsletter

Read articles from SATYA directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

SATYA
SATYA

Hey there! I'm Satya. I love exploring different aspects of tech and life, and I enjoy sharing what I learn through stories and real-life examples. Whether it's web development, DevOps, networking, or even AI, I find joy in breaking down complex ideas into simple, relatable content. If you're someone who loves learning and exploring these topics, I'd be really glad if you followed me on Hashnode. Let's learn and grow together! ๐Ÿ˜Š