CEN610S Core Engineering Networks - IPv4 Addressing and Prefixes
IPv4 Addressing Fundamentals
IP version 4 (IPv4) uses addresses; total address space = addresses.
Each host or router must have a unique address.
Two key elements: Address and Subnet mask.
Addressing written in dotted quad notation with each octet being bits (example: ).
IP Prefixes – Modern
Addresses are allocated in blocks called prefixes; all hosts in an prefix share the same top bits.
Number of addresses in a prefix: .
CIDR notation: ;
E.g., covers to .
E.g., /24 yields addresses; /32 yields 1 address.
Binary representations (optional): e.g. a /24 prefix defines the first 24 bits as the network; the remaining 8 bits are host bits.
IP Prefixes – More Specific / Less Specific
More specific prefix → longer prefix → smaller set of addresses.
Less specific prefix → shorter prefix → larger set of addresses.
Common prefix lengths: .
IP Address Classes – Historical
Classful addressing used fixed-size blocks with the class encoded in high-order bits; networks/hosts split by class:
Class A: 8-bit network portion
Class B: 16-bit network portion
Class C: 24-bit network portion
These class distinctions are historical and largely ignored in favor of CIDR.
Public / Private IP Addresses
Public IP addresses: globally routable on the Internet; must be allocated; space is finite.
Private IP addresses: internal use, not routable on the public Internet; NAT used to reach the Internet.
Private ranges (examples):
Allocating Public IP Addresses
Allocation follows a hierarchy: IANA → RIRs (Regional Internet Registries) → ISPs/enterprises → customers/computers (via DHCP).
RIRs include: ARIN, APNIC, RIPE, LACNIC, AfriNIC.
IP Prefix in Practice / Subnet Mask
Subnet mask is often described by prefix length (e.g., /16) rather than decimal; default for Class B is /16 ≡ .
Subnet mask helps decide if the destination is local to the sender's network.
Process (routing decision): devices perform ANDing between source/destination addresses and the subnet mask to determine locality.
ANDing and Locality (Subnetting)
Definition: local if , where
= Source address, = Destination address, = Subnet mask.
Steps:
Compute source network ID:
Compute destination network ID:
If , destination is local; otherwise, route via a gateway.1.1