Subnetting Extra (Tips & Hints)

I. Bit to mask: (Magic Box fro Subnetting)

Bit to Mask Table

It is easy to write subnet mask in /8, /16...
What if you have to write in bit format or decimal format?
For that you have to just remember this Magic box (Bit to Mask Table).

So, we know:

/8 = 255.0.0.0
/16 = 255.255.0.0
/24 = 255.255.255.0
/32 = 255.255.255.255

What if we have /10, /27, /14...?

Using Magic Box,

/10 = /8 + /2 = 255.192.0.0 (2 is the number on the first row and take the value from below)
/27 = /24 + /3 = 255.255.255.224
/14 = /8 + /6 = 255.252.0.0
/21 = /16 + /5 = 255.255.248.0

soon on..

**Count from Left

For Wildmask just inverse the subnet mask

/27 = 0.0.0.31
/21 = 0.0.7.255

and soon on...


II. Host requirement are more

Example: 16.20.0.0/16, requirement 1000 hosts.

According to the host view of point subnetting,

  • 1000+2 = 1002
  • 2^10 = 1024, 10 bits on host side and 1024 numbers of host.
  • 32-10 = 22 bits on network side
  • 16.20.0.0/22
Now how you will divide into blocks, 
  • 1024/256 = 4, 256 (0 -255) is possible so we need 4 block of 256 (4X256)
Block 1: 16.20.0.0 - 16.20.3.255 /22
Block 2: 16.20.4.0 - 16.20.7.255 /22
.
.
.
.
Block last: 16.20.252.0 - 16.20.255.255 /22




★CT21
Reference: https://rstforum.net/ (CCNA training)

How to do Subnetting?


Easy way to do SUBNETTING

Example:

If you want to design your network and connect HQ and Branches using one IP block, so we need subnetting.
Below diagram will help in understanding Subnetting.


IP address has NETWORK side and HOST side  **IP addressing.

**SUBNET MASK always says bit on network side.

So, Subnetting can be done by 2 ways:
  1. Host Side subnetting
  2. Network Side subnetting
I. HOST SIDE SUBNETTING:

If we want to design host point of view, collect all the number of host in your network according to the branches and connectivity.

Branch1 = 12 Host;
Branch2 = 24 Host;
Branch3 = 28 Host;
Branch4 = 30 Host;
Connectivity = 2 Hosts;
Process:
  • Identify which branch has more requirement (Branch4) because if you break network according to the branches, Branch4 will have shortage of IP's.
    • Branch4 = 30 hosts 
  • Add 2 more hosts (30+2=32) because as you know a block of IP addresses contains a Network address and Broadcast address so it cannot be use as host address.
  • Now match nearest 2^n to the value 
    • 2^5=32, n=5
      • 'n' means number of bit on host side. 5 bits on host side.
      • 32 means total number of host.
  • IP address has total 32 bits and we have taken 5 bits for host side. So, 32-5=27, 27 bits on network side.
    • 16.20.20.0/27
  • We have successfully done subnetting from /24 to /27, 3 bits we have taken from the network side which will be used for our subnet blocks.
  • Now you can use this blocks to each of your branches and connectivity, each block are in same subnet (can be switched).
  • Remember First address is Network address (16.20.20.0) and Last address is Broadcast address (16.20.20.31) they cannot be use for hosts.
    • If you want to use them use cmd:
      • IP subnet-zero
  • This method is Fixed Length Subnet Mask (FLSM).
  • Disadvantage is many IP's will be wasted or unused in your network. We used VLSM - Variable Length Subnet Mask. 
II. NETWORK SIDE SUBNETTING:

If we want to design network point of view subnetting, collect number of networks needed


Process:
  • We need 8 n/w's. Don't need to add 2 more to the n/w as we did in host process.
  • Nearest 2^n to the number of networks required; 8=2^3
    • Where 'n' means number of bits to take from network side. 3 bits we have to take from network side.
  • As per our example, 24 bits are there in network side so we have to take 3 bits more.
    • 24+3=27 bits on network side
  • Total bits are 32 bits in IP address
    • 32-27=5, 5 bits on host side
    • 2^5= 32 (Similarly to Host point of view); 32 number of hosts.
  • We have successfully done subnetting.

III. VSLM:

Since, there are to many wasted or unused IP addressing in FLSM we use VSLM to overcome this disadvantage in FLSM.

\
  • We need 2 hosts on all the connectivity between HQ and Branches, so we will apply Host point of view process and you will obtain,
    • 16.20.20.0/30
  • Do it from each links,
    • 16.20.20.4/30; 16.20.20.8/30; 16.20.20.12/30
  • Similarly, for each branches according to the host and add to the above block to continue your IP subnetting.
    • Branch1 = 16.20.20.16/28
    • Branch2 = 16.20.20.32/27
    • Branch3 = 16.20.20.64/27
    • Branch4 = 16.20.20.95/27
  • So, if you notice we have saved lots of IP's that can be used if we want to extend the network (adding another branch office).
  • Finally, Subnetting design for our example as follows:



★CT21
Reference: https://rstforum.net/ (CCNA training)

Why Subnetting?

Internet Assigned Number Authority (IANA) provides the IP addresses.

**Remember:
Subnet - If mask is more then given mask it called as SUBNET.
eg: 130.20.20.0/26

Supernet - If mask is less then then given mask is called as SUPERNET.
eg: 130.20.20.0/8

SUBNETTING means breaking the network.

Why Subnetting (break the network)?

Reason 1: Organization took an IP block from IANA for connecting there branches. eg: 16.0.0.0/8

All organisations has multiple locations (geographically separated) and they are connected to each other on MAN or WAN (Serial Link), so we have to use ROUTER to connect each other. And, Router routes between the networks. So, each branches will be in different network

Hence, We have to break the IP's into different network (Subnetting).

Reason 2: If organisation is using same subnet ip's throughout the network (Layer 2).

Theoretically, we can design only layer 2 (EoSDH) network to connect each other but practically it will degrade the network performance.

  • Flat Layer 2 disadvantage - Broadcast to all the ports on all branch switches (also multiple application are running), Bandwidth issue because of broadcast, Processing (I/O) in computer too high because of the broadcast. 


So, Router is required to block the broadcast and hence, subnetting is necessary.

Reason 3: Out of new IPv4 address, so break (Subnet) one IPv4 into multiple networks.






★CT21
Reference: https://rstforum.net/ (CCNA training)