Subnetting

 Subnetting explained

Subnetting is a process of dividing a network into multiple small networks. It expand routing efficiency, decrease the size of the broadcast domain and enhanced the security of network.

Considered the below example:-

subnetting example

In the above example we have one network: 10.0.0.0/24. And all hosts on the network are in the same subnet, that has the below disadvantages:

  • A single broadcast domain – All hosts are in same broadcast domain. A broadcast sent by any node on the network will be process by all hosts, which is creating lots of unnecessary traffic in the network.
  • Network security – Each device can reached any device on the network, which can be a security problem. such that, a server contain sensitive information should not be in the same network as user computer's.
  • Organizational problems – In a larger networks, different departments usually grouped into different subnet. such that, you can sort all devices from the Accounting department in the same subnet and then give the access to the sensitive financial data only to user from that subnets.

The above network example could be sub netted like this:-

subnetting example 2

Now, two subnets created for different department: 10.0.0.0/24 for Accounting and 10.1.0.0/24 for Marketing department. Devices are in each subnet are now in a different broadcast domain. This will reduce the unnecessary traffic flowing on the network and allow us for implementing packet filtering on router.


CIDR (Classless inter-domain routing)

CIDR (Classless inter-domain routing) is a technique of public IP address assignment. It introduced in 1993 by Internet Engineering Task Force (IETF) with the given below goals:

  • To deal with the IPv4 address consumption problems
  • To slow down the extension of routing tables on Internet routers

Before CIDR, public IP address were allocate based on the classes boundary:

  • Class A – the classful subnet is /8. The number of IP addresses is 16,777,216 (2 to the power of 24).
  • Class B – the classful subnet is /16. The numbers of possible address is 65,536
  • Class C – the classful subnet is /24. Only 256 addresses available in this subnet.

To combat this, Classful network measure of allocating the IP address was rejected. And The new system in classless – Classful network was split into multiple small networks. Such that, If  company needs 12 public IP address, and would get something like: 190.5.4.16/28..

The number of usable IP addresses can be calculate with the below formula:

2 to the power of host/off bits – 2

In the above example, the company got 14 usable IP address from the 190.5.4.16 – 190.5.4.32 range because there are 4 host bits and 2^4-2 = 14, The first and last addresses are the network address and the broadcast address, And all other addresses inside the range could be assigne to Internet hosts.


Variable Length Subnet Masks (VLSM)

We have limited number of private IPv4 address, that can be use in every organization. As the Internet and most organization are combative growing, we need a way to eliminating wasting IPv4 addresses. One of the way is that we can maximize the use of private IPv4 addresses in the organization is through subnetting.

The reason why need subnetting is to efficiently give out an IPv4 address with the least wastage and to create multiple networks with the smaller broadcast domain. To efficiently use subnetting, we use Variable-Length Subnet Mask (VLSM).

With help of Variable-Length Subnet Mask (VLSM), we can assign the closest required number of IP addresses into subnetwork in our LAN. We do not need to use a /23 subnet mask in all of our subnets..

Process to Implement Variable-Length Subnet Mask (VLSM)

We will use below topology as we go through the process of the Variable-Length Subnet Mask (VLSM).

vlsm

 

Step 1. Identifying the host requirement. How many hosts/IP address are needed by the subnet in our LAN? We arrange them from the high IP requirement to the lowest, and we will perform VLSM subnetting start from the subnet with highest host requirement. Do not forget to contain the point-to-point links as well.

  • HQ LAN(Local Area Network) – 50 hosts
  • BRANCH 1 – 30 host
  • BRANCH 2 – 20 host
  • WAN 1 (HQ to BRANCH 1) – 2 host
  • WAN 2 (HQ to BRANCH 2) – 2 host
  • WAN 3 (BRANCH 1 to BRANCH 2) – 2 host

The total number of host requirements for our network is 106 hosts, and will perform VLSM subnetting on the HQ LAN first.

 

Step 2. decide the class of IP subnet. We need to decide the class of IP subnet that we will use based on the required hosts.

Class A has 16,777,216 hosts, Class B has 65,536 hosts, and Class C has 256 IP hosts. As our network requirement, we need only 106 host, So will use Class C IP address space. In our example, we use 192.168.10.0. It could also be that the organizations buy an IP address space from the IP address authorities.

 

Step 3. recognize the host bits for every subnet. In our network topology, HQ LAN has 50 hosts need, so we would have 6 host bits.

2^6 host bits will give us 64 hosts and minus 2 for network address and the broadcast address, which is equal to 62 usable hosts. It sufficient for our 50 hosts requirement for HQ LAN.

 

Step 4. Calculate subnet mask. determine the network bits and the subnet mask of the network. We can get the subnet mask by subtracting the host bits by 32. For HQ LAN, it’s 32 minus 6 host bits, and that is equal to /26. The subnet mask for HQ LAN is /26 is 255.255.255.192...

 

Step 5. Get the increment. To decide in which block of number should we go up, we use the formula 2^host bits. For HQ LAN, it is 2^6 host bits, which give us an increment of 64.

 

Step 6. decide the network address, broadcast address, and IP address range. Starting from the base IP address,.

For our network, we have a base IP is 192.168.10.0. For HQ LAN, we increment in a block of 64 as calculate in Step 5. also, since it's in the Class C IP address space, as identify in Step 2, we increment in 4th octet.

HQ LAN:

Number of Host – 50

Hosts Bit – 6 bits

Subnet Mask – 255.255.255.192/26

Increments – 64

Network Address – 192.168.10.0

Broadcast Address – 192.168.10.63

Usable IP – 192.168.10.1 to 192.168.10.62

 

BRANCH 1 LAN:

Number of Host – 30

Host Bit – 5 bits

Subnet Masks – /27 or 255.255.255.224

Increments – 32

Network Addresses – 192.168.10.64

Broadcast Address – 192.168.10.95

Usable IP Addresses range – 192.168.10.65 to 192.168.10.94

 

BRANCH 2 LAN:

Number of Host – 20

Host Bit – 5 bits

Subnet Masks – /27 or 255.255.255.224

Increments – 32

Network Addresses – 192.168.10.96

Broadcast Address – 192.168.10.127

Usable IP – 192.168.10.97 to 192.168.10.126

 

WAN 1:

Number of Host – 2

Host Bit – 2 bits

Subnet Mask – 255.255.255.252/30

Increments – 4

Network Address – 192.168.10.128

Broadcast Address – 192.168.10.131

Usable IP – 192.168.10.129 to 192.168.10.130

 

WAN 2:

Number of Host – 2

Host Bit – 2 bits

Subnet Mask –  255.255.255.252/30

Increments– 4

Network Address – 192.168.10.132

Broadcast Address – 192.168.10.135

Usable IP – 192.168.10.133 to 192.168.10.134

 

WAN 3:

Number of Host – 2

Host Bit – 2 bits

Subnet Mask – /30 or 255.255.255.252

Increments – 4

Network Address – 192.168.10.136

Broadcast Address – 192.168.10.139

Usable IP– 192.168.10.137 to 192.168.10.138


Private IP addresses

The real design of the Internet knowing that each host on every network should have a real and routable IP address. An organization that would like to access Internet would complete some paperwork to relate its internal network and number of hosts on it. The organization would receive a number of IP address, according to its need. But there was one problem with this concept – if each host on each network in the world was provide with an unique IP address, we have run out of IP address a long time ago.

So, the concept of private IP addressing was developed to address the IP address consumption problem. The private IP address can be used on the private network of any organization in the world and whichare not globally unique.

Consider the below example:

Private IP addressing

In the above example you see that two unrelated organization use the same private IP network inside their internal network. Because private IP address aren't globally unique, both organization can use private IP addresses from the same range. To access the Internet, the organization use a technology called Network Address Translation (NAT).

There are three range of IP addresses that can be use in a private network:

  • 10.0.0.0 – 10.255.255.255
  • 172.16.0.0 – 172.31.255.255
  • 192.168.0.0 – 192.168.255.255

Internet router are configure to drop any packets coming from the private IP address ranges, so these address are not routable on the Internet.


Post a Comment

2 Comments