Professional Documents
Culture Documents
This course materials contains charts and texts provided by Keio University, Japan
Overview
Last week
Internet protocol
IP address and IP packet format
ICMP
Today: continue the Internet Layer
What is routing?
Static and dynamic routing
Routing algorithms & protocols
What is routing?
Routing principles
Forwarding mechanism
Longest matching rule
Basic of routing (1)
When a host sends an IP packet to a certain
address.
If the destination address is on the same link,
direct forward
If the destination address is not on the same link,
forwarding through routers
Router Router
Basic of routing (2)
Destination?
( Route searc
h)
Destination?
( Route search )
What is routing?
Mechanism for host and router to forward the
packet to destination
Routing elements
Routing table
Routing information
Routing algorithms and protocols
What are routers?
Equipment that transfers packets among
networks
Computer with special hardware
Connect multiple sub-networks
Forward packet based on routing tables
Having many interfaces
Equipment that is suitable with the scale of
network and traffic etc...
Some routers
YAMAHA
RTX-1500 Cisco 2600
BUFFALO PLANEX
BHR-4RV GW-AP54SAG
Edge Router
Cisco CRS-1
Core router
Hitachi
Juniper M10 http://www.cisco.com.vn
GR2000-1B
Foundry Networks
NetIron 800 http://www.juniper.net/
http://www.buffalotech.com
Cisco 3700 Midrange router
Routing table
List of routes stored in memory of a router
or host
Elements of routing table
Destination network address with netmask
Next hop router
Routing table and forwarding
mechanism (1)
Network Next-hop
10.0.0.0/24 A
172.16.0.0/24 C
10.0.0.0/24 172.16.0.0/24
10.0.0.0/24 172.16.0.0/24
200.23.2.0/24
200.23.0.0/22
200.23.3.0/24
200.23.2.0/23
200.23.4.0/24
Routing aggregation (2)
Example of Vietel ISP case
Large IP address space:
203.113.128.0-203.113.191.255
To reach a sub-network in Vietel: routing
aggregation, no need to specify the sub-network
address
Default route is some kind of route aggregation
0.0.0.0/0
Example of routing table
C:\Documents and Settings\hongson>netstat -rn
Route Table
===========================================================================
Interface List
0x1 ........................... ………MS TCP Loopback interface
0x2 ...08 00 1f b2 a1 a3 ...... Realtek RTL8139 Family PCI Fast Ethernet NIC -
===========================================================================
Active Routes:
Network Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.34 20
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.1.0 255.255.255.0 192.168.1.34 192.168.1.34 20
192.168.1.34 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.1.255 255.255.255.255 192.168.1.34 192.168.1.34 20
224.0.0.0 240.0.0.0 192.168.1.34 192.168.1.34 20
255.255.255.255 255.255.255.255 192.168.1.34 192.168.1.34 1
Static routing
Dynamic routing
Pros & Cons
Updating routing table
Network structure may change
New network is added.
Router failure due to power corruption …
It’s necessary to update routing table
of all nodes (theory)
in pratice: some nodes
Network Next- Network Next- Network Next-
hop hop hop
192.168.0.0/24 B 10.0.0.0/24 A 10.0.0.0/24 B
172.16.1.0/24 B 172.16.1.0/24 C
Dynamic routing
Automatically update routing table
By mean of routing protocols
Static routing
Internet
When there is a failure:
Problem happens even
there are alternative
routes.
Network administrator 10.0.0.3 10.0.0.2
needs to change setting
Next-hop 10.0.0.3
Unreachable route
Dynamic Routing
When there is a failure: Internet
Next-hop 10.0.0.1
Static routing
Pros
Stable
Secure
It won’t be effected by other factor
Cons
Very stubborn
Back up link cannot be used
Difficult to manage
Dynamic routing
Pros
Easy to manage
Backup link can be utilized
Cons
Insecure
Difficult to understand the routing protocols
Difficult to manage
Routing algorithms and
protocols
Dijkstra vs. Bellman-Ford algorithm
Link-state vs. distance vector routing
Network as a graph
Graph with nodes (routers) and edges (links)
Link “cost” c(x,y)
Bandwidth, delay, cost, congestion level…
Determine least cost path from every node to every
other node
5
3
v w
2 5
u 2 1 z
3
1
2
x y
1
Shortest path tree - SPT
5
3
v w 5 v w
2
u 2 1 z u z
3
1 2
x 1
y x y
Define
dx(y) := cost of least-cost path from x to y
Then
dx(y) = minv {c(x,v) + dv(y) }
from
from
y ∞∞ ∞ y 2 0 1
z ∞∞ ∞ z 7 1 0 = min{2+1 , 7+0} = 3
node y table
cost to
x y z y
2 1
x ∞ ∞ ∞
x z
y 2 0 1 7
from
z ∞∞ ∞
node z table
cost to
x y z
x ∞∞ ∞
from
y ∞∞ ∞
z 7 1 0
time
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} Dx(z) = min{c(x,y) +
= min{2+0 , 7+1} = 2 Dy(z), c(x,z) + Dz(z)}
node x table = min{2+1 , 7+0} = 3
cost to cost to cost to
x y z x y z x y z
x 0 2 7 x 0 2 3 x 0 2 3
from
from
y ∞∞ ∞ y 2 0 1
from
y 2 0 1
z ∞∞ ∞ z 7 1 0 z 3 1 0
node y table
cost to cost to cost to
x y z x y z x y z y
2 1
x ∞ ∞ ∞ x 0 2 7 x 0 2 3 x z
from
y 2 0 1 y 2 0 1 7
from
from
y 2 0 1
z ∞∞ ∞ z 7 1 0 z 3 1 0
node z table
cost to cost to cost to
x y z x y z x y z
x ∞∞ ∞ x 0 2 7 x 0 2 3
from
from
y 2 0 1 y 2 0 1
from
y ∞∞ ∞
z 7 1 0 z 3 1 0 z 3 1 0
time
Comparison of LS and DV algorithms
Message complexity Robustness: what happens if
LS: with n nodes, E links, router malfunctions?
O(nE) msgs sent LS:
DV: exchange between node can advertise incorrect
neighbors only link cost
convergence time varies each node computes only its
own table
Speed of Convergence DV:
LS: O(n2) algorithm requires DV node can advertise
O(nE) msgs incorrect path cost
DV: convergence time varies each node’s table used by
others
error propagate thru
network
Summary
Routing principles
Static vs. dynamic
Link state vs. distance vector
Next week: Routing in the
Internet
Hierarchical routing
RIP
OSPF
BGP