day4 ch3 switching

Upload: shivang2056yadav

Post on 02-Jun-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Day4 Ch3 Switching

    1/44

  • 8/10/2019 Day4 Ch3 Switching

    2/44

    What is switching ?

    In a telecommunications network, a switching

    is a technique that channels incoming data

    from any of multiple input ports to the specific

    output port that will take the data toward its

    intended destination.

  • 8/10/2019 Day4 Ch3 Switching

    3/44

    Type switching

    Two major packet switching modes exist;

    (1) connectionlesspacket switching, also

    known as datagramswitching

    (2) connection-orientedpacket switching,

    also known as virtual circuitswitching.

    http://en.wikipedia.org/wiki/Connectionless_communicationhttp://en.wikipedia.org/wiki/Datagramhttp://en.wikipedia.org/wiki/Connection-oriented_communicationhttp://en.wikipedia.org/wiki/Virtual_circuithttp://en.wikipedia.org/wiki/Virtual_circuithttp://en.wikipedia.org/wiki/Connection-oriented_communicationhttp://en.wikipedia.org/wiki/Connection-oriented_communicationhttp://en.wikipedia.org/wiki/Connection-oriented_communicationhttp://en.wikipedia.org/wiki/Datagramhttp://en.wikipedia.org/wiki/Connectionless_communication
  • 8/10/2019 Day4 Ch3 Switching

    4/44

    Switching Services

    bridges use software to create and manage a filtertable.

    switches use application specific integrated circuits

    (ASICs) to build and maintain their filter tables. A layer 2 switch is similar to a multi port bridge

    Bridges are self managed while switches are

    manageable. Layer 2 switches and bridges are faster than routers

    because Layer 2 switches do not look at thenetwork layer header and hence faster.

  • 8/10/2019 Day4 Ch3 Switching

    5/44

  • 8/10/2019 Day4 Ch3 Switching

    6/44

    Limitations of Layer 2 Switching

    Bridged networks break up collision domains,

    but the network is one large broadcast

    domain.

    Broadcasts and multicasts, along with the slow

    convergence time of spanning trees, can

    considerably slow down the network

  • 8/10/2019 Day4 Ch3 Switching

    7/44

    Bridging vs. LAN Switching

    Bridges are software based, while switches are hardware based because

    they use ASIC chips to help make filtering decisions.

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

    switches can have many.

    Switches have a higher number of ports than most bridges. Both bridges and switches forward layer 2 broadcasts.

    Bridges and switches learn MAC addresses by examining the source

    address of each frame received.

    Both bridges and switches make forwarding decisions based on layer 2

    addresses.

  • 8/10/2019 Day4 Ch3 Switching

    8/44

    Three Switch Functions at Layer 2

    Address learning,

    forward/filter decisions, and

    loop avoidance.

  • 8/10/2019 Day4 Ch3 Switching

    9/44

  • 8/10/2019 Day4 Ch3 Switching

    10/44

    Switch Operation

    When a device transmits and an interfacereceives a frame, the switch places the framessource address in the MAC forward/filter table

    The switch floods the network with this frameout of every port except the source port

    If a device answers this flooded frame and

    sends a frame back, then the switch will takethe source address from that frame and placethat MAC address in its database

  • 8/10/2019 Day4 Ch3 Switching

    11/44

  • 8/10/2019 Day4 Ch3 Switching

    12/44

    How switches learn hosts locations

  • 8/10/2019 Day4 Ch3 Switching

    13/44

    Forward/Filter Decisions

    When a frame arrives at a switch interface, thedestination hardware address is compared to theforward/filter MAC database.

    If the destination hardware address is known andlisted in the database, the frame is sent out onlythe correct exit interface.

    The switch doesnt transmit the frame out any

    interface except for the destination interface. This preserves bandwidth on the other network

    segments and is calledframe filtering.

  • 8/10/2019 Day4 Ch3 Switching

    14/44

    Loop Avoidance

    Redundant links between switches help prevent

    complete network failures in the event one link

    stops working.

    redundant links can also cause problems

    Frames can be flooded down all redundant links

    simultaneously, creating network loops

    If no loop avoidance schemes are put in place,the switches will flood broadcasts endlessly

    throughout the inter-network. [broadcast storm]

  • 8/10/2019 Day4 Ch3 Switching

    15/44

    Loop Avoidance

    A device can receive multiple copies of thesame frame, since that frame can arrive fromdifferent segments at the same time.

    The MAC address filter table will be totallyconfused about the devices location

    switch could get so caught up in constantly

    updating the MAC filter table with sourcehardware address locations that it may fail toforward a frame [MAC table thrashing].

  • 8/10/2019 Day4 Ch3 Switching

    16/44

    Broadcast storm

  • 8/10/2019 Day4 Ch3 Switching

    17/44

    Multiple frame copies

  • 8/10/2019 Day4 Ch3 Switching

    18/44

    Spanning Tree Protocol (STP)

    Digital Equipment Corporation (DEC) createdthe original version of Spanning Tree Protocol(STP)

    The IEEE later created its own version of STPcalled 802.1D.

    All Cisco switches run the IEEE 802.1D version

    of STP STPs main task is to stop network loops from

    occurring on your layer 2 network

  • 8/10/2019 Day4 Ch3 Switching

    19/44

    Spanning Tree Protocol (STP)

    STP monitors all network links & ensures that

    no loops occur, by shutting down any

    redundant links.

    STP uses the spanning-tree algorithm (STA) to

    first create a topology database, then search

    out and destroy redundant links.

    With STP running, frames will be forwarded

    only on the premium, STP-picked links.

  • 8/10/2019 Day4 Ch3 Switching

    20/44

    A switched network with switching loops

  • 8/10/2019 Day4 Ch3 Switching

    21/44

    Spanning Tree Terms

    STP is a bridge protocol that uses the STA to findredundant links dynamically and create aspanning-tree topology database.

    Bridges periodically exchange BPDU messageswith other bridges to detect loops

    Root bridge The root bridge is the bridge with thelowest(best) bridge ID.

    All the switches in the network elect a rootbridge that becomes the focal point in thenetwork.

  • 8/10/2019 Day4 Ch3 Switching

    22/44

    Spanning Tree Terms

    BPDU All the switches exchange information

    to use in the selection of the root switch, as

    well as in subsequent configuration of the

    network.

    Each switch compares the parameters in the

    Bridge Protocol Data Unit (BPDU) that they

    send / receive from neighbors

  • 8/10/2019 Day4 Ch3 Switching

    23/44

    Spanning Tree Terms

    Bridge ID STP keeps track of all the switches inthe network using bridge IDs .

    It is determined by a combination of the

    bridge priority (32,768 by default on all Ciscoswitches) and the base MAC address.

    The bridge with the lowest bridge ID becomes

    the root bridge in the network. Non-root bridge All bridges except the root

    bridge are Non-root bridges.

  • 8/10/2019 Day4 Ch3 Switching

    24/44

    Spanning Tree Terms

    Root port The root port is always the link directly connected

    to the root bridge, or the shortest path to theroot bridge.

    If more than one link connects to the rootbridge, then a port cost is determined bychecking the bandwidth of each link.

    The lowest-cost port becomes the root port.

    If multiple links have the same cost, the bridgewith the lower advertising bridge ID is used. If multiple links are from the same device, the

    lowest port number will be used.

  • 8/10/2019 Day4 Ch3 Switching

    25/44

    Spanning Tree Terms

    Designated port A designated port is one that

    has been determined as having the best

    (lowest) cost.

    A designated port will be marked as a

    forwarding port.

    Port cost The cost of a link is determined by

    the bandwidth of a link.

  • 8/10/2019 Day4 Ch3 Switching

    26/44

    Spanning Tree Terms

    Non-designated port A non-designated port is onewith a higher cost than the designated port.

    Nondesignated ports are put in blocking mode

    Forwarding port A forwarding port forwardsframes.

    Blocked port A blocked port is the port thatwill not forward frames, in order to preventloops.

    a blocked port will always listen to frames.

  • 8/10/2019 Day4 Ch3 Switching

    27/44

    Spanning Tree Operations

    STP elects a root bridge that will forward throughall ports and act as a point of reference for allother devices in the STP domain.

    Every bridge finds its one, and only one, root port

    Each and every link between two switches musthave one, and only one, designated port.

    Every port on the root switch is a designatedport,

    Any port that is not either a root port or adesignated port is placed in the blocking state,thus breaking the switching loop.

  • 8/10/2019 Day4 Ch3 Switching

    28/44

    Selecting the Root Bridge

    The bridge ID is used to elect the root bridge in the STPdomain as well as to determine the root port for eachof the remaining devices in the STP domain.

    Bridge ID is 8 bytes long, and includes both the priority

    [2 bytes] and the MAC address [6 bytes] of the device.

    The default priority on all devices running the IEEE STPversion is 32,768.

    If two switches or bridges happen to have the samepriority value, then the MAC address becomes thetiebreaker

  • 8/10/2019 Day4 Ch3 Switching

    29/44

    Selecting the Root Bridge

    BPDUs are sent every two seconds, by default

    The bridges ID can be changed by lowering its

    priority so that it will become a root bridge

    automatically.

    Changing the default priority is the best way

    to choose a root bridge.

    core switch in the network should be root

    bridge for STP to converge quickly.

  • 8/10/2019 Day4 Ch3 Switching

    30/44

    Spanning tree commands

    Switch#sh spanning-tree

    VLAN0001

    Spanning tree enabled protocol ieee

    Root ID Priority 32768

    Address 0009.7ccf.a880

    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    command to change a bridge priority on a Catalyst 2950 or 3550 switch:

    Switch(config)#spanning-tree vlan 1 priority ?

    bridge priority in increments of 4096

    Switch(config)#spanning-tree vlan 1 priority 4096

    Switch(config)#spanning-tree vlan 1 root ?

    primary Configure this switch as primary root for this spanning tree(pri=28673)

    secondary Configure switch as secondary root (priority =24577)

  • 8/10/2019 Day4 Ch3 Switching

    31/44

    Selecting the Root Port

    If more than one link leads to the root bridge,then cumulative outbound port costs alongthe path to the root bridge is considered

    The STP cost is an accumulated total path costbased on the rated bandwidth of each of thelinks

    The IEEE 802.1D specification assigns a defaultport cost value to each port based onbandwidth.

  • 8/10/2019 Day4 Ch3 Switching

    32/44

    Typical Costs of Different Ethernet Networks

  • 8/10/2019 Day4 Ch3 Switching

    33/44

    Spanning-Tree Port States

    The ports on a bridge or switch running STP cango through five different states:

    Blocking

    Listening Learning

    Forwarding

    Disabled Blocked ports can still receive BPDUsthey just

    dont send out any frames.

  • 8/10/2019 Day4 Ch3 Switching

    34/44

    Convergence

    Convergence occurs when all ports on bridges

    and switches have transitioned to either the

    forwarding or blocking modes.

    No data is forwarded until convergence is

    complete.

    It usually takes 50 seconds to go from blocking

    to forwarding mode,

  • 8/10/2019 Day4 Ch3 Switching

    35/44

    LAN Switch Types

    LAN switch types decide how a frame is handledwhen its received on a switch port.

    Latencythe time it takes for a frame to be sent

    out an exit port once the switch receives theframedepends on the chosen switching mode.

    There are three switching modes:

    Cut-through (Fast-Forward)

    Fragment-Free (modified cut-through)

    Store-and-forward

  • 8/10/2019 Day4 Ch3 Switching

    36/44

    Different switching modes within a frame

  • 8/10/2019 Day4 Ch3 Switching

    37/44

    Basic Tasks in Cisco Managed switch Configuration

    Setting the passwords

    Setting the hostname

    Configuring the IP address and subnet mask

    Setting a description on the interfaces

    Setting port security

    Erasing the switch configurations

  • 8/10/2019 Day4 Ch3 Switching

    38/44

    To set the user mode passwords for the 2950 switch,

    Switch>enable Switch#config t Switch(config)#line vty 0 15 Switch(config-line)#login

    Switch(config-line)#password telnet Switch(config-line)#line con 0 Switch(config-line)#login Switch(config-line)#password todd Switch(config-line)#exit Switch(config)#exit Switch#

  • 8/10/2019 Day4 Ch3 Switching

    39/44

    Setting the Enable Secret Password

    The enable secret password is a more secure

    password and it supersedes the enable password

    (config)#enable secret todd2

    on the 2950, the enable password and enable

    secret must be different

    Setting the Hostname

    Switch(config)#hostname Todd2950

    Todd2950(config)#

  • 8/10/2019 Day4 Ch3 Switching

    40/44

    Setting IP Information

    Reasons to set the IP address information on

    the switch:

    To manage the switch via Telnet or other

    management software

    To configure the switch with different VLANs

    and other network functions

    By default, no IP address or default-gateway

    information is set.

  • 8/10/2019 Day4 Ch3 Switching

    41/44

    Setting IP Information

    every port on every switch is a member of VLAN1 bydefault.

    Todd2950#config t

    Todd2950(config)#int vlan1

    Todd2950(config-if)#ip address 172.16.10.17255.255.255.0

    Todd2950(config-if)#no shut

    Todd2950(config-if)#exit Todd2950(config)#ip default-gateway 172.16.10.1

    Todd2950(config)#

  • 8/10/2019 Day4 Ch3 Switching

    42/44

    Configuring Interface Descriptions

    Todd2950(config)#int fastEthernet 0/1

    Todd2950(config-if)#description Sales Printer

    Todd2950(config-if)#int f0/12

    Todd2950(config-if)#description Connection

    to backbone

    Todd2950(config-if)#^Z Todd2950#

  • 8/10/2019 Day4 Ch3 Switching

    43/44

    Setting Port Security on a Catalyst Switch

    Ensures that only a certain device is plugged

    into a particular switch port,

    Switch(config-if)#switchport port-security

    mac-address mac-address

  • 8/10/2019 Day4 Ch3 Switching

    44/44

    Erasing the Switch Configuration

    Todd2950#erase startup-config

    Erasing the nvram filesystem will remove all

    files! Continue? [confirm] [Enter]

    [OK]

    Erase of nvram: complete

    Todd2950#