Subnetting (FLSM & VLSM) with examples

7

Click here to load reader

Transcript of Subnetting (FLSM & VLSM) with examples

Page 1: Subnetting (FLSM & VLSM) with examples

Subnetting (FLSM & VLSM)with examples

by Krishna Mohan

[email protected]

Page 2: Subnetting (FLSM & VLSM) with examples

As IP addresses are limited, it is not advisable to waste it, weather it is private IP or public IP.A large network can be divide into various small networks using subnetting.Subnetting involves conversion of host bits into network bits.

Methods of Subnetting:a) FLSM (Fixed Length Subnet Mask)b) VLSM (Variable Length Subnet Mask)

Division of network based on requirement:a) Based on host bits : 2^h-2>=required address where h= no. of host bitsb) Based on network bits : 2^n>=required address where n=no of network bits

Addressing format with network & host bits as

Class & format Network Bits (N) Host bits (H)

A: N.H.H.H 8 24

B: N.N.H.H 16 16

C: N.N.N.H 24 8

Page 3: Subnetting (FLSM & VLSM) with examples

Calculation of Subnet mask with FLSM

Example. Calculate subnet mask using Host Bits , each having 12 hosts or nodes or devices. Also provide IP addresses of all devices. How many subnets available. Given network id as 199.1.1Solution: Step I: Calculation of host bitsFor h host bits, 2^ℎ-2≥requirementHere requirement=12Hence h=4 (as 2^4-2=16-2=14 ≥ 12Hence host bits required is 4

Step II: Calculation of subnet maskGiven class C address, which has format N.N.N.H or11111111.11111111.11111111.00000000 (24 network bits & 8 host bits)From the host bit calculation h=4, hence 4 LSB bits are host bits & remaining 4 bits of are for network bits. On rearranging 11111111.11111111.11111111.11110000 (24+4=28 total network bits & 4 host bits), which is subnet mask for the designed network, can be given as 28/4 (network bits/host bits). Converting into decimal, subnet mask is 255.255.255.240

Step III: Calculation of no of sub-networksNo of networks=2^(no of network bits taken from host bits)= 2^(8-4)=2^4=16 subnets

Page 4: Subnetting (FLSM & VLSM) with examples

Step IV: IP RangeGiven IP is 199.1.1Range=2^4= 16 (group of 16 is one subnetwork) & each having 16 devices or nodes.199.1.1.0, 199.1.1.1, 199.1.1.2………………………………………………………………………………199.1.1.15199.1.1.16, 199.1.1.17………………………………………………………………………………………...199.1.1.31199.1.1.32…………………………………………………………………………………………………………………………….199.1.1.48…………………………………………………………………………………………………………………………….……………………………………………………………………………………………………………………………………………….199.1.1.240, 199.1.1.241……………………………………………………………………………………….199.1.1.255

First address of each subnet is network ID (here 199.1.1.0, 199.1.1.16…….199.1.1.240)Last address of each subnet is broadcast ID (here 199.1.1.15, 199.1.1.31……..199.1.1.255)Network ID & Broadcast ID cannot be assigned to any device.IPs other than network & broadcast ID may be assigned to any deviceAbove IPs are for subnet mask 255.255.255.240Total IPs available for devices are 16*16-16*2=224

Page 5: Subnetting (FLSM & VLSM) with examples

What is 192.168.1.10/26It is a class C IP address with 26 network bits. The network bits used to calculate subnet mask.Since class C has format N.N.N.H, where N is 8 bit network octet, & H is host bitsGiven 26 network bits , hence the format 11111111.11111111.11111111.11000000Host bits can be calculated as h=32-network bits. Here h=32-26=6Thus subnet mask is 255.255.255.192 with IP 192.168.1.10

Page 6: Subnetting (FLSM & VLSM) with examples

Calculation of subnet mask using VLSM (Variable Length Subnet Mask)Here the length of block is variable

Example: Given the no of hosts as 100, 50 20 & 6. find IP addresses & subnet mask. Using Class C (192.168.1 network)

Solution: For 100 hosts: 2^h-2>=100, hence h=7 (host bits)Hence \value is 8+8+8+(8-7)=25Hence subnet mask is 11111111.11111111.11111111.10000000 i.e.255.255.255.128Block size is 2^7=128 hence the range is192.168.1.0/25 to 192.168.1.127/25 for 100 hosts

For 50 hosts:2^h-2>=50, hence h=6 (host bits)Hence \value is 8+8+8+(8-6)=26Hence subnet mask is 11111111.11111111.11111111.11000000 i.e.255.255.255.192Block size is 2^6=64 hence the range is192.168.1.128/26 to 192.168.1.191/26 for 50 hosts

Page 7: Subnetting (FLSM & VLSM) with examples

Solution: For 20 hosts: 2^h-2>=20, hence h=5 (host bits)Hence \value is 8+8+8+(8-5)=27Hence subnet mask is 11111111.11111111.11111111.11100000 i.e.255.255.255.224Block size is 2^5=32 hence the range is192.168.1.192/27 to 192.168.1.223/27 for 20 hosts

For 6 hosts:2^h-2>=6, hence h=3 (host bits)Hence \value is 8+8+8+(8-3)=29Hence subnet mask is 11111111.11111111.11111111.11111000 i.e.255.255.255.248Block size is 2^3=8 hence the range is192.168.1.224/29 to 192.168.1.231/29 for 6 hosts

Hence complete range:192.168.1.0/25 to 192.168.1.127/25 for 100 hosts192.168.1.128/26 to 192.168.1.191/26 for 50 hosts192.168.1.192/27 to 192.168.1.223/27 for 20 hosts192.168.1.224/29 to 192.168.1.231/29 for 6 hosts

Any doubt mail at: [email protected]