Thursday, August 14, 2014

Spanning Tree Protocol



Spanning Tree Protocol

Redundant Topology
A Local Area Network may consist of more than one segment. Each segment of the LAN connected through a separate physical device mostly switch. Switches use their uplink ports to connect different segments. The LAN administrator can connect the switches with each other through more than one uplink port using redundant topology. Redundant topology eliminates the single point of failure and that will improve the performance of network. Overall redundant topology is a good solution for making a LAN efficient but there are some drawbacks of redundant topology. It causes broadcast storms, multiple frame copies and MAC address table instability problems. For example there are two switches connect with each other using redundant topology. A host on one segment sends a broadcast frame. Broadcast frames are flooded to all ports other than the originating port. Remembering redundant topology, there are two uplink ports are using on both the switches, so the switches continue to propagate the broadcast traffic over and over through the uplink ports. Complex topology can cause multiple loops to occur and layer 2 has no mechanism to stop the loops. The solution is Spanning Tree Protocol.
Spanning Tree Protocol Basics
The IEEE defines the Spanning Tree Protocol that provides a loop free redundant network topology by placing certain ports in the blocking state. STP works in a broadcast domain therefore each VLAN has its own spanning tree. Spantree 1 is by default enabled in the Cisco switches for the default VLAN 1. A switch as compare to bridge may have multiple spanning tree protocols as the number of VLAN while Inter VLAN routing supports ip spanning.
How Spanning Tree Protocol Works
The spanning-tree operations are as follows:
  • STP elects a Root Bridge and both the ports of the Root Bridge are designated ports and are placed in the forwarding state.
  • The non Root Bridge considers one of its ports as a root port with the least administrative cost and the other port considers as a non designated port. Root port placed in the forwarding state in the blocking state while the non designated port is in the blocking state. Spanning Tree Protocol Algorithm
    The STP algorithm selects the Root Bridge first:
  • Root Bridge is the switch with the lowest Bridge ID and Bridge ID consists of bridge priority and MAC address. The lowest bridge priority chosen first, the default bridge priority value is 32768; if the bridge priority is same then the lowest MAC address will be chosen.
  • Messages are sent to each switch through BPDU frame. The Bridge Protocol Data Unit (BPDU) frame is also called Hello. By default, Hello messages are sent after every 2 seconds.
  • If a switch receives BPDU that is lowest then its self, the switch forwards that BPDU, claiming it to be the root port.
  • Cost is calculated by adding the cost in the received BPDU to the cost of the interface the BPDU was received. How STP Handles the Network Topology Changes?
  • Hello time: The time root waits before sending periodic Hello BPDU that are forwarded by the other switches. By default, it is 2 seconds.
  • Max Age: The time any switch should wait before trying to change the STP topology after unhearing Hello BPDU.
  • Forward Delay: The delay time an interface takes to converge from blocking state to forwarding state. STP Operation Summary
  • The root sends hello BPDU frame out of all interfaces.
  • Neighbour switches forward hello frames out of their non root designated ports, identifying root, with their cost added.
  • If a switch does not receive BPDU frame, continues as normal until Max Age. STP Convergence
    There are four port states concern with STP topology convergence:
  • Blocking
  • Listening
  • Learning
  • Forwarding
Switch waits Max Age time, place in the listening state for Forward Delay time, place in the learning state for Forward Delay time and then place in the forwarding state. Switch must also timeout entries in MAC address table.
  • Max Age: 20 seconds (blocking to listening)
  • Forward Delay: 15 seconds (listening to learning)
  • Forward Delay: 15 seconds (learning to forwarding)   
     Optional Convergence Features of STP 
EtherChannel: provides a way to prevent STP convergence from being needed when only a single port/cable failure occurs. It combines from 2-8 parallel Ethernet trunks between same pair of switch, which STP treats as a single link. It also provides more bandwidth. Both links to the same switch must fail for a switch to need STP convergence.
  • PortFast: Allows a switch to place a port in the forwarding state immediately when the port becomes physically active (only safely done when device is not a bridge/switch)
  • Cisco BPDU Guard Feature: If enabled, tells the switch to disable PortFast ports if BPDU is received on those ports. Rapid Spanning Tree Protocol
The Intel pro set IEEE Rapid Spanning Tree Protocol (RSTP) can be used alongside 802.1d STP for switches that support RSTP. The assignment of forwarding and blocking ports are same in both STP and RSTP, the main reason to use RSTP is to overcome the convergence time and therefore it supposes the spanning tree best practice.

RSTP Convergence
 
The RSTP convergence time is typically less than 10 seconds as compare to the traditional convergence time of 50 seconds. In case of link between switch and a hub that is called Link-Type shared, RSTP does not improve convergence.

Optional Convergence Features of RSTP
  • Edge-Type Point-to-Point: It is link between the switches and just like PortFast in STP, RSTP immediately places Edge-Type into forwarding state.
  • Link-Type Point-to-Point: It is link between switch/end user. RSTP recognizes lost hello frames must three times faster than the STP default of 6 seconds. It also removes the requirement for listening state and through proposal and agreement messages reduces the time for learning state.

Wednesday, January 15, 2014

Cisco Switch Commands



Cisco Switches

Cisco IOS software is installed in the manageable Cisco switches for better management of the LAN. The Cisco's IOS software delivers network services and enabled networked applications. The Cisco IOS has a command line interface helps you to execute the Cisco IOS commands.

Cisco Switch Commands

The Cisco switch IOS have different EXEC modes with distinctive prompts. You can use these modes for executing different Cisco switch commands. Each mode has a set of specific commands.
The fundamentals of Cisco IOS User Interface are as follows :
  • Uses a command line interface
  • Operations vary on different series of switches
  • Type or paste entries in the console command modes
  • Enter key instructs device to parse and execute the commands
  • Two primary EXEC modes are user mode and privileged mode
  • Command modes have distinctive prompts

Cisco IOS Software Exec

There are two main EXEC modes for entering the Cisco switch commands:

User Mode

·  Limited examination of switch
·  Command prompt on the switch is switch

Privileged Mode

·  Detailed examination of switch
·  Enables configuration and debugging
·  Prerequisites for other configuration modes
·  Command prompt on the router is switches#

Cisco Telnet Commands

There are two primary methods for accessing a Cisco manageable switch to use command line interface.
·  Out of band Console connection
·  Via Ethernet through Telnet
Telnet is a utility used for remotely login to a device. To telnet a Cisco IOS switch from your computer, you have to type the following command on the CMD terminal of your computer:
Telnet ip address of the switch Just like:
Telnet 192.168.0.253

Cisco Catalyst 1900 Switch Commands

Followings are some basic commands of Cisco Catalyst 1900 switch commands:
·  Show running-config: This command displays the memory status of the Cisco Catalyst 1900 switch
·  Show interfaces: This command displays the detailed information about all the interfaces of Cisco Catalyst 1900 switch.
·  Show interfaces Ethernet 0/1: This command displays the detailed information about a specific 10baseT Ethernet interface of the Cisco Catalyst 1900 switch
·  Show interfaces Fast Ethernet 0/26: This command displays the detailed information about a specific 100baseT Fast Ethernet interface of the Cisco Catalyst 1900 switch
·  Show ip: This command displays the ip configuration of the Cisco Catalyst 1900 switch
·  Show Mac-address-table: This command displays the Mac addresses of the devices that are currently connected to the Cisco Catalyst 1900 switch.
·  Show Mac-address-table security: This command displays the address table size and the addressing security of each interface of the Cisco Catalyst 1900 switch.
·  Show VLAN: This command displays the status of current VLANs enabled on the Cisco Catalyst 1900 switch.
·  Show VLAN-membership: This command displays the VLAN membership of all the ports on the Cisco Catalyst 1900 switch.
·  Show Spantree 1: This command displays the complete information about the spanning tree protocol 1 that is by default enabled on the Cisco Catalyst 1900 switch.
·  Copy nvram tftp: //host/dst_file: This command is used to send the configuration to a TFTP server.
·  Copy tftp: //host/src_file nvram: This command is used to download the configuration from a TFTP server.
·  Delete nvram: This command is used to reset the system configuration to factory defaults.

Show Cisco Switch Commands

Here are some show commands of Cisco switches:
·  Show version: This command displays the hardware and software status of the Cisco switch
·  Show flash: This command displays the files and directories in the flash of the Cisco switch
·  Show interfaces: This command displays the detailed information about all the interfaces of the Cisco switch
·  Show interfaces fast Ethernet 0/x: This command displays the detailed information about the specific interface of the Cisco switch
·  Show interfaces VLAN 1: This command displays the ip address configuration of VLAN 1
·  Show running-config:This command displays the status of RAM
·  Show startup-config:This command displays the status of NVRAM
·  Show-mac-address-table: This command displays the MAC address of the devices that are directly connected with any port of the switch.
·  Show port-security: [interface] [address]: This command displays the port security options on the interface
·  Show history: This command displays the last ten commands that are executed in the switch configuration
·  Show line: This command is used to view the brief information about all the lines of the Cisco switch
·  Show line console 0: This command is used to view the detailed information about the specific line of the Cisco switch
·  Erase startup-config: This command is used to erase the nvram of the Cisco switch

Cisco Switch Configuration Commands

·  Configure terminal: This command is used to enter in the global configuration mode of the Cisco switch
·  Hostname: This command is used to assign the hostname of the Cisco switch
·  Enable password: This command is used to set the enable password of the Cisco switch
·  Enable secret: This command is used to set the encrypted password of the Cisco switch that is used for entering in the privileged mode
·  Interface VLAN 1: This is a global configuration command used to configure the VLAN interface of the Cisco switch
·  Interface fast Ethernet 0/x: This command is used to configure the specific interface of the Cisco switch
·  IP address: This command is used to configure the ip address of any interface of the Cisco switch
·  IP default-gateway: This is an interface configuration command to set the default gateway
·  Speed: This command is used to set the speed for the interface of the Cisco switch
·  Duplex: This command is used to set the duplex setting for the interface of the Cisco switch
·  Line console 0: This command is used to enter in the specific line configuration mode of the Cisco switch
·  Password: This command is used to set the password of any line of the Cisco switch

Cisco IOS



As you know that Cisco is the worldwide leader in providing the hardware solutions as well as the software solutions of LAN and WAN. The hardware solutions mean that the hardware devices such as switches and routers etc but what is the meaning of software solution? The software solution actually means that Cisco manufactures manageable devices with a CLI based Cisco IOS Software installed in these devices. With the help of this software you can better manage your network and internetwork environment.

Once you have performed and inspection on the physical components of the Cisco switches and the routers, locate and record the IOS version being used by the router or switch with the show version command. In the display of show version command, the second line lists the following IOS running on a router or switch like:

4500 Software (C 4500-JS-M), version 11.2 (11)
The IOS was developed for a 4500 model router.
The major release 11.2 with the maintenance release (11)
The IOS runs from RAM (-M)


This is reconfirmed in the middle of the show version display with the following line:

System image file is "flash: c4500-js-mz_112-11.bin", booted via flash

This line list the file name as it appears in the flash memory of router.

Knowing how to determine what release and what type of IOS is running on a switch or router is important and critical for proper router administration and configuration. Different IOS images possess different capabilities and features for example, if the IOS is pre-11.2 release, you can not configure integrated routing and bridging or NAT on that router or there is no support of named access lists on that router. Selecting the correct set of IOS feature and the exact version is essential to maintain optimal router and switch performance.
Cisco IOS Download


To download Cisco IOS for a given router or switch, three key elements to be aware of are as follows:
The platform of router and switch
Release
Software Feature Set

If you have the proper Cisco maintenance agreement then you have the privileges to download multiple IOS images directly from the official website of Cisco. Cisco has an"IOS planner" that guides you through the selection process of Cisco IOS under Software Centre on the Cisco website.

If you use the Cisco IOS planner, the first parameter to be selected is the platform of router or switch. Once a platform has been selected, then a major release must be selected. The recent router IOS releases are:
Cisco IOS release 10.3
Cisco OS release 11.0
Cisco IOS release 11.1
Cisco IOS release 11.2
Cisco IOS release 11.3
Cisco IOS release 12.0
Cisco IOS release 12.1
Cisco IOS release 12.2
Cisco IOS release 12.3

If you want the latest IOS releases then select Cisco IOS 12.4 download from the Cisco website.
Cisco IOS Commands

Here are the some basic Cisco IOS commands including in the Cisco IOS command line reference book and are used for configuring and verifying the configuration of the Cisco routers and switches:
ip address [address][subnet mask]: This command is used to configure ip address on an interface of the Cisco routers and switches.
bandwidth: This command is used for setting the bandwidth of the specific interface of the Cisco routers and switches.
shutdown: This command is used to shutdown a specific interface of the Cisco routers and switches.
interface fast Ethernet 0/x: This command is used for entering in the interface configuration mode of the Cisco routers and switches.
hostname [name]: This command is used to assign the hostname to Cisco routers and switches.
line vty 0 5: This command is used for entering in the line VTY configuration mode of the Cisco routers and switches.
line con 0: This command is used for entering in the line console configuration mode of the Cisco routers and switches.
line aux 0: This command is used for entering in the line auxiliary configuration mode of the Cisco routers and switches.
login: This command tells the Cisco routers and switches to ask for password.
password [password]: This command is used to set the line password in the Cisco routers and switches.
enable password [password]: This command is used to set the password for entering the privileged mode of the Cisco routers and switches.
enable secret [password]: This command is used to set the encrypted password for entering the privileged mode of the Cisco routers and switches.
configure terminal: This command is used to enter the global configuration mode of the Cisco routers and switches.
show interfaces serial 0: This command displays the detailed information about a specific interface.
show interfaces: This command displays detailed information about all the interfaces of Cisco routers and switches.
show line: This command displays the status of all the lines in the Cisco routers and switches.
show running-config: This command displays the current configurations of the Cisco routers and switches.
show startup-config: This command displays the saved configurations of the Cisco routers and switches.
show version: This command displays the hardware and software status of the Cisco routers and switches.
show flash: This command displays the files and directories reside in the flash of the Cisco routers and switches.
show history: This command displays the last ten commands that you were performed in the Cisco routers and switches.
erase startup-config: This command erases the nvram of the Cisco routers and switches.