Connecting Networks Using Routers

So far, we’ve shown you the ins and outs of setting up a single network. But what if you need to share resources with another network? That’s where routers come in handy. Routers specialize in seamlessly moving network traffic from one network to another, and this tutorial will show you how. We’ll show you how to program your router and how the router itself can assist you in troubleshooting.

We briefly discussed routers and modems in the first tutorial. In this tutorial, we will go over routers in great detail.

As is usual, let us begin by learning about routers from the ground up. Consider the following scenario.

You and your mate Hermione have created your own network. All of your devices can now communicate with one another and share resources. Your friend Ron has also set up a network in his home. Let us now connect the two networks.

4DM0 TfDxBzBhkZV3JcmqazJOTKL0T EDHdHOXJqPypFBAQthLm5CN70ncl90Lg pSgq9WP3s9vRofQ dh5xsI7ryTqPb8X1L1VnAM04mLvKV4GK WB5ITCHzQ5Ao68lvPuaK9xOcScBcUkjzqqqGHHDIe1VvGNTyvsOcNlQTH2K temmML9iktjJVOBQ - Connecting Networks Using Routers

Let’s connect the two networks. But first, take a look at the network Ron had set up in his home.

peHMm DnWnsFPLEjHdaRRuhMkXNVehixH92KE1or2IxKfi6srxUtWCSooti hnipG6xtySTyrKg6kBPepIxiUGdjPahneNFYq94oqe1lbvBaQMAOf4EKPm7yYt0F1HtOsFUtkuvlnbfG6Qud A7dtIK7PfU1TNgtOKjYgFJ6iOCc2ODk7xSuJpV 4EKOQ - Connecting Networks Using Routers

Now let us compare the two networks. 

Ron has used a switch of model 2950-24 whereas in your network the model of your switch is 2960-24TT. To know more about these switches follow this link. However, because you are new to networking, you may not understand anything useful from the specifications. So, for the time being, let us keep things simple.

If you left-click on the switch and zoom in on the physical view, you’ll see the following.

HAIBpPGcbubDKtrq6yfSCrLRzCxBSBYG1FDxLiiZL9dSZF 4anUp3mfScFY3fe t0hLUwfB n2Gq4FtaKYwiBSqjpZ8ToFFFWeOhGHyOPk5EVxvJx9gVMt6CMULYlr901PAawEVpUN2ER4f6l9FPQGDn33uQXQdXU - Connecting Networks Using Routers

This is the physical view of the 2960-24TT switch(switch 0).

ULCvFYn3059fO8m mu53EuezvnKJ uQcVQuzorptQg8 hyKCtxJ4ru5kwz0MhXFsGLhmYUpjepGiDqzhPEarrbRT22A3DV7kKHxIXjFX1sOumbBT BLQolg3JH3YQwXGNk 4 3CU7v5zTMol4kpdSGIr52NhRAuZPZntk1Ys7imS33h iGW2RUq07MAJ1Q - Connecting Networks Using Routers

This is the physical view of the 2950 switch(switch 1). 

We won’t go over the differences between the two switches. This will lengthen the tutorial unnecessarily. Most importantly, it doesn’t matter which switch you use to set up a network at this point. To connect the devices to the switch, we will only use ethernet cables and RJ-45 connectors.

Both networks’ end devices are clearly different. But the way we connect them to the switch is the same.

Now that we have a firm grasp on both networks, let us focus on connecting them. 

First let us draw a diagram. Network#1 is yours and Sam’s network and Network#2 is Ron’s network. 

qsl4pD5MQsPOP2JwOldiSK2sMjnYJwEUmkoopFWE3B7gvjoMkUiv92IF9S5J RuwuIvuNmtYuTfJFIMWuO7l SgY3rGuCh6vsY Thb6i7gZQbeW TYqQmEE 5BrusCgkfwr3sWPiDdbtT6B zdg2Sm3sxsoX ud8h7H7Eu D1rz24mA4WpcF7K1l8EbYlQ - Connecting Networks Using Routers
The device we will be using to connect the networks is A Router. 
j1skSVgGxGsdMTgmJX9P64U L2MO3rLE61aAprDQNy9YG4bMNQA0OS9akzai0HVGKdUeLSEuHus4om2dvk5fkT8byqB2xHD 3bKxX1GO55VcX9Ptjm5P Y 2jmzkQcvLbbSQXH6y 6hhRiMPqCfn08kjcLtGmPwvV7mfMcerVDM6E8c3vyjc0ODTq6nUQ - Connecting Networks Using Routers

Connecting Two Networks: How to Do It?

The first requirement is a functional local area network (LAN). Second, you must connect to the other network. This could be done via a Cat 5 cable, fiber optic cable, or even a radio link. Finally, a router is required to connect the two networks. The router connects networks both physically and logically.

The hardware that makes up a physical network includes cables, switches, hubs, and routers. The logical network is responsible for network addressing.
InuZdardb4LqW81uZv9ZflLeFidH5 H5Go1TVADnmynEN8IoF7G09mCbir za5K - Connecting Networks Using Routers

The diagram shown above was created using Cisco Packet Tracer. If you look closely, you will notice that even though we have physically connected the networks with ethernet cables, we are unable to communicate between them. That is indicated by the red arrows. The issue is that a node on one network does not understand how to send frames to a node on another network. A router understands how to transfer data from one network to another. 

Q: So why do we have to use a router? Can’t the switch connect the two networks?

When connecting two networks, we must use a router. Between the two networks, the router serves as a “translator.” Simple switches lack the necessary intelligence. 

Q: What is the router “translating”?

Simply put, network addresses. The two networks are like two different cities. The router is responsible for moving data from one network to another.

Q: So do I always need to connect a computer to a switch?

To a switch or to a hub, but never directly to a router.

Q: But I have a DSL router at home, and my computer is directly connected to it. What is that all about?

Excellent observation. There are switches with routing capabilities and routers with switched ports. There is no clear distinction between the two devices. It has more to do with their primary function. Switching routers are now used in large networks. These are equipped with software that allows them to function as routers on switched ports. They are easy to use and make it simple to build large sophisticated networks, but they are very expensive.

Remember from a Network Frame tutorial that data on an Ethernet network is transmitted in discrete units known as frames. The frames are routed based on the MAC address contained within the frame. Remember that in order to send and receive network traffic, every network device on an Ethernet network must have a MAC address.

A switch can only communicate with network nodes that have the same IP network address. A switch can only process MAC addresses. To connect two different IP networks, a router is required. Routers use IP addresses to transfer data from one node to another.

Why Do We Need IP Addresses?

Let us first explain why we do not use MAC addresses to move network traffic.

90S6liyXUNwFD0qMoyCgGUggHsI7CRm7gelOq7SnOOwz1J9fyAMl56sppGT0dUAGenSXoAt4aPp1hB6Z4m RVy ksp1T5VCWhZ577GJtXzTMkGsBAI3lKsh1msYgPRgiMmfHRyJZZo tj4F9Hiqbf3poHKKtW1UKfL2NnT0mbqdUL38Iod8d2Xv0cWbgNA - Connecting Networks Using Routers

Every device connected to an Ethernet network is given a MAC address. In your computer, that is the network card. The manufacturer is designated by the first part of the MAC address. The manufacturer then increments so that all of their products have unique MAC addresses. It’s similar to a social security number in that you can’t tell where someone lives just by looking at it.

The MAC address is not capable of storing network information. Each address is specific to the hardware to which it is assigned. The 6 bytes used to determine the MAC Address are used to uniquely identify the hardware device. We cannot store any network information in these 6 bytes. In practice, it would be somewhat inefficient to do so. The manufacturer has no idea who will buy and use a network device when they are manufacturing the device. Even if they knew who was going to buy it, they have no idea on which network the device will be used.

You could, for example, purchase a network card. You may want to upgrade the network card after some time. Then you go out and get a new one. You give the previous one to a friend. As you can see, the network card has adapted the network. Consequently, storing network information in the MAC Address is inefficient.

A network address and a host address are combined to form an IP address. The host part is the one-of-a-kind bit assigned to a specific network device. It’s similar to a phone number. which includes a country code, area code, and local calling area—and, finally, your unique personal number.

Zsbb8HqT 6gyG4CykPm lXx 7 bbSYltufgKu7tATVbUV3vO fsKHkkkAHr3O16Ou0reMYlQCcTIMeOEx4hQJ2aJtlFosAoCRHjqb3XlsZ1OMJo5a7Z6BKX6hslsspD Zu4icknjiklji6zVJE61 LXL7dRwD4OSjLEKvzeKwASNTD56 UlsfGHJyZIRIg - Connecting Networks Using Routers

The ability to create IP address groups, known as IP networks, is built into the number itself.

LpncMinJsI0ZFoY4SV2 qbR WYeQH0LZ77LHaK98wML epyNaCLDhJl2JhfV7WV2Nt3Y0x7yFq6ejshT1NGTzYLzT5aj2D8z9tWVv1 Tmwn1Vba1PPm - Connecting Networks Using Routers

IP addresses provide our networks with a sense of location, as well as network nodes with a sense of belonging to that location. IP addresses are used to create an address space in order for different networks to communicate with one another, similar to how area codes relate to different geographical areas. The IP address then assigns a unique network and specific address to each network node.

WqBCPoeQK771zMs1rvctOzSd4ectYSuraa2TM3oyyvBCr1EquoDipTOK7W eD BQ2O - Connecting Networks Using Routers

The subnet mask indicates whether two nodes are on the same network. If you have a network address of 192.168.0.0/16, a node at 192.168.0.1 is on the same network as 192.168.100.1, and no router is required to connect them.

Q: I thought I just needed a MAC address for a frame to get somewhere.

That’s all it takes for an Ethernet frame to get somewhere. But, as mentioned in the previous tutorial, Ethernet frames contain packets, which contain data in the form of protocols. In the case of TCP/IP networks, IP addresses are required to move packets between networks.

Q: If my computer has an IP address, why does it need a MAC address too?

On the same network, a computer can communicate using multiple network protocols. The MAC address allows Ethernet frames to travel between network devices such as routers and switches. The network protocols enable the computer to communicate with devices on other networks.

We’ve already mentioned that a router can transfer data from one network to another. It performs this by reading the packet’s destination and source IP addresses (packets are encapsulated in frames).

But how does it accomplish this? Isn’t it supposed to know about both networks, or at the very least how to connect to the outside network?

Also, how does a network node know to send traffic bound for another network to its router?

We need to program a router so that it knows about the networks to which it is connected and how to connect to other networks.

Before we get into how to program a router, let’s talk about “protocol”. We will do so in the following tutorial.

Why do we not use the MAC address as an IP address instead of an IP address in networking?

Assume that we were able to overcome all of the limitations mentioned and that computers can communicate over the Internet solely through their MAC addresses. And suppose you run a website that receives tens of thousands of unique visitors every day. That website is hosted on a server, and that server has a network adapter, which has a MAC address.

What happens if that network adapter or the entire server fails? In most cases, you simply purchase a new server, restore a backup of the old server, and you’re good to go. However, keep in mind that, as previously stated, a MAC address is unique to the physical network adapter, and your new server has a new network adapter with a new MAC address. Instead of your website being up and running, you now have to go tell those tens of thousands of unique visitors a new address (perhaps you can do this via DNS, or perhaps DNS does not exist in our alternate universe).

IP addresses perform all of the functions described in the other answers, but they also provide a layer of abstraction so that hardware-level changes do not disrupt network- or application-level communication.

Share The Tutorial With Your Friends
Twiter
Facebook
LinkedIn
Email
WhatsApp
Skype
Reddit

Check Our Ebook for This Online Course

Advanced topics are covered in this ebook with many practical examples.