Network Devices (Repeater, Hub, Bridge, NIC, Switch, Router and Gateway)

In this tutorial, you will learn about the concept of Network Devices (Repeater, Hub, Bridge, NIC, Switch, Router and Gateway). After reading this tutorial, you will get some basic idea about which device works on which layer, how it works, what are its advantages and disadvantages, etc.

Contents:

  1. Roles of Network Devices
  2. Repeater and Hub
  3. Bridges, NIC, and Switches
  4. Router and its Functions
  5. Firewall and its Types
  6. Transport Gateways and Application Gateways
  7. Client and Server
  8. Topology of Network Devices

Roles of Network Devices

Generally, network devices are responsible for communication over a network. How the user will connect to the network, which path to choose to send the data, and to whom to send the data are the basic responsibilities of the network devices.

  • A network cannot be created without network devices. Each network device has its own responsibilities and functions.
  • Network devices operate in different layers, and they use different information needed for communication.

The figure below shows the different network devices that operate on different layers.

Network Devices on Different Layers

As shown in the figure, different network devices operate on different layers on which they interpret different pieces of information.

The network devices are as follows:

advertisement
advertisement
  1. Repeater and Hub
  2. Bridge, NIC, and Switch
  3. Router
  4. Firewall
  5. Gateway
  6. Client and Server

Repeater and Hub

Repeaters and hubs are physical layer devices. Both devices are used as connection devices at the physical layer. Let us understand these two devices one by one.

Repeater: The repeater only works in the physical layer. Repeaters are used to regenerate weak signals.

  • When the sender sends a signal over a network, it travels a certain distance. There is a repeater between the sender and the receiver that receives the signal sent by the sender before it becomes weak or corrupted and reproduces the original bit pattern. After that, the repeater sends the newly created refresh signal to the receiver.
  • When the cable covers a short distance, we split the cable into segments and install a repeater between the segments. The repeater performs the function of a two-port node.
  • The main disadvantage of the repeater is that it forwards each frame received on the ports, as it has no filtering capability.
  • Furthermore, the repeater is a regenerator, not an amplifier.

The diagram below shows the functionality of the repeater on the network.

Functionality of Repeater
  • As shown in the figure, there is a repeater between the sender and the receiver. When the sender sends a signal to the receiver, the signal strength starts decreasing during transmission.
  • The repeater receives the signal before the signal is too weak or corrupted, reproduces it, and sends it to the receiver.
  • It also shows that the repeater does not connect two LANs, but it connects two segments, increasing the physical length of the LAN.

Hub: The hub operates at the physical layer and is the hardware-based device. The main difference between hub and repeater is that the repeater has two ports for two devices, whereas the hub has multiple ports (4 to 48). Hence, the hub is known as a multiport repeater.

  • Hubs are used to form a star topology on a network that connects multiple devices.
  • If a cable is damaged during transmission, the hub can detect cable damage. This functionality is not present in the repeater.
  • If a device wants to communicate with another device and both are connected with the help of a hub, then the hub provides a forwarding feature to forward the message from one device to another. But it cannot filter messages because it is hardware-based. If one device sends a message to another device, the hub will broadcast the message to all devices connected to it.
  • If more than one device transmits the signal to the hub, the collision occurs inside the hub.
  • The CSMA/CD algorithm is not required for collision detection when the hub uses full-duplex mode over a point-to-point connection.
  • Passive Hub and Active Hub are the two types of hubs.
  • Passive Hub: Passive Hub operates below the physical layer and is a connector that connects wires coming from different devices.
  • Active Hub: It works at the physical level. It is a multiport repeater and is used on the network to form the star topology.

The figure below shows the structure of the hub.

structure of the hub
  • As shown in the figure, five devices are connected to the hub. PC-1 wants to send data to PC-3, so it forwards to the hub. Hub is a hardware device, so it doesn’t understand IP or MAC addresses. It transmits data to all devices. So, we can say that hub does not provide filtering.
  • In the second scenario, all devices simultaneously send data to the hub, so all data will collide and be lost.

Bridges, NIC, and Switches

Bridge, NIC, and Switch are data link layer devices. All three are important for the data link layer to function.

Bridge: The bridge is a hardware as well as software-based device and operates at both physical and data link layers. The bridge checks the MAC addresses of the source and destination in the data link layer, while in the physical layer, the bridge is used to reproduces signals.

advertisement
  • The bridge device acts as a bridge between two LANs and helps to connect them to transmit data with each other.
  • Bridge has filtering functionality. With the help of filtering, the bridge filters the MAC address of the destination and decides whether to transmit or drop the frame.

The diagram below shows the structure of the bridge.

structure of the bridge

As shown in the figure, a bridge connects two different LANs to communicate. LAN-1 devices can send frames to LAN-2 via the bridge so that the bridge decides where to send the frame in LAN-2 according to the MAC address of the destination.

NIC (Network Interface Card): NIC stands for Network Interface Card and is used to connect devices to the network via media. Each NIC has a 48-bit number, known as a MAC address. The MAC address is designed in such a way that no two devices have the same NIC address to avoid collisions on the LAN.

  • Normally, NICs don’t know anything about IP addresses. They use the MAC address of the sender and receiver to send a frame.
  • NIC is a hardware device that performs the operations of the data link layer as well as a physical layer.

Switch: A switch is a bridge, but it has better performance than a bridge. Classic Ethernet used a bridge but then switched networks came, which become more popular these days. It looks like a hub.

  • Switches have multi-ports to which devices can be connected using twisted pair cables.
  • Switches can be classified in two ways, layer-2 switches, and layer-3 switches. Layer-2 and Layer-3 switches are used at the data link layer and the network layer, respectively.
  • Layer-2 switches allow better performance over the network than bridges, connecting multiple devices and making filtering decisions based on the MAC address of the frame it receives.
  • Layer-2 switches also have a buffer that holds frames until the switch detects the destination and has processed the frame.
  • The layer-3 switch is used as a router at the network layer, which has faster processing power. It rapidly checks the address of the frame and finds the MAC address from the table, if available.

The figure below explains the connection of hosts through a switch in the same LAN.

advertisement
Connection of Hosts Through a Switch in the Same LAN

As shown in the figure, switches are used to connect multiple devices on the same LAN. Switches have multi-ports to which each device connects with a twisted pair cable. It supports Ethernet standards such as Fast Ethernet and Gigabit Ethernet.

Router and its Functions

A router is a hardware and software-based device, like a switch. It works at the network layer and forwards the packets on the network based on the IP address.

  • The router is a device that helps to connect a LAN to the Internet.
  • When the router receives a frame from the device, it de-encapsulates the frame and finds the IP packet. Then, the router examines the IP packet, which stores the destination IP address. Based on the IP address of the destination, it decides path, re-encapsulates the frame in WAN format, and sends it to the next device or destination for further processing.
  • The router understands both versions of IP that are IPv4 (32-bit) and IPv6 (128-bit).
  • Router finds a route to send packets and creates a routing table according to IP address. It ensures the optimal path for sending packets from sender to receiver.

The diagram below explains the connection of LANs using a router.

connection of LANs using a router
  • As shown in the figure, the router helps the various LANs to connect to the Internet. In the above figure, 3 LANs are connected to Router-1, and Router-1 is connected to Router-2, which is live on a network.
  • So that, if a LAN connected to Router-1 wants to send data to a LAN connected to Router-2, sends the packet to the router, and the router will forward the packet through the interface.

Firewall and Its Types

A firewall is a device that ensures the security of a LAN. A firewall protects the LAN by filtering out bad and good packets and prevents unwanted packets from entering the LAN.

  • A firewall protects users or organizations from external threats by preventing unwanted traffic from entering the internal network.
  • A firewall is located between two or more networks, which prevents unauthorized access.
  • The network administrator enforces a specific policy for a server called a demilitarized zone server (DMZ server), which is located outside the internal network so that it can access the internal network, even if the network is protected by a firewall.

The figure below shows the firewall topology.

firewall topology
  • As shown in the figure, LAN is protected by a firewall. The firewall blocked external traffic from accessing the resources of LAN.
  • Also, the DMZ server can access LAN because it is configured by the network administrator and has implemented a specific policy.

Four types of firewalls are as follows:

  1. IP or MAC-based filtering: Firewall filters packets based on IP and MAC address.
  2. Port-based filtering: The firewall checks the port number and denies the device if the port number is not allowed to access the internal network.
  3. URL Filtering: Filter by browser URL or specific keywords.
  4. Stateful Packet Inspection (SPI): Filter attacks such as Denial of Service (DoS).

Transport Gateways and Application Gateways

We can consider the gateway as a computer. A computer that operates on all layers of the OSI reference model. Gateway works at Transport Layer and Application Layer. Devices using different models for communication can be connected using gateways.

Transport Gateways: A transport gateway connects two devices that use different connection-oriented protocols.

  • It helps the device to communicate with the TCP/IP model using a connection-oriented protocol such as TCP or SCTP.
  • The transport gateway receives packets from the network layer and copies them from one connection to another. It copies in such a way that the packet format can be understood by the communicating devices.

Application Gateways: The application gateway works at the application layer on which the user is interacting. The user generates the data, and the application gateway receives it. Upon receiving the data, the application gateway understands the format and translates it into another format if necessary.

  • For example, an image file is formatted in PNG, or JPEG, or TIFF, etc. The Video file is formatted in MP4, MKV, etc.
  • Another example of formatting is email messages, in which the application gateway translates Internet messages into SMS messages to make them compatible with mobile phones.
  • It also filters out unwanted application-layer messages that are not necessary and provides security.

Client and Server

Client-server is a common and one of the most used mechanisms on the network. Client and server are network devices in which the client sends a request and the server gives a response.

Client: A client is a computer that wants to access the Internet’s resources from the server. It generates the request and sends it to the server.

Server: A server is a network device that provides services to the client in the form of a response when a request is received from the client.

  • The server only provides the services that the client requests. It does not send security information to the client.
  • Both the client and the server use key mechanisms for authentication so that the server can authenticate to the client that it is authorized to use the services of the Internet.

The diagram below explains the client and server mechanism.

Client-Server Mechanism
  • As shown in the figure, the client wants to access the webpage from the server. So, it will generate a port number randomly from its side. In this case, the port number of the sender is 12345, which is generated randomly.
  • The client adds the destination port 80 in the TCP header, as the 80-port number is used for the HTTP request. After adding port number 80 as the destination, the client will send the TCP segment to the server as a request.
  • The server will identify the port number and assign the web services to the client as per port number 80 as a response.

Topology of Network Devices

We learned about network devices like hubs, bridges, switches, routers, gateways, firewalls, and NICs, etc. Now let’s understand the working of network devices together.

The diagram below explains the topology of various network devices.

topology of various network devices
  • As shown in the figure, all the devices in the LAN are connected through media to the switch port using NIC. The LAN is connected to the router so that the router connects the LAN to the live internet.
  • LAN-1 is protected by a firewall, and the firewall is connected to the router that is connected to the DMZ server. Here, the firewall is used for filtering purposes and prevents bad packets from entering the internal network. However, the DMZ server can access LAN-1, which is protected by a firewall because the network administrator has applied specific policies to it.
  • All LANs are interconnected and can communicate with each other. For example, PC-1 in Network-2 wants to send data to PC-5, PC-1 transmits the data to Layer-3 Switch, Layer 3 Switch will forward the frame to Layer-2 Switch, and finally, Layer-2 Switch will forward the frame to PC-5.

Key Points to Remember

Here is the list of key points we need to remember about “Network Devices”.

  • Network devices operate in different layers, and they use different information needed for communication.
  • Repeater, Hub, Bridge, NIC, Switch, Router, Firewall, Gateway, Client, and Server are the network devices used on a network for communication.
  • Repeaters and hubs are physical layer devices. Repeaters are used to regenerate weak signals. The hub is known as a multiport repeater.
  • Bridge, NIC, and Switch are data link layer devices. The bridge device acts as a bridge between two LANs and helps to connect them to transmit data with each other.
  • Switches can be classified in two ways, layer-2 switches, and layer-3 switches. Layer-2 and Layer-3 switches are used at the data link layer and the network layer, respectively.
  • A router is a hardware and software-based device, like a switch. It works at the network layer and forwards the packets on the network based on the IP address.
  • A firewall protects the LAN by filtering out bad and good packets and prevents unwanted packets from entering the LAN.
  • Gateway works at Transport Layer and Application Layer. Devices using different models for communication can be connected using gateways.

If you find any mistake above, kindly email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.