Switching
Switch is device that works on MAC address, it is a l2 device, in which the data transmitted is in the form of a frame.
Last updated
Was this helpful?
Switch is device that works on MAC address, it is a l2 device, in which the data transmitted is in the form of a frame.
Last updated
Was this helpful?
It is a LAN device which connects one or more devices in the same Network.
Works on L2 layer of OSI model.
Switch has one broadcast domain .
MAC address is used in it.
MAC(Media Access Control) is a 48 bit address that is represented by 12 bit hexadecimal number.
Data is sent in the form of frame.
Vlan is a concept in which one single broadcast domain is split into multiple broadcast domains.
Vlan provides layer 2 security.
VLAN 1 is a default vlan.
vlan's can be created from 2-1001
Vlans advantages.
Limits the number of broadcasts thus preventing broadcast storms.
Better performance and security.
based on port number.
one port can only be a member of a particular vlan. ( voice vlan is an exception)
By default all ports will be in VLAN one.
Syntax for VLAN
Access Port
Access port can carry single vlan information in it.
Acess port can carry traffic for only one vlan.
Normally connected to end devices.
Trunk Port (Trunking)
Trunks are the links where the multiple vlan traffic passes through it.
It is done by adding a tag to the frame. it is called frame tagging.
Frame tag contains vlan number in it.
Vlan tag is added while entering a trunk port and removed after reaching the destination switch.
Syntax for Trunk
STP is a l2 protocol that prevents loops in a network.
STP enables a loop free path between the network devices.
Practically in the network there are redundant links that may cause a broadcast storms in a network that might cause delay or packet loss in the network.
In order to prevent this stp is used.
STP working
Selecting the ROOT BRIDGE
Selecting the ROOT PORT
Selecting the Designated and Non-Designated ports.
Selecting the ROOT BRIDGE
Root Bridge = Priority + MAC address
Lowest bridge id
Default priority in cisco switch is 32,768.
Selecting the ROOT PORT
It is the shortest path to the root bridge.
It is selected on the least cost
Selecting the Designated and Non-Designated ports.
Designated port is the one with the lowest cost. it is marked as a forwarding port.
it can be both on root bridge and non root bridge.
BPDU
BPDU's are short for Bridge Protocol Data Units.
It contains information regarding local bridge and root bridge id.
BPDU's are sent every 2 seconds and is dead in 20 seconds.
STP Timers.
Determine Bridge ID, Root Port, Designated Ports and Non Designated ports(blocking port)
We know that Bridge id would be lowest priority + Mac address.
So that rules out Switch C and D.
looking at priorities we see that both of them A and B are same.
A and B mac address we have the 000d and 0018, so obviously A is least. Hence its the Root Bridge.
Root ports are the shortest path to the root bridge.
It depends on the cost of the links gigabit link has a cost of 4 whereas tengigabit link has 2.
so based on that lets determine the root ports
Te1/0/1 on the switch B is one Root port, Gi1/0/1 is Switch B, now the tricky part is in switch c.
Switch C has both the giga bit ports and so the cost is same, hence due to this lowest bridge id is considered, as the bridge id is also same the root port is dependent on the port number of descending switch.
So, due to this gi1/0/3 is less than gi1/0/4, hence other end of gi1/0/3 becomes root port.
Final Root port is now decided as gi1/0/11 on the switch c.
Designated ports are all segments that are directly connected to the root,
Being on the root is the closest to the root, that implies gi1/0/3, gi1/0/4, gi1/0/10/ and te1/0/1 on switch A.
On switch B the designated ports are gi1/0/7 and gi1/0/5 as the cost from either of the ports are 2 hence both of them are 2.
All the ports that are not Designated ports are called Non-Designated ports/ Blocking ports.
Convergence time of the STP is around 50 seconds, hence this STP is not used in real time.
RPVST is used instead.
If 100Mbps link is down, then the following actions take place.
Blocking : the link is still in blocking phase, here the switch A waits for BPDU's to arrive from Switch B for about 20 seconds.
Listening : link is now out of blocking phase and due to this the switch A enters into listing phase here it listens to BPDU's sent out from Switch B. This operation takes 15 secs.
Learning : Switch A learns more about the MAC address of the switch B and populates the CAM table. This is the learning phase.
Forwarding : Now the link segment 2 comes up.
Portfast: will bypass listening and learning phases, will transition into forwarding stages.
security issues will be there.
if a portfast port receives a BPDU msg then(only switch will generate bpdu)
BPDU Guard: will put the port in an error disabled state.
BPDU Filter: when received the portfast is disabled and restarts the stp.
bpdu guards --- error disabled
bpdu filter ------- disable port fast.
Blocking
Disabled
Discarding
Listening
Learning
Learning
Forwarding
Forwarding
VLAN Trunking Protocol (VTP)
It is a protocol which helps in propagation of vlans in a vtp domain/network.
It is a cisco proprietary.
By default the switches are in server mode.
There are 3 modes of VTP.
VTP Server: Default mode in switch, sends vlan info to other switches.
VTP Client: Receives vlan info takes action and forwards it to other switches.
VTP Transparent: forwards vtp traffic and takes no action/stores in its database.
VLANs info is stored in vlan.dat file. To remove vlan info we have to delete vlan.dat file .
Syntax for configuring VTP modes
By default the switches are in server mode.
Client side configuration.
Dynamic Trunking Protocol
It is used for forming a trunk dynamically.
By default the DTP is enabled in the switch and is in auto/desirable.
whenever a DTP packet request to form a trunk, then it becomes trunk port.
There are two modes in DTP.
Dynamic auto: Passively waits for dtp packets to form trunk.
Dynamic Desirable: Initiates negotiation messages and responds to negotiation to form a trunk port.
Syntax for DTP
It is a process which enables communication between two different VLANS.
for example from vlan 10 to vlan 20.
Inter-VLAN routing can be done by using
using multiple physical link called legacy intervlan routing.
using a trunk and sub-interfaces called Router on a stick.
using a multilayer switch (L3 switch)
It uses something called SVI in this case.
SVI is short for Switch Virtual Interfaces.
SVI are nothing but virtual interfaces that are created on the L3 switch.
Communication between VLAN 10 and VLAN 20 can be done using this SVI.
It is a process in which multiple physical ports are combined together to form a single logical port.
It helps in redundancy.
It helps in increasing the Bandwidth.
It helps in load-balancing.
helps with the decrease in loops in the network.
to create a port-channel all should be having same speed, duplex and physical port(fiber or ethernet).
Etherchannel has two protocols:
PAgP(Port Aggregation Protocol)
LACP (Link Aggregation Control Protocol)
PAgP:
It is a cisco proprietary protocol.
it has two modes Auto and Desirable.
LACP
It is a open standard protocol.
it has two modes Active and Passive.