1 of 19

Intro to Static Routing

NET-150

2 of 19

Why Routing?

  • Routers are devices that transfer packets between different networks
    • IP network uses the Net ID portion of the IP address to identify the specific network

  • Having no routers would be like having no Post Offices.
    • There would only be only 1 zip code for the entire network
    • All systems would be in the same Broadcast Domain
    • So, broadcast protocols like ARP would go to all systems

3 of 19

  • text

4 of 19

Why Routing…

  • Routers inspect the Layer 3 header of packets
  • Makes decisions based on the IP address information in the packet

5 of 19

Remember this example?

  • Could Pi 2 and 3 ping Pi 5?
  • No - and why not?

6 of 19

Example with Simpler Addressing

Router 1

Router 2

Net 1

Net 2

Net 3

Net 4

Network 5

We connected the two routers

by adding their interfaces to another network

We can call that network Net 5

7 of 19

Example with Simpler Addressing

Router 1

Router 2

Net 1

Net 2

Net 3

Net 4

Router 1 now says:

“I have an interface/addresses in:

  • Net 1
  • Net 2 and
  • Net 5

I know what to do with packets addressed to Net 1 and Net 2 and Net 5!

Net 5

Router 2 now says:

“I have an interface/addresses in:

  • Net 3
  • Net 4 and
  • Net 5

I know what to do with packets addressed to Net 3 and Net 4 and Net 5!

8 of 19

Example with Simpler Addressing

Router 1

Router 2

Net 1

Net 2

Net 3

Net 4

If a computer on Net 1 tries to ping a computer on Net 4

Router 1 says:

I know what to do with packets addressed to Net 1 and Net 2 and Net 5,

But – I don’t know anything about Net 4!?!

Net 5

Similarly, if a computer on Net 3 tries to ping a computer on Net 2

Router 2 says:

I know what to do with packets addressed to Net 3 and Net 4 and Net 5,

But – I don’t know anything about Net 2!?!

9 of 19

Switching and Routing Tables

  • Switching is Layer 2
    • Look at Layer 2 headers and monitor the MAC address
    • Switches keep track of MAC addresses and the ports they are on
    • Will forward packets to the appropriate port based on MAC

  • Routing is Layer 3
    • Builds table of Network IDs and the IP of the next router in that direction
    • Inspects packets for NetID of IP address and forwards to next router on the way
    • Does not need to know the whole path- just next router!

10 of 19

Routing Tables

  • At a minimum, router tables need to have:
    • Network Address: The address of a network
    • Subnet Mask: The subnet mask for that network – so it knows how many bits are in the Net ID
    • Next Hop: IP address of a neighboring router it can send the packet it to to reach the network
    • Interface: Which of the routers own physical interfaces it can send the packet out of to reach the Next Hop

  • May also contain other data like distance (how many hops to the network) and preference if there are more than one entries for same route

11 of 19

Build Routing Table

Router

Network

Mask

Next Hop

Interface

Hops

Central

153.104.1.0

/24

Direct

G0

-

153.104.28.0

/22

Direct

G1

-

153.104.8.0

/21

WLAN RTR-Backbone IP

G0

1

153.104.58.0

/23

West RTR-

Backbone IP

G0

1

153.104.60.0

/23

East RTR- Backbone IP

G0

1

West

12 of 19

Switching and Routing Tables

Network

Mask

Next Hop

Interface

153.104.0.0

255.255.0.0

192.168.10.1

2

129.170.0.0

255.255.0.0

192.168.10.1

2

192.168.10.0

255.255.255.0

Direct

Connected

192.168.2.9

255.255.255.0

Direct

Connected

216.87.23.0

255.255.255.0

192.168.2.2

3

Routing Table

13 of 19

How are Routing Tables Built

  • Static:
    • Network admins can type them into the router configuration
    • e.g.: ip route 192.168.4.0 255.255.255.0 192.168.3.2 FA0/1
    • Does not scale well – Imagine having to do that for 100’s of networks on dozens of routers!
    • Focus this week!

  • Dynamic:
    • Use protocols so that the routers can send routing table information to their neighbors
    • We will cover these in future labs

14 of 19

Back to Example…

Router 1

Router 2

Net 1

Net 2

Net 3

Net 4

Router 1 says:

I know what to do with packets addressed to Net 1 and Net 2 and Net 5,

But – I don’t know anything about Nets 3 and 4!?!

STATIC Routes: Configure Router 1 with a rule that says packets for Nets 3 and 4 should go to Router 2 via Net 5!

Net 5

Router 2 says:

I know what to do with packets addressed to Net 3 and Net 4 and Net 5,

But - I don’t know anything about Nets 1 and 2!?!

STATIC Routes: Configure Router 1 with a rule that says packets for Nets 3 and 4 should go to Router 2 via Net 5!

15 of 19

Static Route Example

16 of 19

Another Example…

17 of 19

Static Route Configuration

Static Routes:

  • Configured by the admin on the router
  • Use the NETWORK Address
    • e.g. 192.168.3.0/24

  • Specifies the next hop (IP of neighboring router) needed to reach that network

  • Next-hop IP has to be on a network shared between the 2 routers
    • 192.168.0.0/24 in this example

18 of 19

Configure Static Routes – Western Router

Router

Network

Mask

Next Hop

Hops

Western

129.170.58.0

/24

Direct-No Route Needed

-

153.104.1.0

/24

Direct-No Route Needed

-

129.170.60.0

/24

129.170.149.0

/24

129.170.150.0

/24

19 of 19

Configure Static Routes – Western Router

Router

Network

Mask

Next Hop

Hops

Sample Command

Western

129.170.58.0

/24

Direct-No Route Needed

-

-

153.104.1.0

/24

Direct-No Route Needed

-

-

129.170.60.0

/23

153.104.1.2

1

ip route 129.170.60.0 255.255.254.0 153.104.1.2

129.170.149.0

/24

153.104.1.2

1

ip route 129.170.149.0 255.255.254.0 153.104.1.2

129.170.150.0

/24

153.104.1.2

2

ip route 129.170.150.0 255.255.254.0 153.104.1.2