Network Kings

LIMITED TIME OFFER

$999 $499 only For All Access Pass Today! USE PROMO CODE : LIMITED

d :
h :
m

Layer 2 Devices: Explained 

Layer 2 Devices
Layer 2 Devices

In a computer network, we have different networking devices working at different layers. Layer 2 devices are the devices that transmit the frame with the help of MAC Address, also called physical address. When frames arrive at the layer 2 device, it looks for the destination MAC Address and makes a forwarding decision accordingly. But not every device works in the same manner.  

In this article, we will understand the types of Layer 2 devices, their advantages, and disadvantages. Before understanding the working of the devices, we must be aware of terms called the broadcast domain and collision domain.

What is the Collision domain?

When more than one network device forwards a message at the same time, there is a high probability of collision. In that case, the device needs to transmit the collided message again reducing network efficiency. Each device in the same collision domain must listen to the message even if the message is not for that particular device. 

Collision domain
HUB
Switch
Switch
N ports
3 Collision domain
n ports

What is the Broadcast domain?

When devices broadcast a message, each device in a broadcast domain must listen to that message, even if the message is not for that particular device resulting in network congestion and wastage of bandwidth.  

This situation looks problematic, and we need to reduce congestion and collision, or we can say that we need to increase the number of broadcast domains and collision domains.  

NOTE: More the collision domain, the fewer chances of message collision. Similar is the case with the broadcast domain. 

Broadcast domain
Broadcast domain N ports
switch
switch broadcast domain
N Ports

What are the Layer 2 devices?

The layer 2 devices are as follows- 

  • Repeater:-   

A repeater is a network device that regenerates and amplifies the signal. The repeater gets used if the devices get placed at a distance where the signal might become weak. It can restore the strength and quality of a signal before transmitting it to the next segment. Repeater cannot be used for network segmentation and does not have any packet filtering capabilities. With the advancement of technology, repeaters are no longer in use.  

  • NIC:-  

NIC stands for Network Interface Card. It is the hardware component allowing a computer or other networking devices to connect to a network. It works as an interface between the computer and a network, enabling communication and data transfer. MAC Address gets embedded in the NIC, and each card represents a device. NIC requires driver software for installation in the operating system allowing the operating system to communicate with the NIC.  

  • HUB:-  

A hub, also known as a network hub or ethernet hub, is a device that used to connect multiple devices that connects more than one device in a Local Area Network (LAN). Hub operates at Layer 1 of the OSI model since it is unaware of MAC Address. It contains multiple ports to which network devices like computers, printers, servers, and other hubs can get connected using an Ethernet Cable. It also helps in network segmentation.

Since hubs are unaware of Mac Addresses, they cannot examine the destination Mac Addresses of incoming packets. When a device sends a message to another device via a hub, it broadcasts the data to all the connected devices meaning that every device connected is in the same collision domain and broadcast domain. Hub operates in a half-duplex mode, which means the device connected to it cannot send and receive data at the same time.

NOTE: Every device needs to process the message broadcasted by the hub, which leads to unnecessary network congestion.

In the given diagram, we can see five devices connected to a hub. Suppose device A wants to send some message to device D. Hub will not send it to D only but broadcast it to every connected device leading to unnecessary network congestion. 

HUB

What are the types of Hubs?

The kinds of hubs are as follows- 

  1. Passive Hub 
  2. Active Hub 
  3. Intelligent Hub 
What is a Passive Hub?

A Passive Hub is also known as an unpowered hub because it does not need any external power supply and relies on the electrical signals it receives from the connected devices. It is used to connect different devices. It cannot provide the function of signal regeneration or amplification if needed.

What is an Active Hub?

An Active Hub is a powered hub and an upgraded version of the passive hub. It requires an external power source and can provide signal regeneration and amplification whenever required before broadcasting them to all the connected devices.

What is an Intelligent Hub?

Along with the features of the Active Hub, the Intelligent Hub can also be managed remotely. It helps network administrators to manage the hub remotely.

What is a Bridge? 

Just like in real-world scenarios, bridges connect two sides of the river. Similarly, this network device connects 2 LAN Networks or network segmentations.

So, we understood about the hub, and it’s a limitation of not being aware of the MAC Address and cannot do the packet filtering. Unlike Hub, Bridge is an intelligent device. Bridge works on the data link layer, i.e., at layer 2 of the OSI model. Its primary function is to selectively forward packets based on the destination MAC Address of the incoming packets. By examining the MAC Address, the bridge can decide whether to forward the packet to the other network segment or discard it. A major limitation of the bridge is that it has just two ports, i.e., single input and a single output port.

bridge

What are the functions of a Bridge?

Bridge performs the following functions-   

  • Connects two different LANs 
  • Packet Filtration  
  • Forwarding

What are the kinds of Bridges?

The types of Bridges are as follows:-

  • Static Bridge 

In the case of Static Bridge, the bridge maintains a MAC Address table along with the connected port. Network administrators need to manually configure this table.  

For instance: – Devices and Bridges are connected, as shown in the figure. The administrator will configure this table, and the bridge is now aware of which MAC Address (Device) is connected to which other port. Suppose A sends a message to D, the packet will include the source address of A and the destination address of D. When a packet gets received at the bridge, it will look up the MAC Address table and see that device D is on the other side and hence it will forward the packet. In this way, Bridge performs the function of forwarding. 

kinds of Bridges

When A sends a message to B, the bridge will learn that B is on the same side as A and will not forward the message to avoid unnecessary traffic. Hence it performs the function of packet filtration.

bridge
  • Dynamic Bridge 

Dynamic Bridge is also called transparent bridges. In case the MAC Address of the connected workstation changes, or the Workstation changes its place (For instance, in an institute with two computer labs, a computer placed in LAB 1 is shifted to LAB 2) then the MAC Address table of a static bridge needs to be updated manually by the Network Administrator.

NOTE: The static bridge cannot learn the changes made automatically. But in the case of the dynamic bridge, it can learn the changes automatically and update its MAC Address Table.  

Initially, the MAC Address table of the dynamic bridge is empty. Device A sends the packet to device D, Bridge sees the source address and destination address, but the MAC Address table of the bridge is empty. Hence it broadcasts the packet for the very first time. When D sends an acknowledgement, Bridge learns it gets connected to Port 2 and updates its MAC Address Table. 

If it again gets a packet with a destination address that is not in its table, it again broadcasts the packet. Hence in this way, it updates its MAC Address table. 

NOTE: Dynamic bridge might initially look slower than a static bridge, but its functionality to automatically update the MAC Address table is of great use and network administrator do not need to update the table when changes occur.

What is a Switch?

A switch is also known as a multiport bridge because it has numerous ports. The switch is a combination of a Hub and a Bridge. It is a device that can connect multiple devices in a Local Area Network (LAN). It operates at Layer 2, i.e., the data link layer of the OSI model. The switch offers several ports to which computers, routers, servers, printers, or other switches can get connected using an ethernet cable. It is an intelligent device that uses the destination MAC Address to forward the packet resulting in an efficient communication system.

The switch can operate in both full duplex mode and half duplex mode. Generally, it gets configured to operate at full duplex mode meaning the device connected to it can send and receive the packets at the same time without collision. The number of collision domains in the switch is equal to the number of ports. Hence all host has their collision domain. The switch is best in reducing the collision and increasing the collision domain compared to hubs and bridges.

Switch

What are the types of Switches?

The types of Switches are as follows-

  • Unmanaged Switch 

Unmanaged switches do not have the capabilities to be configured and customized. It provides just plug-and-play functionality. It has a limited number of ports offering no advanced features and is suitable for a small network. 

  • Managed Switch 

It provides greater control and can be configured according to the need. It provides VLAN, Spanning Tree Protocol, Link aggregation, and Quality of service. It also provides network security settings and configurations like Access Control List, etc. It allows network administrators to configure and monitor the switch settings, prioritize traffic, and optimize performance. Managed Switches are more expensive than unmanaged switches. 

  • Layer 2 Switch 

It works on Layer 2, i.e., the data link layer of the OSI Model. It can enable and manage VLAN, enabling network segmentation and enhancing network security. 

  • Layer 3 Switch 

It is also called a multilayer switch as it can work on Layer 2 and Layer 3, i.e., the data link layer and network layer of the OSI Model. Layer 3 switch can be configured to perform the routing function, which can also be used to route traffic between different VLANs or subnets within a VLAN.

  • PoE Switch 

PoE switch or Power over Ethernet switch provides power to the connected devices over an ethernet cable eliminating the need to provide external power to the devices. They power IP phones, wireless access points, and surveillance cameras.

  • Data Centre Switch 

It is designed to meet the high demand for data centres and large-scale networks. They offer high port density, high throughput, and low latency. They are generally expensive. 

Cisco layer 2 devices.

This is a Cisco Nexus 9800 8 and 4 slot switch, costing more than 10lac (price varies according to the number of chassis installed).