Monday, May 7, 2012

IP Sub net

IP Subnet :-- In TCP/IP by default three sizes of networks are available: -
(1) Class A -224 PC -> 16777216
(2) Class B - 216 PC-> 65536
(3) Class C – 28 PC -> 256

In subneting, we will divide class A,B & C network into small size sub networks. This procedure is called subneting.Subneting is performed with the help of subnet mask. There are two types of subneting that we performed: -
  1. FLSM Fixed Length Subnet Mask
  2. VLSM Variable Length Subnet Mask 

Why to Sub?
(i) Default Class Network provide us large no. of PCs in comparison to the requirement   of PCs in the network.
(ii) It is practical never possible to create a class A or class B sized network.To reduce the broadcast of network, we have to perform LAN segmentation of routers. In each sub network, we need different network addresses.

How to Subnet?
In this formula, we will first modify our requirement according to the no. of subnet possible then we calculate new subnet mask and create IP range.

Example 1
Class = C
No. of subnet =5

Step1
No. of subnet possible is 2,4,8,16,32……
Class= C
No. of subnets= 8

Step 2
Calculate key value
2? = No. of subnets
2?  = 8
23= 8

Step 3
Calculate new subnet mask
In class C
Net id                                                                                      Host id
24+key                                                                                    8-key
24+3                                                                                        8-3
27                                                                                             5

11111111.11111111.11111111.11100000
          255.          255.          255.          224

We add this address to make subnet mask

Step 4
Range
No. of Pc/Subnet= Total Pc/ No. of Subnet
                           = 256/8 =32
 In Class C
x.x.x.0 – x.x.x.31
        (1)-         (30)
x.x.x.32- x.x.x.63
         64-          95
         96-          127
       128-           159
       160-           191
       192-           223
x.x.x.224-x.x.x.255     

The first IP of each subnet will be subnet id and last IP will be  sub network broadcast address.

Example 2
Class= C
No. of subnet= 10

Step 1
No. of subnet= 16

Step 2
24= 16

Step 3
Net id                     Host id
24+4                       8-4
11111111.11111111.11111111.11110000

Subneting method 2
Class=
No. of Pc/Sub= 8
Mask= ?
Range= ?

In this case we have to calculate the key according to the no. of per subnet according to the key value the bits of subnet mask from right hand side are set to zero then range is calculated.
 Example
Class= C
No. of Pc/Sub=5

Step 1
No. of Pc/Subnet possible 4,8,16,32,64….

New requirement
Class= C
No. of Pc/Sub= 8

Step 2
2?= No. of Pc/Sub
2?= 8
23= 8
          \ 
          \/
        key 3
11111111.11111111.11111111.11111000
         255.           255.          255.          248

No. of Subnet= Total Pc/(Pc/Sub)
                      = 256/8

Class C                                                Sub                              Pc/Sub
255.255.255.248                                 32                                8

200.100.100.0                          200.100.100.7
        .8                                 .15
                    .16                               .23
                    .24                               .31
                     .
                     .
Example 2
Class C
No. of Pc/Sub=50

Step 1
Class= C
No. of Pc/Sub= 64


Step 2
26= 64
11111111.11111111.11111111.11000000
          255.          255.          255.          192

No. of subnet= 256/64= 4
 Class C                        Sub                              Pc/Sub
255.255.255.192         4                                   64

Method 3
 No. of Pc/Sub= 50

New req.
No. of Pc/Sub= 64

No. of Subnet= 256/64= 4
Class= C
No. of Sub= 4
22= 4
24+2                                           8-2
11111111.11111111.11111111.11000000
         255.          255.          255.          192

Zero Subnet :-- According to the rules of IP Addressing the first subnet and last subnet is not useable due to routing problem. In new Cisco router a command is present in default configuration. With this command, we are able to use first and last Subnet after Subneting.
Command is
Router#config ter
Router(config)#ip subnet-zero
Router(config)#exit
 Example: - Check whether an address is valid IP, N/w address or Broadcast address. If IP is valid then calculate its N/w & Broadcast address.

200.100.100.197
255.255.255.240
28              4

200.100.100.197
200.100.100.1100    0101 --------> Valid IP

200.100.100.192
200.100.100.1100     0000 -------> Network Address
200.100.100.207
200.100.100.1100     1111 -------> Broadcast Address

Example: -
Class= B
No. of subnet= 64
                26= 64
11111111.11111111.11111111.11000000
         255.           255.          255.          192

No. of Pc/Sub= 65536/64= 1024

150.20.0.0 – 150.20.3.255
150.20.4.0 – 150.20.7.255
150.20.8.0 – 150.20.11.255

Prefix Notation of representing IP Address
IP address can be written as IP & Mask as well as IP/Prefix.
200.100.100.18
255.255.255.248
200.100.100.18/29

170.20.6.6
255.255.224.0
170.20.6.6/19
This method is representing IP address also called CIDR (Classless Inter Domain Routing) notation.

Remaining Subnet
144 – 159

160 – 175
176 – 191
192 – 207
208 – 223
224 – 239
240 – 255

Problem with FLSM
In FLSM, we have to create subnet of equal size. All N/w will be allotted constant size subnet instead of their IP addresses requirement. Due to this a N/w may be allotted more than required IP address and less than required IP addresses.


VLSM
       \25
255.255.255.128
      \26
255.255.255.192
      \27
255.255.255.224
      \28
255.255.255.240
     \29
255.255.255.248
  Sub  Pc/Sub
    2      128
  Sub  Pc/Sub
    4      64
  Sub  Pc/Sub
    8        82
  Sub  Pc/Sub
  16      16
  Sub  Pc/Sub
   32       8
    0 - 127      0 - 63     0 - 31     0 - 15       0 - 7
  128 - 255      64 - 127      32 - 63      16 - 31      8 - 15
        128 - 191      64 - 95      32 - 47      16 - 23

   192 - 255      96 - 127      48 - 63      24 - 31



     64 - 79



     80 - 95



   96 - 111




























If we are using VLSM and Dynamic Routing then routing be compatible to VLSM. This will happen only if Subnet masks are also sends in the routing updates.

Super Netting :-- Combining small N/w to create a large size N/w is called Super Network. Super netting is mostly used to define route summarizations in routing tables. It is not used for the implementation of large network.

170.10.0.0                   170.00001010.00000000.00000000
170.11.0.0                   1 70.00001011.00000000.00000000

Twitter Delicious Facebook Digg Stumbleupon Favorites More