contact@embeddedgeeks.com
Embedded World

Network Devices

Hubs

A hub serves as a central point to which all of the hosts in a network connect to. A Hub is an OSI Layer 1 device and has no concept of Ethernet frames or addressing. It simply receives a signal from one port and sends it out to all other ports. Here is an example 4-port Ethernet hub (source: Wikipedia):

hub

Today, hubs are considered obsolete and switches are commonly used instead.

Switches

Like hubs, a switch is used to connect multiple hosts together, but it has many advantages over a hub. Switch is an OSI Layer 2 device, which means that it can inspect received traffic and make forwarding decisions. Each port on a switch is a separate collision domain and can run in a full duplex mode (photo credit: Wikipedia).

Cisco switch

Routers

A router is a device that routes packets from one network to another. A router is most commonly an OSI Layer 3 device. Routers divide broadcast domains and have traffic filtering capabilities.

The picture below shows a typical home router:

home router

Explanation Of Devices

Network Hubs

hub serves as a central point to which all of the hosts in a network connect to. It is an OSI Layer 1 device and has no concept of Ethernet frames or addressing – it simply receives the signal from one port and sends it out to all other ports. Here is an example 4-port Ethernet hub (image source: Wikipedia):

Network hub

As mentioned above, hubs have no way of distinguishing out which port a signal should be sent to; instead, an electrical signal is sent out each port. All nodes on the network will receive data, and the data will eventually reach the correct destination, but with a lot of unnecessary network traffic:

How hubs work

In the example above you can see that the hub has sent out the receiving signal out all other ports, except the incoming port. Hubs are therefore considered obsolete and switches are commonly used instead in modern LANs. Hubs have numerous disadvantages over switches, such as:

  • they are not aware of the traffic that passes through them
  • they create only one large collision domain
  • a hub typically operates in half duplex
  • there is also a security issue with hubs since the traffic is forwarded to all ports (except the source port), which makes it possible to capture all traffic on a network with a network sniffer!

NOTE
Hubs are also known as multiport repeaters because that is basically what they do – repeat the electrical signal that comes in one port out all other ports (except the incoming port).

Network Bridge

network bridge is a device that divides a network into segments. Each segment represent a separate collision domain, so the number of collisions on the network is reduced. Also, because each collision domain has its own separate bandwidth, a bridge also improves the overall network performance.NOTE
Unlike hubs, bridges allow multiple devices to send at the same time. This is why there are considered to be predecessors of network switches.

A bridge works at the Data link layer (Layer 2) of the OSI model, just like a switch does. It inspects incoming traffic and decide whether to forward it or filter it. Each incoming Ethernet frame is inspected for destination MAC address. If the bridge determines that the destination host is on another segment of the network, it forwards the frame to that segment.

Network bridges explained

In the example above we have a network of four computers. The network is divided into segments by a bridge. Each segment is a separate collision domain with its own bandwidth. Let’s say that Host A wants to communicate with Host C. Host A will send the frame with the Host C’s destination MAC address to the bridge. The bridge will inspect the frame and forward it to the segment of the network Host C is on.

Network bridges offered substantial improvements over network hubs, but are not widely used anymore in modern LANs – switches are commonly used instead. Here is why:

  • most bridges have only 2 or 4 ports. A switch can have tens or even hundreds of ports
  • bridges are software based, while switches are hardware-based and use chips (ASICs) when making forwarding decisions, which makes them much faster than bridges
  • switches can have multiple spanning-tree instances, bridges can have only one
  • switches can have multiple broadcast domains (one per VLAN)

Network Switch

Just like hubs and bridges, a switch is used to connect multiple hosts together, but it has many advantages over them. Switch is an OSI Layer 2 device, which means that it can inspect received traffic and make forwarding decisions. Each port on a switch is a separate collision domain and can run in a full duplex mode (photo credit: Wikipedia).

Cisco switch

A switch manages the flow of data across a network by inspecting the incoming frame’s destination MAC address and forwarding the frame only to the host for which the data was intended. Each switch has a dynamic table (called the MAC address table) that maps MAC addresses to ports. With this information, a switch can identify which system is sitting on which port and where to send the received frame.

Network switch explanation

As you can see from teh example above, Host A is trying to communicate with Host C and sends a packet with the Host C’s destination MAC address. The packet arrives at the switch, which looks at the destination MAC address. The switch then searches that MAC address in its MAC address table. If the MAC address is found, the switch then forwards the packet only out the port connected to the frame’s destination. Hosts connected to other ports will not receive the frame.

Network Router

router is a network device that routes packets from one network to another. It is usually connected to two or more different networks. When a packet comes to a router port, the router reads the address information in the packet to determine out which port the packet will be sent. For example, a router provides you with the internet access by connecting your LAN with the Internet.NOTE
A router is most commonly an OSI Layer 3 device, since its forwarding decision is based on the information of the OSI Layer 3 – the destination IP address. Routers divide broadcast domains, provide full duplex communication, and have traffic filtering capabilities.

Typical home router

If two hosts from different networks want to communicate, they will need a router in order to exchange data. Consider the following example:

Network router explained

We have a network of three hosts and a router. Note that each computer is on a different network. Host A wants to communicate with Host B and sends the packet with the Host B’s IP address (10.0.0.20) to the router. The router receives the packet, compares the packet’s destination IP address to the entries in its routing table and finds a match. It then sends the packet out the interface associated with the network 10.0.0.0/24. Only Host B will receive and process the packet. In fact, Host C will not even be aware that the communication took place.