Switch Concepts and Configuration
CSMA/CD
Shared medium
Physical shared
cable or hub.
Ethernet was
designed to work
with collisions.
Uses carrier sense multiple access collision detection.
CSMA/CD
Device needs to transmit.
It “listens” for signals on the medium.
If finds signals – it waits. If clear – it sends.
Carry on listening. If it receives while sending the first 64
bytes of the frame then collision.
Stop sending frame, send jam signal.
Wait for random time (backoff)
Try again – listen for signals etc
No collisions
Fully switched network with full duplex operation = no
collisions.
Higher bandwidth Ethernet does not define collisions –
must be fully switched.
Cable length limited if CSMA/CD needed.
Fibre optic – always fully switched, full duplex.
(Shared medium must use half duplex in order to detect
collisions.)
Ethernet Communications
Unicast:
one-to-one
Broadcast:
one-to-all
Multicast:
one-to-many
Ethernet Frame: Minimum 64 bytes, Maximum 1518 bytes
802.2 is data link layer LLC sublayer
Preamble: Synchronize to medium.
Destination Address: MAC Address of destination device.
Source Address: MAC address of source device.
Length/Type: Length of frame or protocol type code.
Data: Encapsulated data from OSI Layers 7 to 3.
FCS: Frame Check Sequence.
MAC address
48-bits written as 12 hexadecimal digits. Format varies:
00-05-9A-3C-78-00, 00:05:9A:3C:78:00, or
0005.9A3C.7800.
MAC address can be permanently encoded into a ROM
chip on a NIC.
Some manufacturers allow the MAC address to be
modified locally.
Collision Domains
Shared medium – same collision
domain.
Collisions reduce throughput
The more devices – the more
collisions
Hub – maybe 60% of bandwidth
available
How many collision domains
11
Broadcast domains
Layer 2 switches flood broadcasts.
Devices linked by switches are in the same broadcast
domain.
A layer 3 device (router) splits up broadcast domains, does
not forward broadcasts
Destination MAC address for broadcast is
all 1s, that is FF:FF:FF:FF:FF:FF
How many broadcast domains
2
Switch Port Settings:
AUTO:
Auto-negotiation of duplex mode. The two ports
communicate to determine the best mode.
FULL:
Full-duplex mode.
HALF:
Half-duplex mode.
Configure Duplex and Speed:
If auto-negotiation fails because the attached device does
not support it, the Catalyst switch defaults the switch
port to half-duplex mode.
Half-duplex on one end and full-duplex on the other
causes late collision errors at the half-duplex end.
To avoid this, manually set the duplex parameters of the
switch to match the attached device.
a cross-over or a straight-through cable was required
depending on the type of device that was being
connected to the switch.
Ethernet Switches and Bridges
Address learning
Forward/filter decision
Loop avoidance
Switch MAC Address Table
A switch builds a MAC address table by learning the MAC
addresses of each device connected to each of its ports.
Once the MAC address has been added to the table, the
switch uses the table entry to forward traffic to that node.
If a destination address is not in the table, the switch
forwards the frame out all ports except the receiving port.
When the destination responds, the MAC address is added
to the table.
If the port is connected to another switch or a hub, multiple
MAC addresses will be recorded in the table.
MAC Address Table
Initial MAC address table is empty.
Learning Addresses
Station A sends a frame to station C.
Switch caches the MAC address of station A to port E0 by
learning the source address of data frames.
The frame from station A to station C is flooded out to all
ports except port E0 (unknown unicasts are flooded).
Station D sends a frame to station C.
Switch caches the MAC address of station D to port E3 by
learning the source address of data frames.
The frame from station D to station C is flooded out to all
ports except port E3 (unknown unicasts are flooded).
Filtering Frames
Station A sends a frame to station C.
Destination is known; frame is not flooded.
Broadcast and Multicast Frames
Station D sends a broadcast or multicast frame.
Broadcast and multicast frames are flooded to all ports other
than the originating port.
Switch Forwarding Methods
Cut-Through
Store and Forward
•Switch checks destination
Complete frame is received
address and immediately
and checked before forwarding.
begins forwarding frame.
Fragment-Free
•Switch checks the first 64
bytes, then immediately
begins forwarding frame.
Symmetric and Asymmetric Switching
Symmetric – all ports operate at
same bandwidth
Asymmetric – different bandwidths
used, e.g. server or uplink has greater bandwidth
Requires store and forward operation
with buffering.
Most switches now are asymmetric
to allow flexibility.
Port Based Buffering
Each incoming port has its own queue.
Frames stay in buffer until outgoing port is free.
Each incoming port has a fixed and limited amount of
memory.
Shared Memory Buffering
All incoming frames go in a common buffer.
Switch maps frame to destination port and forwards it when
port is free.
Flexible use of memory allows larger frames.
Important for asymmetric switching where some ports work
faster than others.
Layer 2 and Layer 3 Switching
Traditional Ethernet switches
work at layer 2.
They use MAC addresses to
make forwarding decisions.
They do not look at layer 3
information.
Layer 3 switches can carry out
the same functions as layer 2
switches.
They can also use layer 3 IP
addresses to route between
networks.
The can control the spread of
broadcasts.
Storage and start-up
ROM, Flash, NVRAM, RAM generally similar to router.
Boot loader, POST, load IOS from flash, load configuration
file.
Similar idea to router. Some difference in detail.
Boot loader lets you re-install IOS or recover from
password loss.