• सुखार्थी त्यजते विद्यं विध्यार्थी त्यजते सुखम्सु sखर्थीन: कुतॊ विद्या कुतॊ विध्यार्थीन: सुखम् ||
  • “Luxury people leave knowledge, but a student leaves Luxury No knowledge for one who seeks Luxury, No luxury for student”
  • न चोर हार्यं न च राज हार्यं न भात्रू भाज्यं न च भारकारि |व्ययं कृते वर्धत एव नित्यं विद्याधनं सर्वधनप्रधानम ||
  • Cannot be snatched away by thief, cannot be snatched away by king, Cannot be divided among brothers, Not heavy either If spent daily, it always keeps growing. The wealth of knowledge is the precious of wealth of all”

Subnetting




Subnetting

IP Subnetting is a process of dividing a large IP network in smaller IP networks. In Subnetting we create multiple small manageable networks from a single large IP network. There are two types of Subnetting;  FLSM (Fixed Length Subnet Mask) Subnetting  and VLSM (Variable Length Subnet Mask) Subnetting.

Fixed Length Subnet Mask FLSM

In FLSM , all subnets are equal in size. All subnets have equal number of hosts. Subnet mask is same for all the subnets. FLSM is easy in configuration and administration. It can be used for classful as well as classless IP addresses. Disadvantage of FLSM is wastage of many IP addresses. 


Example 

 

An ISP is granted a block of addresses starting with 190.100.0.0/16 (65,536 addresses). The ISP needs to distribute these addresses to 4 groups of customers.

 

  1.         What is Network id of each block?
  2.              What is usable range of addresses in each block?
  3.              What  is broadcast id of each block?
  4.              How many hosts are there in each block?

 


Solution:

 Given IP address is in CIDR (Classless Inter Domain Routing) so first task is to find out number of bits used for network ID and host id

 As IP address given is 190.100.0.0/16


GNB (Given Network bits) 16 bits

GHB (Given Host bits) 16 bits


Total subnets / block required = 4


Bits required of blocks 2N= 4 so N=2


Required Network Bits / Converted Network Bits

 


RNB = GNB +   N =   16 + 2 = 18bits

 

Required Host bits / Converted Host Bits

 

RHB = GHB –N = 16-2 = 14bits

 

Default mask as GNB=16 so default mask is 16times ‘1’

 

DM = 11111111 . 11111111 . 00000000 . 00000000

DM = 255.255.0.0

 

Required / Converted  mask as RNB = 18 so required mask is 18 times one

 

RM = 11111111 . 11111111 . 11000000 . 00000000

RM = 255.255.192.0

Compare default mask and required mask starting from 4th octet

 

RM = 255.255.192.0

DM = 255.255.0.0

 

Difference is between third octets   256-192 = 64

 

Create following table to find out answers 1 to 3 of our questions

 

 

Block 0

Block 1

Block2

Block3

Answer 1

Network ID

190.100.0.0

 

Given in question

190.100.64.0

 

Difference between DM and RM which is 64 is added in third octet of network id of Block0

190.100.128.0

 

Difference between DM and RM which is 64 is added in third octet of network id of Block1

190.100.192.0

 

Difference between DM and RM which is 64 is added in third octet of network id of Block2

Answer 3


Usable

190.100.0.1

190.100.64.1

190.100.128.1

190.100.192.1

Range

190.100.0.2

190.100.64.2

190.100.128.2

190.100.192.2

Of

.

.

.

.

addresses

.

.

.

.

 

.

.

.

.

 

190.100.63.254

190.100127.254

190.100191.254

190.100255.254

Answer 3

Broad cast id

190.100.63.255

 

One less than Network id of Block1

190.100.127.255

 

One less than Network id of Block2

190.100.191.255

 

One less than Network id of Block3

190.100.255.255

 

One less than Network id of Block4

 

 

Answer 4

 

Possible Number of hosts

 =2 RHB -2 ( one IP address is reserved for Network address and one IP address is reserved as broadcast address)

RHB -2  =2 14 -2 = 16384-2= 16382 Hosts 

First and Last address of the block

Example

 A block of addresses is granted to a small organization. We know that one of the addresses is 200.16.37.39/28. What is the first address and last address in the block?

 Answer

 

The first address can be found by bit wise ANDing the given IP addresses with the mask. 

Given Address   200.16.37.39/28

 Default mask   /28  :    11111111.11111111.11111111.11110000

 

Address

200.16.37.39      .

11001000.

00100000.

00100101.

00100111

Mask

/28

11111111.

11111111.

11111111.

11110000

 

 

 Bit wise 

 ANDing

 

 

First Address

 

11001000.

00100000.

00100101.

00100000

 

.

 

 

 


 First Address is 200.16.37.32    

 The last address can be found by bit wise  ORing the given addresses with the complement of the mask. 

 

Address

200.16.37.39      

11001000.

00100000.

00100101.

00100111

Mask Compliment

/28

00000000.

00000000.

00000000.

00001111

 

 

 Bitwise

 ORing

 

 

Last Address

 

11001000.

00100000.

00100101.

00101111

 

.

 

 

 

 

  

Last Address is 200.16.37.47