This lecture is divided into hyperlinked sections
Introduction
Internet Protocol (IP)
addressing today (IPv4)
Specific Addresses
Reserved numbers
Class A Addresses
Class B Addresses
Class C Addresses
Network Address
Broadcast Number
Exercise 01
Subnetworks
Subnetting
More Subnetting
Subnet Mask
Using the Subnet
Mask
Exercise 02
IP addressing tomorrow (IPv6)
Conclusion
Resources
Worksheet
Internet addresses are known as IP (Internet Protocol) addresses. These are used for addressing and routing. The RFC that deals with IP addressing is RFC 791. Each computer that is connected to the Internet must have an IP number. In the case of a computer that has several NICs (adapters) it will have a corresponding number of IP addresses.
The IP addressing scheme is hierarchical. The number divides into two main sections. The first part denotes the network that host is attached to and the second part relates to the unique identity number of the host that resides on the network that is named in the first section. Compare this with MAC hardware addressing which is a flat addressing scheme.
The hierarchical nature of the IP addressing scheme allows for messages to be routed to their correct destination.
IP version 4 (cf IPv6) is the current addressing standard across the Internet for identifying hosts and their networks. It is based on a 32 bit number, or 4 bytes and the number is divided into 4 sections. Each of the sections can range from 0 to 255. To make the interpretation of the IP address a little asier, the 32 bits are presented as 4 bytes separated by dots and the bytes are converted to decimal. This is known as the dotted decimal notation. A typical IP address could be:
193.60.61.243
When using these numbers, a computer will use the binary form of this number:
11000001.00111100.00111101.11110011
Each address is composed of two sections. The first section identifies the network that the host is a member of and the second part identifies the host itself within the network.
Note that the
class notation of addressing is no longer used in the Internet although
addressing may be referred to as a specific address class even today.
The range of available IP addresses is divided into classes. Specifically these are class A, B and C addresses. There are two further classes, D and E. These are not used for addressing purposes currently and this course will not concentrate on classes D or E.
IP numbers that begin with a number in the range 1 to 126 are class A addresses.
IP numbers that begin with a number in the range 128 to 191 are class B addresses.
IP numbers that begin with a number in the range 192 to 223 are class C addresses.
IP numbers that begin with a number in the range 224 to 239 are class D addresses.
IP numbers that begin with a number in the range 240
to 254 are class E addresses.
There are certain numbers within the IP scheme that have been reserved.
No network number may consist of all 0s or all 1s. This means that no network (or subnetwork) may take these numbers
Any IP number that has the host octet set to 0 is reserved as a network address.
Any IP number that has the host octet set to 255 is reserved as a network broadcast (a message for all hosts) address.
All numbers that begin
with 127 are reserved for the loopback test of a network interface
card. This uses 127.0.0.1. The rest of the 127 numbers are wasted here.
A typical class A address (in dotted decimal notation) would be 10.213.43.122
In binary notation this is 00001010.11010101.00101011.01111010
Note that the first 8 bits are the network identity and the last 24 bits are
host identity.
This means that there are a possible 224 = 16 777 216 combinations available for the last 24 bits.
If we subtract the two combinations that cannot be used as host addresses we now have the total number of hosts that can be on a class A network address.
Therefore a class A address can have 16 777 216 - 2
= 16
777 214 different hosts.
A typical class B address (in dotted decimal notation) would be 155.17.47.100
In binary notation this is 00001010.00010001.00101111.01100100
Note that the first 16 bits are the network identity and the last 16 bits are
host identity.
This means that there are a possible 216 = 65 536 combinations available for the last 16 bits.
If we subtract the two combinations that cannot be used as host addresses we now have the total number of hosts that can be on a class B network address.
Therefore a class B address can have 65 536 - 2 = 65
534 different hosts.
A typical class C address (in dotted decimal notation) would be 207.18.199.12
In binary notation this is 00001010.00010010.11000111.00001100
Note that the first 24 bits are the network identity and the last 8 bits are host identity.
This means that there are a possible 28 = 256 combinations available for the last 16 bits.
If we subtract the two combinations that cannot be used as host addresses we now have the total number of hosts that can be on a class C network address.
Therefore a class C address can have 256 - 2 = 254 different hosts.
The network address of the host having IP number ( unsubnetted class B address) 129.236.127.44 is 129.236.0.0. This can be easily seen as this is an un-subnetted class B address. this address would today be written as 129.236.127.44 /16
To work this out, first convert this IP number to binary:
129.236.127.44 /16 = 10000001.11101100.01111111.00101100
The first 16 bits are the network identity. Replace the host identity section of the address with 0s.
10000001.11101100.00000000.00000000
If we convert this back to decimal we get 129.236.0.0.
It is important to note that hosts on a particular network cannot communicate directly with hosts on a different network, even if they are on the same network segment!
Sometimes it is necessary to
send a message to all the hosts in a network. This is done using a
broadcast address.
To obtain the broadcast
address number for a network, substitute the
host
section of the binary version of the IP address with 1s. With the /
notation this means setting the last bits (32 - /number) to zero.
For the address above 129.236.127.44 /16, the broadcast address would be 129.236.255.255.
To work this out, first convert this IP number to binary:
129.236.127.44 = 10000001.11101100.01111111.00101100
The first 16 bits are the network identity. Replace the host identity section of the address with 1s.
10000001.11101100.11111111.11111111
If we convert this back to decimal we get 129.236.255.255.
For the IP numbers given below:
1. Identify the classes to which the following IP
numbers belong to. Are there any IP numbers that are illegal within
this exercise?
2. Show clearly which parts of the IP numbers are
the network identity and which parts are the host identity.
3. Calculate the number of hosts that can be
assigned within each network.
a) 122.34.45.133
b) 12.12.12.12
c) 192.0.233.26
d) 202.344.17.11
e) 126.123.16.87
f) 128.3.87.6
g) 220.126.17.13
h) 127.17.35.144
i) 1.2.3.4
j) 165.77.98.254
Unfortunately, the means by which IP numbers were originally assigned has meant that a lot of numbers are wasted. Class A addresses are given to governments for their own use.
Class B addresses have the potential for 65 534 hosts. This is more than the number of hosts that most organisations would need or ever implement. Having 65 634 hosts on the same network would be an incredible headache for the MAC method that was used and all hosts broadcast messages would flood the network.
Class C addresses have the potential for 256 hosts. This is less than the number of hosts that many organisations would need.
To help improve on this situation, a technique known as subnetworking is used.
This involves taking an IP network number and dividing it into several different smaller networks. Each of these smaller networks is known as a subnetwork (subnet).
Let us take the example of a class B address or as we know it today /16. As stated earlier, it has the potential for 65 534 hosts. A company may have several branches of its organisation that need to appear to be on a separate network for the purposes of administration and for network traffic management purposes.
Recall that a typical class B address has 16 bits for the network identity and 16 bits for the host identity.
e.g. 188.234.125.24
In binary notation this is:
10111100.11101010.01111101.00011000
It is possible to borrow bits from the host identity field to lengthen the network identity field. In this example we shall borrow 4 bits. The borrowed bits are highlighted in green.
10111100.11101010.01111101.00011000
This now leaves 12 bits for
the host
identity = 212
=
4096 but remember that the first and last numbers are reserved. This
leaves
scope for 4094 hosts on each network.
To show where the network/
host boundary lies the / notation informs us of the number of network
bits - this is the sum of the network and borrowed bits. In the example
above, there are now 20 network bits so this is a /20 address.
We have now divided our original single class B address into 24 = 16 subnetworks. Unfortunately we cannot use the first or last of these addresses. Therefore we have the potential for 16 - 2 = 14 networks within our original class B address. This allows for 14 networks with 4094 hosts (maximum) residing on each subnetwork.
A quick calculation shows that this allows for 14 x 4096 = 57 344 hosts as a maximum number within the subnetted class B address. This falls short of the 65 534 hosts available within an un-subnetted class B address. Why is the total number within a subnetted environment less than that available within a non-subnetted environment?
When we borrow bits from the host field of an IP number, we must note that the minimum number of bits that can be borrowed is 2. Why?
We should also note that the maximum number of bits that can be borrowed is all but the rightmost 2 bits of the 32 bits of the IP address. Why?
This term is often used in place of the real name, 'extended network prefix'. It is used to help determine which part of the IP address refers to the network and which part refers to the host.
A subnet mask is 32 bits long and has 4 sections or octets that are separated by dots the same as an IP address.
To work out the subnet mask for a particular subnetwork IP address follow the steps below.
1. Express the subnetwork IP address in binary form.
2. Replace the network and subnet portion of the address with all 1s.
3. Replace the host portion of the address with all 0s.
4. Now convert the binary expression back to dotted-decimal notation.
Example
What is the subnet mask for the subnetted class C address ( /24) 199.177.166.34 that has borrowed 3 bits from the host field?
1. Change decimal to binary:
11000111.10110001.10100110.00100010
We are told 3 bits have been borrowed from the host field. These are denoted in green above. This means that the network identity part of the IP address is 27 bits long.
2. Substitute 1s for these 27 bits
3. Substitute the last 5 bits for 0s
11111111.11111111.11111111.11100000
4. Convert back to dotted decimal
255.255.255.224 or we can write the subnet mask as /27
This is the subnet mask for the above network number.
When making routing decisions, a router will use the subnet mask and the IP address of the host to work out the network number. The Boolean operator AND is used here. The IP address is ANDed together with the subnet mask to obtain the network number.
Example.
What is the network number for the IP address 199.177.166.34 given that the subnet mask is 255.255.255.224 ( or /27)
1. Convert both numbers to binary
IP Address = 11000111.10110001.10100110.00100010
Subnet Mask = 11111111.11111111.11111111.11100000 (note the 27 binary 1s)
2. AND these two numbers together
11000111.10110001.10100110.00100010
AND
11111111.11111111.11111111.11100000
11000111.10110001.10100110.00100000
3.Convert back to dotted decimal
199.177.166.32
This is the network identity.
Example.
How many hosts can be resident on the above network?
There are 5 bits remaining for the host, therefore there are 25 - 2 = 30 possible hosts.
You have been given the IP network address 213.72.83.0. You require at least 15 subnets. List:
1. The required subnet mask
2. The number of total subnets
3. The number of available host addresses per subnet
4. The first four subnet addresses
5. The valid range of host addresses for the first four
subnets
6. The Broadcast address for each subnet
Hints
Conduct this calculation in binary.
When you work this out, remember that you need to firstly calculate the total number of bits that must be borrowed from the host field. Note that two of these addresses cannot be used as host IP numbers. Therefore for 15 subnets, you will need to borrow sufficient bits to make at least 17 choices. This means you must borrow 5 bits (25 = 32). This will leave the remaining 3 bits for host addresses on each subnet.
For the subnet mask, substitute the network bits for 1s and the host bits for 0s and convert back to decimal.
When calculating the first four subnet addresses, you will begin with:
00001000 = 8
00010000 = 16
00011000 = 24
00100000 = 32
3 bits for the host leaves 23 - 2 = 6 host addresses per subnet. Remember that you cannot use the subnet number nor the last number in the subnet. Therefore the first subnet number is 213.72.83.8 and the valid host range is:
213.72.83.9
213.72.83.10
213.72.83.11
213.72.83.12
213.72.83.13
213.72.83.14
(When you have finished this example, there is a worksheet
available for download in .doc format)
IP version 6 (sometimes seen as IPng - Internet Protocol next generation) is the successor to IPv4. To overcome the numerical limitation imposed by the 32 bits of IPv4 addresses, the address field in IP v6 has been lengthened to 128 bits.
There are three classes of IP addresses that an organization can receive from InterNIC: Class A, B, and C.
InterNIC reserves Class A addresses for governments
throughout the world, Class B addresses for medium-size companies, and
Class C addresses for all other entities.
When written in a binary format, the first bit of a Class A address is always 0 the first 2 bits of a Class B address are always 10, and the first 3 bits of a Class C address are always 110.
In order to provide extra flexibility for the network administrator, networks -- particularly large ones -- are often divided into smaller networks called subnetworks or subnets.
Subnets are concealed from outside networks by using masks referred to as subnet masks.
IP addressing
part 1
IP
addressing
part 2
IP
addressing part 3
IP
addressing architecture
The Internet
Corporation for Assigned Names and Numbers
Back to top of page
© MM Clements 2002