Switching is process to forward packets coming in from one port to a port leading towards the destination. When data comes on a port it is called ingress, and when data leaves a port or goes out it is called egress. A communication system may include number of switches and nodes. At broad level, switching can be divided into two major categories:
Connectionless:
The data is forwarded on behalf of forwarding tables. No previous handshaking is required and acknowledgements are optionl.
Connection Oriented:
Before switching data to be forwarded to destination, there is a need to pre-establish circuit along the path between both endpoints. Data is then forwarded on that circuit. After the transfer is completed, circuits can be kept for future use or can be turned down immediately.
A network switch is a multiport network bridge that uses MAC addresses to forward data at the data link layer (layer 2) of the OSI model. Some switches can also forward data at the network layer (layer 3) by additionally incorporating routing functionality. Such switches are commonly known as layer-3 switches or multilayer switches. It forwards frames on the basis of MAC address and 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 learning and aging
To switch frames between LAN ports efficiently, the switch maintains an address table called the MAC table. When the switch receives a frame, it associates the media access control (MAC) address of the sending network device with the LAN port on which it was received. MAC address learning is enabled on all VLANs by default, The switch dynamically builds the address table by using the MAC source address of the frames received. When the switch receives a frame for a MAC destination address not listed in its address table, it floods the frame to all LAN ports of the same VLAN except the port that received the frame. When the destination station replies, the switch adds its relevant MAC source address and port ID to the address table. The switch then forwards subsequent frames to a single LAN port without flooding all LAN ports. You can also enter a MAC address, which is termed a static MAC address, into the table. These static MAC entries are retained across a reboot of the switch.
MAC Aging: You can configure the amount of time that an entry (the packet source MAC address and port that packet ingresses) remains in the MAC table. You can also configure MAC aging time in interface configuration mode or VLAN configuration mode. The MAC aging time specifies the time before an entry ages out and is discarded from the MAC address table. The range is from 0 to 1000000; the default is 300 seconds. Entering the value 0 disables the MAC aging. If a VLAN is not specified, the aging specification applies to all VLANs.
Static MAC Address: You can configure static MAC addresses on a service instance. Static MAC address configuration on service instances eliminates the need for MAC address learning, which is required for traffic forwarding. Without MAC address learning, MAC address table resources can be conserved and network resources can be optimized. Static MAC address support on service instances provides the following benefits:
• Facilitates optimization of network resources.
• Conserves MAC table resources when used for upstream traffic.
• But Multicast static MAC addresses are not allowed in MAC address configurations.
Static MAC Learning
switch# enable
switch# configure terminal
switch(config)# interface type number [interface TenGigabitEthernet 0/45]
switch(config)# service instance id ethernet [evc-id] [service instance 1 ethernet]
switch(config-if-srv)# mac static address mac-address [mac static address 0000.bbbb.cccc]
exit
Removing a MAC Address:
1. enable
2. configure terminal
3. clear mac-address-table [address mac-address] [interface type number] [bridge-domain bridgedomain-id]
4. exit
Display MAC Address Table
#show mac-address-table address mac-addr
#show mac-address-table bridge-domain bridge-domain-id
#show mac-address-table interface type number