核心 · Key Idea
In one line: An IP address is a 32-bit integer that uniquely identifies a host's location on a network. Every packet header on the internet says "from this IP, to that IP".
What it is#
192.168.1.10 is the 32-bit integer split into 4 bytes and written in decimal:
11000000 . 10101000 . 00000001 . 00001010
192 . 168 . 1 . 10
IPv4 encodes 2³² ≈ 4.3 billion addresses, already long exhausted (hence NAT and IPv6).
Analogy#
打个比方 · Analogy
An IP address is a house number. Knowing the number isn't enough — the postal system needs to know which city, neighbourhood, building, unit — and IP splits address into "network part + host part" exactly to solve this.
Key concepts#
Public IPPublic IP
Globally unique, reachable from the internet. Usually ISP-assigned and often dynamic.
Private IPPrivate IP
RFC1918 ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. Home/office LANs use these.
LoopbackLoopback
127.0.0.1 — always your own machine; never leaves the NIC.
BroadcastBroadcast
The .255 (or last) address in a subnet — send once to all hosts.
ReservedReserved
0.0.0.0 (any), 169.254.x.x (link-local), 224.x.x.x (multicast).
How it works#
When sending: destination on the same subnet → deliver directly. Otherwise → send to the default gateway.
Practical notes#
ifconfig/ip addrshow local IPs;ipconfigon Windows.- Public IPs aren't necessarily fixed. Home broadband typically gets a dynamic one; rebooting the modem can change it.
- 192.168.x.x is almost certainly private. Private IPs can't route on the internet — NAT is required to leave.
0.0.0.0listening means "all interfaces"; as a destination it means "unspecified".127.0.0.1never leaves the NIC. Listening on 0.0.0.0 vs 127.0.0.1 is two very different security postures.
Easy confusions#
IP address
**Logical address**, mutable.
For inter-subnet routing.
For inter-subnet routing.
MAC address
**Physical address**, baked into the NIC.
Only meaningful within a subnet.
Only meaningful within a subnet.
Further reading#
- MAC addresses / ARP
- Subnet & CIDR
- NAT — how private IPs reach the internet