You are on page 1of 12

Introduction to Network Switches, what is a Network Switch, Features/advantages of

Network Switch

A Network Switch is a device which is used to connect multiple computers inside Local Area
Network (LAN).

Network Switches operate at Layer Two (Data Link Layer) of the OSI model. There are
Network Switches that can operate at the Network Layer (layer 3 and above) also. Network
Switches operate in Layer 3 are often referred to as Layer 3 switches or multilayer switches

Basic Function of a Network Switch and a Network Hub are same. That is to forward Layer 2
packets (Ethernet frames) from source device to destination device. But a Network switch
generally contains more intelligence than a hub.

Most common Local Area Network (LAN) architecture is Ethernet and most of today’s
Network Switches are for Ethernet Local Area Network (LAN) architecture. You can find
Network Switches of different input and output bandwidths. Today’s Ethernet Network
Switches can have bandwidths of 10, 100, 1000 or 10,000 Megabits per second.

Some of the features/advantages of Network Switch are listed below.

• Network Switches are used to connect network devices together in a Local Area Network
(LAN).

• Network Switches can learn Layer 2 (MAC) addresses and forward Layer 2 packets (Ethernet
frames) to exact destination (network hubs forward Layer 2 addresses (MAC addresses) to all
ports)

• Network Switches can control of who has access to various parts of the network.

• Network Switches have provision to monitor network usage.

• High-end switches have pluggable modules.


Difference between Network Switches and Bridges

Network Switches and Bridges are both Layer 2 devices. They operate at the Data Link Layer
(Layer 2) of the OSI Reference Model. Network Switches and Bridges have many similarities
and similar function. But Switches are considered as superior devices than bridges.
Following are the major differences between Network Switches and Bridges.

• Packet forwarding in Bridges are performed using software. Packet forwarding in Switches
are performed using ASICs (Application Specific Integrated Circuits).

• Switches operate comparatively higher speeds that Bridges.

• Method of switching of a Bridge is store and forward. Method of switching of a Switch can
be store and forward, cut-through or fragment-free.

• Normally a Switch has more ports than a Bridge.

• Bridges can operate only in half duplex mode, but a Switch can operate both in half duplex or
full duplex mode.

• Both Bridge and Switch has one collision domain per port, but switches have one broadcast
domain per VLAN.

• Switches support full-duplex Local Area Network (LAN) communication.


Methods of Switching, Store and Forward, Cut-through and Fragment-Free Switching

Local Area Network (LAN) Switches support different Switching Methods. Important
Switching Methods are store and forward, cut-through and fragment-free.

Switching Methods determine how a switch receives, processes, and forwards a Layer 2
Ethernet frame.

Store and Forward Switching

In Store and Forward switching, Switch copies each complete Ethernet frame into the switch
memory and computes a Cyclic Redundancy Check (CRC) for errors.

If a Cyclic Redundancy Check (CRC) error is found, the Ethernet frame is dropped and if there
is no Cyclic Redundancy Check (CRC) error, the switch forwards the Ethernet frame to the
destination device.

Store and Forward switching can cause delay in switching since Cyclic Redundancy Check
(CRC) is calculated for each Ethernet frame.
Cut-through Switching

In cut-through switching, the switch copies into its memory only the destination MAC
address (first 6 bytes of the frame) of the frame before making a switching decision.

A switch operating in cut-through switching mode reduces delay because the switch starts to
forward the Ethernet frame as soon as it reads the destination MAC address and determines the
outgoing switch port. Problem related with cut-through switching is that the switch may
forward bad frames.

Fragment-Free Switching

Fragment-free (runtless switching) switching is an advanced form of cut-through switching.


The switches operating in cut-through switching read only up to the destination MAC
address field in the Ethernet frame before making a switching decision.

The switches operating in fragment-free switching read at least 64 bytes of the Ethernet
frame before switching it to avoid forwarding Ethernet runt frames (Ethernet frames smaller
than 64 bytes).

Difference between Half-duplex and Full-duplex Switching

Local Area Network (LAN) communication can operate in two modes. Half-duplex and Full-
duplex.

Half-duplex Local Area Network (LANs) are networks of the past. Half-duplex Local Area
Networks (LAN) exists normally in a shared network medium like 10Base2 (coaxial cable),
10Base5 (coaxial cable), and Ethernet hubs. Devices operating in a half-duplex Local Area
Network (LAN) cannot send and receive data simultaneously.

A device can either Send data or Receive data only in a half-duplex Local Area Network
(LAN). In half-duplex Local Area Networks (LANs), one device sends the frame and all
other devices in the collision domain listen for the Ethernet frame. Collision is a problem in
half duplex networks.

Almost all current networks operate in full-duplex mode. In a Local Area Network
(LAN) operating in full-duplex mode, a device can send and receive Ethernet
frames simultaneously. In a full-duplex mode, there are separate channels to send and
receive frames. There is no collision detection in devices operating in full-duplex mode,
since collision detection is not required.
Functions of a Network Switch, Learning, Forwarding and Preventing Layer 2
Switching Loops

Three basic functions of a switch are Learning, Forwarding and Preventing Layer 2 Loops.

Learning

Learning is the process of obtaining the MAC address of connected devices. When a frame
reaches into the port of a switch, the switch reads the MAC address of the source device
from Ethernet frame and compares it to its MAC address table (also known as CAM
(Content Addressable Memory) table). If the switch cannot find a corresponding entry
in MAC address table, the switch will add the address to the table with the port number via
the Ethernet frame arrived.

If the MAC address is already available in the MAC address table, the switch compares the
incoming port with the port already available in the MAC table. If the port numbers are
different, the switch updates the MAC address table new port number. This will normally
happen when network administrators remove the cable from one port and attach it to another
port.

Whenever switch updates an entry in the MAC address table, the switch resets the timer for
that entry. Timers are used in aging process of old entries. Aging helps to remove old entries
and free memory of MAC address table to add new entries.

Forwarding

Forwarding is the process of passing network traffic a device connected to one port of a
Network Switch to another device connected to another port on the switch. When a Layer 2
Ethernet frame reaches a port on the Network Switch the switch reads the source MAC
address of the Ethernet frame as a part of learning function, and it also reads the
destination MAC address also as a part of forwarding function.

The destination MAC address is important to determine the port number which the
destination device is connected.

If the destination MAC address is found on the MAC address table, the switch forwards
the Ethernet frame via the corresponding port of the MAC address.

If the destination MAC address is not found on the MAC address table, the switch forwards
the Ethernet frame through all its ports except the source port. This is known as flooding.
Normally flooding happens when the network switch is starting up.

Flooding prevents loss of traffic when the switch is learning. When the destination device
receives the Ethernet frame and send a reply frame to the source device, the switch reads
the MAC address of the destination device and add it to the MAC address table, which is the
function of learning process.

If the source MAC address is same as the destination MAC address, the switch will drop
the Ethernet frame. This is known as filtering. This will normally happen if there is a hub
connected to a port of the switch, and both the source device and destination device are
connected to the hub.

Preventing Layer 2 Switching Loops

In practical Local Area Networking, redundant links are created to avoid complete network
failure in an event of failure in one link. Redundant links can cause layer 2 switching
loops and broadcast storms. It is the function of a network switch to prevent layer 2
switching loops and broadcast storms.

What is switch management VLAN and how to configure Management VLAN

Management VLAN is used for managing the switch from a remote location by using
protocols such as telnet, SSH, SNMP, syslog etc. Normally the Management VLAN is
VLAN 1, but you can use any VLAN as a management VLAN.

Cisco recommends not to use VLAN 1 and not to use any VLAN that carries user data traffic
as Management VLAN. You must configure IP address and default gateway for Management
VLAN.

Follow these steps to configure IP address and default gateway for Management VLAN.

sw01>enable

sw01#configure terminal

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

sw01(config)#interface vlan 1

sw01(config-if)#ip address 192.168.100.28 255.255.255.0

sw01(config-if)#no shutdown

%LINK-5-CHANGED: Interface Vlan1, changed state to up

sw01(config-if)#exit

.sw01(config)#ip default-gateway 192.168.100.1

sw01(config)#exit
Do remember to use the "no shutdown" IOS interface mode command to bring the
Management VLAN up. After configuring IP address and default gateway for Management
VLAN, you can telnet or SSH to the switch to perform switch management functions.

Basic Cisco Switch Configuration Commands


How to Configure a hostname for a Cisco Switch

To configure a name for router, use "hostname" command from Global Configuration mode.

switch>enable

switch#configure terminal

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

switch(config)#hostname sw01

sw01(config)#exit

How to Configure a MOTD Banner for Cisco Switch

Users will be presented with a MOTD (Message of the DAY) banner every time they attempt
a connection via the console port, auxiliary port, SSH or a telnet session to Cisco switch.

Use the following commands to configure a MOTD message. Here the "#" character is
known as a delimiting character. The banner message should be surrounded by delimiting
character and the message should not contain the delimiting character.

sw01>enable

omnisecu.com.sw01#configure terminal

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

sw01(config)#banner motd #Welcome to omnisecu.com.sw01.#

sw01(config)#exit

sw01#
How to enable DNS lookup for a Cisco Switch

sw01>enable

sw01#configure terminal

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

sw01(config)#ip name-server 192.168.100.10

sw01(config)#exit

sw01#

How to turn off the automatic name resolution for a Cisco Switch

The Cisco switch is set by default to try to resolve any word that is not a command to a DNS
server at address 255.255.255.255. We can turn off this by using the following command.

sw01>enable

sw01#configure terminal

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

sw01(config)#no ip domain-lookup

sw01(config)#exit

sw01#

How to assign a Local Name to an IP address

Following command assigns a host name to an IP address. Once this is completed, we can
use the configured host name for telnet or ping.

sw01>enable

sw01#configure terminal

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

sw01(config)#ip host PC001 192.168.100.122

sw01(config)#exit
sw01#

How to Turn on synchronous logging

If the Cisco Switch IOS sends a message to the console while you're entering a command, by
default the switch will interrupt your work to show the message.

If you want the information sent to console not interrupt the command you are typing, turn
on synchronous logging.

sw01>enable

sw01#configure terminal

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

sw01(config)#line console 0

sw01(config-line)#logging synchronous

sw01(config-line)#exit

sw01(config)#exit

com.sw01#

How to configure an inactivity time-out for automatic log-off

Sets time limit when console automatically logs off. Set to 0 0 (minutes seconds) means
console never logs off.

sw01>enable

sw01#configure terminal

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

sw01(config)#line console 0

sw01(config-line)#exec-timeout 3 0

sw01(config-line)#exit
sw01(config)#exit

What is Broadcast Storm

In practical Local Area Networking, it is common that the switches are interconnected for
redundancy. When switches are interconnected, the network will not fail completely even
one if the connected link fails.

When switches are interconnected for redundancy as shown below, another serious
network problem can occur, which is known as broadcast storm.

The Layer 2 traffic can be classified as unicast (one to one), multicast (one to many), and
broadcast (one to all). Broadcasts and Multicasts are required for the normal operation of
the network. MAC addresses for broadcast and multicast are given below.

• Broadcast Destination MAC address - FF:FF:FF:FF:FF:FFF

• Multicast Destination MAC addresses - 01:00:5E:00:00:00 to 01:00:5E:7F:FF:FF

In case of a broadcast and multicast switch need to forward the frame out all its ports.

For unknown destination MAC addresses also, the switch need to forward the Ethernet
frame to all ports (known as flooding) except the source port, to make sure that the frame
reach the destination.

Broadcasts from each network segment are received and processed by every device in the
network. Most of the network devices discard broadcasts because these broadcasts may be
irrelevant to those devices. These broadcasts can consume large amount of available
network bandwidth.
When switches are interconnected for redundancy as shown above, a broadcast originating
from a device connected to any switch, can cause the circulation of broadcasts around the
network and can saturate the network consuming all available bandwidth.

This network condition known as a broadcast storm. Broadcast storms consume entire
bandwidth and deny bandwidth for normal network traffic.

Broadcast storm is a serious network problem and can shut down entire network in
seconds.

Broadcast storms are prevented in networks using Spanning Tree Protocol.


What is Layer 2 Switching loop

In practical Local Area Networking, it is common that the switches are interconnected for
redundancy. When switches are interconnected, the network will not fail completely even
one if the connected link fails.

When switches are interconnected for redundancy as shown below, another serious
network problem can occur, which is known as Layer 2 Switching loop.

The Layer 2 traffic can be classified as unicast (one to one), multicast (one to many),
and broadcast (one to all). Unicasts, Multicasts and Broadcasts are different types of
network communication and are required for the normal operation of the network. MAC
addresses for broadcast and multicast are given below.

• Broadcast Destination MAC address - FF:FF:FF:FF:FF:FFF


• Multicast Destination MAC addresses - 01:00:5E:00:00:00 to 01:00:5E:7F:FF:FF

In case of a broadcast and multicast switch need to forward the Ethernet frame out all its
ports.

For unknown destination MAC addresses also, the switch need to forward the packet to all
ports (known as flooding) except the source port, to make sure that the Ethernet
frame reach the destination.

To understand Layer 2 Switching loop, refer the following diagram.

A Ethernet frame originating from Workstation to the File Server, first reaches the Switch
4. Switch 4 will forward the packet to all its ports (except the source port) since the MAC
address of the destination device (File Server) may not be available in its MAC address
table (File Server is attached to Switch 2).

Both Switch 1 and Switch 3 will receive a copy of the Ethernet frame . Now the Switch 1
and Switch 3 will search for the destination MAC address in its MAC address table and if
they fail to find the destination MAC address in their MAC address tables, both the
Switches will forward the Ethernet frame to all the ports (except the source port).

This may cause the Ethernet frame to reach back the Switch 4 via path Switch 1 – Switch
3 – Switch 4 or Switch 3 – Switch 1 – Switch 4. This may lead to a switching loop and
the Ethernet frame will start circulating the network in a loop.

Another problem is that the File Server can receive multiple copies of the same Ethernet
frame arriving via different paths, which leads to additional overhead.

Layer 2 Switching loops may cause serious problem to network performance. Layer 2
Switching loops are prevented in networks using Spanning Tree Protocol.

You might also like