IP Routing overview

Address classes

Class First octet Classful mask (dotted notation) Classful mask (prefix notation)
A 1 - 126 /8
B 128 - 191 /16
C 192 - 223 /24
D 224 - 239 Multicast - no mask  
E 240 - 255 Experimental - no mask  

The class of an IP address is entirely determined by the first octet. The default network mask is always the corresponding classful mask.

ICANN assigns IPv4 address blocks, and delegates the fine-grained attribution to continental organisations.

Private address ranges

The private address ranges are not routable on the public internet. NAT is used to route from publicly addressable IP addresse to private addresses.

Class Range Prefix
A - /8
B - /16
B - /16
C - /24

The addresses are autoconfigured address, usually assigned when no static IP or DHCP is available. They are APIPA addresse, and are not routable by any router, even on local networks.


“Classless Inter-Domain Routing” is aggregating several subnets under one route. For example, the following four network can be addressed as one:


You only need 1 route advertisement for those 4 networks, This saves space on the routing tables.

Addressing methods


  • Unicast: one-to-one, eg. HTTP
  • Broadcast: one-to-all, eg. ARP
  • Multicast: one-to-many-subscribers, eg. RIPv2, OSPF, EIGRP


  • Unicast
  • Multicast
  • Anycast: select the closest corresponding host, eg. DNS Anycast


128 bits per address.

Benefits of IPv6

  • Roughly 5 * 10^28 addresses available per person on the planet
  • Simplified headers, 8 fields instead of 12
  • Designed with security and device mobility in mind
  • No broadcast (but certain types of multicast are equivalent)
  • MTU discovery performed for each connection
  • Can and does coexist with IPv4 (via dual stack or IPv6 over IPv4 tunneling)


Written in hexadecimal, 8 groups of 4 digits. They can be shortened:

  1. the leading zeroes in a group can be omitted
  2. the biggest continuous group of zero can be replaced with:

2041:0001:140F:0000:0000:0000:875B:131B becomes 2041:1:140F::875B:131B

Global Unicast addresses

Addresses starting with bits 001, in other terms addresses in the 2000::/3 network, are the global unicast addresses.

001 global routing prefix subnet id interface id
3 bits 45 bits 16 bits 64 bits


Addresses have a FF-valued first byte.

11111111 flags scope group id
8 bits 4 bits 4 bits 112 bits