Who is local? 12 min read
IPv4 Addresses, Subnets, and Gateways
Learn how an endpoint decides whether a destination is local, what a subnet mask really does, and when the default gateway becomes involved.
- Separate an IP address into network and host portions.
- Interpret common CIDR prefixes such as /24, /23, /25, and /16.
- Determine whether two addresses are in the same subnet.
- Explain exactly when an endpoint uses its default gateway.
An address plus a boundary
An IPv4 address alone is incomplete. The subnet mask—or CIDR prefix—tells the endpoint which bits identify the network and which identify a host inside that network.
In 172.16.20.45/24, the /24 means the first 24 bits identify the network. The network is 172.16.20.0, the traditional broadcast address is 172.16.20.255, and the ordinary host range is 172.16.20.1 through 172.16.20.254.
Local or remote is a calculation
Before sending an IP packet, an endpoint applies its subnet mask to its own address and the destination address. If the resulting network portions match, the destination is local. The sender resolves the destination's MAC address and sends directly.
If the network portions differ, the destination is remote. The endpoint still creates a packet addressed to the final remote IP, but the local Ethernet frame is addressed to the default gateway's MAC address. The router then forwards the packet toward the remote network.
This is why an incorrect mask can create bizarre partial communication. Two devices may each reach some neighbors while disagreeing about whether another address is local or remote.
Useful subnet sizes
A /24 provides 256 total addresses and traditionally 254 ordinary host addresses. A /25 divides that space into two blocks of 128 addresses. A /23 combines two adjacent /24-sized ranges. A /16 contains 65,536 total addresses and is usually much larger than an AV VLAN should be.
More addresses are not automatically better. Larger broadcast domains increase the reach of broadcasts and make failures harder to contain. Choose subnets from endpoint count, growth, platform behavior, operational boundaries, and multicast design—not because /16 is easy to remember.
Put it in an AV system.
Control VLAN
A processor at 172.16.20.10/24 and touchscreen at 172.16.20.50/24 communicate locally. Their gateway is irrelevant to that direct conversation.
Commissioning laptop
A laptop at 172.16.30.200/24 cannot directly reach a device at 172.16.20.50/24. It needs a route through a gateway and a policy permitting the traffic.
- IPv4
- A 32-bit logical addressing system written as four decimal octets.
- Subnet
- A defined IP network whose members share a network prefix.
- CIDR
- Prefix notation such as /24 describing how many address bits define the network.
- Gateway
- The router an endpoint uses to reach remote networks.
- Broadcast address
- The address traditionally used to reach all hosts in an IPv4 subnet.
Make the local/remote decision
For a device at 192.168.40.70/24, classify 192.168.40.200, 192.168.41.20, and 8.8.8.8 as local or remote. Then identify which conversations require the gateway.
Three quick questions.
01Does an endpoint use its gateway to reach another device in the same subnet?
No. It resolves the local destination and sends directly.
02What does /24 mean?
The first 24 bits of the address identify the network portion.
03Why can a wrong subnet mask cause partial connectivity?
The endpoint may make incorrect local-versus-remote decisions for only part of the address range.
Discuss a project