Download presentation
Published byBridget Holmes Modified over 9 years ago
1
Chapter 8 Layer 2 Switching and Spanning Tree Protocol (STP)
2
Before Switching
3
Network with Switching
4
Switching Service Layer 2 switches provides the following:
Hardware- based bridging (ASIC) Switch uses ASIC in building and maintaining their Forward/Filter table. Wire speed Switch create a private dedicated Collision Domain (for each port) and provide independent bandwidth on each port so increase the bandwidth for each user (unlike Hub). Low latency Switches and bridges are faster than Routers because they do not look at network layer header information. Low cost
5
Both Bridges and Switches
Bridges vs. Switches Bridges are software base , while switches are hardware base because they use (ASIC). A switch can be viewed as multi port bridge. Switches have higher number of ports than bridges. Bridge can have only one spanning tree , while switches can have many. Both Bridges and Switches Forward layer 2 broadcast. Learn MAC address by examining the source address of each frame received. Make forward decision based on layer 2 address. Break up collision domain but still have a single broadcast domain (Switches have 1 broadcast domain BY DEFAULT).
6
Three switch functions at layer 2
Address Learning Forward / Filter decision Loop avoidance
7
Address Learning. Notice that a switch or a bridge never learns a BROADCAST or MULTICAST address because broadcast or multicast never appear as the source address of the frame.
8
Address Learning. Switch#sh mac address-table
Vlan Mac Address Type Ports dccb.d74b DYNAMIC Fa0/1 1 000a.f467.9e80 DYNAMIC Fa0/3 1 000a.f467.9e8b DYNAMIC Fa0/4 1 000a.f467.9e8c DYNAMIC Fa0/3 b7f.c2b0 DYNAMIC Fa0/3 dc.460b DYNAMIC Fa0/3 a5dd DYNAMIC Fa0/1 00d0.58ad.05f4 DYNAMIC Fa0/1 Total Mac Addresses for this criterion: 8 Switch(config)#mac-address-table static aaaa.bbbb.cccc vlan 1 int fa0/5
9
Redundant link between Switches Problems
1.Broadcast Storm
10
2. Multiple frame copies
11
Host_1 sends a unicast frame to Router C
3. Instable MAC Table Host_1 sends a unicast frame to Router C The MAC address of Router C has not been learned by either switch. Switches A and B learn the MAC address of Host_1 on port 0. The frame to Router C is flooded. Switches A and B incorrectly learn the MAC address of Host_1on port 1.
12
Switching Modes Store and Forward.
Cut through (Fast forward ,Real time, Wire speed). Fragment free (Modified Cut through)
13
CISCO 1900 Switch Configuration
>enable #config t (config)#enable password level 1 cisco (config)#enable password level 15 cisco1 (config)#enable secret cisco (config)#hostname 1900A 1900A(config)#ip address 1900A(config)#ip default-gateway 1900A(config)#banner This is 1900A Switch @ 1900A(config)#int fa0/12 1900A(config)#description Connection_to_HR 1900A(config)#^Z 1900A#sh ip 1900A#delete nvram
14
CISCO 2950 Switch Configuration
Switch>en Switch#config t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname 2950B 2950B(config)#enable secret cisco 2950B(config)#line console 0 2950B(config-line)#password cisco 2950B(config-line)#login 2950B(config)#line vty 0 15 2950B(config-line)#password telnet 2950B(config-line)#banner Enter the text followed by the to finish This is 2950B Switch @ 2950B(config)#int f0/4 2950B(config-if)#desc connection to 2950C 2950B(config-if)#int f0/5 2950B(config-if)#desc 2nd connection to 2950C 2950B(config-if)#int vlan 1 2950B(config-if)#ip address 2950B(config-if)#no shut 2950B(config-if)#exit 2950B(config)#ip default-gateway 2950B(config)#exit 2950B#copy run start Destination filename [startup-config]? (enter) Building configuration... [OK]
15
CISCO 2950 Switch Configuration
2950B#erase startup 2950B#delete flash:nvram 2950B#reload 2950B#ping Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to , timeout is 2 seconds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/1 ms
16
Port Security Switch#config t Switch(config)#int f0/1
Switch(config-if)#switchport port-security ? aging Port-security aging commands mac-address Secure mac address maximum Max secure addresses violation Security violation mode <cr> Switch(config-if)#switchport port-security maximum 1 Switch(config-if)# switchport port-security violation ? protect Security violation protect mode restrict Security violation restrict mode shutdown Security violation shutdown mode Switch(config-if)#switchport port-security violation shutdown
17
Port Security Switch(config-if)#switchport port-security mac-address sticky Switch(config-if)#switchport port-security maximum 2 Switch(config-if)#switchport port-security violation shutdown
18
Spanning Tree Protocol
19
Bridge Protocol Data Unit (BPDU)
Port Cost BID BID: Priority, MAC Address. Cost: B.W Cost 10Gbps 2 1Gbps 4 100Mbps 19 10Mbps 100 Port: Priority, Port no. Cost BID Port Priority Port No.
20
STP Example 1
21
STP Example 2
22
STP Example 3
23
STP Example 4
24
STP Example 5
25
STP Example 6
26
STP Example 7
27
Switch#show spanning-tree vlan 2
Switch#sh spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority Address cc0 Cost Port (GigabitEthernet0/1) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority (priority sys-id-ext 1) Address b.6880 Aging Time 300 Interface Role Sts Cost Prio.Nbr Type Fa0/ Altn BLK P2p Gi0/ Root FWD P2p Switch#show spanning-tree vlan 2
29
Configuring Catalyst Switches
Administrative functions (General settings) Configuring the IP address and subnet mask Setting the IP default gateway Setting port security Setting PortFast Enabling BPDUGuard and BPDUFilter Enabling UplinkFast Enabling BackboneFast Enabling RSTP (802.1w) Enabling EtherChannel Configuring an STP root switch Using the CNA to configure a switch
30
Spanning Tree PortFast
Switch(config-if)#spanning-tree portfast ? disable Disable portfast for this interface trunk Enable portfast on the interface even in trunk mode <cr> Switch(config-if)#exit Switch(config)#int range fastEthernet 0/1 - 12 Switch(config-if-range)#spanning-tree portfast
31
BPDUGuard BPDUFilter Switch(config-if-range)#spanning-tree bpduguard ?
disable Disable BPDU guard for this interface enable Enable BPDU guard for this interface Switch(config-if-range)#spanning-tree bpduguard enable BPDUFilter Switch(config-if-range)#spanning-tree bpdufilter ? disable Disable BPDU filtering for this interface enable Enable BPDU filtering for this interface Switch(config-if-range)#spanning-tree bpdufilter enable
32
Use it on switches that have blocked port
UPLinkFast Switch(config)#spanning-tree uplinkfast Switch(config)#do show spanning-tree uplinkfast UplinkFast is enabled Station update rate set to 150 packets/sec. UplinkFast statistics Number of transitions via uplinkFast (all VLANs) : 1 Number of proxy multicast addresses transmitted (all VLANs) : 8 Name Interface List VLAN0001 Fa0/1(fwd), Fa0/2 Use it on switches that have blocked port
33
Use it on all switches BackboneFast
Switch(config)#spanning-tree backbonefast Switch(config)#do show spanning-tree backbonefast BackboneFast is enabled BackboneFast statistics Number of transition via backboneFast (all VLANs) : 0 Number of inferior BPDUs received (all VLANs) : 2 Number of RLQ request PDUs received (all VLANs) : 0 Number of RLQ response PDUs received (all VLANs) : 1 Number of RLQ request PDUs sent (all VLANs) : 1 Number of RLQ response PDUs sent (all VLANs) : 0 Use it on all switches
34
STP (802.1d) x RapidSTP (802.1w) Switch(config)#spanning-tree mode ?
mst Multiple spanning tree mode pvst Per-Vlan spanning tree mode rapid-pvst Per-Vlan rapid spanning tree mode Switch(config)#spanning-tree mode rapid-pvst
35
EtherChannel Switch(config)#int port-channel 1
Switch(config-if)#int range f0/1-2 Switch(config-if-range)#switchport mode trunk 1d03h: %SPANTREE_FAST-7-PORT_FWD_UPLINK: VLAN0001 FastEthernet0/2 moved to Forwarding (UplinkFast). Switch(config-if-range)#switchport nonegotiate Switch(config-if-range)#channel-group 1 mode desirable Switch(config-if-range)#do sh int fa0/1 etherchannel Port state = Up Sngl-port-Bndl Mstr Not-in-Bndl Channel group = 1 Mode = Desirable-Sl Gcchange = 0 Port-channel = null GC = 0x Pseudo port-channel = Po1 Port index = 0 Load = 0x00 Protocol = PAgP [output cut]
36
Selecting Root Bridge Switch(config)#spanning-tree vlan 1 priority ?
< > bridge priority in increments of 4096 Switch(config)#spanning-tree vlan 1 root ? primary Configure this switch as primary root for this spanning tree secondary Configure switch as secondary root Switch(config)#spanning-tree vlan 1 root primary
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.