UCCN1004 - Lect5 - Network Routing
UCCN1004 - Lect5 - Network Routing
UCCN1004 - Lect5 - Network Routing
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
• 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:
• 2 types of routing
– Static Routing
– Dynamic Routing
Static and Dynamic 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)#
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
Router4#show ip route
……….
Gateway of last resort is 200.1.1.3 to network 0.0.0.0
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
Counter-clockwise routes
Router0(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2