Layer 2 Switch Layer 2 Switching is hardware based. Uses the host's Media Access Control (MAC)...
-
Upload
godwin-hardy -
Category
Documents
-
view
221 -
download
0
Transcript of Layer 2 Switch Layer 2 Switching is hardware based. Uses the host's Media Access Control (MAC)...
Layer 2 Switch
Layer 2 Switching is hardware based.
Uses the host's Media Access Control (MAC) address.
Uses Application Specific Integrated Circuits (ASIC) to build
and maintain filter tables.
Break up Collision domain but don't break up Broadcast
domain.
Security through VLAN implementation.
Cost effective, Low Latency, Wire Speed.
Provide dedicated bandwidth to end users.
Avoid loops using STP (Spanning Tree Protocol).
Functions of Layer 2 Switch
• Address LearningLayer 2 switches retain, in their filter tables, the source
hardware address and port interface it was received on.
• Forward/Filter decisions When a frame is received, the switch looks at the
destination hardware address and finds the interface it is on
in the filter table. If the address is unknown, the frame is
broadcast on all interfaces except the one it was received
on.
Functions of Layer 2 Switch
• Loop Avoidance
If multiple connections between switches exist for
redundancy, network loops can occur. Spanning Tree
Protocol is used to stop loops while still allowing
redundancy.
Switching Loops
• Broadcast Storms.• Multiple copies of frames.• Database instability.• Multiple Loops
Broadcast Storm
Send ARP request
Flood broadcast through non-source ports
And so on with nothing to stop it
Multiple Copies of Frames
Send frame to B
A is on port 3Don’t know B
So flood
Frame arrives
And again
Database Instability
Send frame to B
A is on port 1A is on port 2
???
A is on port 3A is on port 1A is on port 2
Spanning Tree Protocol
• Originally created by DEC (Compaq HP)• IEEE creates its own version called 802.1 D• All CISCO switches run 802.1 D• STP’s main task is to stop network loops from
occurring in layer 2 network.• Use Spanning tree algorithm.
Spanning Tree Protocol
• STP’s main task is to stop network loops from occurring in layer 2 network.
• Use Spanning tree algorithm– Create a topology database.– Search out and destroy redundant links.
Spanning Tree Algorithm
The switches use this algorithm to decide which ports should be shut down.
1. Choose one switch to be “root bridge”
2. Choose a “root port” on each other switch
3. Choose a “designated port” on each segment.
4. Close down all other ports.
Outline of ProcessRoot bridge
Root port
Root port
Root port
Designated portDesignated port
Designated port
Designated port Not chosenClose down
1. Choose the Root Bridge
• Each switch has a bridge ID (BID) of priority value followed by MAC address
• Switches exchange Bridge Protocol Data Units (BPDUs) to compare bridge IDs
• The switch with the lowest bridge ID becomes the root bridge
• Administrator can set the priority to fix the selection
Bridge ID
• The bridge ID consists of bridge priority, and MAC address
• By default the priority is 32768• Lowest priority wins• Value 1 - 65536, multiples of 4096• MAC address used if priority is the same.
Better not to rely on MAC address.
Select Root Ports• Every non-root bridge (Switch) selects a root port• This is the port with the lowest cost path to the root
bridge.
Finding the cost of Link
• Default port costs depend on the speed of the link. Set by IEEE.
• Costs may change as faster Ethernet is developed.
Link speed Revised cost Previous cost
10 Gbps 2 1
1 Gbps 4 1
100 Mbps 19 10
10 Mbps 100 100
What if Ports have same Cost?
• Use the port priority and port number.• By default
F0/1 has 128.1F0/2 has 128.2
Passing Cost InformationEach BPDU includes the cost of the path back to the root bridge.The cost is the total cost of all the links.
As a switch receives a BPDU, it updates the cost by adding on the cost of the port through which the BPDU was received
Select Designated Port
• On every segment, the port with the lowest cost path to the root bridge becomes the designated port
Designated Port if Cost Same
• Choose the port on the switch with the lower bridge ID. Suppose this is switch B.
Close down redundant links
• Any port that is not a root port or a designated port is put in blocking state
BPDU
The BPDU message is encapsulated in an Ethernet frame.The destination MAC address is 01:80:C2:00:00:00, which is a multicast address for the spanning-tree group.
Port Roles
STP makes ports:Root ports (forwarding)Designated ports (forwarding)Non-designated ports (shut down)
Port States in traditional STP
Blocking – receives and transmits BPDU frames.Listening - receives and transmits BPDU frames. Learning - receives and transmits BPDU frames. Learns MAC addresses.Forwarding – Fully active, forwards user data.Disabled – Administratively shut down.
States and Timers
BlockingLoss of BPDU detectedMax-age = 20 sec
BlockingWhen link first comes up
ListeningForward delay = 15 sec
LearningForward delay = 15 sec
Forwarding
Hello timer 2 sec for sending BPDUs.
Up to 50 sec from broken link to forwarding again.
LAN Switching Modes
Store and Forward
The entire frame is copied into its buffer and computes the Cyclic Redundancy Check (CRC). Since it copies the entire frame, latency varies with frame length. If the frame has a CRC error, is too short (<64 bytes), or is too long (>1518 bytes) it is discarded. If no error, the destination address (MAC) is looked up in the filter table and is sent to the appropriate interface. Is the default state for 5000 series switches.
LAN Switching Modes
Cut Through
Fastest switching mode as only the destination address is copied. It will then look up the address in its filter table and send the frame to the appropriate interface.