CCNA—Cisco Certified Network Associate

pogonotomyeyrarNetworking and Communications

Oct 26, 2013 (3 years and 10 days ago)


CCNA—Cisco Certified Network


Dag 13

Kap 7

Layer 2 Switching

A collision domain is a
network segment with
two or more devices
sharing the same
Layer 2 Switching

Switching breaks up
large collision domains
into smaller ones
Before Layer 2 Switching

The design in Figure was called a collapsed
backbone because all hosts would need to
go to the corporate backbone to reach any
network services
Before Layer 2 Switching

Servers run OS/2 or LAN Manager because
this was "pre-NT."
Before Layer 2 Switching

Each floor of a building ran either coax or
twisted-pair wiring to the corporate
backbone, and was then connected to a

PCs ran an emulating software program that
allowed them to connect to the mainframe
services, giving those PCs the ability to
access services from the mainframe and
LAN simultaneously.
Before Layer 2 Switching

In the late 1980s and early 1990s Novell
became more popular

OS/2 and LAN Manager servers were
replaced with NetWare servers.

This made the Ethernet network even more
popular, because that's what Novell 3.x
servers used to communicate with client/
server software.
Before Layer 2 Switching

There was only one problem—the corporate
backbone grew and grew, and as it grew,
network services became slower
Before Layer 2 Switching

Cisco created faster routers, but more
segmentation was needed, especially on the
Ethernet LANs.

The invention of FastEthernetwas a very
good and helpful thing, too, but it didn't
address that network segmentation need at
Before Layer 2 Switching

Devices called bridges were first used in the
network to break up collision domains.

Bridges were limited by the amount of ports
and other network services they could
provide, and that's when layer 2 switches
came to the rescue.
Before Layer 2 Switching

These switches
saved the day by
breaking up
collision domains
on each and every
port—like a
bridge, and
switches could
provide hundreds
of ports!

Early switched
Before Layer 2 Switching

Each hub was placed into a switch port.

Now, instead of each building being crammed into
the same collision domain, each hub became its own
separate collision domain.

Switch ports were still very new and unbelievably
expensive. Because of that, simply adding a switch
into each floor of the building just wasn't going to
happen—at least, not yet.

Ethernet usesa process with the name
carriersensemultiple access collisiondetect
(CSMA/CD) to communicateacrossthe

Under CSMA/CD, a nodedoesnot sendout
a packet unlessthe networkis clearof traffic.

Iftwonodessendoutpackets at the same
time a collisionoccursand the packets are
lost. Then, bothnodeswaitfor a random
amountof time and retransmitthe packets.

Anypart of the networkwherepackets from
twoor morenodescaninterferewith each
otheris a collisiondomain.

A networkwith a largenumberof nodeson
the same segment oftenhas a lotof
collisionsand, therefore, a largecollision

Hubsprovidean easy wayto scaleup and
shortenthe distancethat the packets must
travelto get from onenodeto another. But
hubsdonot break up the actualnetworkinto
discretesegments. Switcheshandlethis job.

Imaginethat eachvehicleis a packet of
data that waitsfor an opportunityto
continuethe trip.

Thinkof a hubas a four−wayintersectionwhereall
vehicleshaveto stop. Ifmorethanonecarreaches
the intersectionat onetime, the cars must waitfor a
turnto proceed.

Nowimaginethis scenario with a dozenor evena
hundredroads that intersectat a singlepoint. The
waitand the potential for a collisionincreases
significantlyifeverycarhas to check all the other
roads beforethe carproceeds.

A switchis like a cloverleafintersection.Eachcarcan
takean exitramp to get to the destination withoutthe
needto stop and waitfor othertrafficto pass.

Imaginescenario with a dozenor evena hundred
roads that you cantakean exitramp from anyoneof
thoseroads to the road of your choice.

This abilityis whata switchprovidesfor network
Switching Services

Switches use Application-Specific-Integrated
Circuits (ASIC's) to build and maintain filter

A layer 2 switch as a multiportbridge.

Layer 2 switching breaks up collision
domains making a flatter network than an
ordinary 10BaseT network.
Switching Services

Switchesmake the LAN more
efficientby creatingmultiple

Eachport of the switchis a
separate collisiondomain. With
port, collisionsare not possible
and communicationsare more
efficient. End systems can
operatein full duplex mode and
enjoyfull availablebandwidth
Switching Services

Layer 2 switching provides the following:


Wire speed
Switching Services

Layer 2 switching provides the following:

Lowlatency(Latencyis the amountof time that a
packet takesto get to the destination. Eachnode
in a hub−basednetworkhas to waitfor an
opportunityto transmit in order to avoid

Limitations of Layer 2 Switching


We absolutely must break up the collision
domains correctly.

The right way to create a functional bridged
network is to make sure that its users spend 80
percent of their time on the local segment.
Bridging vs. LAN Switching

Bridges are software based, while switches are
hardware based because they use ASIC chips to
help make filtering decisions.

A switch can be viewed as a multiportbridge.
Bridging vs. LAN Switching

Bridges can have only one spanning-tree
instance per bridge, while switches can have

Switches have a higher number of ports than
most bridges.
Bridging vs. LAN Switching

Both bridges and switches forward layer 2

Bridges and switches learn MAC addresses by
examining the source address of each frame

Both bridges and switches make forwarding
decisions based on layer 2 addresse
Three Switch Functions at Layer 2

Address learning

Forward/filter decisions

Loop avoidance
Address learning

Layer 2 switches and bridges remember the
source hardware address of each frame
received on an interface, and they enter this
information into a MAC database called a
forward/filter table.

Address learning
Forward/Filter Decisions

When a frame is received on an interface,
the switch looks at the destination hardware
address and finds the exit interface in the
MAC database. The frame is only forwarded
out the specified destination port.
Forward/Filter Decisions
Loop avoidance

If multiple connections between switches
are created for redundancy purposes,
network loops can occur. Spanning Tree
Protocol (STP) is used to stop network
loops while still permitting redundancy.

SpanningTreeProtocolis a layer2 bridge-
basedprotocolthat helpsa networkbe more
faulttolerant, especiallyto linkfailures. Dr.
RadiaPerlman inventedSTP, whichis part of
the IEEE 802.1d specification. STP also
helpspreventoneof the major causesof
broadcaststorms: networkloops.

STP usesthe SpanningTreeAlgorithm
(STA) to avoidor eliminateloops.
HowSTP works

Eachswitchis assigneda group of IDs, onefor the
switchitselfand onefor eachport on the switch.

The switchidentifieris calledthe Bridge ID (BID).
The BID is how STP keeps track of all the switches
in the network. It is determined by a combination of
the bridge priority and the base MAC address. The
bridge with the lowest bridge ID becomes the root
bridge in the network.
HowSTP works

A pathcostvalueis given to eachport. The
costis typicallybasedon a guideline
establishedas part of 802.1D.

The speed of networkshas increased
beyondthe gigabit range, so therehas been
a slightmodificationof the standard cost
HowSTP works
New IEEE Cost
Original IEEE Cost
HowSTP works

Eachswitchbeginsa discoveryprocess to
choosewhichnetworkpathsto usefor each
segment. Special networkframeswith the
nameBridge ProtocolData Units(BPDU)
sharethis information betweenall the
HowSTP worksparts of a BPDU

RootBID. This is the BID of the currentroot

Pathcostto rootbridge. Determineshowfar
awaythe rootbridge is.

For example, ifthe data haveto travelover three
100−Mbps segments to reachthe rootbridge, the costis
38 (19 + 19 + 0). The segment that attachesto the root
bridge normallyhas a pathcostof 0.
HowSTP works-parts of a BPDU


The BID of the switchthat sendsthe BPDU.

Port ID.

The actualport on the switchfrom whichthis
BPDU wassent.
HowSTP works

All the switchesconstantlysendBPDUsto
eachotherin attemptto determinethe best
pathbetweenvarioussegments. Whena
switchreceivesa BPDU from anotherswitch
that is betterthanthe BPDU that the switchis
broadcastingfor the same segment, the
switchstops broadcastingitsBPDU outthat
HowSTP works

The switchinsteadstores the otherswitch's
BPDU for referenceand broadcastingoutto
inferiorsegments, suchas segments that
are fartherawayfrom the rootbridge.
HowSTP works

A RootBridge is chosen basedon the
resultsof the BPDU process betweenthe
switches. Initially, everyswitchconsiders
itselfthe rootbridge. Whena switchfirst
powersup on the network, the switchsends
outa BPDU with itsownBID as the rootBID.
HowSTP works

Whenthe otherswitchesreceivethe BPDU,
the switchescomparethe BID to the one
theyalreadyhavestoredas the rootBID. If
the new rootBID has a lowervalue, the
switchesreplacethe savedone. Butifthe
savedrootBID is lower, the switchsendsa
BPDU to the new switchwith this BID as the
HowSTP works

Whenthe new switchreceivesthe BPDU,
this switchrealizesthat it is not the root
bridge. The switchreplacesthe rootBID in
the switchtablewith the new rootBID. The
resultis that the switcheselectas the root
bridge the switchthat has the lowestBID.
HowSTP works

Basedon the locationof the rootbridge, the
otherswitchesdeterminewhichof theirports
has the lowestpathcostto the rootbridge.
Theseports are calledrootports. With the
exceptionof the currentrootbridge, each
switchmust haveone.
HowSTP works

The switchesdeterminewho willhave
designatedports. A designatedport is the
connectionusedto sendand receivepackets
on a specificsegment. The assignmentof
onlyonedesignatedport per segment
resolvesall looping issues.
HowSTP works

Designatedports are selectedbasedon the
lowestpathcostto the rootbridge for a
segment. Sincethe rootbridge has a path
costof 0, anyports on the rootbridge that
connectto segments becomedesignated
HowSTP works

For the otherswitches, thereis a pathcost
comparisonfor a specificsegment. Ifone
port has a lowerpathcost, that port becomes
the designatedport for that segment. Iftwo
or moreports havethe same pathcost, the
choiceis the switchwith the lowestBID.
HowSTP works

After the choiceof the designatedport for a
networksegment, anyotherports that
connectto that segment become
nondesignatedports. Theseports block
networktrafficfrom that pathso that the
trafficcanonlyaccess the segment through
the designatedport.
HowSTP works

Eachswitchhas a tableof BPDUsthat the
switchcontinuallyupdates. The networknow
has a singlespanningtreeconfiguration. The
rootbridge is the trunk and all the other
switchesare branches..
HowSTP works

Eachswitchcommunicateswith the root
bridge throughthe rootports and with each
segment throughthe designatedports to
maintaina loop−freenetwork.
HowSTP works

In the eventthat the rootbridge beginsto fail
or has networkproblems, STP allowsthe
otherswitchesto immediatelyreconfigurethe
networkso that anotherswitchactsas root
bridge. This process gives a companythe
abilityto havea complexnetworkthat is
fault−tolerantyetfairlyeasy to maintain.
LAN Switch Types

Cut-through (FastForward)When in this
mode, the switch only waits for the
destination hardware address to be received
before it looks up the destination address in
the MAC filter table. Cisco sometimes calls
this the FastForwardmethod.
LAN Switch Types

FragmentFree(modified cut-through)This
is the default mode for the Catalyst 1900
switch, and it's sometimes referred to as
modified cut-through. In FragmentFree
mode, the switch checks the first 64 bytes of
a frame before forwarding it for
fragmentation, thus guarding against
forwarding runts, which are caused by
LAN Switch Types

Store-and-forwardIn this mode, the
complete data frame is received on the
switch's buffer, a CRC is run, and, if the CRC
(cyclicredundancycheck )passes, the
switch looks up the destination address in
the MAC filter table.