UCCN1004 - Lect5 - Network Routing

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

UCCN 1004

Data Communications & Networks


Network Routing
What’s The Route?
• A route is the predetermined forwarding path used to
forward IP packets.

Destination
network N

E0/1
S0/0 RTC
E0/0
RTB

RTA
Other networks
Routing Process in Router
• A router must perform the following steps while
making routing decision:
– The router receive data (with IP address, both source IP
and destination IP) from an interface.
– The router then checks destination IP of the data to see if
the destination network address exists in its routing table.
• If Yes: From the routing table, the router determines which
interface to use to forward the packet.
• If no, the router will discard the packet and send an ICMP
destination network unreachable message to the source of the
packet.
– The packet continues this process until it reaches its
destination.
IP Routing Process

E1 E0 E0 E1 E0 E1
10.3.1.0 10.1.2.0/24 10.2.1.0/24 10.4.1.0
.1 .2 .1 .2
RTA RTB RTC

destination Next hop interface destination Next hop interface destination Next hop interface

10.1.2.0 10.1.2.1 E0 10.1.2.0 10.1.2.2 E0 10.1.2.0 10.2.2.2 E0

10.2.1.0 10.1.2.2 E0 10.2.1.0 10.1.2.1 E0 10.2.1.1 10.2.1.2 E0

10.3.1.0 10.3.1.1 E1 10.3.1.0 10.1.2.1 E0 10.3.1.0 10.2.1.1 E0

10.4.1.0 10.1.2.2 E0 10.4.1.0 10.2.1.2 E1 10.4.1.0 10.4.1.1 E1


Cisco Routing Table Example

Gateway IP (or Next Hop)


Unique destination network
Routing Table Entry Explained - 1

• R
– A code indicating how the route entry was learned on this router. In this case,
the R stands for RIP (a form of dynamic routing).
• 175.21.0.0/16
– The network address and prefix length (number of bits set to 1 in the subnet
mask) of the destination network.
• [120
– The administrative distance of the route.
• /1]
– The metric of the route specific to the routing protocol used to determine the
route.
– RIP uses hops as its metric. In this example, there is one router between this
router and the destination.
– Different routing protocols have different set of metrics
Routing Table Entry Explained - 2

• via 10.10.10.1
– The next-hop address (gateway) for the route.
– This is the IP address that the packet will exit from the LAN in order
for the packet to reach its destination.
• 00:00:18
– The length of time since the route has been updated in the routing
table. In this example, the route was updated 18 seconds ago.
• Serial0
– The interface the route was learned through.
– This is also the interface the packet will be switched to in order for the
packet to be forwarded toward its destination.
An example of Cisco Routing Table
• Destination IP address of data will look at this
routing table as a “road sign for direction”.

Outbound
Destination network Exit this gateway if data wants interface
to go the destination network
Gateway IP (next hop address)
• Gateway IP is a interface of “another” router.
Example:

In order for Router0 to


direct the data from 190.1.1.0/24 to 193.200.30.0/24,
the gateway IP is 200.1.1.4
Quick Quiz
• Data from 193.200.30.0 reaches Router3,
what should be the gateway IP from Router3
if the data wants to travel to 195.10.10.0?
IP Routing Rule #1
• If there are 2 or more routers in a network, you
need to configure routes in the routers
IP Routing Rule #2

• 2 types of routing

– Static Routing
– Dynamic Routing
Static and Dynamic Route

Static route Dynamic route

n The route that router gets


n The route configured
from other routers via
manually by network
routing protocol
administrator
n When network topological
n When network topological is changed, routers will
is changed, administrator update route information
need to update static route automatically
How to set static route?

Destination
network
gateway

Router0#conf t
Router0(config)#ip route 192.168.2.0 255.255.255.0 10.1.1.2
Router0(config)#

Syntax of static route


Router(config)#ip route destination_network subnet_mask gateway_IP
How to set Dynamic Route? (RIPv1)
• Setting dynamic routes with RIP (routing information
protocol). Router1(config)#router rip
Router1(config-router)#network 192.168.2.0
Router1(config-router)#network 10.1.1.0
Router1(config-router)#exit
Router1(config)#

Router0(config)#router rip
Router0(config-router)#network 192.168.1.0
Router0(config-router)#network 10.1.1.0
Router0(config-router)#exit
Router0(config)#
Setting Dynamic Routes - 3
• Routing tables of two routes with dynamic routes.
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, FastEthernet0/0
C 192.168.1.0/24 is directly connected, FastEthernet0/1
R 192.168.2.0/24 [120/1] via 10.1.1.2, 00:00:25, FastEthernet0/0

10.0.0.0/24 is subnetted, 1 subnets


C 10.1.1.0 is directly connected, FastEthernet0/0
R 192.168.1.0/24 [120/1] via 10.1.1.1, 00:00:04, FastEthernet0/0
C 192.168.2.0/24 is directly connected, FastEthernet0/1
IP Routing Rule #3: Default Route
• Default route is the gateway of last resort. If destination IP
can’t find a matching destination network in the routing
table, the data will go the way of default route

• Default route is a special static route using 0.0.0.0 as the


destination network address and 0.0.0.0 as the next hop IP

• Command in Cisco router:


Router(config)#ip route 0.0.0.0 0.0.0.0 gateway_IP
Default route in Dynamic Routing - 2
• Adding in the default route will ensure all other destination
IP to Internet to go to the gateway 200.1.1.3 (in the case of
Router4)

Router4#show ip route
……….
Gateway of last resort is 200.1.1.3 to network 0.0.0.0

R 190.1.0.0/16 [120/1] via 200.1.1.1, 00:00:15, FastEthernet0/0


R 193.200.30.0/24 [120/1] via 200.1.1.4, 00:00:00, FastEthernet0/0
R 195.10.10.0/24 [120/1] via 200.1.1.2, 00:00:13, FastEthernet0/0
C 200.1.1.0/24 is directly connected, FastEthernet0/0
R 201.2.2.0/24 [120/2] via 200.1.1.3, 00:00:23, FastEthernet0/0
R 201.3.3.0/24 [120/2] via 200.1.1.3, 00:00:23, FastEthernet0/0
R 202.188.5.0/24 [120/1] via 200.1.1.3, 00:00:23, FastEthernet0/0
C 209.67.8.0/24 is directly connected, FastEthernet0/1
S* 0.0.0.0/0 [1/0] via 200.1.1.3
Quick Quiz: Stub Network

• A stub network is a network (or part of an internetwork), with no


knowledge of other networks, that will typically send much or all
of its non-local traffic out via a single path.

• Question: What should be our configuration for the interface


Serial0/1/0 which hold a public IP and have a point-to-point
connection with a TMnet router (the only way out to the Internet).
Answer

Router(config)#int se0/1/0
Router(config-if)#ip addr 58.27.19.137 255.255.255.252
Router(config-if)#exit
Router(config)#ip route 0.0.0.0 0.0.0.0 58.27.19.138

• Stub network edge router is best configured with a default


route to the “outside world” since it only has 1 way in/out to
the outside world.
Ring Network
• Ring network can have
routing set by setting
default routes either in:
– Counter-clockwise
– Clock wise

Counter-clockwise routes
Router0(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2

Router1(config)#ip route 0.0.0.0 0.0.0.0 2.2.2.2

Router2(config)#ip route 0.0.0.0 0.0.0.0 3.3.3.2

Router3(config)#ip route 0.0.0.0 0.0.0.0 4.4.4.2

Router4(config)#ip route 0.0.0.0 0.0.0.0 5.5.5.2

Router5(config)#ip route 0.0.0.0 0.0.0.0 6.6.6.2

You might also like