Category - Networking Notes

Switching Layer 2

Layer 2
This layer, known as the switching layer, allows end station addressing and attachment. Because architectures up to Layer 2 allow end station connectivity, it is often practical to construct a Layer 2-only network, providing simple, inexpensive, high-performance connectivity for hundreds or even thousands of end stations. The past five years have seen the extraordinary success of the “flat” network topologies provided by Layer 2 switches connected to other Layer 2 switches or ATM switches.

Layer 2 switching, also called bridging, forwards packets based on the unique Media Access Control (MAC) address of each end station. Data packets consist of both infrastructure content, such as MAC addresses and other information, and end-user content. At Layer 2, generally no modification is required to packet infrastructure content when going between like Layer 1 interfaces, like Ethernet to Fast Ethernet. However, minor changes to infrastructure content?not end-user data content?may occur when bridging between unlike types such as FDDI and Ethernet. Either way, processing impact is minimal and so is configuration complexity.

Layer 2 deployment has seen the most striking infrastructure change over the past decade. Shared Ethernet, represented by particular cable types or contained within shared hubs, offered a very simple, and even more inexpensive, approach for Layer 2. Though still quite popular, shared technology, where all stations use the same bandwidth slice, has very limited scaling capabilities. Depending upon the applications being used, shared networks of more than one hundred users are becoming less common. Many network designers have “tiered” their infrastructure by feeding shared Layer 2 into switched Layer 2 or even Layer 3. Switched Layer 3 apportions each station?or port?its own dedicated bandwidth segment. Recent enhancements at Layer 2 provide packet prioritization capabilities for the application of network policies. The new IEEE 802.1p standard defines Class of Service (CoS) policies capabilities for Layer 2 segments.

Note that Layer 2 does not ordinarily extend beyond the corporate boundary. To connect to the Internet usually requires a router; in other words, scaling a Layer 2 network requires Layer 3 capabilities.

What is the difference between a router and hub or switch?

Question: What is the difference between a router and hub or switch?
Answer: A router is a more sophisticated network device than either a switch or a hub. Like hubs and switches, network routers are typically small, box-like pieces of equipment that multiple computers can connect. Each features a number of “ports” the front or back that provide the connection points for these computers, a connection for electric power, and a number of LED lights to display device status. While routers, hubs and switches all share similiar physical appearance, routers differ substantially in their inner workings.Traditional routers are designed to join multiple area networks (LANs and WANs). On the Internet or on a large corporate network, for example, routers serve as intermediate destinations for network traffic. These routers receive TCP/IP packets, look inside each packet to identify the source and target IP addresses, then forward these packets as needed to ensure the data reaches its final destination.Routers for home networks (often calledbroadband routers) also can join multiple networks. These routers are designed specifically to join the home (LAN) to the Internet (WAN) for the purpose of Internet connection sharing. In contrast, neither hubs nor switches are capable of joining multiple networks or sharing an Internet connection. A home network with only hubs and switches must designate one computer as the gateway to the Internet, and that device must possess two network adapters for sharing, one for the home LAN and one for the Internet WAN. With a router, all home computers connect to the router equally, and it performs the equivalent gateway functions.

Router Switch Hub

Additionally, broadband routers contain several features beyond those of traditional routers. Broadband routers provide DHCP server and proxy support, for example. Most of these routers also offer integrated firewalls. Finally, wired Ethernet broadband routers typically incorporate a built-in Ethernet switch. These routers allow several hubs or switches to be connected to them, as a means to expand the local network to accomodate more Ethernet devices.

In home networking, hubs and switches technically exist only for wired networks. Wi-Fiwireless routers incorporate a built-in access point that is roughly equivalent to a wired switch.

STP Spanning Tree Protocol step by step

STP is enabled by default for all VLANs in a switch. To change the priority to a lower value for root switch elections, use one of the following commands:

Switch(config)#spanning-treevlan 1 priority 4096


Switch(config)#spanning-treevlan 1 root

STP Topology Changes and Enhancements

In the event of a topology change, formerly blocked ports might transition to a forwarding state. It might take up to 50 seconds to transition from a blocking state to a forwarding state.

An exception to these 50 seconds is if the following Cisco enhancements are in place to speed up convergence:

PortFast skips the listening and learning states on end-devices such as servers, PCs, and printers. PortFast can cause switching loops if a hub or switch is connected. BPDU Guard adds protection by disabling a port if the interface receives a BPDU.

UplinkFast skips the listening and learning transitions when a direct failure occurs on its root port on a switch with redundant uplinks to a distribution switch.

BackboneFast speeds up convergence by skipping the max age time when switches learn of a failure indirectly.




EtherChannel is a Cisco method of bundling redundant links between switches to act as a sin­gle aggregated link. This allows utilization of all the link’s bandwidth, because STP treats the link as a single interface (no blocking/discarding ports). In the case of a link failure, EtherChannel automatically distributes the traffic load over the remaining links in milliseconds.

To add an interface to an EtherChannel bundle (up to eight), use the channel-group chan­nel# mode on command in the interface configuration.

 Rapid Spanning Tree Protocol

Incorporates several of Cisco’s STP enhancements and ensures a safe and quick transition to a forwarding state and topology convergence by removing the overdepen­dence on STP timers.

RSTP Port States
State Function STP Equivalent
Disabled The interface is administratively shut down or disabledfrom port violation. Disabled
Discarding Does not forward any user data. All ports start out in this state.Does not send, but still can receive BPDUs to react totopology changes. Blocking and listening
Learning Begins to build MAC addresses learned on the interface.No user data is sent. Learning
Forwarding User data is forwarded. Forwarding


RSTP Link Types

State                                                            Function

Link type point-to-point                     Full-duplex links between switches

Link type shared                                     Half-duplex links between switches or hubs

Edge type                                                    Connections to end devices such as PCs, printers, and servers


RSTP Convergence

Edge ports immediately transition to a forwarding state when connected to RSTP ports. For point-to-point link types, transitioning to a forwarding state involves a synchronization process:

  1. After switches are connected to a point-to-point link, they exchange BPDUs.
  2. If a switch dvcermines its port will become a designated port, it sends a proposal to start forwarding to its neighbor.
  3. The neighboring switch receives the proposal. If its port is a root port, it synchronizes the change by putting all nonedge ports into a discarding state and sending an agree­ment back to the original switch. If its port is a discarding port, it does not respond to the proposal.
  4. The original switch immediately transitions to a forwarding state if it receives an agreement or eventually transitions to a forwarding state after a forward delay occurs.

RSTP uses BPDUs as keepalives to dvcect if a neighboring switch goes down. When the topol­ogy change is dvcected, RSTP immediately starts aging out the affected MAC address and tells its neighbors to do the same.

Copyright ©2010 - 2022 | Privacy Policy | Terms & Conditions