Networking Fundamentals —
IP Addressing & Services
IP addresses, IPv4 vs IPv6, public & private IPs, subnet masks, gateways, DHCP, hostnames, localhost, and DNS — everything a device needs to communicate on a network.
Why Do We Need IP Addresses?
From Part 1, we know every NIC has a MAC address — great for identifying devices on a local network. But MAC addresses are not practical for global communication. There is no hierarchy; routers cannot use them to determine where a device is located globally.
Just like sending a letter requires Country → State → City → Street → House Number, networks need a hierarchical location system. That system is called an IP Address.
What is an IP Address?
IP stands for Internet Protocol. An IP address identifies where a device is located on a network — think of it as a home address, while the MAC address is an identity card.
| Identifier | Analogy | Answers | Changes? |
|---|---|---|---|
| MAC Address | Identity Card | Who are you? | Never |
| IP Address | Home Address | Where are you? | Yes (can change) |
IPv4
IPv4 (Internet Protocol Version 4) is the most widely deployed version of IP. It uses 32 bits, written as four octets (0–255) separated by dots.
Example: 192.168.1.10 → four sections, each called an octet, each ranging from 0 to 255.
IPv4 allows 232 ≈ 4.3 billion addresses — a number that seemed enormous in the early days but has been exhausted by smartphones, laptops, tablets, and IoT devices.
Why Not IPv5?
IPv5 actually existed — it was assigned to the Internet Stream Protocol (ST-II), designed for audio streams, video streams, and real-time communications. It was never intended to replace IPv4 as the general Internet protocol, so IPv6 became the successor.
IPv6
IPv6 (Internet Protocol Version 6) was created specifically to solve IPv4 address exhaustion. It uses 128 bits — providing 2128 addresses, an unimaginably large number sufficient for every device on Earth many times over.
Example: 2001:0db8:85a3::8a2e:0370:7334
More Addresses
The primary reason IPv6 exists. Virtually unlimited address space.
Better Routing Efficiency
Internet routers handle routes more efficiently with IPv6 headers.
Simpler Allocation
Large address spaces simplify network design and eliminate NAT.
Built-In Modern Features
Designed with future networking requirements in mind from the start.
Public IP Addresses
A Public IP Address is globally unique and reachable from anywhere on the Internet. They are assigned by ISPs (Internet Service Providers). Your home router uses one public IP to represent the entire home network to the outside world.
Private IP Addresses
Private IPs are used inside local networks and are not routable on the public Internet. They exist because if every device needed a public IP, IPv4 would have been exhausted far sooner. Millions of networks can reuse the same private ranges internally.
| Range | Addresses | Typical Use |
|---|---|---|
| Range 1 | 10.0.0.0 – 10.255.255.255 | Large enterprise networks |
| Range 2 | 172.16.0.0 – 172.31.255.255 | Medium networks |
| Range 3 | 192.168.0.0 – 192.168.255.255 | Home & small office |
Static vs Dynamic IP Addresses
A static IP is configured manually and never changes — essential for servers, printers, routers, and cameras that must always be reachable at a predictable address. A dynamic IP is assigned automatically (via DHCP) and can change over time — used for phones, laptops, and home computers where flexibility matters more than predictability.
Subnet Mask
When a computer wants to communicate, it must first answer: is the destination on the same local network, or is it remote? The subnet mask answers this question.
A subnet mask divides an IP address into two parts: the Network Part (which network does this device belong to?) and the Host Part (which specific device within that network?).
Example: IP 192.168.1.10 with mask 255.255.255.0 means:
- ›Network Part: 192.168.1 (the first 24 bits, identified by 255.255.255)
- ›Host Part: .10 (the last 8 bits, identified by .0 in the mask)
Default Gateway
The Default Gateway is the network’s exit door — the device that handles traffic destined for outside your local network. Think of it like a highway entrance: you stay on local streets within your city, but to reach another city you use the highway. In networking, the gateway is that highway entrance.
When a computer determines (via subnet mask) that the destination is not local, it sends the packet to the Default Gateway, which then decides where to forward it next. The gateway is typically:
- ›Home Router — common in home networks
- ›Enterprise Router — used in business and campus networks
- ›Firewall Appliance — provides security and routing between networks
Gateway vs Bridge
Beginners often confuse these two. The key distinction: a bridge joins segments into one network; a gateway connects separate networks.
| Feature | Bridge | Gateway |
|---|---|---|
| OSI Layer | Layer 2 (Data Link) | Layer 3 and above |
| Address used | MAC Addresses | IP Addresses |
| Purpose | Join network segments | Connect different networks |
| Perspective | "These are really one network" | "These are separate networks — I'll route between them" |
| Analogy | Remove a wall → one large room | Keep rooms separate + add a controlled door |
DHCP
DHCP stands for Dynamic Host Configuration Protocol. Every device that joins a network needs four things: IP Address, Subnet Mask, Default Gateway, and DNS Server. Without DHCP, every device must be configured manually. With DHCP, a server (usually your router) assigns all of this automatically.
DHCP uses the DORA process — four messages between client and server:
| Step | Name | Who sends | Message |
|---|---|---|---|
| 1 | DISCOVER | Client → Broadcast | "Who can give me an IP?" |
| 2 | OFFER | Server → Client | "I can give you 192.168.1.100" |
| 3 | REQUEST | Client → Broadcast | "I want that address." |
| 4 | ACKNOWLEDGE | Server → Client | "It’s yours." |
Hostname
Humans dislike remembering IP addresses. A hostname is a human-readable name assigned to a device — instead of remembering 192.168.1.50, you use SATWIK-LAPTOP. Hostnames make systems easier to identify in logs, configurations, and network tools.
Localhost
Localhost means this computer itself. When software communicates with localhost, it is communicating with services running on the same machine — no network traffic leaves the computer. This is essential for developers running local web servers, testing APIs, and database development without requiring a network connection.
127.0.0.1
127.0.0.1 is the special IPv4 loopback address — the actual IP that represents localhost. It always points back to the local machine and allows software to test and run without touching the network at all.
Testing Software
Run and test applications without needing a real network.
Local Web Servers
Develop websites locally before deploying to the Internet.
Database Development
Connect to local database instances during development.
Troubleshooting
Verify that network software is working at the application layer.
Introduction to DNS
Imagine typing 142.250.193.14 instead of google.com every time. DNS (Domain Name System) solves this.
DNS converts human-readable domain names into IP addresses that computers use — exactly like your phone’s contacts book converts "Mom" into a phone number. You remember the name; the system looks up the number.
Part 2 Summary
- IP Address — identifies where a device is on a network (location, like a home address). IP = Internet Protocol.
- IPv4 — 32-bit, four octets (0–255), ~4.3 billion addresses. Most widely deployed.
- IPv5 — assigned to Internet Stream Protocol (ST-II); never replaced IPv4. IPv6 did.
- IPv6 — 128-bit, 2³²⁸ addresses. Created to solve IPv4 exhaustion. Adds routing efficiency & modern features.
- Public IP — globally unique, routable on Internet, assigned by ISP. Example: 8.8.8.8.
- Private IP — used inside local networks, not routable publicly. Three ranges: 10.x.x.x, 172.16–31.x.x, 192.168.x.x.
- Static IP — never changes, manually configured. For servers, printers, routers, cameras.
- Dynamic IP — assigned automatically by DHCP, can change. For phones, laptops, home computers.
- Subnet Mask — divides IP into Network Part + Host Part; determines if destination is local or remote.
- Default Gateway — network’s exit door; handles all traffic destined outside the local network.
- Bridge vs Gateway — bridge joins segments (Layer 2, MAC); gateway connects networks (Layer 3+, IP).
- DHCP — auto-assigns IP, Subnet Mask, Gateway, DNS. DORA process: Discover → Offer → Request → Acknowledge.
- Hostname — human-readable device name (SATWIK-LAPTOP) replacing hard-to-remember IP addresses.
- Localhost / 127.0.0.1 — loopback address; refers to "this computer itself". No network traffic leaves.
- DNS — Domain Name System; converts google.com to 142.250.x.x. The Internet’s contacts book.
Networking Fundamentals — Part 2: IP Addressing, Configuration & Services