px13-l2basics

40
Switching/L2 Basics Session code: PX-13

Upload: nasarthemax

Post on 21-Nov-2015

6 views

Category:

Documents


0 download

DESCRIPTION

Layer 2 Protocol basics

TRANSCRIPT

Rapid Consultancy Presentation

Switching/L2 Basics

Session code: PX-13Layer 2 SwitchingSwitching breaks up large collision domains into smaller ones

Collision domain is a network segment with two or more devices sharing the same bandwidth.

A hub network is a typical example of this type of technology

Each port on a switch is actually its own collision domain, you can make a much better Ethernet LAN network just by replacing your hubs with switchesSwitching ServicesUnlike bridges that use software to create and manage a filter table, switches use Application Specific Integrated Circuits (ASICs)Layer 2 switches and bridges are faster than routers because they dont take up time looking at the Network layer header information. They look at the frames hardware addresses before deciding to either forward the frame or drop it.layer 2 switching so efficient is that no modification to the data packet takes place

How Switches and BridgesLearn AddressesBridges and switches learn in the following ways:

Reading the source MAC address of each received frame or datagram

Recording the port on which the MAC address was received.

In this way, the bridge or switch learns which addresses belong to the devices connected to each port. Ethernet Access with Hubs

Ethernet Access with Switches

Address learningForward/filter decisionLoop avoidanceEthernet Switches and BridgesEmphasize: The next few slides discuss the basic function of a bridge/switch:1. How it learns the location of the hosts by reading the source MAC address of incoming frames.2. How it makes forwarding/filtering decisions.There are three conditions in which a switch will flood a frame out on all ports except to the port on which the frame came in, as follows:Unknown unicast addressBroadcast frameMulticast frame3. How STP is used to avoid loops in a switched/bridged network.

Switch FeaturesThere are three conditions in which a switch will flood a frame out on all ports except to the port on which the frame came in, as follows:Unknown unicast addressBroadcast frameMulticast frame

MAC Address TableInitial MAC address table is empty.Slide 1 of 3Emphasize: The 1900en max MAC address table size is 1024. Once the table is full, it will flood all new addresses until existing entries age out.The command to change the MAC address table aging time is, as follows:wg_sw_a(config)#mac-address-table aging-time ? Aging time valueThe default is 300 sec.The MAC address table is also referred to as the CAM table (Content Address Memory) on some switches.

Learning AddressesStation 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).Slide 2 of 3Learning Addresses (Cont.)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).

Slide 3 of 3Emphasize: Once C replies, the switch will also cache station Cs MAC address to port E2, as shown in the next slide.

Filtering FramesStation A sends a frame to station C.Destination is known; frame is not flooded.

Station D sends a broadcast or multicast frame.Broadcast and multicast frames are flooded to all ports other than the originating port.

Broadcast and Multicast FramesForward/Filter Decision When a frame arrives at a switch interface, the destination hardware address is compared to the forward/ filter MAC database.

If the destination hardware address is known and listed in the database, the frame is sent out only the correct exit interface

If the destination hardware address is not listed in the MAC database, then the frame is flooded out all active interfaces except the interface the frame was received on.

If a host or server sends a broadcast on the LAN, the switch will flood the frame out all active ports except the source port. Learning Mac Address

Learning Mac Address

Learning Mac Address

Learning Mac Address

Learning Mac Address

Learning Mac Address

Learning Mac Address

Forward/Filter PC3 to PC1

Forward/Filter PC3 to PC2

Loop AvoidanceRedundant links between switches are a good idea because they help prevent complete network failures in the event one link stops workingHowever, they often cause more problems because frames can be flooded down all redundant links simultaneously This creates network loops

Network Broadcast LoopsA manufacturing floor PC sent a network broadcast to request a boot loaderThe broadcast was first received by switch sw1 on port 2/1The topology is redundantly connected; therefore, switch sw2 receives the broadcast frame as well on port 2/1Switch sw2 is also receiving a copy of the broadcast frame forwarded to the LAN segment from port 2/2 of switch sw1. In a small fraction of the time, we have four packets. The problem grows exponentially until the network bandwidth is saturated

Multiple Frame Copies

The server in the figure sends a unicast frame to Router C. Since its a unicast frame, Switch A forwards the frame, and Switch B provides the same serviceit forwards the unicast. This is bad because it means that Router C receives that unicast frame twice, causing additional overhead on the network.one: The MAC address filter table will be totally confused about the devices location because the switch can receive the frame from more than one link.Spanning Tree ProtocolOverviewRedundancy in a network is extremely important because redundancy allows networks to be fault tolerant.

Redundant topologies based on switches and bridges are subject to broadcast storms, multiple frame transmissions, and MAC address database instability.

Therefore network redundancy requires careful planning and monitoring to function properly.

The Spanning-Tree Protocol is used in switched networks to create a loop free networkProvides a loop-free redundant network topology by placing certain ports in the blocking state.Spanning-Tree Protocol

Emphasize: A looped topology is often desired to provide redundancy, but looped traffic is undesirable. The Spanning-Tree protocol was originally designed for bridges. Today, it is also applied to LAN switches and routers operating as a bridge. Spanning-Tree protocol ensures that all bridged segments are reachable but any points where loops occur will be blocked. Spanning Tree ProtocolSpanning Tree Protocol resides in Data link Layer

Ethernet bridges and switches can implement the IEEE 802.1D Spanning-Tree Protocol and use the spanning-tree algorithm to construct a loop free network.

a company called Digital Equipment Corporation(DEC) created the original version ofSpanning Tree Protocol (STP). The IEEE latercreated its own version of STP called 802.1D. All Cisco switches run the IEEE 802.1D versionof STP, which isnt compatible with the DEC version.STP uses the spanning-tree algorithm (STA) to first create atopology database, then search out and destroy redundant links.

Spanning-tree transits each port through several different states:Spanning-Tree Port States

DisabledEmphasize: Using the default Spanning-Tree protocol timers setting, the times it takes to go from the blocking state to the forwarding state is 50 sec (20 + 15 + 15).

Blocking A blocked port wont forward frames; it just listens to BPDUs. The purpose of theblocking state is to prevent the use of looped paths. All ports are in blocking state by defaultwhen the switch is powered up.Listening The port listens to BPDUs to make sure no loops occur on the network before passingdata frames. A port in listening state prepares to forward data frames without populatingthe MAC address table.Learning The switch port listens to BPDUs and learns all the paths in the switched network.A port in learning state populates the MAC address table but doesnt forward data frames.Forwarding The port sends and receives all data frames on the bridged port. If the port is stilla designated or root port at the end of the learning state, it enters this state.Disabled A port in the disabled state (administratively) does not participate in the frame forwardingor STP. A port in the disabled state is virtually nonoperational.Switch ports are most often in either the blocking or forwarding state. A forwarding port isone that has been determined to have the lowest (best) cost to the root bridge. But when and ifthe network experiences a topology change (because of a failed link or because someone addsin a new switch), youll find the ports on a switch in listening and learning states.

Selecting the Root BridgeThe first decision that all switches in the network make, is to identify the root bridge.

When a switch is turned on, the spanning-tree algorithm is used to identify the root bridge. BPDUs are sent out with the Bridge ID (BID).

The BID consists of a bridge priority that defaults to 32768 and the switch base MAC address.

When a switch first starts up, it assumes it is the root switch and sends BPDUs. These BPDUs contain BID.

All bridges see these and decide that the bridge with the smallest BID value will be the root bridge.

A network administrator may want to influence the decision by setting the switch priority to a smaller value than the default.Spanning Tree Protocol TermsBPDU Bridge Protocol Data Unit (BPDU) - All the switches exchange information to use in the selection of the root switch

Bridge ID - The bridge ID is how STP keeps track of all the switches in the network. It is determined by a combination of the bridge priority (32,768 by default on all Cisco switches) and the base MAC address.

Root Bridge -The bridge with the lowest bridge ID becomes the root bridge in the network.

Nonroot bridge - These are all bridges that are not the root bridge.

Root port - The root port is always the link directly connected to the root bridge or the shortest path to the root bridge. If more than one link connects to the root bridge, then a port cost is determined by checking the bandwidth of each link.

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

Nondesignated Port - A nondesignated port is one with a higher cost than the designated port. Nondesignated ports are put in blocking mode

Forwarding Port - A forwarding port forwards frames

Blocked Port - A blocked port is the port that will not forward frames, in order to prevent loopsBPDUs are sent every two seconds,BPDUs are sent every two seconds,If more than one link connects to the root bridge, then a port cost is determined by checking the bandwidth of each link.The lowest-cost port becomes the root port. If multiple links have the same cost, the bridge with the lower advertising bridge ID is used. Since multiple links can be from the same device, the lowest port number will be used.Bpdu = Bridge Protocol Data Unit (default = sent every two seconds)Root bridge = Bridge with the lowest bridge IDBridge ID =

In the example, which switch has the lowest bridge ID?

Spanning-Tree Protocol Root Bridge Selection Emphasize: By default, the switch with the lowest MAC address will be the root bridge. Note: The Catalyst switches support an instance of spanning tree per VLAN. Each VLAN will use a unique MAC address for spanning tree purposes. On the Catalyst 1900, the address it uses for spanning tree is the MAC address on the various ports. VLAN is discussed in the next chapter.The IEEE 802.1d specification specifies for a 16-bit priority field. The Catalyst 1900 switch only supports the 802.1d Spanning-Tree protocol. The default priority on the Catalyst 1900 is 32768 in decimal or 8000 in hex, the midrange value.BPDU contain the following fields:Protocol ID versionMessage typeFlagsRoot IDCost of pathBridge IDPort IDMessage ageMax age Hello time Forward delay

One root bridge per networkOne root port per nonroot bridgeOne designated port per segmentNondesignated ports are unusedSpanning-Tree OperationEmphasize: The three general rules when dealing with STP are as follows:1. One root bridge per network. The root is the bridge with the lowest bridge ID. All the ports on the root bridge are designated ports (forwarding).2. For every non-root bridge, there is a root port (forwarding). The root port is the port with the lowest accumulated path cost to the root bridge.3. For every segment, there is only one designated port. The designated port forwards traffic for the segment. The designated port has the lowest accumulated path cost to the root bridge.

Selecting the Root PortThe STP cost is an accumulated total path cost based on the rated bandwidth of each of the linksThis information is then used internally to select the root port for that device

Selecting the Root PortIf more than one link leads to the root bridge, then cumulative outbound port costs along the path to the root bridge becomes the factor used to determine which port will be the root port

One root bridge per networkOne root port per nonroot bridgeOne designated port per segmentNondesignated ports are unusedSpanning-Tree Operation19100Emphasize: The three general rules when dealing with STP are as follows:1. One root bridge per network. The root is the bridge with the lowest bridge ID. All the ports on the root bridge are designated ports (forwarding).2. For every non-root bridge, there is a root port (forwarding). The root port is the port with the lowest accumulated path cost to the root bridge.3. For every segment, there is only one designated port. The designated port forwards traffic for the segment. The designated port has the lowest accumulated path cost to the root bridge.

Switching Methods1. Cut-Through (Fast Forward)The frame is forwarded through the switch before the entire frame is received. At a minimum the frame destination address must be read before the frame can be forwarded. This mode decreases the latency of the transmission, but also reduces error detection.

2. Fragment-Free (Modified Cut-Through)Fragment-free switching filters out collision fragments before forwarding begins. Collision fragments are the majority of packet errors. In Fragment-Free mode, the switch checks the first 64 bytes of a frame.

3. Store-and-ForwardThe entire frame is received before any forwarding takes place. Filters are applied before the frame is forwarded. Most reliable and also most latency especially when frames are large. Switching Methods

Thank You !!!