Page 22 / 141
DTUS065 rev A.7 – June 27, 2014
V.1.3
IP layer: IP addresses and routing
V.1.3.1
IP addresses
This section focuses on IPv4 addresses.
The IP address is a 4 bytes (or 32 bits) number, unique to each device on the
network, which hosts can use to communicate. The IP address is usually
represented in the “decimal dotted notation” which consists of the decimal
value of each of the four bytes, separated by dots.
The IP address is divided into two parts: network and host. The main
purpose of this division is to ease the routing process. The set of bits
constitutive of the network part is identified by a “network mask”. For
example the mask 255.255.255.0 selects the 24 upper bits of an address as
the network address, and the lower 8 bits as the host address.
Another way to specify a netmask is to indicate the number of ‘1’ bits,
assuming they all are the most significant. For example, in “192.168.1.0/24”
the “/24” part means “netmask 255.255.255.0”
Example: Class C network address and netmask
1 1 0 0 0 0 0 1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 0
193
168
1
200
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
255
255
255
0
Historical usage has named “Class A network” the networks 1.x.x.x/8 to
127.x.x.x/8; “Class B” the networks 128.0.x.x/16 to 191.255.x.x/16; “Class
C” the networks 192.0.0.x/24 to 223.255.255.x/24.
A host part with all bits set to 1 is the broadcast address, meaning “for every
device”. A host part with all bits fixed to 0 addresses the network as a whole
(for example, in routing entries). Addresses above 224.0.0.0 are used for
multicast addressing.
I.1.1.1
Public and private addresses
IP addresses can be private or public. Public ones are reserved to devices
that require sending data over a public network, such as internet. They are
usually purchased or leased from a local ISP.
Ideally each device in the world should have its own IP address so that they
always can communicate together. In the real world, most organizations
manage their own IP address space independently, so there are duplicates
from one organization to another. Two rules help avoiding conflicts:
-
Internally, organizations use only private addresses from a known
set: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
-
Routers between private area and the Internet convert internal,
private addresses to their own Internet public address, hence making
the whole world believe that there is only one computer there,
holding all the organization’s computing resources. This conversion
is called NAT (network addresses translation).