Switching

You might also like

You are on page 1of 6

Switching

Features
1.
2.
3.
4.

Ethernet switch operates at Layer 2.


Layer 2 switching is also called bridging.
They segment the n/w into multiple collision domains.
Unlike hub they do not broadcast the frames to all the ports thus switch breaks the
broadcast domain and segments the collision domain.
5. They are fast because they do not look at the n/w layer header, instead look at the
frames h/w address.
6. Specific features:
i. Hardware-based bridging (MAC)
ii. Wire speed
iii. Low latency
iv. Low cost
Uses of Switching
1. Workgroup connectivity
2. N/w segmentation breaking up of collision domains)

Difference between Bridging and Switching

Bridging

Switching

S/w based
One spanning tree per bridge
Only 16 ports

H/w based
Many spanning tree per bridge
Can have hundreds

Basic Functions Of Layer 2 Switches


1. Address Learning
Layer 2 switches and bridges remember the source h/w address of devices attached to
each of its ports. It then stores this information into its MAC database.
2. Forward/Filter decision
On receiving a frame, Ethernet switch consults its MAC database to match destination
h/w address with the exit interface.

3. Loop Avoidance
With the help of STP, Ethernet switch can prevent n/w loops. Loops are occurred when
frames look for redundant path.
Address Learning
Before understanding the address learning function of a switch we need to understand the
initial state of a switch:
1) When a switch is powered on for the first time, the MAC address table is empty.
2) When a device transmits a frame, the switch places the source address in the
MAC address table.
3) Since the destination h/w address is not available in the MAC address table, the
switch forwards the frame to each connected port except the port receiving the
frame (called flooding).
4) Flooding causes bandwidth wastage.
5) If a device answers and sends a frame back, the switch learns the source address
of the host and enters in the MAC database.
6) Now with the help of two MAC addresses, switch cannot establish point-0to
point connection.
7) This makes switch better than hub. In a hub n/w, all frames are forwarded out all
ports every.

Forward/Filter Decision
1) A frame with destination h/w address is forwarded only on the specific port. This
preserves bandwidth.
2) If destination h/w address is not listed in the MAC database, then the frame is
broadcasted out all active interfaces except the interface the frame was received
on.
3) If a device answers, the broadcast, the MAC database is updated with the devices
h/w address (called address learning).
Loop Avoidance
Loops in the n/w are occurred due to redundant links.

Redundant links are extremely helpful, but they cause more problems then they solve.
Some of the more serious problems caused by redundant links are as follows:
1) In the absence of loop avoidance scheme, the switch will flood broadcast
endlessly. This situation is commonly called as broadcast storm or bridge loop.
2) This causes wasted bandwidth and severely impacts network and host
performance.
3) A device can receive multiple copies of the same frame, since the frame can
arrive from different segments at the same time.
4) This confuses MAC address filter table about the location of a device. Thus frame
forwarding become impossible, since switch is constantly updating its MAC filter
table.
Fig. Showing redundant Topology for a Switched Network

STP and Network Loop Avoidance


STP constantly monitor the n/w, finds all the links and make sure that loops do not occur
by shutting down redundant links.
When the n/w topology changes STP reconfigures switch or bridge ports to avoid a total
loss of connectivity
STP is enabled by default in catalyst switch.
Working of STP
1. Electing a Root Bridge
Only one switch/bridge is designated as the root bridge.
All the ports on the root bridge are in the forwarding state and are called designated ports.
To elect the root bridge we first compare the bridge priority and if they are same then we
compare their MAC address.
The switch with lowest bridge ID is taken as Root Bridge. Bridge ID is made of priority
(2 bytes) plus the bridge MAC address (6 bytes)

2. Selecting the Root Port on the Non-root Bridge


The root port on the non-root bridge is the port giving lowest path from the non-root
bridge to the root bridge. Root port is put at the forwarding state.
3. Selecting Designated Port
On each segment there is one designated port. The designated port is selected on the
bridge that has the lowest cost path to the root bridge. Designated ports are responsible
for forwarding traffic for the segment.
Spanning Tree Port States

Spanning Tree Port States


There are four spanning tree states
1.
2.
3.
4.

Blocking
Listening
Learning
Forwarding

Blocking
All ports are in blocking state when the switch is powered on. Ports wont forward frames
but can still receive BPDUs.
Listening
This state is used to indicate that the port is getting ready to transmit. Llistens to BPDUs
to make sure that no loops occur in the network before passing data frames.
Learning
In this state port learns MAC addresses and builds a filter table but does not forward
frames.
Forwarding
The port can send and receive data.

Topology change (convergence) and STP


Convergence refers to any change in the n/w topology, which causes all the switches and
bridge port to transition to either forwarding or blocking state. No data is forwarded
during this time.
Fast convergence is a desirable n/w feature because it reduces the time taken by switches
to move from blocking to forwarding state. The default time is 50 seconds to go from
blocking to forwarding state.

Different Switching Modes or Methods of Transmitting Frames:

1. Store and forward


2. Cut-through
3. Fragment-free

Features

Store and Forward

Cut Through

Fragment Free

1.Part of frame to
receive

Must receive
complete frame
before forwarding

Receive partial
frame consisting of
preamble, SFD, DA

Partial: preamble,
SFD,
DA, SA, Length

2.Frame checking

DA, SA are read


CRC is performed,
relevant files are
applied.
Very high; varies
with frame length
Default

Checks DA and
begins forwarding

Lowest

Reads only first


64bytes and can
filter out collision
frames
Low

Not a default

Not a default

3.Latency
4.Default switching
method

Frame showing different Switching Modes:

6 bytes
Preamble

1 byte
SFD

6 bytes
DA

6 bytes
SA

2 bytes
Length

Up to
1500 bytes 4 bytes
DATA
FCS

|====== Cut through=======|


|=========Fragment free=======================|
|===============Store and forward============================|

You might also like