virtualgate's picture

IP Addressing

Understanding IP Addressing [Part-1]
Content covered: 

IP v4 Addressing System

More Less
14Comments
Understanding IP Addressing [Part-2]
Content covered: 

Classful Network Architecture

More Less
6Comments

IP Address: 143.27.16.14  Find the following:

  1. Class
  2. Network ID
  3. Maximum number of hosts
  4. Directed broadcast address
  5. Limited broadcast address
Classful IPv4 addressing:

Class Type

Number of IP
addresses

NID+HID (bits)

Range (First octet only)

Example

Class A

231

8 + 24

1-126

124.0.25.36

Class B

230

16 + 16

128 - 191

130.3.6.9

Class C

229

24 + 8

192 - 223

210.3.6.5

Class D : Total Number of IP addresses = 228  (224 - 239)   // Reserved for multicasting
Class E : Total Number of IP addresses = 228  (240 - 255)   // Reserved for future use

Number of hosts in any Class = 2(number of bits in HID)-2 .

Contributor's Info

Created: Edited:
0Comment
IP addressing

Which one of the following IP addresses are not used for loop back addresses?

i. 127.1.1.10
ii. 127.10.15.7
iii. 127.0.0.0
iv. 127.255.255.255

(A) i,iii
(B) ii,iii
(C) iii,iv
(D) None

Though 127.0.0.0 , 127.255.255.255 starting with 127, but these have all 0's and all 1's in the remaining part. So, they will not be useful for loopback addressing.Hence C is the correct option.

15Comments
Finding subnet mask

For one of class B network, all odd bit positions are selected for subnetmask bits. What is the possible subnetmask?

(A) 255.255.170.170
(B) 255.255.85.85
(C) 255.255.255.240
(D) None

Given that, it is class B netwrk. Means first two octents are for NID. Have to keep all 1's in NID part.
All odd bit positions are selected for subnetmask bits. These bits are from HID part.

11111111.11111111.10101010.10101010 = 255.255.170.170
 1 octect  2 octect   3 octect   4 octect

14Comments
Subnet masking

255.255.58.0 is the subnet mask for a particular network. Which of the following pairs of IP addresses could belong to this network?

(A) 100.25.135.10 and 100.25.167.10
(B) 192.212.3.5 and 192.212.4.6
(C) 140.34.23.65 and 140.35.222.123
(D)177.90.204.44 and 177.90.136.89

If we perform bitwise ANDing between the subnet mask and ip address, network id can be obtained.
For option (A): 100.25.135.10 and 100.25.167.10
We have subnet mask as
255.255.58.0   =  11111111. 11111111.   00111010. 00000000
100.25.135.10 =  01100100.00011001. 10000111.  00001010 
                          -------------------------------------------------------
                            0110100.00011001.00000010.00000000   
                        = 100.25.2.0 
255.255.58.0   =  11111111. 11111111.   00111010. 00000000
100.25.167.10 =  01100100.00011001. 10100111.  00001010 
                          -------------------------------------------------------
                            0110100.00011001.  00100010.00000000   
                        = 100.25.36.0 
Since both network address are different . Hence It is incorrect.

For option (B): 192.212.3.5 and 192.212.4.6
255.255.58.0   =  11111111. 11111111.  00111010. 00000000
192.212.3.5     =  11000000.11010100. 00000011.00000101
                          -------------------------------------------------------
                             11000000.11010100.00000010.00000000
                       = 192.121.2.0
255.255.58.0   =  11111111. 11111111.   00111010. 00000000
192.212.4.6     =  11000000.11010100. 00000100.00000110
                          ------------------------------------------------------
                             11000000.11010100.00000000.00000000
                       = 192.121.0.0
Since both network address are different . Hence It is incorrect.

For option (C): 140.34.23.65 and 140.35.222.123
255.255.58.0   =  11111111.  11111111.   00111010. 00000000
140.34.23.65   =   10001100.00100010.00010111. 01000001
                             -------------------------------------------------------
                             10001100.00100010.00010010.00000000
                          =140.34.18.0
255.255.58.0   =    11111111.  11111111.   00111010. 00000000
140.35.222.123=   10001100.00100011.  11011110. 01111011
                             -------------------------------------------------------
                             10001100.00100011.00011010.00000000
                          =140.35.26.0
Since both network address are different . Hence It is incorrect.

For option (D) :177.90.204.44 and 177.90.136.89
255.255.58.0   =    11111111.  11111111.   00111010. 00000000
177.90.204.44 =    10110001. 01011010. 11001100. 00101100
                               ------------------------------------------------------
                           =  10110001.01011010. 00001000.00000000
                           =  177.90.8.0
255.255.58.0   =    11111111.  11111111.   00111010. 00000000
177.90.136.89=    10110001. 01011010. 10001000. 01011001
                               ------------------------------------------------------
                           =  10110001.01011010. 00001000.00000000
                           =  177.90.8.0
Since both network address are same . Hence It is the correct answer.
 

5Comments
CIDR Representation

Consider the following block of ip addresses:
150.10.20.32
150.10.20.33
150.10.20.34
-----------------
-----------------
150.10.20.47
Check if it can be represented into CIDR representation or not ?
 

Step1: IP addresses should be contiguous.
Here IP addresses are contiguous.
Step2: Check total size of the block. It should be power of 2.
Here total size is 16, i.e, 16 ip addresses are present in the block, which is 24.
Step3: First ip address in the block should be evenly divisible by size of block.
Here first ip address is 150.10.20.32 = 150.10.20.(00100000)and block size is 16 = 24 .
We can check if the number of zeros present at the end of the ip address are greater or equal to log2(Size of block), then this address will be evenly divisible by the size of the block.
So it is divisible here.

Hence this block can be represented into CIDR representation.
Here block size is 24, so 4 bits can be used for HID and remaining 28 bits can be used for NID.
So the CIDR representation will look like, 150.10.20.32/28.

12Comments
Understanding the basics of Subnetting and Subnet Mask
Content covered: 

Subnetting and Subnet Mask

More Less
6Comments

For the given subnet mask 255.255.255.224 , Find the number of subnets in each class.

  • This quiz contains 5 questions on the topic IP Addressing
  • Lean well before you attempt the quiz
  • You can attempt the quiz unlimited number of times.

Difficulty Level:  basic