Explainer

What Is an IP Address? IPv4 vs IPv6

An IP address is the logical Layer 3 (Network layer) address that identifies a device on a network and tells the network where to deliver its traffic. It works like a mailing address for data: it says both who a host is and, just as importantly, where it lives so routers can move packets toward it.

The two versions you'll meet are IPv4 (the older 32-bit format written as four numbers, like 192.168.1.10) and IPv6 (the newer 128-bit format written in hexadecimal). IPv6 exists mainly for one reason: the world ran out of IPv4 addresses.

What an IP Address Actually Is (and Does)

An IP address lives at Layer 3 of the OSI model, the Network layer. It is a logical, software-assigned identity, which means it can be set, changed, or reassigned, unlike a device's hardware address. Its whole job is to make a host reachable across one or more networks.

Every IP address does two things at once: it identifies a specific host, and it encodes that host's location. The address is split into a network portion and a host portion (the subnet mask decides where the split falls). Think of a street address: the city and street name are the network, and the house number is the host. Routers only need to read the network portion to send a packet toward the right neighborhood, then the local network handles the final hand-off.

IPv4: 32 Bits in Dotted Decimal

IPv4 uses 32 bits, written as four 8-bit chunks called octets, each ranging 0 to 255 and separated by dots, such as 192.168.1.10. That gives roughly 4.3 billion possible addresses (2 to the 32nd power), a number that felt limitless in the 1980s.

A subnet mask, or its shorthand CIDR notation like /24, marks where the network bits end and the host bits begin. Early IPv4 used rigid Class A, B, and C blocks; CIDR (Classless Inter-Domain Routing) replaced those with flexible prefix lengths so a network can be sized to fit. A handy rule for planning: usable hosts in a subnet equal 2 to the power of the host bits, minus 2 (you subtract the network and broadcast addresses), with /31 and /32 as special exceptions.

Public vs. Private Addresses (RFC 1918)

Public IPv4 addresses are globally unique and routable across the internet. Private addresses are reserved for internal use and are reused freely inside millions of separate networks. The RFC 1918 private ranges are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16, which is why your home router almost certainly hands out something like 192.168.1.x.

Private addresses cannot travel on the public internet on their own. NAT (Network Address Translation), and specifically PAT, rewrites addresses at the router's inside/outside boundary so many private hosts can share a single public IP, keeping them apart by port number. That is how every phone, laptop, and TV in a house reaches the internet through one public address.

IPv6: Why It Exists and How It Looks

Roughly 4.3 billion addresses sounded enormous decades ago, but the internet blew past it. IPv6 solves this with 128 bits, or 2 to the 128th power addresses, a pool so vast that exhaustion is effectively off the table.

An IPv6 address is written as eight groups of four hexadecimal digits separated by colons, for example 2001:0db8:85a3::8a2e:0370:7334. To keep them readable, leading zeros in a group can be dropped and one run of all-zero groups can be compressed to a double colon (::). The job is identical to IPv4, Layer 3 identity plus location, just with a far larger space, so NAT becomes far less necessary. During the long transition, many networks run IPv4 and IPv6 side by side, an approach called dual-stack.

IP vs. MAC: The Classic Beginner Mix-Up

A MAC address is a 48-bit Layer 2 address burned into a device's network card. It is flat (it carries no location information) and is only meaningful within a single local segment, or broadcast domain. A switch forwards frames by MAC address at Layer 2.

An IP address is a Layer 3, logical, hierarchical address that encodes network location and changes as a device moves between networks. A router forwards packets by IP address at Layer 3. A useful analogy: your MAC is like your name (fixed, but it doesn't say where you are), while your IP is like your mailing address (it tells the delivery system how to reach you and changes when you move). The two work together on every trip: IP gets a packet across networks, and MAC handles the delivery on each local link along the way.

How Your Device Uses Its IP Every Day

When a device wants to send data, it compares the destination against its own address and subnet mask. If the destination is on the same subnet, it delivers directly on the local network. If the destination is off-subnet, it hands the packet to its default gateway, the router that serves as the next hop toward everywhere else (represented by the default route 0.0.0.0/0).

That single decision, local or remote, is the heart of how IP routing feels from a host's point of view. Actually assigning addresses, masks, and gateways on real gear is a separate, hands-on topic that lives in our step-by-step how-to guides; here the goal is simply to understand what each piece is and why it matters.

Frequently asked questions

Does every device need its own IP address?

Yes. Any device that communicates over IP needs an address that is unique within its network. On the public internet, public addresses are globally unique. At home, your devices each get their own private IP (like 192.168.1.x) and then share a single public IP through NAT, so they are unique locally even though the public-facing address is shared.

Why do we need IPv6 if IPv4 still works?

IPv4's roughly 4.3 billion addresses have run out, and workarounds like private addressing and NAT only stretch that pool so far. IPv6's 128-bit space is effectively unlimited, guaranteeing room for future growth without heavy reliance on NAT. IPv4 still works, so most of the internet runs both at once (dual-stack) during the gradual transition.

Is an IP address the same as a MAC address?

No. A MAC address is a 48-bit Layer 2 hardware address, usually burned into the network card, and is used to move frames within a single local segment. An IP address is a Layer 3 logical address used to route packets across networks and can change as a device moves. They are different layers doing different jobs, and they cooperate to deliver traffic end to end.

Now build it on real Cisco IOS

Concepts stick when you configure them. Try a free graded lab, then grade your own config against the answer key.