4.3 More on routing
Now watch the following video, which is about 2 minutes long.
More on routing
Let’s now look at an example involving three routers. Here, routers A, B and C are interconnected. Each router has a local network, reached via a switch.
The end devices have individual IP addresses, and the network itself also has an IP address. For example, if we take a closer look at router C we can see it has devices with IP addresses: 220.127.116.11, 18.104.22.168 and 22.214.171.124. And the network also has its own IP address, which is 126.96.36.199. This address cannot be allocated to a device, only to a network.
Here’s a device on router B’s local network sending a packet addressed to a device on router C’s local network. The destination device has address 188.8.131.52, so the network it is on is 184.108.40.206.
The first router the packet meets is router B. This router knows that the network 220.127.116.11 can be reached on port 1. The packet goes via router B’s port 1 to router A, which then passes it to router C. From router C it goes to a switch, which the end device is connected to.
From here, the switch takes over and uses its forwarding table as we saw in the previous part. It not only associates MAC addresses with port numbers, it also associates IP addresses with MAC addresses. The switch forwards a frame containing the packet to the correct port. This final stage of delivery is actually a switching process which occurs at the Network Access layer of the TCP/IP protocol stack. At this stage, the IP packet is encapsulated in an Ethernet frame. The initial stage of the journey, wheren the packet leaves the sender, also involves switching prior to the packet reaching router B.
Of course, one important point here is that we have assumed that the three routers already have enough information in their routing tables to be able to deliver packets to the other networks.
Activity 4 Think about
In the previous session you were asked why it might not be a good idea to have too many devices connected by just switches. Can you think how routers might help?
All devices connected by a switch will be in the same broadcast domain, which you saw previously means all devices will receive and have to process any broadcast packets. Routers do not forward broadcasts by default and therefore break up broadcast domains.
Now watch the following video, which is about 3 minutes long.
Routers in Packet Tracer
Here we have the same example, but now in Packet Tracer, with three networks each connected to a router. So we have router C connected to network 18.104.22.168, router B connected to network 22.214.171.124 and router A connected to network 126.96.36.199.
You may recognise that each of these networks is very similar to the ones we were looking at in the last part on switching, with a small number of PCs connected by a wire to a switch. Now though, each switch is connected to a router and there are connections between some of these routers.
This overall network is identical to the network in the animation we’ve just seen, but now we’ll take a closer look at what information we need to give these routers and how we configure them to enable them to send data from a PC on one network to a PC on another network.
So at the moment, the connections between the PCs and the switches are all green, which means they are up and working. This is because I’ve already configured each of these PCs with their IP address.
I’ll go into one of these PCs to show you that information – so if we go into ‘IP Configuration’ we can see that we’ve got the IP address of the device, the subnet mask and I’ve also put in the IP address of the gateway for that network. So if the network address is 188.8.131.52, the default gateway entered here is 184.108.40.206.
That should look similar for each of these networks: I’ll just check another one – this network is 192.10.7 and the host ID 56. The default gateway is 220.127.116.11.
So remember the switch can build a forwarding table using the MAC addresses and port numbers. It will also associate the IP addresses with the MAC addresses. So PCs are able to send data via the switch to other devices on the same network.
So if we open a command window and ping from one device on this network to another to test that out; we should see that packets are reaching their destination successfully.
However, you may have also noticed that the ports connecting the switches and the routers, and between the routers, are all still red. This is because we haven’t configured the routers yet. So each of these routers doesn’t know what networks are available on each of its ports yet. We’ll look at this in more detail in the next video.
Activity 5 Try it out
1. Openin a new tab or window so you can read these instructions. There are two networks connected by two routers.
2. Can PC0 on the first network send messages to PC1 on the same network?
Click Reveal answer if you would like a hint.
You will need to find the IP addresses of both PCs and ping from PC0 to PC1. You should find this is working OK.
Now watch the following video about configuring routers, which is about 4 minutes long. In the video the speaker refers to a serial connection. This is a type of connection sometimes used to join routers.
In this video we will look at how to configure the routers.
We know that this port, or interface, on router C (which is actually FastEthernet Port 0/0), is connected to network 18.104.22.168.
If I click on Router C, and then ‘Config’, then FastEthernet 0/0 (as this is the port we’re currently working with) – I need to set the IP address to 22.214.171.124 because this provides the default gateway for this network. The subnet mask fills in automatically. I also then need to switch this port ‘on’, and then when I close this down we can see that this is starting to configure, so these ports should now turn green.
This router now knows that on port 0 it can access network 126.96.36.199.
If we then do the same for Router B, so configure, and then FastEthernet port 0, the network on this port is 192.10.6 and then .1 as it is the default gateway for this network. Then remember to switch it on and close it down.
Finally, we would need to do the same for Router A.
As well as configuring the routers this way, we could use the command-line interface. The window at the bottom here, when we were in the ‘Config’ tab, shows the commands that are used: for example, interface and ip address. We won’t look at this in any more detail at the moment, but we will be using those commands later in this course.
So as well as the three networks that we’ve already configured on each of those ports, the connections between routers also need to be considered networks. So the link between Router C and Router A is one network. There is also a network between Router A and Router B. So the next job is to provide network addresses for these router interfaces.
So to save a little time – as you’ll be looking as this in more detail later in the course – I’ve created a preconfigured version. I’ve given these network segments addresses. So you can see here between Router A and Router C we have a network address 172.16.0.0. And the between Router A and Router B we have a network address 10.0.0.0.
If we now have a look at Router C, remember before we had configured the FastEthernet 0 port to show this network address. If we look at the connection between the two routers here, which is actually serial connection 2/0, we can see that this now knows that this network is available on this interface – as we’ve given it the address 172.16.1.1.
Router A has two connections – one to Router B and one to Router C – so we should see that in the configuration here. Again, we’ll just check the FastEthernet connection to the local network, which is 188.8.131.52. And then we’ll take a look at the two serial connections. The first one here is 172.16.1.2. And to the other router we have 10.10.10.1.
We’ll take a final look at Router B – which has also been done.
So now we can see that all ports are up and everything is green.
Now watch the following video about using the configured routers as a network, which is about 5 minutes long.
Using the configured routers
Next I’m going to try to send some packets between different devices. There’s a facility in Packet Tracer that enables us to send a simple packet by clicking on this icon and then clicking on a source and destination device, and it sends a simple packet. We could of course do this by pinging at the command line from one PC to another, but this will be quicker.
A report is received – down at the bottom here – on each packet that’s sent.
So we’ll start off by doing a simple test between two PCs on the same network. We can see here that the packet was sent successfully.
We’ll now try between two PCs on a different network. And again, we have a successful packet sent.
What we’ll do now is try sending a packet from a device from network B to network C. As you can see, when we’ve done that, that’s failed. This is because we haven’t yet configured each of these routers with a routing protocol which would in turn discover which networks are available and via which ports and which routers. So this is what we’re going to do next.
It would be possible to input the information manually, typing in each network and path that packets need to take. This wouldn’t take much to do here because we only have three routers. But in large networks this becomes a very complex task. So instead we’re going to use a routing protocol to do it. Again, this is something that could be done via the command-line interface, and you’ll see how to do this in a later session. But for now it’s easier to see what I’m doing if I use the configure option. So starting with Router C, I’m going into ‘Configure’ and I need to click on RIP (which stands for Routing Information Protocol) – the routing protocol I’m going to use here. Then I need tell the router which networks are available on its ports.
So we know Router C is connected to the network 184.108.40.206, so we’re going to add that one. We also know it’s connected to this network here, so we’re going to add that one, too. Then I need to make sure I save those.
Now going to Router A. ‘Configure’, ‘RIP’, and then we’re going to add the network addresses that Router A is connected to. So we have 220.127.116.11, and we also have 172.16.0.0. We also have a third one, which is 10.0.0.0. And again, I make sure I save those. Finally, we do the same for Router B.
We may need to allow a little time for this to update. I’m going to start by sending a few packets to see if they’re reaching their destination yet. We might need to send a few packets before the route’s found. Finally, we can see that packets are starting to be sent from network to network successfully.
So just one final word on broadcast domains. We saw in the part on switching how a broadcast domain comprises all the devices that will receive each other’s broadcast frames – so all the devices a switch will forward a broadcast message on to. Routers do not forward broadcast messages. So in our example, a broadcast message sent on network C will not be sent on via Router C so will not reach A or B. Let’s just try this. If I send a broadcast ping on network C, let’s see where it reaches. So we can see we’re getting replies from hosts 16, 84 and 1, but packets are not going any further than devices on the network 192.10.8.
Activity 6 Sort it out
1. Go back to this network in PT Anywhere that you were just exploring.
2. Can PC0 on the first network send messages to PC2 on the other network?
Click Reveal answer if you would like a hint.
You will need to find the IP addresses of both PCs and ping from PC0 to PC2. You should find it doesn’t work.
3. Can you identify what the problems might be in sending messages from one network to the other?
Click Reveal answer if you would like a hint.
Router0 is OK, but Router1 should have the FastEthernet0/0 and Serial2/0 interfaces configured. We also haven’t checked the RIP settings on the routers.
You haven’t yet covered how to do this at the command line (which is the only option in PT Anywhere) but you will be looking at how this is done later in the course.