×
1 Lessons
1 Lessons
2 Lessons
2 Lessons
2 Lessons
2 Lessons
1 Lessons
2 Lessons
2 Lessons
2 Lessons
2 Lessons

Routing fundamentals

Introduces routing and explains how routers forward traffic between different networks.

1 Lessons
2 Lessons
2 Lessons
2 Lessons
2 Lessons
1 Lessons
2 Lessons

1. Lesson Introduction

Routing is one of the most important functions in computer networking.

When a computer sends data to another device on the same local network, the communication can usually take place directly through the local network. However, when the destination is located on a different network, the data needs to be forwarded through one or more routers.

Routing is the process of determining a path for network traffic to travel from a source network to a destination network.

For example, when a computer in Kampala communicates with a server located in another network, routers examine the destination IP address and determine where the packet should be forwarded.

Routing is therefore essential for:

  • Local networks communicating with other networks

  • Internet communication

  • WANs

  • Inter-VLAN communication

  • Enterprise networks

  • Cloud connectivity

  • Branch-office communication

2. Learning Objectives

By the end of this lesson, the learner should be able to:

  1. Define routing.

  2. Explain why routing is necessary.

  3. Explain the role of a router.

  4. Describe how routers forward packets.

  5. Explain routing tables.

  6. Identify the components of a routing table.

  7. Explain directly connected networks.

  8. Explain static routing.

  9. Explain dynamic routing.

  10. Explain default routes.

  11. Describe routing metrics.

  12. Explain next-hop addresses.

  13. Distinguish between routing and switching.

  14. Explain the relationship between routing and IP addressing.

  15. Perform basic routing configuration in a network simulator.

  16. Troubleshoot basic routing problems.

3. Meaning of Routing

Routing is the process of selecting and using a path through a network to deliver packets from a source to a destination.

Consider two networks:

Network A: 192.168.10.0/24

Network B: 192.168.20.0/24

If a computer on Network A needs to communicate with a computer on Network B, a router can connect the two networks.

The router examines the destination IP address and forwards the packet toward Network B.

4. What Is a Router?

A router is a networking device that connects different IP networks and forwards packets between them.

For example:

Computer Network A
↓
Router
↓
Computer Network B

A router can have multiple interfaces, with each interface connected to a different network.

A typical router may connect:

  • LAN

  • WAN

  • Internet

  • Another branch

  • Server network

  • Guest network

  • VLANs

5. Why Is Routing Necessary?

Without routing, separate IP networks would not be able to communicate with one another.

For example:

PC1: 192.168.10.10

PC2: 192.168.20.10

If PC1 wants to communicate with PC2, the traffic must cross between two different IP networks.

A router or Layer 3 device is required to forward the traffic.

Routing therefore makes communication between different networks possible.

6. Routing and the OSI Model

Routing is primarily associated with Layer 3 of the OSI model.

Layer 3 is the Network Layer.

The Network Layer is responsible for functions such as:

  • Logical addressing

  • IP addressing

  • Routing

  • Packet forwarding

Routers operate primarily at Layer 3.

7. Routing and IP Addresses

Routers use destination IP addresses to determine where packets should go.

For example:

Source:

192.168.10.25

Destination:

192.168.30.15

The router examines the destination address.

It determines which route should be used to reach the 192.168.30.0/24 network.

8. Same Network vs Different Network

Understanding whether a destination is on the same network is important.

Suppose a computer has:

IP address: 192.168.10.10

Subnet mask: 255.255.255.0

Destination:

192.168.10.20

Both addresses belong to the same /24 network.

The computer can communicate through the local network.

Now consider:

Source:

192.168.10.10

Destination:

192.168.20.20

These addresses belong to different /24 networks.

The source device normally sends the traffic to its default gateway.

9. Default Gateway

A default gateway is the router or Layer 3 device that a host uses to reach destinations outside its local network.

For example:

PC IP: 192.168.10.20

Subnet mask: 255.255.255.0

Default gateway: 192.168.10.1

If the PC needs to communicate with another network, it can send the packet to 192.168.10.1.

The router then determines where the packet should go.

10. How a Router Forwards a Packet

A simplified routing process is:

  1. A host creates a packet.

  2. The host determines the destination IP address.

  3. If the destination is on another network, the host sends the packet toward its default gateway.

  4. The router receives the packet.

  5. The router examines the destination IP address.

  6. The router searches its routing table.

  7. The router selects the best matching route.

  8. The router forwards the packet through the appropriate interface.

  9. Another router may repeat the process.

  10. The packet eventually reaches the destination network.

11. Routing Table

A routing table is a data structure maintained by a router that contains information about available routes.

A simplified routing table might contain:

Destination NetworkSubnet MaskNext HopInterface
192.168.10.0/24DirectG0/0
192.168.20.0/24DirectG0/1
192.168.30.0/24192.168.20.2G0/1
0.0.0.0/0192.168.20.1G0/1

The router uses this information to make forwarding decisions.

12. Destination Network

The destination network identifies the network that the router can reach.

For example:

192.168.30.0/24

This means the route applies to addresses within that network.

13. Next Hop

The next hop is the next router or device to which a packet should be forwarded.

For example:

Destination network: 192.168.30.0/24

Next hop: 10.0.0.2

The router sends the packet to 10.0.0.2.

That router then continues the forwarding process.

14. Routing Interface

The routing interface identifies the router interface through which traffic should leave.

For example:

Destination: 192.168.30.0/24

Outgoing interface: GigabitEthernet0/1

The router forwards traffic through that interface.

15. Directly Connected Networks

A router automatically knows about networks directly connected to its active interfaces.

For example:

Router interface G0/0:

192.168.10.1/24

Router interface G0/1:

192.168.20.1/24

The router knows that:

192.168.10.0/24 is directly connected.

192.168.20.0/24 is directly connected.

No additional route is required for these directly connected networks.

16. Static Routing

Static routing involves manually configuring routes.

The administrator tells the router where a particular network can be reached.

For example:

Destination:

192.168.30.0/24

Next hop:

192.168.20.2

The administrator creates the route manually.

Static routing is useful for:

  • Small networks

  • Simple network designs

  • Specific routes

  • Backup routes

  • Networks where predictable paths are required

17. Advantages of Static Routing

Static routing provides:

  • Simple operation in small networks

  • Predictable paths

  • Low protocol overhead

  • Greater administrator control

  • No dynamic routing protocol traffic

18. Disadvantages of Static Routing

Static routing can become difficult to manage when the network becomes large.

Disadvantages include:

  • Manual configuration

  • More administration

  • Risk of configuration errors

  • Difficult maintenance in large networks

  • Routes may not automatically change when a link fails

19. Example of Static Routing

Suppose there are two routers:

Router A:

192.168.10.0/24

Router B:

192.168.20.0/24

The routers are connected through:

10.0.0.0/30

Router A can be configured with a route to:

192.168.20.0/24

through Router B.

Router B can similarly be configured with a route to:

192.168.10.0/24

through Router A.

20. Dynamic Routing

Dynamic routing allows routers to learn routes automatically through routing protocols.

Instead of manually entering every route, routers exchange routing information.

Examples of routing protocols include:

  • RIP

  • OSPF

  • EIGRP

  • IS-IS

  • BGP

Different protocols are designed for different network environments.

21. Advantages of Dynamic Routing

Dynamic routing can:

  • Automatically learn routes

  • Adapt to network changes

  • Reduce manual configuration

  • Support large networks

  • Select alternative paths

  • Improve scalability

22. Disadvantages of Dynamic Routing

Dynamic routing can involve:

  • Greater configuration complexity

  • Additional processing

  • Routing protocol traffic

  • More advanced troubleshooting

  • Security considerations

23. Routing Protocols

A routing protocol is a set of rules that routers use to exchange information about available networks and paths.

Examples include:

RIP – Routing Information Protocol

OSPF – Open Shortest Path First

EIGRP – Enhanced Interior Gateway Routing Protocol

BGP – Border Gateway Protocol

24. RIP

RIP is an older distance-vector routing protocol.

It uses hop count as its primary metric.

A router can use the number of routers that a packet must pass through to compare routes.

RIP is simple but has significant limitations compared with modern routing protocols.

It is mainly useful for understanding basic routing concepts.

25. OSPF

OSPF stands for Open Shortest Path First.

It is a widely used link-state routing protocol.

OSPF allows routers to build a view of the network topology and calculate suitable paths.

It is commonly used in enterprise networks.

26. EIGRP

EIGRP stands for Enhanced Interior Gateway Routing Protocol.

It is a dynamic routing protocol developed by Cisco and has been widely used in Cisco-based environments.

It can use multiple factors when selecting routes.

27. BGP

BGP stands for Border Gateway Protocol.

BGP is the major routing protocol used to exchange routing information between autonomous systems on the Internet.

It is important for understanding how large Internet networks exchange routing information.

BGP is considerably more advanced than the routing concepts covered at beginner level.

28. Routing Metrics

A routing metric is a value used to help select between possible routes.

Depending on the routing protocol, metrics may consider factors such as:

  • Hop count

  • Bandwidth

  • Delay

  • Cost

  • Reliability

  • Path characteristics

The specific metric depends on the routing protocol.

29. Best Route

If a router knows multiple routes to the same destination, it must determine which route is preferred.

Routing protocols and routing rules help determine the best available route.

For example:

Route A → 3 hops

Route B → 5 hops

A protocol using hop count might prefer Route A.

However, another routing protocol may use different criteria.

30. Longest Prefix Match

Routers can have multiple routes that match a destination.

The router generally selects the route with the longest matching network prefix.

For example:

10.0.0.0/8

10.10.0.0/16

10.10.10.0/24

For a destination such as:

10.10.10.50

The /24 route is the most specific matching route.

This principle is called longest prefix match.

31. Default Route

A default route is used when a router does not have a more specific route for a destination.

The IPv4 default route is:

0.0.0.0/0

A common example is a router sending unknown Internet destinations toward an ISP.

Conceptually:

Internal Network → Router → ISP → Internet

The router may use a default route pointing toward the ISP.

32. Static Default Route

An administrator can manually configure a default route.

Conceptually:

Destination: 0.0.0.0/0

Next hop: ISP router

This tells the router where to send traffic for destinations not otherwise listed in the routing table.

33. Routing and VLANs

Routing is required when devices in different VLANs need to communicate.

For example:

VLAN 10 – Administration

VLAN 20 – Students

VLAN 30 – Staff

If Administration needs to access a server in the Staff VLAN, inter-VLAN routing is required.

This can be performed using:

  • Router-on-a-stick

  • Layer 3 switch

34. Routing and WANs

WANs depend heavily on routing.

Consider:

Kampala → Mbarara → Masaka

Routers determine how traffic moves between these networks.

If one path fails, dynamic routing protocols can potentially select another available path when the network has alternative links.

35. Routing and the Internet

The Internet consists of many interconnected networks.

Routers operate throughout this infrastructure.

When a user accesses a website, packets may pass through multiple routers before reaching the destination.

Routing protocols allow networks to exchange information about how destinations can be reached.

At the global Internet level, BGP plays a major role in exchanging routing information between autonomous systems.

36. Routing vs Switching

Routing and switching are related but different.

FeatureSwitchingRouting
Main LayerLayer 2Layer 3
Main AddressMAC addressIP address
Main DeviceSwitchRouter
Main PurposeConnect devices within networks/VLANsConnect different networks
ExamplePC to printer in same VLANOffice LAN to Internet

Modern Layer 3 switches can perform both switching and routing.

37. Routing and MAC Addresses

Although routers make forwarding decisions using IP information, Ethernet networks also require MAC addresses for local frame delivery.

A router removes the incoming Layer 2 frame information and creates a new Layer 2 frame for the next network segment.

Therefore:

IP addresses help determine the destination network.

MAC addresses are used for local Ethernet delivery.

38. Routing Example

Suppose:

PC A:

IP: 192.168.10.10

Gateway: 192.168.10.1

Destination:

192.168.30.20

The PC determines that 192.168.30.20 is outside its local subnet.

It sends the traffic to its default gateway:

192.168.10.1

The router examines its routing table.

If it has a route to:

192.168.30.0/24

it forwards the packet toward that network.

39. Routing Table Example

A simplified routing table could look like:

RouteTypeNext Hop
192.168.10.0/24ConnectedDirect
192.168.20.0/24ConnectedDirect
192.168.30.0/24Static192.168.20.2
0.0.0.0/0Default192.168.20.1

The router uses this information to forward packets.

40. Routing Loops

A routing loop occurs when packets repeatedly travel between routers without reaching their destination.

For example:

Router A → Router B → Router C → Router A

Routing protocols contain mechanisms designed to prevent or reduce routing loops.

Incorrect static routes can also create loops.

41. Routing Failure

Routing can fail because of:

  • Incorrect IP addresses

  • Incorrect subnet masks

  • Missing routes

  • Incorrect next-hop addresses

  • Failed interfaces

  • Incorrect VLAN configuration

  • Routing protocol problems

  • Firewall rules

  • Physical link failures

  • Incorrect default gateway

42. Basic Routing Troubleshooting

A technician can follow these steps:

  1. Check physical connectivity.

  2. Check interface status.

  3. Verify IP addresses.

  4. Verify subnet masks.

  5. Verify default gateways.

  6. Test the local gateway.

  7. Check the routing table.

  8. Test the next-hop router.

  9. Test the destination network.

  10. Check firewall rules.

  11. Check routing protocol status.

  12. Check for routing loops.

43. Useful Troubleshooting Commands

On many network devices and operating systems, commands such as the following can help:

ping
traceroute
tracert
ipconfig
ip addr
route

Cisco IOS devices commonly provide commands such as:

show ip route
show ip interface brief
show running-config

The exact commands depend on the operating system and network equipment.

44. Ping

Ping is commonly used to test IP connectivity.

For example:

ping 192.168.20.1

A successful response indicates that communication is possible between the source and destination under the tested conditions.

Ping does not prove that every network service is working.

45. Traceroute

Traceroute can help identify the path packets take toward a destination.

Windows commonly uses:

tracert

Linux and many network devices commonly use:

traceroute

It can help identify where communication is failing or where latency is introduced.

46. Practical Activity 1: Identify Routes

Using a network simulator, create:

PC1 → Switch → Router → Switch → PC2

Assign different IP networks to each side.

Identify:

  • Source IP

  • Destination IP

  • Default gateway

  • Router interfaces

  • Destination network

47. Practical Activity 2: Configure Static Routing

Create two routers.

Router 1:

LAN: 192.168.10.0/24

Router 2:

LAN: 192.168.20.0/24

Connect the routers.

Configure static routes so that computers on both LANs can communicate.

Test the configuration using ping.

48. Practical Activity 3: Configure a Default Route

Create a small network containing:

  • PC

  • Switch

  • Router

  • ISP router

Configure a default route toward the ISP router.

Test connectivity to the simulated external network.

49. Practical Activity 4: Routing Between VLANs

Create:

VLAN 10 – Administration

VLAN 20 – Students

Connect both VLANs to a Layer 3 device.

Configure routing between them.

Test communication.

50. Practical Activity 5: Routing Troubleshooting

Create a network with an intentional routing problem.

Examples:

  • Incorrect default gateway

  • Missing static route

  • Wrong subnet mask

  • Incorrect next-hop address

Ask learners to identify and correct the problem.

51. Assessment Questions

  1. What is routing?

  2. What is the purpose of a router?

  3. At which OSI layer does routing primarily operate?

  4. What is a routing table?

  5. What is a next-hop address?

  6. What is a default gateway?

  7. What is a directly connected network?

  8. What is static routing?

  9. What is dynamic routing?

  10. Name four routing protocols.

  11. What is a routing metric?

  12. What is a default route?

  13. What is inter-VLAN routing?

  14. Explain the difference between switching and routing.

  15. What is longest prefix match?

  16. What is a routing loop?

  17. Give five possible causes of routing failure.

  18. What is the purpose of the ping command?

  19. What is the purpose of traceroute?

  20. Explain how a router forwards a packet from one network to another.

52. Practical Assignment

Design a network containing:

  • Two LANs

  • Two routers

  • Two switches

  • Four computers

Use different IP networks for the two LANs.

Your assignment should include:

  1. Network diagram.

  2. IP addressing table.

  3. Default gateways.

  4. Router interfaces.

  5. Static routes.

  6. Routing table.

  7. Connectivity tests.

  8. Explanation of how packets travel between the two LANs.

53. Key Terms

Routing – Process of selecting and using paths for network traffic.

Router – Device that forwards packets between networks.

Routing Table – Information used by a router to determine where packets should be forwarded.

Route – Information describing how to reach a network or destination.

Next Hop – The next router or device to which traffic is forwarded.

Default Gateway – Device used by a host to reach networks outside its local network.

Static Route – Manually configured route.

Dynamic Route – Route learned through a routing protocol.

Routing Protocol – Rules used by routers to exchange routing information.

Metric – Value used to compare routes.

Default Route – Route used when no more specific route exists.

Inter-VLAN Routing – Routing between different VLANs.

Longest Prefix Match – Selection of the most specific matching route.

54. Lesson Summary

Routing is the process of determining how packets move from one network to another.

Routers use IP addresses and routing tables to make forwarding decisions.

Important routing concepts include:

  • Default gateways

  • Routing tables

  • Directly connected networks

  • Static routes

  • Dynamic routes

  • Default routes

  • Next-hop addresses

  • Routing metrics

  • Routing protocols

  • Inter-VLAN routing

Routing is essential for LAN-to-LAN communication, WANs, enterprise networks, cloud connectivity and the Internet.

Understanding routing provides the foundation for more advanced topics such as OSPF, RIP, BGP, route summarisation, routing protocols and enterprise routing design.

55. Further Learning Through Senior ICT Academy

More learning will be delivered through the Senior ICT Academy Campus by either a physical instructor or an online instructor.

Learners can continue with practical routing configuration, static routing, dynamic routing, OSPF, inter-VLAN routing, routing troubleshooting and enterprise network design.

Campus: https://campus.seniorictacademy.com/login

Senior ICT Academy: https://seniorictacademy.com