Skip to main content

Classless IP Addressing - Q & A

 Visit to learn the theory more clearly



Before questions

Slash Notation
Three Rules in CIDR Block

Question 1

Given the CIDR representation 168.1.2.10 / 18. Find the range of IP Addresses in the CIDR block.

IP address - 168.1.2.10
                    10101000.00000001.00000010.00001010

Number of bit allocated to Network ID     -     18
Number of bit allocated to Host ID            -     32-18 = 14

Subnet mask - 11111111.11111111.11000000.00000000

First address = (given address) AND (Subnet mask)
10101000.00000001.00000010.00001010
AND
11111111.11111111.11000000.00000000
10101000.00000001.00000000.00000000
168.1.0.0

Last Address = (any address) OR [NOT (Subnet mask)]
NOT (Subnet mask)
=
11111111.11111111.11000000.00000000
00000000.00000000.00111111.11111111
Last Address = (any address) OR [NOT (Subnet mask)]
10101000.00000001.00000010.00001010
OR
00000000.00000000.00111111.11111111
10101000.00000001.00111111.11111111
168.1.63.255

 Range of IP Addresses = 168.1.0.0 - 168.1.63.255

Question 2

Consider a block of IP Addresses ranging from 100.1.2.32 to 100.1.2.47.
           1. Is it a CIDR block?
           2. If yes, give the CIDR representation.

1. If it is a CIDR block, 3 rules must be satisfied.

    Rule 01 - All the IP Addresses must be contiguous unallocated addresses. 
                    Clearly, all IP addresses are contiguous.
                    Rule 01 - Correct

    Rule 02 - Size of the block must be power of 2 
                    Number of IP address in block = 47 - 32 + 1
                    Size of the block                       = 16
                    Size of the block                       = 2^4
                    Rule 02 - Correct

    Rule 03 - The first address of every block must be divisible by the length of the block.
                    First IP  address - 100.1.2.32 - 01100100.00000001.00000010.00100000
                    Last 4 bits (4 least significant bits) are Zero.
                    That means this address divisible by 2^4
                    Rule 03 - Correct
So, this IP range / Block is a CIDR Block
      

Size of Block - Total number of IP address = 16 = 2^4
Length of Host ID            = 4
Length of Network ID     = 32 - 4 = 28

CIDR representation - 100.1.2.32/28

Question 3

Consider a block of IP Addresses ranging from 150.10.20.64 to 150.10.20.127.

  1. Is it a CIDR block?
  2. If yes, give the CIDR representation.

1. If it is a CIDR block, 3 rules must be satisfied.

    Rule 01 - All the IP Addresses must be contiguous unallocated addresses. 
                    Clearly, all IP addresses are contiguous.
                    Rule 01 - Correct

    Rule 02 - Size of the block must be power of 2 
                    Number of IP address in block = 127 - 64 + 1
                    Size of the block                       = 64
                    Size of the block                       = 2^6
                    Rule 02 - Correct

    Rule 03 - The first address of every block must be divisible by the length of the block.
                    First IP  address - 150.10.20.64 - 10010110.00001010.00010100.01000000
                    Last 6 bits (6 least significant bits) are Zero.
                    That means this address divisible by 2^6
                    Rule 03 - Correct
So, this IP range / Block is a CIDR Block
      

Size of Block - Total number of IP address = 16 = 2^6
Length of Host ID            = 6
Length of Network ID     = 32 - 6 = 26

CIDR representation - 150.10.20.64/26

Question 4

Perform CIDR aggregation on the following IP Addresses-

200.96.86.0/24

200.96.87.0/24

200.96.88.0/24

200.96.89.0/24

    Rule 01 - All the IP Addresses must be contiguous unallocated addresses. 
                    Clearly, all IP addresses are contiguous.
                    Rule 01 - Correct

    Rule 02 -  Size of the block must be the power of 2
                     Each IP address prefix length is = 24
                     Suffix length is = 32 -24 = 8
                     Total number of IP Addresses = 28 + 28 + 28 + 28 = 4 x 2^8 = 2^2 x 2^8 = 2^10.
                     Rule 02 - Correct

    Rule 03 - The first address of every block must be divisible by the length of the block.
                       First IP  address - 200.96.86.0 - 11001000.01100000.01010110.00000000
                    Last 9 bits (9 least significant bits) are Zero.
                    That means this address not divisible by 2^10
                    Rule 03 - Incorrect

All 3 rules are not satisfied. Because of that cant Perform CIDR aggregation

Question 5 

Two computers C1 and C2 are configured as follows. C1 has IP address 203.197.2.53 and netmask 255.255.128.0. C2 has IP address 203.197.75.201 and netmask 255.255.192.0. which one of the following statements is true?
(A) C1 and C2 both assume they are on the same network
(B) C2 assumes C1 is on same network, but C1 assumes C2 is on a different network
(C) C1 assumes C2 is on same network, but C2 assumes C1 is on a different network
(D) C1 and C2 both assume they are on different networks.

For more clear let's write all the IP addresses and Subnet masks in binary format.

C1 IP - 203.197.2.53        -    11001011.11000101.00000010.00110101
C2 IP - 203.197.75.201    -    11001011.11000101.01001011.11001001

C1 subnet mask -  255.255.128.0    -    11111111.11111111.10000000.00000000
C2 subnet mask -  255.255.192.0    -    11111111.11111111.11000000.00000000

Let see now look at the network ID that belongs to the C1 IP address Block.

C1 Network ID = (given address) AND (Subnet mask)
11001011.11000101.00000010.00110101
AND
11111111.11111111.10000000.00000000
11001011.11000101.00000000.00000000
203.197.0.0
Now C1 see C2 network ID and subnet mask of C1.

                     = (given address) AND (Subnet mask)
11001011.11000101.01001011.11001001
AND
11111111.11111111.10000000.00000000
11001011.11000101.00000000.00000000
203.197.0.0

Now you can see C1 and C2 IP address as the same network ID

Let see now look at the network ID that belongs to the C2 IP address Block.

C2 Network ID = (given address) AND (Subnet mask)
11001011.11000101.01001011.11001001
AND
11111111.11111111.11000000.00000000
11001011.11000101.01000000.00000000
203.1.64.0

Now C2 see C1 network ID and subnet mask of C2

                     = (given address) AND (Subnet mask)
11001011.11000101.00000010.00110101
AND
11111111.11111111.11000000.00000000
11001011.11000101.00000000.00000000
203.197.0.0
The network ID of the C2 is different. 

So answer - (C) C1 assumes C2 is on the same network, but C2 assumes C1 is on a different network.

Comments

Popular posts from this blog

Inspire with Nextgen

Representing ICOVDEN and Faculty of Technology  University of Sri Jayewardenepura Join nextgen members to discuss their journey from student to professionals in the technology industry. Sunday, 4th of July at 6.00 pm - 7.00 pm Live on Nextgen IOT Facebook Page https://fb.me/e/1xZdfKS1H #shilpasayura #nextgen #Shipasayura #GiT #LKA NextGen is a great platform for anyone interested in technology and information technology knowledge scattered throughout Sri Lanka to explore their technical knowledge. Working together from school children to universities and people in the industry, this is led by the young team of the current generation. More Details http://shilpasayura.org  

Short Note - IP classes

IP address classes and Subnet mask An  IP address  is a unique identifier or numeric label used to identify devices connected to the network. This helps to develop a virtual connection between source and destination for packet communication in networking. As we develop the network, we consider the scale, the number of devices connected to the network, and other requirements. That IP address space is divided into 5 classes and then we can get a better idea of ​​the range we need to use when we need to build a network. Class A Class B  Class C  Class D Class E Important Dividing IP address space (2 * 32 no. of IP addresses) into 5 classes is called  Classful addressing . In this concept, the number of hosts for each class is fixed. We use the concept of  Classless Inter-Domain Routing (CIDR)  concept because of the limitations of classful addressing. Before short note IP classes are identified by the 1st octet of the IP address (left most from all)....