Problems on CO-2
1. a). block of addresses is granted to a small organization. We know that one of the
addresses is 205.16.37.39/28. What is the first address in the block?
The binary representation of the given address is
11001101 00010000 00100101 00100111.
If we set 32 - 28 right most bits to 0, we get
11001101 0001000 00100101 0010000 or 205.16.37.32.
b). Find the last address for the block. We know that one of the addresses is
205.16.37.39/28.
The binary representation of the given address is
11001101 00010000 00100101 00100111.
If we set 32 - 28 right most bits to 1, we get
11001101 00010000 00100101 00101111 or 205.16.37.47.
c) Find the number of addresses. We know that one of the addresses is
205.16.37.39/28.
The value of n is 28, which means that number of addresses is 232-28 or 16.
d) Find The first address and the last address. We know that one of the addresses is
205.16.37.39/28
The first address can be found by AND operation in the given addresses with the mask.
AND operation is done bit by bit. The result of 2 bits AND operation is 1.If both bits are 1
The result is 0 otherwise.
(i) First Address
Address : 11001101 00010000 00100101 00100111
Mask : 11111111 11111111 11111111 11110000
First address : 11001101 00010000 00100101 00100000
(ii) The last address
The last address can be found by perform OR operation on the given addresses with the
complement of the mask.
OR operation is done bit by bit. The result of OR 2 bits is 0 if both bits are Os. The result is 1
otherwise.
The complement of a number is found by changing each 1 to 0 and each 0 to 1
Address : 11001101 00010000 00100101 00100111
Mask : 00000000 00000000 00000000 00001111
Last address : 11001101 00010000 00100101 00101111
2) If a class B network on the Internet has a subnet mask of 255.255.248.0, what is
the maximum number of hosts per subnet?
The subnet mask is 255.255.245.0
The binary representation of given subnet is: Host Part
11111111 11111111 11110101 00000000
W.K.T From the subnet shaded region is network part hence
The number of host=2n-2 212-2=>4096-2 4094 Hosts
The number of host is:4094 host (Out of 4096 Two address is reserved for Network
ID and Broadcast ID.
3) Find the Network ID, 4th Host ID, Last host ID, and Broadcast address for the given
IP address 201.20.30.40.
W.K.T it is a Class C Address. We have to perform AND operation on given IP and subnet
mask of Class C.
Binary representation of given IP is:
11001001 00010100 00011110 00101000
Binary representation of Class C mask is:
11111111 11111111 11111111 00000000
Step-2:
Do the AND operation on IP and Mask
Given IP 11001001 00010100 00011110 00101000
Subnet Mask 11111111 11111111 11111111 00000000
11001001 00010100 00011110 00000000
The decimal value for the above multiplied answer is: 201.20.30.0
The number of Host is : 2n-228-2254 Host we can connect
Hence the Network ID of given IP is: 201.20.30.0
The first Host address is: 201.20.30.1
The 4th Host ID is: 201.20.30.4
The last Host ID is: 201.20.30.254
The broadcast address is: 201.20.30.255
4. Using fixed length subnetting divide the given network 196.220.84.32 into two
parts. Give the first host ID, Last host ID, Subnet mask and the number of hosts
connected.
Clearly, the given IP is belongs to class C.
The single network having IP Address is: 196.220.84.32
196.220.84 is net ID (24 bits) and 32 is host ID (8 bits)
The Binary representation of given IP is:
11000100 11011100 01010100 00100000
For creating two subnets and to represent their subnet IDs, we require 1 bit. So, we borrow
one bit from the Host ID part.
After borrowing one bit, Host ID part remains with only 7 bits.
11000100 11011100 01010100 0/1 (host id)
If borrowed bit = 0, then it represents the first subnet.
11000100 11011100 01010100 00000000
196.220.84.00000000
If borrowed bit = 1, then it represents the second subnet.
11000100 11011100 01010100 10000000
196.220.84.10000000
IP Address of the two subnets are-
196.220.84.00000000 = 196.220.84.0
196.220.84.10000000 = 196.220.84.128
Hence
196.220.84.0 to 196.220.84.127 Subnet-1
196.220.84.128 to 196.220.84.255 Subnet-2
For 1st Subnet-
IP Address of the subnet = 196.220.84.0
Total number of IP Addresses =2n-2 = 27-2 = 128-2
Total number of hosts that can be configured = 128 – 2 = 126
Range of IP Addresses is :
196.220.84.0 to 196.220.84.127
Range of IP Addresses in Binary form is :
11000100.11011100.01010100.00000000 to 11000100.11011100.01010100.01111111
[196.220.84.00000000, 196.220.84.01111111] = [196.220.84.0, 196.220.84.127]
Direct Broadcast Address = 196.220.84.01111111 = 196.220.84.127
Subnet mask = 255.255.255.0
For 2nd Subnet-
IP Address of the subnet = 196.220.84.128
Total number of IP Addresses =2n-2 = 27-2 = 128-2
Total number of hosts that can be configured = 128 – 2 = 126
Range of IP Addresses is:
196.220.84.128 to 196.220.84.255
Range of IP Addresses in Binary form is:
11000100.11011100.01010100.10000000 to 11000100.11011100.01010100.11111111
[196.220.84.10000000, 196.220.84.11111111] = [196.220.84.128, 196.220.84.255]
Direct Broadcast Address = 196.220.84.11111111 = 196.220.84.255
Subnet mask = 255.255.255.0
5. Divide the network using variable length subnetting for the network
192.10.25.130/26 give the first host ID, last host ID, Subnet mask and network
address.
Ans.
Clearly shows, the given IP is belongs to classless address
The single network having IP Address is: 192.10.25.130
In question CIDR value is 26. Hence from left 26 bit out of 32 Bit is Network ID and right
most 6 bits are Host part for the given IP address. Representation shown below
Host part 6-Bit
The binary form of given IP is:
11000000 00001010 00011001 10000010
26-Bit network part as per the CIDR
Value given in the question
We know that for creating two subnets have to represent their subnet IDs so we require 1
bit. Hence we borrow one bit from the Host ID part.
11000000 00001010 00011001 10 0/1 (host id)
If borrowed bit = 0, then it represents the first subnet.
If borrowed bit = 1, then it represents the second subnet.
Network (IP) Address of the two subnets are:
192.10.25.10000000 = 192.10.25.128
192.10.25.10100000 = 192.10.25.160