Professional Documents
Culture Documents
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Course Name
Routing is the process of selecting paths (or routes) in a network along which
data will be forwarded
Routing is a function of routers
As can be seen in the diagram, routers are in the core of the network to
interconnect different networks together
Routers uses store-and-forward, packet switching technique to forward packets
from source to the correct destination
In the given example
RTA is sending packets to a destination in network N
By searching the routing table, RTA finds the outgoing interface to N is E0/0, and
the next hop router is RTB
Then RTA sends the packet through E0/0 to RTB
By using the same operations, RTB forwards the packet to RTC, which in turn
sends to the destination network, N
The routing process shows that packet forwarding is dependent on the information in
the routing table
To function effectively, a router should
Check the destination of a packet — does the router have information about the
destination of the packet?
Determine the source of the information — where is the information about the
route to the destination from? Is it defined by the administrator statically? Or is it
obtained from other routers?
Find possible routes — what are the possible routes to the destinations?
Select the best route — which is the best route to the destination? Should the
router use the load balancing mechanism to send the packet by multiple routers?
Verification and maintenance of routing information — is a route valid? Is it the
latest? Routers have to verify and maintain routing information to ensure that
the information is correct.
In the example, RTA is connected to network 10.3.1.0 on the left and RTC is connected
with network 10.4.1.0 on the right
A packet (datagram) is to be sent from network 10.3.1.0 to network 10.4.1.0
The routing process is as follows:
1. The packet is sent to E1 port of RTA that is directly connected with network
10.3.1.0. After receiving the packet, RTA looks up the routing table and finds
that the next hop to the destination is 10.1.2.2, and the egress is E0. The
packet is then sent out from E0 to 10.1.2.2.
2. When the packet reaches E0 port of network 10.1.2.2, RTB looks up its
routing table and finds that the next hop to the destination is 10.2.1.2, and
the egress is E1. The packet is then sent out from E1 to 10.2.1.2.
3. When the packet reaches E0 port of network 10.2.1.2, RTC looks up its
routing table and finds that the destination of the packet is in its own
segment and the next hop for the packet is 10.4.1.1, and the egress is E1. The
packet is then sent out from E1 to the destination.
The example zooms in to illustrate the forwarding process a packet destined for network
10.4.1.101
Consider router X receives the packet
X looks up its routing table, and finds that the closest match to the destination is
10.4.1.0 — the lookup is based on a concept called longest prefix match (see
next slide)
The corresponding next hop and outgoing interface are 10.1.2.2 and E0,
respectively
The packet is forwarded to 10.1.2.2 through E0
The longest prefix matching algorithm is used to find the corresponding routing entry for
a given destination IP address
The process:
1. For the given destination IP address, router performs logical AND operation
with network mask — the result is a network address
2. The resultant network address is compared with the addresses in the routing
table
3. The comparison is done at bit level — the entry with IP address that matches
the longest prefix of the destination IP is selected
In the example, at RTA, the first route is statically configured — as indicated by the Proto
field: Static
From the figure, destination (2.2.2.2) is attached to RTB
RTA is connected to RTB via network segment 10.1.1.0/30, RTB interface at this
network segment is 10.1.2.2
Hence, the NextHop for the route is set to 10.1.2.2
The syntax for configuring static routes using Huawei’s VRP (Versatile Routing Platform)
ip route-static [destination-network] [subnet-mask] [next hop/exit interface]
In the example, RTB has been configured for static route to 10.1.1.0/24 network using
the next hop address of 1.1.1.1
Static route can be verified using the command display ip routing-table in Huawei’s VRP
The routing table shows that the route to 10.1.1.0/24 has been successfully configured
as static route via Serial0
At RTB, the last group of routes are discovered by dynamic routing protocols
Route to destination 172.16.1.1/32 is discovered by OSPF (Open Shortest Path
First)
Route to destination 192.168.1.0/24 is discovered by RIP (Routing Information
Protocol)
In stub network, default routes are typically used to point to the default gateway (router)
In the example, RTA is the default gateway for the stub network
Hence, hosts in the network configure RTA as the default gateway
All packets that are destined for other network segments will be forwarded to
RTA
A default route is configured by setting the destination address and mask to be 0.0.0.0
0.0.0.0 when using the command ip route-static
One of the topologies where default routes are used is in a stub network where there is
only one default path for network packets to access the external or greater network
The default route has a destination of 0.0.0.0 and mask of 0 in the routing table
In the example shown above, the default route has a next hop address of 1.1.1.2
Black hole route is a route entry that points to a virtual interface (usually referred to as
NULL0) which is always UP
NULL interfaces are created by network administrator
Packets matching a black hole route will be discarded. Black hole routing is usually used
for security and loop prevention
In the example, packets destined for 1.1.1.1/32 will be sent to NULL0 interface — they
will be discarded
Routes to the same destinations may come from different sources — the next hop of
those routes may be different
In this case, routers need to decide which route will be used. This is done based on route
preference
In the example, there are two routes to the network segment 10.0.0.0
The first route (R0) is discovered by RIP and the second route (R1) is discovered
by OSPF
By default, OSPF has a higher route preference level than that of RIP
So router will choose the route discovered by OSPF and add it to the global
routing table for packet forwarding
Route metric gives the cost of route to its destination. It is used by routing protocol to
determine the best path to the destination
Typically used route metric:
Hop count
Link bandwidth
Link delay
Link load
Link reliability
Link MTU
Cost
For example, RIP uses hop count as route metric
Route metrics make sense only for routes discovered by the same routing
protocol. Hence it is meaningless to compare route metrics calculated by different
protocols and there is no formula to convert between route metrics from different
routing protocols
The route metric of the static route is 0
Path cost: sum of route metric on each of the links along the path
In the example, Router A learns route to Router D from Router B and Router E using the
same protocol
From the figure, the path cost from A to D via B is 9; the path cost from A to D via E is 12
Obviously the route via B is better than the route via E
So A will add the first route to its routing table, and set Router B as the next hop for the
route
Routing loop is a network problem in which packets transferred between two or more
routers circularly
As in the figure, a routing loop is formed between RTA, RTB and RTC for packets
destined for Network N
Due to the loop, packet will be circulated from RTA to RTC, RTC to RTB, RTB back
to RTA, and so on
The TTL value in the packet is used to prevent the packet from circulating in the
network endlessly
In particular, when RTA receives the packet, it decrements the packet’s TTL value
by 1 and forwards it to RTC; when RTC receives the packet, it decrements the
packet’s TTL value by 1 and forwards it to RTB;
The above process continues until the packet is discarded when its TTL reaches 0
At RTB, the last group of routes are discovered by dynamic routing protocols
Route to destination 172.16.1.1/32 is discovered by OSPF (Open Shortest Path
First)
Route to destination 192.168.1.0/24 is discovered by RIP (Routing Information
Protocol)
Best effort service model basically means no service is provided: there is no guarantee
on delay, bandwidth and packet lost rate.
For packets trapped in a routing loop, they will eventually discarded by the routers when
their TTL reach zero.
A packet of 1000 bytes:
3 fragments will be created.
Actual payload: 1000 – 20 (IP header) = 980
First fragment can accommodate: 480 bytes of data
2nd fragment can accommodate: 480 bytes of data
3rd fragment will store the remaining: 980 – 480 – 480 = 20 bytes of data.
Unicast routing means one-to-one; multicast routing is one-to-many or point to
multipoint.
Traceroute operation: refer to Page 96.