What is a router?
A router is a device that forwards packets between networks. When you look at a network diagram, you will often see an image like these to represent a router. In this example, two users on different networks are connected to the same router. This router is connected to another router, which is connected to the internet.
To understand where and when you use a router, I will first look at one of the problems a router solves.
Broadcast Domain
A broadcast domain is a segment of the network that receives broadcasts. A broadcast is received by all nodes on the data-link layer, or layer 2. To understand what that means, consider that we have a router on the network.
Connected to this router, there are two switches. Connected to each of these switches are four devices. For the purpose of this example, these could be any kind of device with a network card in it. Any device on the network follows the same basic network rules.
To identify each device on the network, each device has a unique MAC address. The MAC address is a 48-bit unique value. We have used a very simple MAC address in this example to make it easier to understand. Real world MAC accesses will look more random.
MAC addresses allow devices to determine what traffic they are supposed to receive. The MAC address works on layer 2. Layer 2 comes from the OSI model, which is a topic for a different video. But for this video, all you need to know is that layer 2 allows nodes to communicate when they are on the same local network. However, it does not allow network data to travel over routers to other networks. Routers are layer 3 devices. Later in the video, I will look into this in more detail, so don’t worry about it for the moment.
Now, let’s consider that a node on the network wants to send a direct message to another node on the network. To do this, it sends data known as a frame with the address of the node it wants to send the data to.
Data is sent using frames and network packets, but these operate at different stages of the network journey. Frames are used on local area networks and include both addressing information and the data. They rely on local addresses and are limited to node-to-node communication, meaning they work between devices on the same local network, such as between computers or between a computer and a router.
Network packets, on the other hand, are designed for traversing various networks. They encapsulate the data with additional addressing information, allowing routers to determine the best path for delivery across the internet or interconnected networks.
Why do we need both frames and packets? Packets are a universal data format, enabling communication across different hardware on the internet. Frames, on the other hand, are hardware-specific and optimized for the network interface they operate with. To send packets across diverse hardware, they are encapsulated in frames. This allows packets to travel seamlessly across various media, such as Ethernet, wireless, or serial. Packets don’t worry about the hardware—they’re simply placed in a frame and sent to the next node on their journey.
Now, let’s consider that a node on the network wants to send a direct message to another node on the network. To do this, it sends data known as a frame with the address of the node it wants to send the data to.
This frame will leave the node and travel through the switch to its destination. You will notice that none of the other network nodes will receive this traffic. This is direct communication, but sometimes you may need to send a frame to all nodes on the network.
To send a frame to all nodes on the network, this time the destination MAC address is set to all F’s. When this occurs, the frame will be sent to all nodes on the network. You will notice the frame did not go over the router. Frames on the data-link layer don’t travel over the router by default. If the data is for another network, they need to be forwarded. More on that later in the video.
Routers don’t forward broadcast traffic by default. If a router did forward broadcast traffic on large networks, the network would get badly congested with just broadcast traffic. You could imagine a network with 1000 plus users; every time a broadcast frame was sent, 1000 nodes would be receiving that frame.
So far, we have a method for transferring frames across the local network. Routers don’t forward these frames even if they are broadcast domains. Now, let’s look at how a router transfers data from one network to another.
Routing Example
To understand routing better, let’s look at a simple example. In this example, the user on the left is attempting to send data through a router to a user on another network. To do that, we need some configuration. The user’s computer will be configured with an IP address and a subnet mask. The subnet mask is used by the computer to determine if the data should be sent locally or to the router.
In this example, the data is being sent to the user on the other network. Thus, this computer will also need an IP address and a subnet mask.
The first step is to send the data to the router interface on the network the sending user is on. Thus, this interface will need an IP address and subnet mask on the same network as the user. The first step is to create an IP packet. This IP packet works on layer 3 and thus can be routed to other networks. There is a lot more information in the packet, but we are going to focus just on the destination IP address to make it easier to understand.
IP packets can be routed across networks, but cannot travel over the local network natively. The IP packet needs to be piggybacked onto another protocol to travel over the network. In this example, it needs to be put into a Frame. Thus, the IP packet will be encased in an Ethernet frame. To do this, we need the MAC address of the user’s computer and the MAC address of the router. The MAC address of the router is placed inside an Ethernet frame as the destination address.
Now we can send the frame on the network. The frame is sent directly to the router. When the frame gets to the router, the ethernet frame, or layer 2 is deleted. However, the IP packet, or layer 3 data is copied.
Since the data is now on another network, the router will need network configuration for that network. Once again, an Ethernet frame will need to be used to get the IP packet to its destination. Thus, the IP packet is encased in a new Ethernet frame. This Ethernet frame will need a destination MAC address, which will be the MAC address of the destination computer.
The frame can now be sent across the network to the destination. You can see how traffic is routed between networks. It is a combination of two different protocols. One is used to get from one interface to another, and the other is for routing across different networks.
Now that we have an understanding of routers, let’s now have a look at the two main ways they are used.
LAN Router
One of the main uses of a router is as a LAN router. A LAN router is used internally; that is, it is only used to connect internal networks to other internal networks. When looking at a LAN router, and later on in the video when we look at WAN routers, focus on the concept. I have attempted to find a router that is more likely to be used as a LAN router, but we will see this router could also be used as a WAN router.
One of the reasons for using a LAN router is for performance and security. Generally, when creating an internal network, you want good performance and good security. The security is obtained by isolating different parts of the network.
A router achieves this by dividing a single physical network into multiple networks. For example, in this network, there are three networks divided by routers. These are main network, research and development and a Wi-Fi network.
If I now start looking at the concepts used on this network, the routers divide the network into multiple logical subnets. This makes sense as you want your main network to have stable infrastructure. On the research and development network, you may want to deploy some experimental servers or services. You don’t want something experimental to affect those working on the main network. Thus, you can see one of the reasons you want to divide your network using routers is for security reasons. The router can filter traffic between the networks, stopping unwanted traffic from traveling between them.
Dividing networks like this also creates multiple broadcast domains. Broadcasts go to every device on the network. This reduces performance on the network as the number of nodes increases. Thus, you can see LAN routers are often used to divide a network for performance and security reasons.
Let’s now have a look at WAN routers.
WAN Router (Edge/Border)
A WAN router, also known as an edge or border router, is located on the boundary of a LAN and WAN. These devices usually include a WAN link but may not. In some cases, the device may perform the routing but use an Ethernet connection to connect to another device that connects to the external network. You can start to see that routers are often purchased based on what features you want. Nowadays, an edge router will often include firewall or VPN options. In the case of modular routers, different services can be added, and different external connector types can be used.
The main two places where an Edge router is used is to connect a WAN router to a LAN. The second place these routers get used is connecting two LANs together. Although a direct physical connection could be used to connect both sides together, nowadays this is often done using the internet to create a tunnel between the sites as this is cheaper than a dedicated line.
In many cases, you may find your WAN router connects multiple sites together. For example, a head office connected to all the regional offices. This will include virtual private networks or VPNs and other services like firewalls. You can start to understand why these routers are often specialized devices and are quite expensive to purchase.
There has been a lot of information in this video, which can be confusing to those new to networking. Let’s put it all together so we can have a better understanding of how it all works.
Putting It All Together
This information is tested more on the Network+ exam than the A+, but looking at it, I believe, gives a better understanding of how routers work. To start with, you have the physical layer, or layer 1. This defines the cabling, the electrical signal, and any other mechanical specifications for sending data over the network. I have not mentioned this before now because the vast majority of devices you will work on operate at layer 2 or layer 3.
Layer 2 devices, like switches, work on the data-link layer. This provides node-to-node communication. Thus, if the nodes are on the same network, layer 2 can be used to send direct messages between nodes.
Layer 3 devices provide routing. Layer 2 protocols are used to send frames to or from the router. The routable packet is inside the frame. Layer 3 devices, that is, devices that have routing functions, extract the packet and then forward it to the next network.
There are many different routers on the market. Some routers have additional features like firewalls and virtual private networking. Certain router features are aimed towards internal use and others are aimed towards WAN use.
End Screen
I hope you have found this video on routers helpful and that it has improved your understanding of routers. Until the next video, I would like to thank you for watching.
References
“The Official CompTIA A+ Core Study Guide (Exam 220-1101)” pages 167 to 168
“Mike Myers All in One A+ Certification Exam Guide 220-1101 & 220-1102” page 765, pages 769 to 771
“Picture: Router symbol” https://commons.wikimedia.org/wiki/File:Router_mark.PNG
“Picture: Switch symbol” https://commons.wikimedia.org/wiki/File:Switch_symbol-Blue.svg
“Picture: https://en.wikipedia.org/wiki/Ethernet_frame#/media/File:Ethernet_Type_II_Frame_format.svg”
Credits
Trainer: Austin Mason http://ITFreeTraining.com
Voice Talent: HP Lewis http://hplewis.com
Quality Assurance: Brett Batson http://www.pbb-proofreading.uk