Friday, October 14, 2011

Fundamentals of L2 Switching - Part:1


1. LAN Segmentation

1.1 In a collision domain, a frame sent by a device can cause collision with a frame sent by another device in the same collision domain. Moreover, a device can hear the frames destined for any device in the same collision domain.

1.2 In a broadcast domain, a broadcast frame sent by a device can be received by all other devices in the same broadcast domain.

1.3 A LAN segment or an Ethernet network segment consists of the devices connected with a coaxial cable or a hub. The devices are in the same collision domain.

1.4 Ethernet congestion problem occurs when too many devices are connected to the same Ethernet network segment, such that the high network bandwidth utilization increases the possibility of collision, which causes degradation of network performance.


1.5 LAN segmentation solves the congestion problem by breaking the network into separate segments or collision domains using bridges, switches or routers (but not hubs or repeaters). LAN segmentation can reduce the number of collisions in the network and increase the total bandwidth of the network (e.g. 10 Mbps for one segment, 20 Mbps for two segments, 30 Mbps for three segments, and so on).

1.6 The 80/20 rule should be used when designing how to segment a network, i.e. 80% or more data traffic should be on the local network segment while 20% or less data traffic should cross network segments.

2. LAN Switching

2.1 LAN switching (or Layer 2 switching) refers to the switching of a frame from the source computer to the destination computer across network segments. It consists of three major functions:

Address learning - learning the MAC addresses of the connected devices to build the bridge table.

Forward and filter decision - forwarding and filtering frames based on the bridge table entries and the bridge logic.

Loop avoidance - avoiding network loop by using Spanning Tree Protocol.

2.2 A bridge or switch maintains a forwarding table (also known as bridge table or MAC address table) which maps destination physical addresses with the interfaces or ports to forward frames to the addresses.

2.3 A bridge or switch builds a bridge table by learning the MAC addresses of the connected devices. The process is as follows:

1. When a bridge is first powered on, the bridge table is empty.

2. The bridge listens to the incoming frames and examines the source MAC addresses of the frames. For example, if there is an incoming frame with a particular source MAC address received from a particular interface, and the bridge does not have an entry in its table for the MAC address, an entry will be created to associate the MAC address with the interface.

3. An entry will be removed from the bridge table if the bridge has not heard any message from the concerned host for a certain time period (default aging time = 300 seconds or 5 minutes).

2.4 A bridge or switch forwards or filters a frame based on the following logic:

1. If the destination MAC address of the frame is the broadcast address (i.e. FFFF.FFFF.FFFF) or a multicast address, the frame is forwarded out all interfaces, except the interface at which the frame is received.

2. If the destination MAC address is an unicast address and there is no associated entry in the bridge table, the frame is forwarded out all interfaces, except the interface at which the frame is received.

3. If there is an entry for the destination MAC address in the bridge table, and the associated interface is not the interface at which the frame is received, the frame is forwarded out that interface only.

4. Otherwise, drop the frame.

2.5 There are three types of switching method:

Store-and-forward switching

_ The entire frame is received and the CRC is computed and verified before forwarding the frame.

_ If the frame is too short (i.e. less than 64 bytes including the CRC), too long (i.e. more than 1518 bytes including the CRC), or has CRC error, it will be discarded.

_ It has the lowest error rate but the longest latency for switching. However, for high-speed network (e.g. Fast Ethernet or Gigabit Ethernet network), the latency is not significant.

_ It is the most commonly used switching method, and is supported by most switches.

Cut-through switching (also known as Fast Forward switching or Real Time
switching)

_ A frame is forwarded as soon as the destination MAC address in the header has been received (i.e. the first 6 bytes following the preamble).

_ It has the highest error rate (because a frame is forwarded without verifying the CRC and confirming there is no collision) but the shortest latency for switching.

Fragment-free switching (also known as Modified Cut-through switching)

_ A frame is forwarded after the first 64 bytes of the frame have been received. Since a collision can be detected within the first 64 bytes of a frame (collision window size of Ethernet), fragment-free switching can detect a frame corrupted by a collision and drop it. Therefore, fragment-free switching provides better error checking than cut-through switching.

_ The error rate of fragment-free switching is above store-and-forward switching and below cut-through switching.

_ The latency of fragment-free switching is shorter than store-and-forward switching and longer than cut-through switching.

2.6 Bridges only support store-and-forward switching. Most new switch models also use store-and-forward switching. However, it should be noted that Cisco 1900 switches use fragment-free switching by default.

No comments:

Post a Comment