IP addressing exercises
IP addressing exercises
Exercise 1 - Determination of the IP address class
Which class do the following addresses belong to?
[Link]
2. [Link]
3. [Link]
4. [Link]
5. [Link]
6. [Link]
7. [Link]
Solutions
Class B
2. Classe B
3. Classe A
Class C
5. Class C
6. Classe A
Class A
Exercise 2 – Determination of the number of bits to use for the subnet ID
In this exercise, you must determine how many bits are needed to create the
number of requested subnets.
84 subnets
2. 145 subnets
3. 7 subnets
4. 1 subnet
5. 15 subnets
Solutions
1. 7 bits (27- 2 = 126)
2. 8 bits (28- 2 = 254)
3. 4 bits (24- 2 = 14)
4. 2 bits (22– 2 = 2)
5. 5 bits (25- 2 = 30)
Page 1
IP Addressing Exercises
Exercise 3 - Calculation of the subnet mask and the number of hosts per subnet
network.
A partir d'un ID de réseau et d'un nombre voulu de sous-réseaux, calculez le masque de
sous-réseau et le nombre d'hôtes par sous-réseau.
1. ID réseau : [Link] et 37 sous-réseaux
2. Network ID: [Link] and 2 subnets
3. ID réseau : [Link] et 1000 sous-réseaux
4. Network ID: [Link] and 550 subnets
5. Network ID: [Link] and 60 subnets
Solutions
1. The subnet ID belongs to class B. For 37 subnets, we must allocate
create 6 bits (26- 2 = 62). The subnet mask is therefore: 255.255.1111
1100. 0 is [Link]. There are 10 bits (2 + 8) left for the machine identifier. We
so 1022 machines per subnet (210- 2 = 1022).
2. L’ID sous-réseau appartient à la classe C. Pour 2 sous-réseaux, on doit consacrer
2 bits (22– 2 = 2). The subnet mask is therefore: 255.255.255.1100 000
So it is [Link]. There are 6 bits left for the machine identifier. Therefore, we have 62.
machines per subnet (26– 2 = 62).
3. The subnet ID belongs to class A. For 1000 subnets, one must
dedicate 10 bits (210- 2 = 1022). The subnet mask is therefore:
255.1111 1111.1100 0000.0 is equivalent to [Link]. There are 14 bits remaining (6 + 8) for
the machine identifier. So we have 16382 machines per subnet (214- 2 =
16382).
4. The subnet ID belongs to class B. For 550 subnets, it is necessary to allocate
create 10 bits (210- 2 = 1022). The subnet mask is therefore: 255.255.1111
1111.1100 0000 soit [Link]. Il reste 6 bits pour l’identifiant machine.
There are therefore 62 machines per subnet (26- 2 = 62).
5. The subnet ID belongs to class C. For 60 subnets, we must allocate
create 6 bits (26– 2 = 62). The subnet mask is therefore: 255.255.255.1111
1100 or [Link]. There are 2 bits left for the machine identifier. So we have
2 machines per subnet (22- 2 = 2).
Exercise 4 - Calculation of the subnet mask, the number of hosts per subnet
and the subnet identifiers.
From a network ID and a desired number of subnets, calculate the mask of
subnet, the number of hosts per subnet and the subnet identifier
1. Network ID: [Link] and 7 subnets.
2. Network ID: [Link] and 5 subnets.
3. Network ID: [Link] and 6 subnets.
4. ID réseau : [Link] et 12 sous-réseaux.
5. Network ID: [Link] and 56 subnets. Only the identifier is required.
of 10th17thand 36thsubnets.
Page 2
IP addressing exercises
Solutions
The subnet ID belongs to class A. For 7 subnets, we must allocate
4 bits (24– 2 = 14). The subnet mask is therefore: 255.1111 0000.0.0
[Link]. There are 20 bits left (4 + 8 + 8) for the machine identifier. Therefore, we have
1,048,574 machines per subnet (220- 2 = 1048574). As a re-identifier
we will have a bucket
Subnet 1: 114.00010000.0.0 or [Link]
Subnet 2: 114.00100000.0.0 or [Link]
Subnet 3: 114.00110000.0.0 or [Link]
Subnet 4: 114.01000000.0.0 or [Link]
Subnet 5: 114.01010000.0.0 or [Link]
Subnet 6: 114.01100000.0.0 or [Link]
Subnet 7: 114.01110000.0.0 or [Link]
2. The subnet ID belongs to class C. For 5 subnets, one must allocate
3 bits (23- 2 = 6). The subnet mask is therefore: 255.255.255.1110 0000
thus [Link]. There are 5 bits left for the machine identifier. So we have 30
machines by subnet (25– 2 = 30). As the network identifier we will have:
Subnet 1: 192.168.69.0010 0000 or [Link]
Subnet 2: 192.168.69.0100 0000 or [Link]
Subnet 3: 192.168.69.0110 0000 or [Link]
Subnet 4: 192.168.69.1000 0000 or [Link]
Subnet 5: 192.168.69.1010 0000 or [Link]
3. L’ID sous-réseau appartient à la classe C. Pour 6 sous-réseaux, on doit consacrer
3 bits (23– 2 = 6). The subnet mask is therefore: 255.255.255.1110 0000
So it is [Link]. There are 5 bits left for the machine identifier. Thus, we have 30.
machines per subnet (25- 2 = 30). As a network identifier, we will have:
Subnet 1: 221.14.32.0010 0000 or [Link]
Subnet 2: 221.14.32.0100 0000 or [Link]
Subnet 3: 221.14.32.0110 0000 or [Link]
Subnet 4: 221.14.32.1000 0000 or [Link]
Subnet 5: 221.14.32.1010 0000 or [Link]
4. The subnet ID belongs to class B. For 12 subnets, we must allocate
4 bits (24– 2 = 14). Le masque de sous-réseau est donc : 255.255.1111 0000.0 soit
255.255.240Il reste 12 bits (4 + 8) pour l’identifiant machine. On a donc 4094
machines per subnet (212- 2 = 4094). As a network identifier we will have:
Subnet 1: 172.16.00010000.0 or [Link]
Subnet 2: 172.16.00100000.0 or [Link]
Subnet 3: 172.16.00110000.0 or [Link]
Subnet 4: 172.16.01000000.0 or [Link]
Subnet 5: 172.16.01010000.0 or [Link]
Subnet 6: 172.16.01100000.0 or [Link]
Subnet 7: 172.16.01110000.0 or [Link]
Subnet 8: 172.16.10000000.0 or [Link]
Subnet 9: 172.16.10010000.0 or [Link]
Subnet 10: 172.16.10100000.0 or [Link]
Subnet 11: 172.16.10110000.0 or [Link]
Subnet 12: 172.16.11000000.0 or [Link]
Page 3
IP addressing exercises
5. The subnet ID belongs to class B. For 56 subnets, one must allocate
6 bits (26– 2 = 62). The subnet mask is therefore: 255.255.1111 1100 0 or
[Link] There are 10 bits left (2 + 8) for the machine identifier. So we have 1022.
machines par sous-réseau (210– 2 = 1022). As a network identifier, we will have:
Subnet 10: 185.42.0010 1000.0 so [Link]
Subnet 17: 185.42.0100 0100.0 or [Link]
Sous-réseau 36 : 185.42.1001 0000.0 soit [Link]
Exercise 5 - Calculation of the subnet mask according to the number of hosts
In this exercise, the maximum number of hosts per subnet is given. Calculate it.
subnet mask and the number of possible subnets.
Network [Link] and a maximum of 100 hosts per subnet
2. Network [Link] and a maximum of 100 hosts per subnet
3. Network [Link] and a maximum of 1500 hosts per subnet
4. Network [Link] and a maximum of 2000 hosts per subnet
5. Network [Link] and a maximum of 14 hosts per subnet
Solutions
1. The subnet ID belongs to class A. For 100 hosts per subnet, we
must dedicate 7 bits (27– 2 = 126). There are 17 bits (8 + 8 + 1) left for the identifier
of subnets. Therefore, there are 131070 subnets (217- 2 = 131070). The mask
The subnet mask is therefore: 255.1111 1111.1111 1111.1000 0000 or
[Link].
2. The subnet ID belongs to class C. For 100 hosts per subnet, one
must allocate 7 bits (27- 2 = 126). There is 1 bit left for the sub-identifier.
network. Therefore, one cannot create a subnet. The subnet mask is
[Link].
3. The subnet ID belongs to class B. For 1500 hosts per subnet, we
doit consacrer 11 bits (211– 2 = 2046). There are 5 bits left for the sub-identifier.
network. So we have 30 sub-networks (2 5- 2 = 30). The subnet mask is
thus: 255.255.1111 1000.0000 0000 is [Link].
4. The subnet ID belongs to class A. For 2000 hosts per subnet, we
must dedicate 11 bits (211 - 2 = 2046). There are 13 bits left (8 + 5) for the identifier.
subnet. We therefore have 8190 subnets (213 - 2 = 8190). The mask of
The subnet is thus: 255.1111 1111.1111 1000.0000 0000 or [Link].
5. The subnet ID belongs to class C. For 14 hosts per subnet, one must
dedicate 4 bits (24- 2 = 14). There are 4 bits left for the subnet identifier. We
therefore 14 subnets (24- 2 = 140). The subnet mask is therefore:
255.255.255.11110000 is [Link].
Page 4
IP addressing exercises
Exercise 6 – Determination of the range of host IDs
Given a subnet ID and a subnet mask, determine the host IDs.
you validate.
1. ID de sous-réseau : [Link] avec le masque [Link]
2. Subnet ID: [Link] with mask [Link]
3. ID de sous-réseau : [Link] avec le masque [Link]
4. ID de sous-réseau : [Link] avec le masque [Link]
5. ID de sous-réseau : [Link] avec le masque [Link]
Solutions
1. The subnet ID belongs to class B. With a subnet mask of
[Link], 6 bits were allocated for the subnet identifier. Therefore, there remains
10 bits (2 + 8) available for the machine identifier. To calculate the range
hosts, we need to work on these 10 bits.
The first machine will have the IP address (all machine ID bits are 0 except for the
last) :
148.56.0100 0000.0000 0001 is [Link]
The last machine will have the IP address (all machine ID bits are set to 1 except for the
last) :
[Link]
For the broadcast address, all the machine ID bits are set to 1, so we have:
148.56.0100 0011.1111 1111 is [Link]
2. The subnet ID belongs to class A. With a subnet mask of
[Link], 8 bits have been allocated for the subnet identifier. Therefore, 16 remain.
bits (8 + 8) available for the machine identifier. To calculate the range
hosts, we must work on these 16 bits.
The first machine will have the IP address (all machine ID bits are 0 except the
last) :
[Link]
The last machine will have the IP address (all machine ID bits are set to 1 except the
last) :
52.36.1111 1111.1111 1110 is [Link]
For the broadcast address, all machine ID bits are set to 1, thus we have:
52.36. 1111 1111.1111 1111 is [Link]
3. L’ID sous-réseau appartient à la classe C. Avec un masque de sous-réseau de
[Link], on a consacré 2 bits à l’identifiant de sous-réseau. Il reste donc
6 bits available for the machine identifier. To calculate the host range,
we need to work on these 6 bits.
The first machine will have the IP address (all the machine ID bits are 0 except the
last) :
198.53.24.0100 [Link] [Link]
The last machine will have the IP address (all the machine ID bits are 1 except the
dernier) :
198.53.24.0111 [Link] [Link]
For the broadcast address, all machine ID bits are set to 1, so we have:
198.53.24.0111 [Link] [Link]
Page 5
IP addressing exercises
4. The subnet ID belongs to class B. With a subnet mask of
[Link], 5 bits were dedicated to the subnet identifier. Therefore, there remain
11 bits (3 + 8) available for the machine identifier. To calculate the range.
hosts, we need to work on these 11 bits.
The first machine will have the IP address (all machine ID bits are 0 except for the
last) :
132.56.0001 0000.0000 0001 is [Link]
La dernière machine aura l’adresse IP (tous les bits ID machine sont à 1 sauf le
last) :
132.56.0001 0111.1111 1110 soit [Link]
Pour l’adresse de broadcast tous les bits ID machine sont à 1, on a donc :
132.56.0001 0111.1111 1111 soit [Link]
5. The subnet ID belongs to class B. With a subnet mask of
[Link], 7 bits have been dedicated to the subnet identifier. Therefore, 9 remain.
bits (1 + 8) available for the machine identifier. To calculate the range
hosts, we need to work on these 9 bits.
The first machine will have the IP address (all machine ID bits are 0 except the
last) :
152.56.1001 0000.0000 0001 is [Link]
The last machine will have the IP address (all machine ID bits are set to 1 except the
last) :
152.56.1001 0001.1111 1110 is [Link]
For the broadcast address, all machine ID bits are set to 1, so we have:
152.56.1001 0001.1111 1111 or [Link]
Exercise 7 - Determination of the range of host IDs from a host ID
Based on an IP address and a subnet mask, determine the range of host IPs.
which includes this address.
1. IP address: [Link] with the mask [Link]
2. IP address: [Link] with the mask [Link]
3. IP address: [Link] with the mask [Link]
4. IP address: [Link] with the mask [Link]
5. IP address: [Link] with the mask [Link]
Solutions
1. The subnet ID belongs to class A. With a subnet mask of
[Link], 3 bits were allocated for the subnet identifier. Therefore, there are 13
bits (5 + 8) available for the machine identifier. We must start
to identify the subnet ID from the machine's IP address. We have:
23 .25 . 0100 0100. 0000 0010
255.255.1110 0000. 0000 0000
Ce qui donne : 23.25 0100 0000 0000 0000
Let it be [Link]
The first machine will have the IP address (all machine ID bits are 0 except the
last) :
23.25.0100 0000.0000 0001 soit [Link]
The last machine will have the IP address (all machine ID bits are set to 1 except the
last) :
Page 6
IP addressing exercises
23.25.0101 1111.1111 1110 is [Link]
For the broadcast address, all machine ID bits are set to 1, so we have:
23.25.0101 1111.1111 1111 is [Link]
2. The subnet ID belongs to class C. With a subnet mask of
[Link], 0 bits have been dedicated to the subnet identifier. Therefore, there are 8
available bits for the machine identifier. We must start with
Identify the subnet ID from the machine's IP address. We have:
198.53.64.0000 0111
255.255.255. 0000 0000
Which gives: 198.53.64.0000 0000
Let it be [Link]
The first machine will have the IP address (all machine ID bits are 0 except for the
last) :
198.53.64.0000 0001 is [Link]
The last machine will have the IP address (all machine ID bits are set to 1 except the
last) :
[Link] 1110 is [Link]
Pour l’adresse de broadcast tous les bits ID machine sont à 1, on a donc :
198.53.64.1111 1111 or [Link]
The subnet ID belongs to class B. With a subnet mask of
[Link], 5 bits were dedicated to the subnet identifier. Therefore, there are 11
available bits (3 + 8) for the machine identifier. We need to start
to identify the subnet ID from the machine's IP address. We have:
131.107.0011 1000.0001 1001
255.255 . 1111 1000. 0000 0000
Which gives: 131.107.0011 1000.0000 0000
Let it be [Link]
The first machine will have the IP address (all machine ID bits are 0 except the
dernier) :
[Link]
The last machine will have the IP address (all the machine ID bits are set to 1 except the
last) :
131.107.0011 1111.1111 1110 is [Link]
For the broadcast address, all machine ID bits are set to 1, we have thus:
131.107.0011 1111.1111 1111 is [Link]
4. The subnet ID belongs to class B. With a subnet mask of
[Link], 4 bits were allocated for the subnet identifier. Therefore, there are 12
bits disponibles (4 + 8 ) pour l’identifiant de machine. Nous devons commencer
to identify the subnet ID from the machine's IP address. We have:
148.53.0100 0010.0000 0111
[Link]
This gives: 148.53.0100 0000 0000
Let it be [Link]
The first machine will have the IP address (all machine ID bits are set to 0 except the
dernier) :
148.53.01000000.0000 0001 is [Link]
The last machine will have the IP address (all the machine ID bits are set to 1 except for the
dernier) :
148.53.01001111.1111 1110 is [Link]
Page 7
IP addressing exercises
For the broadcast address, all machine ID bits are set to 1, so we have:
148.53.01001111.1111 1111 is [Link]
5. The subnet ID belongs to Class A. With a subnet mask of
[Link], 8 bits have been dedicated to the subnet identifier. Therefore, there are 16
bits (8 + 8) available for the machine identifier. We must start
par identifier l’ID de sous-réseau à partir de l’adresse IP de la machine. On a :
1.1. 0000 0000. 0000 0001
255.255.0000 0000. 0000 0000
Which gives: 1.1.0100 0000.0000 0000
Let it be [Link]
The first machine will have the IP address (all machine ID bits are 0 except the
last) :
1.1. 0000 0000.0000 0001 or [Link]
The last machine will have the IP address (all machine ID bits are set to 1 except the
last) :
1.1. 1111 1111.1111 1110 is [Link]
For the broadcast address, all machine ID bits are set to 1, thus we have:
1.1. 1111 1111.1111 1111 is [Link]
Exercise 8 - IP Addressing Plan
A company has 73 machines that it wants to distribute among 3 subnetworks.
Network 1: 21 machines
•Network 2: 29 machines
Network 3: 23 machines
She wishes to work with private IP addresses.
You are asked:
To select the class of IP addresses
2. To calculate the number of bits needed for subnet configuration.
3. To calculate the subnet mask
4. Calculate the number of configurable machines in each subnet
5. To calculate the addresses of the first and last machines actually installed.
read in each department.
Solutions
Nombre de sous-réseaux :3
Number of bits required: 3 bits (6 potential subnets)
Maximum number of machines in a subnet: 29
Number of bits required: 5 bits (30 potential machines per subnet)
Number of bits for subnet ID and host ID: 3 + 5 = 8
We can therefore work in class C.
Network ID: [Link]
Page 8
IP addressing exercises
Subnet mask 255.255.224 (2 bytes for the network and 3 bits for the
subnet
Subnet ID First machine Last machine Last machine Broadcast
configurée potential
[Link] [Link] [Link] [Link] [Link]
[Link] [Link] [Link] [Link] [Link]
[Link] [Link] [Link] [Link] [Link]
[Link]
[Link]
[Link]
Exercise 9 - IP Addressing Plan
A company has a network of 512 machines divided into 5 subnets. The addresses-
since these IPs are private addresses, we ask you:
To choose the network identifier
•To define the number of bits dedicated to subnet identifiers and
machines
•De calculer le nombre de sous-réseaux potentiels et le nombre maximum de
machines per subnet
Define the identifiers for each subnet
•De définir le masque de sous-réseau
To calculate the addresses of the first and last machines in each of
subnets
Solutions
On 512 machines distributed in 5 subnets, which gives approximately 103 machines.
by subnets.
For 103 machines, 7 bits are needed (126 potential machines).
To have 5 subnets, it is necessary to allocate 3 bits (6 potential subnets)
This gives us 7 + 3 = 10 bits for the subnet + host identifier. Therefore, we cannot
do not work in class C. We will adopt class B addresses. To simplify this.
life, we will dedicate on the 3rdthoctet to the subnet identifier and the 4ème à
the host identifier. We thus have 254 potential networks of 254 machines each.
We will adopt [Link] as the network identifier.
The 5 subnets will have the following identifiers:
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
The subnet mask is [Link] (2 bytes to identify the network and 1 byte
for the subnet)
Page 9
IP addressing exercises
The IP addresses of the first and last machine in each subnet are
Subnet First machine Last machine Broadcast
[Link] [Link] [Link] [Link]
[Link] [Link] [Link] [Link]
[Link] [Link] [Link] [Link]
[Link] [Link] [Link] [Link]
[Link] [Link] [Link] 172.16.255
Exercise 10 - IP Addressing Plan
A company has a network of 254 machines divided into 7 subnets. The repair-
The partition of the machines is as follows:
Subnet 1: 38 machines
Subnet 2: 33 machines
Subnet 3: 52 machines
Subnet 4: 35 machines
Subnet 5: 34 machines
Subnet 6: 37 machines
Subnet 7: 25 machines
Since IP addresses are private addresses, you are asked:
To choose the network identifier
To define the number of bits dedicated to subnet identifiers and
machines
To calculate the number of potential subnets and the maximum number of
machines per subnet
To define the identifiers of each subnet
To define the subnet mask
To calculate the addresses of the first and last configured machines in
each of the sub-networks
Solutions
Number of subnets: 7
Number of bits required: 4 bits (14 potential subnets)
Maximum number of machines: 52
Nombre de bits nécessaires : 6 bits (62 machines potentielles par sous-réseau)
Number of bits required for subnet ID and host ID: 4 + 6 = 10
Again, we cannot work in class C, so we will adopt addresses of
class B and we dedicate 1 byte for subnet ID and 1 byte for host ID
Network ID: [Link]
Subnet mask [Link]
Page 10
IP addressing exercises
Subnet ID First machine Last machine confi- Broadcast
safety
[Link] [Link] [Link] [Link]
[Link] [Link] [Link] [Link]
[Link] [Link] [Link] [Link]
[Link] [Link] [Link] [Link]
[Link] [Link] [Link] [Link]
[Link] [Link] [Link] [Link]
[Link] [Link] [Link] [Link]
Page 11