Menu

Earn Premium with Referrals

Invite your friends and earn Premium rewards through our referral program.

See how it works and start inviting friends.

IP Addressing (IPv4)
CN

IP Addressing (IPv4)

Master the structure of IPv4, Network IDs, and the difference between Public and Private IPs.

The Network Layer (Layer 3) is responsible for end-to-end delivery across multiple networks. The IP address is the logical identifier that makes this possible.

IPv4 Structure

32-bit address written as four decimal octets: 192.168.1.1

Bits0-78-1516-2324-31
Octet19216811

Every IP address has two parts:

  • Network ID — identifies the network segment
  • Host ID — identifies the specific device on that network

The boundary between network and host is determined by the subnet mask (e.g., 255.255.255.0 = 24 network bits, 8 host bits).

Public vs Private IP Addresses

Private IP ranges (defined in RFC 1918, not routable on the internet):

RangeCIDRUse
10.0.0.010.255.255.255/8Large enterprise networks
172.16.0.0172.31.255.255/12Medium networks
192.168.0.0192.168.255.255/16Home/Small office (default for most routers)

Public IPs are globally unique and assigned by ISPs. Private IPs are reusable across networks — billions of home routers use 192.168.1.x.

Special Addresses

AddressPurpose
127.0.0.1 (localhost)Loopback — test the local network stack
0.0.0.0Default route / “all addresses”
255.255.255.255Limited broadcast
Network address (host bits all 0)Identifies the network itself
Broadcast address (host bits all 1)All devices on the network

Q: Why do we need public IP addresses?

A: Public IPs are globally unique and routable on the internet. Any server providing services must have a public IP so clients worldwide can reach it.

Q: What is the benefit of using private IP addresses?

A: Address reuse — the same 192.168.1.x can be used in millions of homes without conflict. Also security — private IPs are not directly reachable from the internet (they require NAT).

Q: What are the two parts of an IP address?

A: The Network ID (identifies the subnet) and the Host ID (identifies the specific device). The subnet mask defines the boundary between them.

My Private Notes

Notes are auto-saved locally to this device.