Wednesday 3 May 2023

More on routing....

Routing refers to the best path for network traffic to travel. Communication at layer 2 uses mac address tables whereas layer 3 communication uses routing tables. I will discuss the different types of routing below;  

Static Routing

Static routing is the most basic type of routing and involves configuring the routing tables manually. In static routing, the network administrator defines the routes that packets can take through the network. This routing type is ideal for small networks with a limited number of devices as it is easy to configure, but it is not scalable for large networks. They are also ideal for internal networks designed for no external communications. These networks are commonly called stub networks. In a fully specified static route both the exit interface and the next hop IP address are specified. We will work through this below;

Configuring static routes 

Build a simple topology and configure relevant interfaces and pcs with IP addresses.



On router 0 we want to configure the route back to the network. We only need to configure routes which are not directly connected. The command is shown below, the first IP is the network address on the furthest right followed by the subnet mask, then you need to specify the exit interfaces IP address as shown below;



On router 1 the same logic applies;



When we look up the routing table on Router 0 using the show ip route command we can see which networks are local(L), which are connected(C) and which are static (S) notice here the (L) - Local host routes have a /32 prefix with an administrative distance of 0, (more on administrative distance below). Cisco automatically installs a host route when the interface is configured on the router. It adds efficiencies for packets coming into the router rather than forwarding. 


Summary Static routing

A summary route is one route that represents multiple networks. Summary routes can also be called route aggregation. Summary routes are used to;

  • Save memory 
  • Save bandwidth
  • Stability within the routing table
  • Saves CPU cycles

To calculate a summary rout we convert each of the IP addresses to binary, so here we have 4 IP addresses that we want to summarise. 
172.16.0.0 /16
172.17.0.0 /16
172.18.0.0 /16
172.19.0.0 /16

Below are the IP addresses written in IP form then the next step is to match all all the matching bits that aren't all zeros (highlighted in green)

10101100.00010000.00000000.00000000 (172.16.0.0)
10101100.00010001.00000000.00000000 (172.17.0.0)
10101100.00010010.00000000.00000000 (172.18.0.0)
10101100.00010011.00000000.00000000 (172.19.0.0)

We can now add them bits to give us our CIDR notation of /14 (14 bits) 
To get out network address use the same 14 bits and add zeros until your get to 32 bits the form the complete answer below. 

172.16.0.0/14 - Subnet mask 
255.252.0.0

Practical application of summary routes






From the above topology configure the relevant IP addresses on devices.

192.168.1.0   11000000.10101000.00000001.00000000
192.168.2.0   11000000.10101000.00000010.00000000
192.168.3.0   11000000.10101000.00000011.00000000


192.168.0.0/22  subnet mask 255.255.252.0


Router1 configuration (notice here I have used the exit interface physical value


Same process on Router0 as the interface is the same



Default routes 

Default routing is a type of routing that is used when a router cannot find a specific route to a destination network. Instead, the router forwards the packet to a default gateway or next-hop router. This type of routing is useful for conserving network resources and reducing the size of routing tables.

Configuring default routes and the gateway of last resort

Using a similar topology as the prior example, configure the relevant IP addresses for devices, matching their networks.



Once IP addresses have been assigned, starting with router0 use the below command, the 0.0.0.0 and 0.0.0.0 are default network and subnet masks and the IP address is the gateway of last resort which is the next hop address.


Similarly on Router1



Now when will look up the routing table we can see the gateway of last resort is linked to the default network route.


Gateway of last resort

A gateway of last resort is used to forward IP packets where the destination is not listed in a routing table. in simple terms if the forwarding route is not known or specified it will be forwarded to the Gateway of last Resort. It is useful if a path becomes unavailable or you want to save space in a routing table and cut down on admin time.


Dynamic routing

Dynamic routing is a type of routing that automatically updates routing tables in response to changes in the network topology. In dynamic routing, routers use routing protocols such as OSPF (Open Shortest Path First), RIP (Routing Information Protocol), and BGP (Border Gateway Protocol) to exchange routing information with other routers in the network. This type of routing is suitable for large networks that are subject to frequent changes in topology.

Link to RIP article here

Administrative distance

Floating static routes are often used with dynamic routing. For example with two exit points out of a router one exit point may be configured for dynamic routing and the other for static routing. This is where administrative distance comes in. The router chooses the highest number for its chosen path. Administrative distance goes off the number of hops and each protocol has a specific default administrative distance for each router. Some of these are shown below;

Connected 0 
Static 1
Rip 120
OSPF 110

If a router is using the dynamic protocol of RIP for exit 1 and a static route for exit 2 the administrative distance needs to be set higher than the defaults for RIP to make that the primary route. (nb When the administrative distance is set to the same number the router sends packets equally across both paths)

For example; 



No comments:

Post a Comment

Fast switching vs Process switching

Process Switching: Process switching is the traditional method of packet forwarding used in early routers. When a packet arrives at a router...