Difference Between VLAN and Subnetting

 

VLAN:

1.VLAN - VIRTUAL AREA NETWORK

2.VLAN is any broadcast domain that is partitioned and isolated in a computer network at the data link layer.

3.VLAN work by applying tags to the network frames and handling these tags in networking systems

4.creating the appearance and functionality of network traffic that is physically on a single network but acts as if it is split between separate networks

5.In this way Vlan can keep network application separate despite being connected to same physical network and without requiring multiple sets of cabling andd networking devices to be deployed





EXAMPLE:

Here in the above figure, there is a router connected to three switches and each switch has many systems connected to many systems. So all End devices are connected to the same Local Area Network. So in this Network, The End device of any switch can access the data from every end device in the network.

Let us assume a scenario, You are a network administrator in a company called XYZ, you have three departments in your office 
1.VLAN _ Admin- 3PC
2.VLAN _ Pro -3PC
3.Vlan _ Dev -6PC
So you are given a job to restrict the communication between the three departments, that is the PC in the admin department should be able to communicate with systems in the same department only. It should not access the resources in the pro or dev department and the same way in every department. what is the solution for this problem??? the answer is VLAN

we can create three VLAN for each department and restrict access. This can be configured in each switch inside CLI 

VLAN 100 - Admin-FE 0/2,0/3,0/4(Interface used to connect the switch)
VLAN 200 - Pro-FE 0/2,0/3,0/4
VLAN 300 - Dev-FE 0/2,0/3,0/4,0/5,0/6,0/7

So doing this we have separated the Network into three subparts without using etc Router or switch

CODE:

Switch>en # Enable configuration 

Switch#config t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#vlan 100 #create a VLAN and declare it as 100 any number given

Switch(config-vlan)#name admin # declare a name as admin

Switch(config-vlan)#exit # exit VLAN configuration

Switch(config)#interface fastethernet 0/2  # interface to be added to VLAN 100

Switch(config-if)#switchport mode access # change the switchport mode to access

Switch(config-if)#switchport access vlan 100 # command to access vlan 100

Switch(config-if)#exit

Switch(config)#exit

------------------------------------------for FE 0/3

Switch(config)#interface fastethernet 0/3

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 100

Switch(config-if)#exit

Switch(config)#exit

----------------------------------------for FE 0/4

Switch(config)#interface fastethernet 0/4

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 100

Switch(config-if)#exit

Switch(config)#exit

----------------------------------------to see the VLAN that you have created

Switch#

%SYS-5-CONFIG_I: Configured from console by console

show vlan#command 


OUTPUT:


VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active Fa0/1, Fa0/8, Fa0/9, Fa0/10

Fa0/11, Fa0/12, Fa0/13, Fa0/14

Fa0/15, Fa0/16, Fa0/17, Fa0/18

Fa0/19, Fa0/20, Fa0/21, Fa0/22

Fa0/23, Fa0/24, Gig0/1, Gig0/2

100 admin active Fa0/2, Fa0/3, Fa0/4->VLAN THAT WE HAVE CREATED


SUBNETTING

1. A subnetwork or subnet is a logical subdivision of an IP network. The practice of dividing a network into two or more networks is called subnetting.

2. Computers that belong to a subnet are addressed with an identical most-significant bit-group in their IP addresses. This results in the logical division of an IP address into two fields: the network number or routing prefix and the rest field or host identifier. The rest field is an identifier for a specific host or network interface.

3. Traffic is exchanged between subnetworks through routers when the routing prefixes of the source address and the destination address differ. A router serves as a logical or physical boundary between the subnets.

4. The benefits of subnetting an existing network vary with each deployment scenario. In the address allocation architecture of the Internet using CIDR and in large organizations, it is necessary to allocate address space efficiently




USES OF SUBNETTING

-TO MINIMIZE COST
-TO MINIMIZE IP WASTAGE

COMPANY - SALES, HR, DEVELOPERS, SUPPORT - 100, 200, 300, 400
HOME - DESKTOP,LAPTOP - 2 COMPUTER.
CLASS C = 254 -2 = 252 HOSTS WASTED.
THIS CAN BE PREVENTED BY SUBNETTING.


EX  : 255.255.255.0 - 11111111.11111111.11111111.00000000 - 2 COMPUTERS
     111111 - CONVERTING TO N/W

     11111111.11111111.11111111.11111100
255.255.255.248 - CUSTOM SUBNET MASK


HOW SUBNETING WORKS

IS THE PROCESS OF CALCULATING WASTED HOST BITS AND 
CONVERTING THE WASTED HOST BIT TO NETWORK BITS.




SCENARIO 1

SALES - 120
HR - 120

STEP 1 : TO FIND CLASS

NO OF COMPUTERS = 120+120 = 240 < 254
WE CAN USE CLASS C

STEP 2 : TO FIND ‘n’

‘N’ - no of bits to be borrowed

2 power n >= Req No of Network
2 power n >= 2

 n=0
2 power 0 = 1>=2 false
 n=1
2 power 1 = 2>=2 true

n=1 (no of bits to borrow)

STEP 3 : TO FIND CSM

CLASS C
DSM - 255.255.255.0 - 11111111.11111111.11111111.00000000

CSM - 11111111.11111111.11111111.10000000 - 255.255.255.128


STEP 4 : CALCULATING NO OF N/W AND HOST

NO OF N/W = 2 power n
NO OF HOST = 2 power h and -2

No of N/w = 2 power 1 = 2 network
No of Host = 2 power 7 and -2 = 128-2 = 126 hosts.


STEP 5 : IP ASSIGNING 

A + B = C + 2 = D - 1 = E

SALES

192.168.1.0 -------------- 192.168.1.127

0 - A

126 - B

0+126 = 126 + 2 = 128 - 1 = 127

HR

192.168.1.128 ----------------192.168.1.255

128 - A
126 - B

128+126 = 254+2 = 256-1 + 255

-----------------------------------------------------------------------------------------------------------
Any Comments feel free to post it.
Any doubts Dm  it in programming_spot page in Instagram
  

Comments

Popular posts from this blog

DDR 3 VS DDR 4

JAVA BEANS

GOOGLE DORKS