4.2 Key routing terms
Now watch the following video, which is about 5 minutes long.
Key routing terms
Routers operate at the Internet layer of the TCP/IP protocol stack and use IP addresses to make routing, or forwarding, decisions.
As we have seen, unlike MAC addresses, IP addresses are hierarchical, and contain location information – in this case within a hierarchy of networks, not geographical places as would be the case in an address or postcode.
IP address can apply to networks themselves, as well as to individual devices, and that address locates a network within the hierarchy of networks.
The home gateway device we have focused on previously provides some routing capabilities – but these generally route local data traffic to the next level of router usually at the ISP (internet service provider) which will aggregate data traffic from several home routers (shown here as Tier 3). Then there are routers that will aggregate data from these and so on – core routers (or Tier 1, shown here) provide the backbone to the internet and are designed to carry huge amounts of data.
When a user sends a packet that has a destination on a different network – not the one that the user is connected to – the packet is sent to a router. In the case of our domestic network, a device is configured to know its ‘default gateway’ which will be the home gateway device.
The router then has to work out which network the packet should be forwarded to. The router might only be connected to a small number of devices and the ISP, or it may be connected to other networks, but the processes used are the same.
Routers make their decisions on how to direct packets from network to network using routing tables. Routing tables store destination IP addresses that can be reached via a particular port. This sounds similar to the way in which forwarding tables store MAC addresses and associated port numbers. However, with routing this can be a much more complex process and the ways in which routing tables are constructed also differ.
Normal PCs connected to a network also have a routing table so that they know where to direct a packet, although these are much simpler compared to the ones used by a router, as they have very little to route: they simply have to get data to the default gateway.
Using the command route print at the command line will show you your computer’s routing table. Another command that will also show the routing table is netstat (short for network statistics) with the parameter -r.
I’ll use route print here. So if I start at the command line by typing route print, my results look like this with several tables.
I’ll start by locating the IPv4 routing table. Let’s have a quick look at some of the information that’s shown. The top line is of most significance to us at the moment. Under ‘Interface’, the IP address given – 192.168.1.191 – is the IP address that my computer’s currently using. And under ‘Gateway’, you can see the IP address of my home gateway is 192.168.1.1. You should recognise this by now as a commonly used private network address.
The 0.0.0.0 under ‘Destination’ means that this is the default route. All packets sent from my PC will be sent to the gateway router which then has the more difficult job of deciding what to do next. The value in the ‘Metric’ column refers to how efficient the route is – in more complex networks there may be several routes a packet could take and therefore the router has to decide which is the best one. So the lower this value here – the lower the metric – the better.
Routers have more complex routing tables as it then has to decide where to send the packet next, sometimes via several ‘hops’ – where one hop is one section of the path taken. The number of hops a packet takes between source and destination is basically the number of network devices that the packet has to pass through on its journey. This is one of the pieces of information, amongst other things, that is used to determine the metric of a route. The more hops, the less efficient the route.
When a router is first connected to a network, it doesn’t know about other networks – so its routing table is empty. The router has to be configured with a routing protocol that will enable it to learn routes and populate the routing table.
A routing protocol is a set of rules that uses software and algorithms to specify how routers share information with each other. Some examples that you may come across are shown here. But we won’t go into the detail of these until later in the course. For now you should just be aware of why they are used and that there are different types.
The routing protocol enables the router to learn about nearby networks by exchanging information with other routers. In this way it learns about more distant networks. This enables it to determine the best path for sending packets from source to destination device, and via which routers it will travel.
Activity 3 Try it out
1. Try using route print or netstat –r at the command prompt of your PC.
Click Reveal answer if you would like a hint.
Look for the IPv4 route table.
2. What can you deduce from the results?
Click Reveal answer if you would like a hint.
Can you find the IP addresses of your PC and gateway?