Special IP addresses

There are several specific settings in which IP addresses have special uses, or special constructions.

Address class

IP addresses were originally divided into five classes, and the first three classes were actually used in deciding the range of IP addresses that should be assigned to a particular organization. These classes are no longer used for assigning addresses, but the terminology still lingers, and the last two classes are still in use.

The class of an address is decided by its first few bits.

class A

The first bit of the address is 0.

In dotted decimal language this means that the address begins with a number between 0 and 127.

These were used for very large organizations, such as a corporation like IBM or AT&T.

An address beginning with 127, we will see below, actually has the special meaning that it is a "loopback", meaning that it does not "go out" onto a real internet through an interface, but is handled by the local machine.

class B

The first two bits of the address are 10.

In dotted decimal language this means that the address begins with a number between 128 and 191.

These were once assigned for midsize organizations, such as a typical moderate-sized university, which needed thousands of addresses.

Marquette University, for example, is assigned the "class B" address 134.48. The University of Wisconsin-Milwaukee is assigned the "class B" address 129.89.

class C

The first three bits of the address are 110.

In dotted decimal language this means that the address begins with a number between 192 and 223.

These were once assigned for smaller organizations, perhaps in groups of more than one contiguous class C address, who needed perhaps hundreds of hosts.

class D - multicast

The first four bits of the address are 1110.

In dottted decimal terms this means that the address begins with a number between 224 and 239.

These addresses might be used by any computer, and are used for a special kind of limited broadcasting called "multicasting".

On a Windows compute note that if you give the command "route print" it shows the address 224.0.0.0 with the netmask 224.0.0.0, routed through the local loopback interface.

class E - experimental

The first four bits of the address are 1111.

In dotted decimal terms this means that the address begins with a number between 240 and 255.

You will not normally see such an address.

private addresses

A very common problem is to wish to assign internet addresses to a number of computers, which will not be used as part of the global Internet, but just used within a particular organization. A network using such address is called a "private" network.

Hosts which need also to access the global Internet will either need to have an interface for that specific purpose, with a global Internet address which is properly assigned, or will need to access the global Internet through a special "network address translator" which changes the address of packets as they pass to and from the private network.

The rules for assigning such addresses are spelled out in rfc 1918.

Three ranges of addresses are assigned in that document:

10/8

that is, the dotted decimal addresses
from 10.0.0.0 through 10.255.255.255.

In the older "class" terminology this is a single "class A" address.

172.16/12

that is, the dottted decimal addresses
from 172.16.0.0 through 172.31.255.255.

In the older "class" terminology this is a block of 16 contigous "class B" addresses.

192.168/16

that is, the dotted decimal addresses
from 192.168.0.0 through 192.168.255.255.

In the older "class" terminology this is a block of 256 contiguous "class C" addresses.

broadcast addresses

The RFC for this material is section 3.2.1.3 of rfc 1122.

We will use a special notation.

Each interface connects to a particular net, which has a prefix of some particular length.

An addresses will be written as {net, host}, where the length of each part is determined by the prefix for the interface at which we are considering the address.

0 in one of the fields will mean all bits are 0, and -1 will mean that all bits in that field are binary 1.

Here are the special cases.

{ 0, 0 }

This host on this network.

MUST NOT be sent, except as a source address as part of an initialization procedure by which the host learns its own IP address.

{ 0, host }

Specified host on this network.

It MUST NOT be sent, except as a source address as part of an initialization procedure by which the host learns its full IP address.

{ -1, -1 }

Limited broadcast.

It MUST NOT be used as a source address.

A datagram with this destination address will be received by every host on the connected physical network but will not be forwarded outside that network.

{ net, -1 }

Directed broadcast to the specified network.

It MUST NOT be used as a source address.

{ 127, any }

Internal host loopback address.

Addresses of this form MUST NOT appear outside a host.

Which addresses to send

When a host sends any datagram, the IP source address MUST be one of its own IP addresses (but not a broadcast or multicast address).

Which addresses to receive

A host MUST silently discard an incoming datagram that is not destined for the host. An incoming datagram is destined for the host if the datagram's destination address field is:

  • an address for this host
  • a broadcast address valid for a net this host is on
  • a multicast address for a group the host is in.

For most purposes, a datagram addressed to a broadcast or multicast destination is processed as if it had been addressed to one of the host's IP addresses; we use the term "specific-destination address" for the equivalent local IP address of the host. The specific-destination address is defined to be the destination address in the IP header unless the header contains a broadcast or multicast address, in which case the specific-destination is an IP address assigned to the physical interface on which the datagram arrived.

A host MUST silently discard an incoming datagram containing an IP source address that is invalid by the rules of this section. This validation could be done in either the IP layer or by each protocol in the transport layer.