Part 5 – IP Addressing in Depth

IP Addressing in Depth

Introduction

Welcome to Part 5 of the Network Fundamentals study notes! If you haven’t already, we recommend watching the video first.

In Part 4, we looked at how IP addresses are structured, the history of classful addressing, and how CIDR and subnet masks work. Now we build on that — exploring more advanced addressing concepts including VLSM, traffic types, private addresses, how devices get their IPs, and the IP packet header itself.

Variable Length Subnet Masks (VLSM)

In Part 4, we broke a large network into equal-sized subnets — for example, carving a /16 into many /24s. But in real networks, not every subnet needs to be the same size. This is where Variable Length Subnet Masking, or VLSM, comes in.

Consider a company using the network 172.16.0.0/16, broken into /24 subnets for each office. That gives 256 host addresses per subnet — reasonable for an office. But what about the links between offices? Each link connects two routers, so it only needs two IP addresses. Allocating a full /24 to each link wastes over 250 addresses.

With VLSM, you can break one of your /24 subnets into much smaller pieces — for example, /30 subnets. A /30 has 4 IP addresses (2 usable for the routers, 2 reserved), which is exactly what’s needed for a point-to-point link. The result is a network with subnets of different sizes, sized appropriately for each purpose. That’s all VLSM is: subnets of different sizes within the same overall network.

Types of IP Traffic

Unicast

Most of the time, a device wants to send traffic to just one other device. This is called unicast — a one-to-one conversation. Think of it like walking up to one person in a room and speaking only to them.

Broadcast

Sometimes a device needs to reach every other device on the local network — for example, if it’s looking for a particular resource but doesn’t know where it is. This is called broadcast traffic. Like someone grabbing a microphone and making an announcement to the whole room.

Every subnet has a reserved broadcast address — the last IP in the subnet, where all host bits are set to 1. For example, in the network 172.16.2.0/24, the broadcast address is 172.16.2.255. You can never assign this address to a device.

There’s also a special broadcast address — 255.255.255.255 — which means “send to everyone, regardless of subnet”. This is useful when a host doesn’t yet have an IP address and needs to find a DHCP server. More on that shortly.

An important rule: routers never forward broadcast messages. Broadcasts stay within the local subnet. If they could cross routers, broadcasts from millions of devices would quickly flood the internet.

Multicast

What if you want to send traffic to a group of interested devices — but not everyone? Unicast would mean duplicating the traffic for every single recipient. Broadcast won’t work because not all devices want it, and routers block broadcasts anyway.

The answer is multicast. Devices can opt in to receive traffic sent to a particular multicast address. The sender transmits once, and only the opted-in devices receive it — like a group in a room having their own side conversation while ignoring the rest.

Multicast uses the Class D address range: 224.0.0.0 to 239.255.255.255. Unlike broadcasts, routers can forward multicast traffic, so it can reach devices across multiple subnets.

Special Addresses in a Subnet

Every subnet has two addresses you can never assign to a device:

  • Network address – the first IP in the subnet, where all host bits are set to 0. For 172.16.0.0/24, this is 172.16.0.0.
  • Broadcast address – the last IP in the subnet, where all host bits are set to 1. For the same network, this is 172.16.0.255.

This means a /24 subnet has 256 total addresses, but only 254 usable host addresses. This is why a /30 network (4 total addresses) leaves only 2 usable — the other two are the network and broadcast addresses.

The Default Gateway

When you configure an IP address on a device — say a Windows PC — you also configure a default gateway. This is the IP address of the local router. When the device has no other way to deliver traffic (because the destination is on a different network), it sends the traffic to the default gateway as a last resort.

You might also hear this called the gateway of last resort — a fitting name, since the router is the device’s last option when it can’t handle the traffic itself.

IP Address Uniqueness and Management

IP addresses need to be unique — just like postal addresses. If two devices share an IP address, data ends up in the wrong place. So how is uniqueness managed globally?

IP addresses are managed by an organisation called IANA — the Internet Assigned Numbers Authority. IANA distributes large blocks of addresses to Regional Internet Registries (RIRs) around the world. For example, the Asia-Pacific region is managed by APNIC. RIRs then allocate blocks to ISPs, who distribute them further to customers.

Private Addresses (RFC 1918)

Getting a public IP address allocation takes time, and we’ve seen how quickly public IP space can run out. To help, a standard called RFC 1918 (published in the mid-1990s) reserved certain address ranges for private use. Anyone can use these addresses freely within their own network:

  • 10.0.0.0/8 (Class A)
  • 172.16.0.0/12 (Class B range)
  • 192.168.0.0/16 (Class C range)

You’ll see these addresses constantly — 192.168.x.x is what most home routers use. The catch is that private addresses are not allowed on the internet. This prevents different organisations from clashing when they use the same private ranges. It also conserves public IP space, since many devices can share a single public address.

NAT – Network Address Translation

If private addresses can’t go on the internet, how do private devices access it? The answer is NAT — Network Address Translation. When traffic from a private address heads to the internet, a router (typically your ISP’s edge device or your home router) translates the private source address into a public one. The return traffic is then translated back. NAT is a major topic in its own right, and we’ll cover it in detail in another video.

How Devices Get Their IP Addresses

There are three main ways a device can be assigned an IP address.

Static Addressing

An administrator manually logs into the device and configures the IP address. This is called a static address because it doesn’t change unless someone changes it. You must ensure each device gets a unique address — duplicates cause an IP conflict, which creates all sorts of problems. Static addressing is commonly used for routers and servers — devices whose addresses need to stay consistent.

Dynamic Addressing (DHCP)

Rather than configuring every device manually, a DHCP server (Dynamic Host Configuration Protocol) handles this automatically. The server maintains a pool of available IP addresses. When a device starts up, it broadcasts a message to find the DHCP server (this is one use case for that 255.255.255.255 broadcast address — the device doesn’t have an IP yet, so it broadcasts to find the server). The server then assigns an IP address from its pool, ensuring no two devices get the same address.

Because there’s no guarantee a device will get the same address each time, this is called dynamic addressing. This is ideal for workstations, laptops, phones, and tablets — devices that move around and don’t need a fixed address.

APIPA

There’s a third, less common method called Automatic Private IP Addressing (APIPA) — used only by Windows. If a device is configured to get its address from DHCP but can’t find a DHCP server, APIPA kicks in and assigns a random address from the range 169.254.0.0/16. This allows devices on the same local network to still communicate with each other — but since they won’t know the default gateway, they can’t reach other networks or the internet. It’s a fallback, not a recommended solution.

The IP Header

When the network layer adds IP addressing information to a packet, it creates an IP header. A few key fields are worth knowing:

  • Source and Destination addresses – the sender’s and receiver’s IP addresses. These are the most important fields.
  • Version – identifies whether this is IPv4 or IPv6.
  • Fragment Offset – if a packet is too large for a device to handle, it can be broken into smaller fragments. This field tracks the order of those fragments so they can be reassembled correctly at the destination. The Flags field can be used to prevent fragmentation altogether if needed.
  • Time to Live (TTL) – every packet has a TTL value set by the sender. Each time the packet passes through a router, the TTL is decremented by one. If it reaches zero, the packet is dropped. This prevents packets from looping forever if there’s a routing error.

Resources

Test your knowledge with the Introduction to Networking quizzes.