Computer Networks (CS3623)

thoughtlessskytopΔίκτυα και Επικοινωνίες

29 Οκτ 2013 (πριν από 3 χρόνια και 7 μήνες)

73 εμφανίσεις

Computer Networks

(CS3623)

#
11

|

Routing


Taking a packet


Looking at its destination address


Consulting forwarding table


Sending the packet in the right direction



Q: How do routers acquire the information in
their forwarding table?



Routing


Datagram Forwarding

The tables


Routing table





Forwarding table


Intradomain

routing protocols


Interdomain

routing protocols



Domain
: an internetwork in which all the
routers are under the same administrative
control

Scalability



Hierarchical Routing Infrastructure

Agenda


Network as a
Graph


Distance Vector (RIP
)


Link State (OSPF
)


Metrics


Routing for Mobile Hosts


Routing


problem of graph theory



The basic problem: to find the lowest
-
cost
path between any two nodes

Network as a Graph



nodes = router



edges = NW links



cost = desirability of
sending traffic over
that link


Calculates all the shortest paths


Loads them into some nonvolatile storage on
each node



Shortcomings:

Static approach


Running routing protocols among nodes


Dynamic


Distributed


Challenges: making distributed algorithm works well



Two main classes:


Distance vector


Link state


Assumption
-
simplification
-
:


Undirected edges


The edge costs are known

Practical approach


Starting assumption:


Each node knows the cost(s) of its directly
connected link(s)


Idea:


Each node constructs a one
-
dimensional array (a
vector) containing the ‘distance’ (costs) to all
other nodes


Distributes that vector to its immediate neighbors

Distance Vector

Example:

Initial states


Global view


A’s routing table


F tells A:


it can reach G at cost 1


A
can reach G via F at cost 2


C tells A:


C can reach D at cost 1


A
can reach D via C at cost 2 ;
better than ∞


recorded


C can reach B at cost 1


A
can reach B via C at cost 2 ;
not better than 1


ignored



Exp: table exchange


A’s routing table


The process of getting consistent routing
information to all nodes.

Convergence


Global view


Periodic


Frequency: several seconds


several minutes


Even if nothing has changed


Sender: ‘keep alive’


Receivers: keep getting info if their current routes
become unviable


Triggered


Whenever a node’s routing table changes, it sends
an update to its neighbors

Updates


A node continually tests the link to other node
by sending a control packet and seeing if it
receives an acknowledgement


A node determine that the link or the node is
down if it does not receive the expected
periodic routing update for the last few
update cycle




Link or node fail detection


F detects the failure


F sets its new distance to G = ∞


F passes that info to A


A also set its distance to G = ∞


From the next update from C


A can reach G
via C at cost 3


A advertises this to F


F can reach G via A at
cost 4

Exp: link fail


A detects the failure


A to E = ∞; A advertises this info


This case might happen:


B receive ‘A to E = ∞’


B receive ‘C to E = 2’


B to E via C = 3


C receive
‘A to E = ∞’


B advertises to A


A to E via B = 4


A advertises to C


C to E via A = 5





None of the nodes knows that E is actually unreachable

Count
-
to
-
infinity

problem


Use some relatively small number as ‘∞’



Split horizon
’: when a node advertises, it does
not send those routes it learned from each
neighbor back to that neighbor


If B has (E,2,A) ; it must learned from A


(E,2) will
not advertised to A



Split horizon with poison reverse
’:


B sends that route to A but it puts negative info to
ensure that A will not use B to get to E


B sends (E,∞) to A

Partial solutions to Count
-
to
-
Infinity


Q: are those techniques

work for larger routing loops?


Routers advertise the cost of reaching
networks



C adv to A, it can reach:


Net 2 & 3 at a cost of 0


Net 5 & 6 at a cost of 1


Net 4 at a cost of 2

Routing Information Protocol (RIP)


Uses UDP port 520


RIP packet format






RIP
-
1 entry format


RIP: port & format


Routers send periodical advertisement every
30 seconds


Router sends an update message whenever its
routing table changed



All links costs = 1


Infinity = 16

RIP = DV


RIPv1

-

RFC 1058


U
ses

classful

routing. The periodic routing updates do not
carry subnet information, lacking support for variable
length subnet masks (VLSM).
N
o support for router
authentication


RIPv2

-

RFC 2453


S
upporting

Classless Inter
-
Domain Routing (CIDR).


T
he 15 hop count limit remained. MD5 authentication.

RIPv2 multicasts routing updates to 224.0.0.9


RIPng

-

RFC 2080


E
xtension

of Ripv2 to support IPv6.


RIP versions


Every node knows how to reach its directly
connected neighbors


Make sure that the totality of this knowledge is
disseminated to every node


Every node will have enough knowledge of the
network to
build a complete map of the network



2 main mechanims:
reliable flooding

&
route
calculation

Link State
: idea


Node sends its link
-
state info (Link
-
State
Packet [LSP]) out on all of its directly
connected links


Each node that receives this info forwarding it
out on all of its links

Reliable Flooding

A.
The ID of the node that created the LSP

B.
A list of directly connected neighbors of that
node with the costs

C.
A sequence number

D.
A time to live for this packet



A & B


enable routing calculation


C & D


reliability, e.g. make sure that you
have the most recent copy

LSP


The transmission of LSPs between adjacent routers is
made reliable using ACKs and retransmissions



When node X receives LSP from node Y:


IF not (X has a copy of LSP from Y)

THEN X stores the LSP

ELSE



X compare the seq_num



IF (the new LSP has a larger seq_num)



THEN




X replace the saved copy with the new LSP




X forwards to all neighbors, not the sender



ELSE X discards the new LSP

The flooding


Periodic


A change in topology


One of router’s directly connected links or
neighbors has gone down


Detects using periodic ‘hello’ packets

LSPs generation


Avoid generating LSPs unless absolutely
necessary


Using very long timers (on the order of hours)
for the periodic updates


Reliable flooding


‘nothing has changed’ messages do not need to
be sent very often

Reducing overhead


Are not expected to wrap; the field need to be
quite large (say, 64 bits)


If a node reboot, it starts with a seq_num = 0


Seq_Num

TTL


to ensure that old link
-
state information is
eventually removed from the network


A node always decrements the TTL of a newly
received LSP before flooding it to its
neighbors.


It also “ages” the LSP while it is stored in the
node.


When the TTL reaches 0, the node
refloods

the
LSP with a TTL of 0


a signal to delete that LSP


Based on: Dijkstra’s shortest
-
path algorithm


M = {s}

for each n in N − {s}


C(n) = l(s, n)

while
(N ≠ M)

M = M


{w} such that C(w) is the minimum for all
w in (N −M)

for each
n in (N −M)


C(n) = MIN(C(n), C(w) + l(w, n))

Route Calculation


Each switch maintains two lists:


Tentative


Confirmed


Each list contains a set of triples:


(Destination, Cost,
NextHop
)


Forward Search Algorithm

1.
Initialize the
Confirmed

list with an entry for myself; this
entry has a cost of 0.

2.
For the node just added to the
Confirmed

list in the
previous step, call it node

Next
, select its LSP.

3.
For each neighbor (
Neighbor
) of
Next
, calculate the cost
(
Cost
) to reach this

Neighbor

as the sum of the cost from
myself to
Next

and from
Next

to
Neighbor
.

a)
If
Neighbor

is currently on neither the
Confirmed

nor the
Tentative

list, then

add (
Neighbor
,
Cost
,
NextHop
) to the
Tentative

list, where
NextHop

is the

direction I go to reach
Next
.


b)
If
Neighbor

is currently on the
Tentative

list, and the
Cost

is
less than the currently

listed cost for
Neighbor
, then replace
the current entry with (
Neighbor
,

Cost
,
NextHop
), where
NextHop

is the direction I go to reach
Next
.

4.
I
f the
Tentative

list is empty, stop. Otherwise, pick the
entry from the
Tentative

list with the lowest cost, move
it to the
Confirmed

list, and return to step 2.

Example:

building routing
table for node D


Stabilize quickly


It does not generate much traffic


Responds rapidly to topology changes or node
failures


Amount of info stored at each node can be
quite large


The LS properties


OSPF adds features to the basic link
-
states
algorithm:


Authentication of routing messages


Additional hierarchy: domain to be partitioned into
areas


Load balancing: same cost for multiple routes to the
same place



OSPF: RFC
-
1131


OSPF v2: RFC
-
2328

Open Shortest Path First Protocol
(OSPF)


Type:

1.
Hello

2.
Database Description

3.
Link State Request

4.
Link State Update

5.
Link State Acknowledgment

OSPF Header


The basic building block of link
-
state message
in OSPF


One message may contain many LSAs



A router running OSPF advertises:


Networks that are directly connected


If the router connected to another router by some
link must advertise the cost of reaching that
router over the link

Link
-
State Advertisement (LSA)

Packet format for ‘type 1’ message
(router
-
LSA)


Simple & reasonable: for all links, cost = 1


Does not distinguish links on:


Static attributes: latency, capacity …


Dynamic attributes: current load …



Learn from the evolution of the ARPANET
routing metric

Link cost?


Measured the number of packets that were
queued

waiting to be transmitted on each link


Does not work well


It moves packet toward the shortest queue rather
than toward the destination


It did not consider either the bandwidth or the
latency

ARPANET: Original version


Considers bandwidth and latency


Metric = average delay


1.
Each packet was timestamped: DepartTime &
ArrivalTime

2.
When link
-
level ACK received, compute:

Delay = (DepartTime
-

ArrivalTime) +
TransmissionTime + Latency


(DepartTime
-

ArrivalTime)


queueing delay

3.
If the ACK did not arrived:


DepartTime = retransmission


(DepartTime
-

ArrivalTime)


link reliability

ARPANET: second version


Light load


okay


Heavy load


problems


Instability


A congested link would start to advertise a very high cost


All the traffic will move off that link


idle


It will then advertise a low cost


attracting back all the
traffic


Too large range of link values


A heavily loaded 9.6 Kbps link could look 127 times more
costly than a lightly loaded 56 Kbps link


126 hops of lightly loaded 56 Kbps is better than 1 hop of 9.6
Kbps link

ARPANET: second version

(cont’d)


Major changes:


Compress the dynamic range of the metric


Account for the link type


Smooth the variation of the metric with time



The smoothing: reducing the likelihood that all
nodes would abandon a route at once


The delay measurement


link utilization; averaged
with the last reported utilization


There was a hard limit on how much the metric could
change

ARPANET: third version


The compression of the dynamic range


Feeding the measured utilization, the link type,
and the link speed into a function

ARPANET: third version

(cont’d)


Highly loaded max 3 times
costly than idle


The most expensive link ≈ 7
times the least expensive


A high
-
speed satellite is more
attractive than low
-
speed
terrestrial


Cost is a function of link
utilization only at moderated
to high loads


None of the metrics are instantaneous


An average over a period of time


Just because a metric changes does not mean
that the node sends out an update message


In practice: updates are sent only when the
change is larger than some threshold

C
alculating edge weight: final issues

Routing for Mobile Hosts


what would happen (in the perspective of
routing ) if a host were disconnected from one
network and connected to another?


Need new address


DHCP



Wireless computer running an application;
moves from
netA

to
netB


Changing IP address in the middle of operation?



Mobile IP


Mobile IP with foreign agent


Care
-
of address

Problems


How does the home agent intercept a packet that
is destined for the mobile node?


Proxy ARP


How does the home agent then deliver the
packet to the foreign agent?


“wraps” the packet inside an IP header that is
destined for the foreign agent


How does the foreign agent deliver the packet to
the mobile node?


strips the extra IP header


recognize the address


delivers the packet to the
hardware
address of the
mobile node

Mobile IP without foreign agent


mobile node can perform the foreign agent
function itself


DHCP


dynamically acquire an IP address of the
foreign network


care
-
of address


Traffic from mobile node to fixed node


Puts the IP address of the fixed node in the
destination field of its IP packets


Puts mobile node’s permanent address in the
source field