When it comes to networking technology, it is important to understand the different products that Cisco offers for different solutions, especially when designing LAN and WAN solutions. The three most common network devices in use today are routers, switches, and hubs, which are shown below in Figure 1.4:
Figure 1.4 – Network Devices
When describing various network devices, the following terminology is used:
- Domain: A specific part of a network.
- Bandwidth: The amount of data that can be carried on a link in a given time period.
- Unicast data: Data sent to one device.
- Multicast data: Data sent to a group of devices.
- Broadcast data: Data sent to all devices.
- Collision domain: Includes all devices that share the same bandwidth; collision domains are separated by switches.
- Broadcast domain: Includes all devices that receive broadcast messages; broadcast domains are separated by routers.
Hubs are network devices that operate at Layer 1 and connect multiple devices, which are all on the same LAN. Hubs became necessary when the need to connect more than two devices first arose, because a cable can connect only two endpoints.
Unlike switches, hubs do not have any intelligence and they do not process packets in any way. Their main function is to send all the data received on a port to all the other ports, so devices receive all the packets that traverse a specific network, even if they are not addressed to them. For this reason, hubs are also called repeaters. This behavior is depicted below in Figure 1.5, where a packet sent by PC 1 to PC 3 is broadcasted out by the hub to all ports, forcing the workstations that do not need the packet (i.e., PC 2 and PC 4) to discard it.
Figure 1.5 – Hub Operations
Note: Devices connected to the hub are in the same collision domain and the same broadcast domain.
Using hubs in medium- and large-sized networks is not efficient. In order to improve performance, especially from a bandwidth and security standpoint, LANs are divided into multiple smaller LANs, called collision domains, which are interconnected by a LAN switch. When using switches, only the destination device in a communication flow receives the data sent by the source device; however, multiple conversations between devices connected to a switch can happen simultaneously.
Switches have some intelligence, unlike hubs, because they send data to a port only if the data needs to reach that particular segment. Switching intelligence functions based on a MAC table kept in the switch’s memory. The MAC table contains MAC address-to-port mappings, and it is populated when a device sends data to a device located on another switch port and the switch learns the source MAC address (Layer 2 address) and its associated port. It then floods the received frames out to all ports. This process continues until the MAC table contains entries for all the devices in the network. When a switch must forward a frame with a destination MAC address in the MAC table, it forwards that frame only to the specific port for which it is meant.
Figure 1.6 below exemplifies this process. In the diagram on the left, PC 1 sends a frame to PC 3, but the switch does not know the port to which PC 3 is connected so it floods that frame out to all ports. At the same time, it records the source port and MAC address of that specific frame (Port 1, with a MAC address of PC 1). In the diagram on the right, PC 3 responds and sends a frame back to PC 1, but the switch does not have to flood that frame out to all ports because it now knows the port associated with PC 1, which is Port 1. At the same time, it also records the port-MAC association for PC 3, so if PC 1 sends a future frame to PC 3, the switch will forward it only to Port 3 because it now knows where PC 3 is connected.
Figure 1.6 – Switch Operations
Devices connected to a switch port are in the same collision domains, while devices connected to different ports are in different collision domains. The most important feature of a switch is separating collision domains. On the other hand, all devices connected to a switch are in the same broadcast domain. Special scenarios are those in which the destination Layer 2 field contains a multicast or broadcast address. In those cases, the switch forwards the frame to multiple ports. In addition, a special category of switches are Layer 3 switches, which have full Layer 3 capabilities, including routing. They are also called routing switches.
The most intelligent devices in a network are called routers. Routers are Layer 3 devices that use Layer 3 addresses and allow devices on different LANs to communicate with each other. By default, they do not forward any information between devices connected to different ports.
Figure 1.7 – Router Operations
Figure 1.7 above illustrates how a router operates. First, it reads the source and destination IP addresses in the packets and then it keeps track of which devices connect to which ports, and which devices need to communicate with devices on other ports. A router separates broadcast domains, so devices connected to different ports are located in different broadcast domains. The process of moving a packet across different broadcast domains is called routing, which works by implementing different routing protocols on the router.
Routers block multicast and broadcast packets by default. This is a significant difference between a router and a switch, and it helps control the bandwidth utilization on a network. In addition, devices connected to the same router port are in the same collision and broadcast domains, but devices connected to different router ports are in different collision and broadcast domains. Routing operations are discussed further in Chapter 7.