Layer 2 Switching

Switch

1. Layer 2 device
2. works on Data link layer
3. It forwards frames on the basis of MAC addredd
4. it has single broadcast domain an multiple collision domain

Switch performs:-
- Learning source MAC address
- Forwarding and filtering Layer 2 data
- Loop avoidance
- Switch performs 2 Table CAM/MAC address table and TCAM table

MAC address Table:-

Port No. MAC Address Type of Learning Vlan ID
1 A Dynamic 1
2 B Static 1
- MAC address table has aging time of 300 sec i.e 5 minute and after every 5 minutes switch refreshes it self and MAC address will erase because host are connected to Switch mainly and host can change time to time.

- Dynamic entry will erase after aging time but static enrty do not erase.

- When switch receives data it learns MAC address and saved to MAC address table is called Dynamic and MAC address can be stored manually and is called Static.

See MAC address use command #Show mac-address-table on switch.

- Entering MAC manually in switch
switch(config)#mac-address-table static A vlan 1 interface f0/0
Here A ia MAC addredd of device
Vlan is the Vlan of that particular interface host is connected
Interface f0/0 is interface number that host is connected.

- Increasing aging time
switch(config)# mac-address-table aging time [? - time]

The number of MAc learning on s single switch depends upon storage capability of the catalyst/Switch.


Switch Ports

Switch has a 2 types of ports:-
1. Access port:
The access port on switch are ports which are connects to end devices or hosts.
Configuring access port :

switch(config)#interface f0/0
switch(config)#switchport mode access


2. Trunk Port:
The trunk port on switch are ports which are connects to another switch.
Configuring trunk port :

switch(config)#interface f0/0
switch(config)#switchport mode trunk


Different Between Access POrt and Trunk Port

Access Port Trunk Port
Member of Single Vlan All Vlan member
Forwards single Vlan traffic Forwards all Vlan traffic
Traffics are untagged Traffics are tagged
DTP is disabled DTP is enable
No encapsulation is not done Encapsulation is done
Above while learning difference between access and trunk port you got to know that encapsulation is done in trunk port. There are two way of encapsulation of trunk port.
ISL 802.1Q
Cisco Properity Open Standard
It adds extra 30 bytes information into frame It adds only 4 bytes of information on ethernet header
26 byts is header and 4 byte is trailer, header contains vlan info 4 byte info contains vlan info
Doesnot support Native Vlan Does support Native Vlan