Saturday, July 9, 2011

What Is an Ethernet Switch?

An Ethernet switch is a networking device that is used in almost all data networks to provide connectivity for our networking devices. Prior to the invention of the Ethernet switch, our Ethernet data networks used either Repeaters or Hubs to build Local Area Networks.

Before Ethernet Switches, a lot of networks used coaxial cable for local network connections, in a network topology that became known as a bus network. The most common bus networks used two early Ethernet cabling standards, which were the 10Base5 and 10Base2 coaxial cable standards. The 10Base5 networks were often referred to as Thicknet, while the 10Base2 networks were known as Thinnet. All network devices such as computers and servers were connected to a segment of cable in what was known as a "shared environment", or more commonly a collision domain. This type of network relied on data being broadcast across the media to all connected devices.

The invention of the hub made it easier for devices to be added or removed from the network, but an Ethernet network using a Hub was still a collision domain, where collisions were way of life. Ethernet network interface cards were designed to use CSMA/CD and detect and deal with collisions. Unfortunately collisions do have an effect of slowing down a network and make that network less than efficient. A Hub is said to be a Layer-1 device as it has no real intelligence, and in fact it is really just a multi-port repeater, with data entering one port being duplicated when sent out the other ports. The reference to Layer 1 is to the bottom layer of the OSI 7 Layer reference model.

The Hub was eventually replaced by the Ethernet switch as the most common device in Local Area Networks. The switch, which is a much more efficient device, is said to be a more intelligent device than a Hub because it is able to interrogate the data within the Ethernet Frames, whereas a hub just retransmits the data. With Ethernet, we use 48-bit MAC Addresses when labelling specific physical network interfaces, and an Ethernet frame of data contains both the Source and Destination MAC Addresses to enable data to be routed and switched from one specific physical interface to another.

An Ethernet switch has 3 main functions, which are:

Address Learning

Forwarding and Filtering

Loop Avoidance.

Address Learning

When a data frame enters through a port on a switch, the Ethernet Switch reads the Source MAC Address and adds that address to a MAC Address Table. This table is often referred to as Content Addressable Memory (CAM). Within the table the MAC Address is associated with the physical port on the switch to which the network device is attached. The switch now knows which port to forward data to when an Ethernet frame arrives from elsewhere in the network, because it checks the destination MAC Address, and looks for a match in the table. The Destination MAC Address is therefore used by the Ethernet Switch to forward data out of the correct port to reach the correct physical interface.

Forwarding and Filtering

When a switch receives an Ethernet frame, it will read the Destination MAC Address in order to determine which port to forward the data out of. When a switch receives an Ethernet frame with a Destination MAC Address that is not referenced in the table, it floods that frame out of all ports in an attempt to reach the correct physical interface. If the correct device responds, then the switch will now know where that MAC Address resides, and is therefore able to add that address to the table for future reference.


Almost all modern switches run a protocol known as the Spanning-Tree Protocol, or STP. STP was originally a proprietary protocol developed by DEC, but is now an IEEE Standard known as IEEE 802.1d, which was later revised to IEEE 802.1w (Rapid Spanning-Tree Protocol). The role of Spanning Tree is to detect and manage loops in a network, which can be a big problem by allowing duplicate frames to be delivered, and cause the MAC Address Table to become unstable. In severe cases network loops will cause a network to be over subscribed and eventually be overwhelmed by the amount of data. Spanning-Tree allows network designers to build redundancy and resilience into a network, safe in the knowledge that any physical or logical loops created will be managed by the Spanning Tree Protocol.

You will hear the terms Layer 2 and Layer 3 Switch, what do they mean?

A Layer 2 Ethernet switch operates by performing like we described in the previous paragraphs. The Layer 2 name comes from the fact that it operates at Layer 2 of the OSI 7 Layer Reference Model. This Layer is often referred to as the Data-Link Layer, and it is the layer that Ethernet is described, and where MAC Addresses are used.

So what is a Layer 3 Ethernet Switch?

A Layer 3 Ethernet Switch combines the features and functions of a basic Layer 2 switch, with features normally associated with a Router. In fact, it is probably easy to describe a Layer 3 switch as a switch and a router combined. A Layer 3 switch will have either a number of fixed Ethernet ports that have layer 3 IP Addresses associated with them, or more commonly, configurable ports that can be Layer 2 or Layer 3 as desired. All but the smallest home consumer Layer 2 switches allow the configuration of VLANs (Virtual Local Area Networks), but are not able to directly route traffic between multiple VLANs. In order to do this, the addition of a Layer 3 device such as a Router would be needed. A Layer 3 switch can perform this function in addition to tradition Layer 2 switch functions.

When purchasing an Ethernet switch, you need to determine what its role will be in the network, and whether or not Layer 3 functions will be required. Normally a Layer 3 Ethernet switch will be more expensive than a comparable Layer 2 device, so it would be an unnecessary expense to employ a Layer 3 switch when a Layer 2 switch would suffice.

Ethernet switches have evolved since the first simple devices were introduced, and some have a lot of additional features and support a wide range of ever increasing network protocols. Some of these features and protocols will be discussed in future articles.


Post a Comment