Categories

Archives

IP Addressing Explained (and a little history too)

An IP address is a set of numbers that identifies a certain element on a
network or, more in general, on the Internet. The IP addressing has gone
through several iteration in the course of the years. The first
iteration that became the actual standard is what is called today IPv4,
or IP version 4. The last iteration, that is slowly but steadily
supplanting IPv4, is IPv6, or IP version 6.

IPv4 is defined as a 32 bits address. Because of that, there are at most
232 = 4,294,967,296 different available addresses. Since the inception of
this standard, due to the continuous and exponential growth of the
Internet, the remaining available addresses are getting less and less
and, soon, they will be exhausted. That was the driving force to create
a new standard, capable of providing many more addresses: IPv6.
The 32 bits in the IPv4 address are usually grouped together in
different ways, each one with its own terminology.
The initial way of grouping the 32 bits was called “2-level addressing
hierarchy”. In that terminology, the 32 bits of the address are split in
two groups, of 16 bits each, called the “Network Number” and the “Host
Number” as seen in the following picture:
A while after the 2-level addressing was introduced, a new way of
representing the addresses started to become more popular, because
allowed a greater flexibility over the simple splitting of the address
in two groups of 16 bits each. The Classful IP address format was born.
A different amount of bits now represented the Network number, or
network prefix, the number of bits depending on the class of the IP
address. Class A, Class B, and Class C where introduced. Each class
fixed the boundary between the network number and the host number.
With Class A, the most significant bit is set to 0 and the next 7 bits
are actually used for the Network Number. As a result, the Host Number
is made up of 24 bits. There can be only 27 - 1 = 127 Class A networks
in the whole Internet, each with up to 224 -2 = 16,777,214 host numbers.
Two host numbers are lost to account for the address 0.0.0.0, which
represents the default route, and the address 127.0.0.0, which
represents the address of the loopback function, used mostly to test the
local connection of a device, or for internal communications within the
device itself.
With Class B, the first two bits are set to '10' and the next 14 bits
are used for the Network Number, resulting in up to 214 = 16384 Network
Numbers, each with up to 65,534 host numbers per network.
With Class C, the first 3 bits are set to '110' and the following 21
bits are used for the network number, resulting in up to 2,097,152
Network Numbers, each with only 254 host numbers.
There are actually 2 more classes, called D and E. However, these last
two classes are used only for special purposes.
Class D is used for IP multicasting, a way to address several hosts at
the same time. The first 4 bits of the address are set to '1110' and the
remaining bits are the multicast address.
Class E is for experimental use. The address begins with the four digits
'1111' and the remaining are those for experimental usage.
Another way of grouping the bits of the IPv4 standard is the so called
dotted notation, more human friendly than the classful notation. In the
dotted notation, the 32 bits are all grouped in four 8 bit blocks. Each
8 bit block is represented by its decimal value. Each value is then
separated with a dot. This notation assumes the following form:
xxx.xxx.xxx.xxx
where each ‘x’ represents a decimal digit. Each group becomes therefore
a number between 0 and 255. Here are some examples:
192.168.1.57 
126.35.12.4
180.254.168.111
If we want to compare the classful notation with the dotted notation, we
can see the following:
In the above table, the xxx groups identify the Host Number in the IP
address.
At some point after the standard IPv4 was created, network engineers
started seeing the limitations of the classful notation, so changes were
made to the standard to introduce what was called “subnetting” (circa
1985). The concept is simple: instead of dividing the whole internet in
a limited amount of classes, they thought of dividing the whole
addressing space into subnetworks, or subnets. And each subnet could be
further divided into smaller subnets, and so on and so on.
Each subnet is identified by the number of bits that identify its index,
thus going to the concept of Network Prefix instead of Network Number.
Service  providers could assign subnets instead of classes to
individuals and companies. Each of them could still create their own
internal hierarchical structure splitting the given subnet in further
subnets.
Since the number of bits that identify a subnet was now variable, the
need arose to be able to identify how many of the 32 bit addressing
where identifying the subnet and which bits where identifying the host
numbers.
It was decided to introduce the concept of masking. Each subnet space is
therefore accompanied by a set of 32 bits that specify which are the
network prefix bits and which are the host number bits. For example:
192.168.1.0/255.255.255.0
In the above address, the numbers on the left of the / symbol identify
the first address of the subnet; the numbers on the right side identify
the mask. Each decimal number on the mask can be represented by its
corresponding binary form. In essence, the mask is made of a number of
‘1’ followed by a number of ‘0’. The ‘1’ represent the digits in the
network prefix, the ‘0’ represent the digits in the host number.
In the above example, there are 24 ‘1’ in the mask, therefore
identifying the first 24 bits of the full IP address as the network
prefix. The remaining digits in the mask are 8 ‘0’, which identify the 8
bits of the host number. Therefore, this is a network that has prefix
192.168.1 and has up to 256 host numbers. In other words, the IP
addresses that belong to this subnet are all those in the following
range:
192.168.1.0  -  192.168.1.255
Another notation for the same mask is the following:

192.168.1.0/24
The “/24” identifies the number of bits that provide the network prefix,
which is 24, in this example. It is called the prefix length.
Basically, the original host number is split in two parts, the subnet
number and the actual host number.
This technique allows for a better distribution of the IP addresses on
the Internet. Furthermore, subnets can be defined entirely within the
boundary of an organization network. Routers within that organization
take care of resolving the addresses to reach each host. The Internet
routers do not need to know the details of the subnets and, therefore,
the corresponding routing tables are simplified.
More in general, there are three main advantages in using subnetting:
1) global internet routing tables don't grow when new subnets within a
private organization are added.
2) Local administrators can create new subnets within the organization,
without the need to obtain a new network number from the Internet.
3) Route flapping (the rapid changes on routes in the subnets) does not
affect internet routing tables.
Private network routers use subnet masks to identify their subnets. As
in the Internet masks, bits in the subnet mask are set to ‘1’ if they
are part of the extended network prefix, they are set to ‘0’ if they are
part of the host number range.
When designing subnet partitioning within an organization, 3 rules have
to be verified, so that the correct network index can be requested:
1) how many subnets are currently needed for the organization?
2) how many subnets will be needed in the future for the organization?
3) what is the max number of hosts required within each subnet in the
future?
Another way of subnetting is to have a single IP address assigned by the
Internet provider and use private subnetting in the organization
network. Routers in the organization network are equipped with a service
named NAT, or Network Address Translator. NAT translates the internal IP
addresses in the organization to the one external IP address and vice
versa. This method totally hides the configuration of the organization
network to the external world, adding as a bonus an increase in
security.
Many are familiar with this setup, because it is what a service provider
does when assigning an IP address to a household. Although there is a
single IP address to commnicate with the Internet, each device within
the household has its own IP address in the Private Network.
IP addresses available to build Private Networks must be in one of the
following ranges:
10.0.0.0 – 10.255.255.255 (/8 mask)
172.16.0.0 – 172.31.255.255 (/12 mask)
192.168.0.0 – 192.168.255.255 (/16 mask)
These ranges are all reusable. It means that different private network
may use the same IP address ranges, because these addresses are hidden
to the external world through the NAT service.
It is also worth noting that back in 1993 the Internet was quickly
running out of available IP addresses. The IETF (Internet Engineering
Task Force) then came up with a way to better use what was left of the
IP addresses. That idea worked so well that, as of today, we can still
use IP addresses that were saved using that idea.
What the IETF did was to create the concept of Classless Inter-Domain
Routing, or CIDR for short.
With that innovation, each Network prefix could be provided with any
number of digits, using a mask to identify their number. This technique
allowed to better split the IP addresses in different networks for
different organizations, thus saving a number of IP addresses that
otherwise would have been wasted. IPv4 routing would not work anymore
since a long time, if it wasn’t for this clever and simple idea.

But, regardless of the clever techniques used to save on the number of
wasted IP addresses, IPv4 addressing space has less and less available
IP addresses available to build new networks.
Introducing IPv6, the solution to the exhaustion of IP addresses on the
Internet.
IPv6 is an address made of 128 bits, instead of the 32 of IPv4.
Therefore, the max number of available addresses is 2128 =
340,282,366,920,938,463,463,374,607,431,768,211,456. That is over 340
billions of billions of billions of billions of addresses. It is now
believed that this number of IP addresses will last forever, but will
it?
Let’s see how IPv6 works.
There are three ways to represent an address in IPv6 format. These are
different than the IPv4 notation, because it needs to account for so
many bits. In fact, we still group the bits in blocks, but now these
blocks are 8 instead of 4 and are made up of 4 hexadecimal digits
instead of 3 decimal digits. The first of the 3 notations is the so
called “full notation”, which is structured as follows:
xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx
Here is an example:
fd00:04e8:aac5:459b:1234:abcd:ffff:01f5
The second notation, called “compressed notation”, allows to save space
when 1 or more consecutive blocks are made of all zeros. In that case,
we replace all the consecutive blocks with ‘::’. Note that this can be
done only once in the whole IP address, otherwise it would not be
possible to identify which ones are the 0 blocks.
Here is an example:
fd00::48ab:f000:017b
which is the short version of:
fd00:0000:0000:0000:0000:48ab:f000:017b
The third notation, called “mixed notation”, has been introduced for
compatibility and interworking with the IPv4 standard. The notation uses
one of the above two formats for the first 6 blocks, then it uses the
old IPv4 notation for the last 2 blocks, which comprise the last 32 bits
of the address. This way, IPv6 can handle old IPv4 addresses by
incorporating them in the new format as the last 32 bits. Note that this
is kind of equivalent in saying that now we have a massive amounts of
subnets, each equal to the size of the whole Internet addressing when
IPv4 was the only standard available.
Here is the example for the mixed notation:
1234:5678:9abc:def0:0fed:8765:192.168.1.124
IPv6 still uses masks, with the exact same meaning of IPv4. However, the
only possible notation for the mask is the slash format.
Example: xxxx:xxxx:xxxx:xxxx:0000:0000:0000:0000/64
It would be really cumbersome having to type 8 blocks of 1 and 0 for a
mask, otherwise.
It is worth noting that, in IPv6, the Network Prefix is actually split
in 5 separate fields, used to aggregate the most significant bits in a
way that is easier for the routers to analyze the addresses and
determine the correct routing to apply to packets. Although this is not
the place to be so detailed, here is the list of the names of these
fields and their size:
Note that the table also reports one extra field, the Interface ID,
which corresponds to the Host ID in the IPv4 notation. However, the
Interface ID is actually the ID of an interface on the host. If the host
has multiple interfaces, it can have multiple Interface IDs, or IP
addresses.
Finally, IPv6 has the ability to provide extra level of functionality
and, in particular, security, with respect to IPv4:
  • Streamlined IPv6 header
  • Stateless and Stateful Configuration
  • Built-In security (Ipsec)
  • Better support for Quality of Service (QoS)
  • Real time performance
As IPv4, also IPv6 has a number private network defined in the standard.
Well, it is actually only one:
fd00::/8
This private network has the capability to identify addresses in the
subnet with 64 bits. Thus, the max number of hosts in a private subnet
are:
216 = 18,446,744,073,709,551,616
Quite a few, don’t you think?

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

This site uses Akismet to reduce spam. Learn how your comment data is processed.