the networking layer rudra dutta csc 453 - fall 2012
Post on 08-Jan-2018
221 Views
Preview:
DESCRIPTION
TRANSCRIPT
The Networking Layer
Rudra DuttaCSC 453 - Fall 2012
Copyright Rudra Dutta, NCSU, Fall 2013 2
Positioning DLC allows communication between connected computers Cooperation can create connectivity not present in physical
topology – networking Lowest layer aware of end-to-end traffic Functions:
– Forwarding– Routing– Addressing?
We want to understand:– Descriptive– Algorithmic
Copyright Rudra Dutta, NCSU, Fall 2013 3
Concepts Inter-networking
– Assume physical (“sub”)network knows how to deliver Addressing
– Physical network computers already have addresses– Do these make sense in broader context?
Consider postal - house, subdivision, ...– If not, networking layer addresses must be assigned
Forwarding and Routing Switching granularity and context
– Circuits (L1), packets (L3)– Hierarchical switching
Forwarding Information Base
Copyright Rudra Dutta, NCSU, Fall 2013 4
Concepts - Forwarding / Routing Forwarding
– The act of forwarding PDUs Where to forward?
– Likely to be partially determined by data source/destination Must be embedded in data
– Likely to be partially determined by network factors Must be stored at node
– Forwarding will combine these two types of information Routing
– Path-finding For any and all traffic, determination of path it takes from source to
destination– At a node, must translate into:
Distilling “network factors” above into easy-to-refer information for forwarding - mapping from data to next-hop
Copyright Rudra Dutta, NCSU, Fall 2013 5
System Components
Copyright Rudra Dutta, NCSU, Fall 2013 6
Concepts - Forwarding Information Base A “lookup table” for next-hop router
– Packet arrives with embedded context (full or partial)– Context information is extracted and looked up in FIB– Packet forwarded to next-hop intermediate node
DLC
PHY
NET
DLC
PHY
DLC
PHY
NET
A R D
DLC
PHY
NET
Forwarding
Next-hop
FIBContext
Copyright Fall 2013, Rudra Dutta, NCSU 7
Overlay Networking Operation of L3 can be performed by L7
– Overlay forwarding – integrate with application logic Receive-process-decide-output cycle
– May fall behind Discard data loss
DLC
PHY
NET
DLC
PHY
DLC
PHY
NET
A D
DLC
PHY
NET
L7 “NET”
TRANSPORTForwarding
Host
TRANSPORT
APP
APPLICATION
Next-hop
FIBContext
Copyright Rudra Dutta, NCSU, Fall 2013 8
Connection-less Forwarding
H1 sends packet 1 to A A consults FIB forward to C C consults FIB forward to E E consults FIB forward to F F uses LAN to forward to H2
If FIB changes, a following packet may traverse different path
A’s FIB A’s FIB C’s FIB E’s FIB
Copyright Rudra Dutta, NCSU, Fall 2013 9
Routing - Fundamentals Different concerns
– Correctness and optimality– Robustness, stability, …– More complicated “policy” concerns– Optimality – who decides?
Once design goals have been decided,– Algorithm must be designed to attain them– Some fundamental approaches to routing exist
Routing may be fixed, or fixed alternate May be adaptive, or dynamic
– Adapting to what? How is information shared?
Copyright Rudra Dutta, NCSU, Fall 2013 10
Space of Routing Choices Static vs. dynamic or adaptive For a node, next-hop determined by
– Destination only– Source and destination– Particular flow of traffic– Other characteristics
May be bifurcated (split) or non-bifurcated Next-hop may be unique or multiple
– Deterministically or randomly picked
Copyright Rudra Dutta, NCSU, Fall 2013 11
Flooding Simple – forward to everybody else Generates unbounded copies Hop count can be introduced to bound Can be more intelligent if packets can be
recognized Selective flooding – shortlist of links Highly robust Serves as benchmark Useful as a “phase” in other strategies
Flooding
Copyright Rudra Dutta, NCSU, Fall 2013 12
B
C
D E
F G
2
2
31 3
45
1
5
72
A
Copyright Rudra Dutta, NCSU, Fall 2013 13
Link State Protocols Each router distributes information it has to every other
router Information is in the form of LSA’s
– (myID, neighborID, link cost) Distribution is by controlled flooding
– Distribute along each link but receiving one Now, each router has complete information OSPF is a prevalent example
– SPF with LSA to find arc costs
Copyright Rudra Dutta, NCSU, Fall 2013 14
LSA Routing AlgorithmEach router does the following1. “Meets the (immediately adjacent) neighbors” and
learns their IDs2. Builds an LSA containing IDs and distance to each of
its neighbors3. Transmits the LSA to all other routers
– How? Most complex and critical piece of link-state routing algorithm
4. Stores the most recent LSA from every other router in the network
– Not just from its immediate neighbors!5. Creates a “map” of the network topology from LSAs6. Computes routes (to store in forwarding table) from its
local map of the topology
Copyright Rudra Dutta, NCSU, Fall 2013 15
Generating LSAs A router generates LSAs periodically background
refresh rate A router also generates LSAs when its local
environment changes– it has a new neighbor (router comes online)– a link goes down (indicated by absence of "Hello" packets)– the cost of a link to an existing neighbor has changed
Limiting the overhead (network bandwidth) consumed by routing messages, particularly LSAs– set a minimum interval between successive updates
Copyright Rudra Dutta, NCSU, Fall 2013 16
Forwarding LSAs Flooding except to transmitting neighbor
– Infinite number of packets– Hop-limited would still result in exponential number of
packets LSA flooding can use information in LSA
– Each router stores the most recent copy of LSAs from all routers easy to recognize duplicate LSAs
– Each router floods an LSA only once an LSA will travel over each link of the network exactly oncegenerally, O (n) packets propagatedActually, could be more (simultaneity)
Copyright Rudra Dutta, NCSU, Fall 2013 17
“Optimality Criterion”
• Nice characteristic, works for “distance” or “cost” related routing goals• Based on “sink tree” argument• Goals that can be expressed additively• “Sub-path of optimal path must be optimal”
Copyright Rudra Dutta, NCSU, Fall 2013 18
Finding Shortest Paths An example where a graph-theoretic abstraction is
useful– Abstract networking into vertices and arcs– Weighted arcs – least cost approach
Dijkstra’s algorithm– Finds least cost path to all vertices from one– Based on moving vertices from a set with “tentative” distances
to a set with “fixed” distances– Desirable computational properties– Other algorithms exist
Useful for additive measures of path cost– “Shortest” is better understood as “least additive cost”
∞
∞
∞
Copyright Rudra Dutta, NCSU, Fall 2013 19
Dijkstra’s Algorithm Finding shortest distances (and
corresponding paths) from ONE source to ALL destinations– Easily adapted to vice-versa
First, mark source node with tentative distance zero
Mark all other nodes tentatively with distance “infinity” (not reachable)
Do iteratively (until all nodes marked):– Pick the node with the least tentative distance,
and mark it as final distance – call it node X– Pick all outgoing links from this node, for each:
Update the tentative distance of the neighbor IF: (Final distance of X + link cost) < Tentative distance
of neighbor If updated, remember X as previous node of
neighbor
A
5
7
3
21 8
1
5
2
∞
∞
∞∞
∞
5
∞B E
C F
D G
5
7
3
21 8
1
5
2
0
∞
∞
∞
7
3
5
5
A
B E
C F
D G
At the end, previous nodes can be read off to find complete paths
0
Copyright Rudra Dutta, NCSU, Fall 2013 20
Dijkstra’s Algorithm
A
5
7
3
21 8
1
5
2
5
7
3
21 8
1
5
2
5
7
3
21 8
1
5
2
5
7
3
21 8
1
5
2
0 0
0
∞
∞
∞∞
∞
∞
∞
∞
∞
∞
∞
∞
7
3
5
7
3
46
3
4
4
45
5
5
5
∞B E
C F
D G
A
B E
C F
D G
A
B E
C F
D G
A
B E
C F
D G
0
Copyright Rudra Dutta, NCSU, Fall 2013 21
Distance Vector (DV) Routing Asynchronous, iterative distributed computation
– exchange of routing information: (destination, min_distance)– exchange info with neighbors only– computation step: based on Bellman-Ford method
Find for each destination– cost of least cost path– next node (neighbor) on least cost path (not complete path)
Routers do not store or compute the network topology; they only store distance / next hop information
Used by many protocols: RIP, BGP, ISO IDRP, Novel IPX Advertise distances to route prefixes (networks, subnets, hosts),
not routers
Copyright Rudra Dutta, NCSU, Fall 2013 22
Bellman's Equation
7
3
I can get you to 54.0.0.0 for $10
Hey, I can get you there for
$8!
For any node A,– Edge costs l(ij) =
– Cost of link from i to j, if exists– ∞, otherwise
Beyond neighborhood, trustneighbors’ claims D(i,j) = mink {l(ik) + D(k,j)} D(i,i) = 0
A forms vector of D(A,j), distributes to neighbors So does every other node Nodes collectively and iteratively learn about better and better
paths
A D(A,54.0.0.0 = min (3+10, 7+8)
Copyright Rudra Dutta, NCSU, Fall 2013 23
Distance-Vector Algorithm (Each Router) Start with a distance vector consisting of the value
– "0" for itself– "infinity" for every other destination
Link cost to neighbors is available, through direct measurement, or administrator configuration
Transmit its distance vector to each of its neighbors– when the link to the neighbor first comes up– whenever the information changes triggered updates– periodically (even if there are no changes)
Saves the most recent distance vector from each neighbor
Calculates its own distance vector using Bellman's equation
Iterate
DV Example
Copyright Rudra Dutta, NCSU, Fall 2013 24
DE
C
A B1
215
1
2
8
D(i,j) = mink {l(ik) + D(k,j)}
A B C D E
A’s DV - - - - -
B’s DV - 0 - - -
C’s DV - - - - -
D’s DV - - - - -
E’s DV - - - - -
A B C D E
A’s DV - - - - -
B’s DV - - - - -
C’s DV - - 0 - -
D’s DV - - - - -
E’s DV - - - - -
A B C D E
A’s DV - - - - -
B’s DV - - - - -
C’s DV - - - - -
D’s DV - - - - -
E’s DV - - - - 0
A B C D E
A’s DV - - - - -
B’s DV - - - - -
C’s DV - - - - -
D’s DV - - - 0 -
E’s DV - - - - -
A B C D E
A’s DV 0 - - - -
B’s DV - - - - -
C’s DV - - - - -
D’s DV - - - - -
E’s DV - - - - -
DV Example
Copyright Rudra Dutta, NCSU, Fall 2013 25
DE
C
A B1
215
1
2
8
D(i,j) = mink {l(ik) + D(k,j)}
A B C D E
A’s DV - - - - -
B’s DV - 0 - - -
C’s DV - - - - -
D’s DV - - - - -
E’s DV - - - - -
A B C D E
A’s DV - - - - -
B’s DV - - - - -
C’s DV - - 0 - -
D’s DV - - - - -
E’s DV - - - - -
A B C D E
A’s DV - - - - -
B’s DV - - - - -
C’s DV - - - - -
D’s DV - - - - -
E’s DV - - - - 0
A B C D E
A’s DV - - - - -
B’s DV - - - - -
C’s DV - - - - -
D’s DV - - - 0 -
E’s DV - - - - -
A B C D E
A’s DV 0 - - - -
B’s DV - - - - -
C’s DV - - - - -
D’s DV - - - - -
E’s DV - - - - -
A B C D E
A’s DV 0 - - - -
B’s DV 1 0 1 8 -
C’s DV - - 0 - -
D’s DV - - - 0 -
E’s DV - - - - -
A B C D E
A’s DV 0 - - - -
B’s DV - 0 - - -
C’s DV 2 1 0 - 1
D’s DV - - - - -
E’s DV - - - - 0
A B C D E
A’s DV 0 - - - -
B’s DV - - - - -
C’s DV - - 0 - -
D’s DV - - - 0 -
E’s DV 5 - 1 2 0
A B C D E
A’s DV - - - - -
B’s DV - 0 - - -
C’s DV - - - - -
D’s DV - 8 - 0 2
E’s DV - - - - 0
A B C D E
A’s DV 0 1 2 - 5
B’s DV - 0 - - -
C’s DV - - 0 - -
D’s DV - - - - -
E’s DV - - - - 0
A B C D E
A’s DV 0 1 2 - 5
B’s DV - - - - -
C’s DV 2 1 0 - 1
D’s DV - 8 - 0 2
E’s DV 5 - 1 2 0
DV Example
Copyright Rudra Dutta, NCSU, Fall 2013 26
DE
C
A B1
215
1
2
8
D(i,j) = mink {l(ik) + D(k,j)}
A B C D E
A’s DV 0 1 2 - 5
B’s DV 1 0 1 8 -
C’s DV 2 1 0 - 1
D’s DV - 8 - 0 2
E’s DV - - - - -
A B C D E
A’s DV 0 1 2 - 5
B’s DV 1 0 1 8 -
C’s DV 2 1 0 - 1
D’s DV - - - - -
E’s DV 5 - 1 2 0
A B C D E
A’s DV - - - - -
B’s DV 1 0 1 8 -
C’s DV - - - - -
D’s DV - 8 - 0 2
E’s DV 5 - 1 2 0
A B C D E
A’s DV 0 1 2 - 5
B’s DV 1 0 1 8 -
C’s DV 2 1 0 - 1
D’s DV - - - - -
E’s DV 5 - 1 2 0
A B C D E
A’s DV 0 1 2 - 5
B’s DV 1 0 1 8 2
C’s DV 2 1 0 - 1
D’s DV - 8 - 0 2
E’s DV - - - - -
A B C D E
A’s DV 0 1 2 - 5
B’s DV 1 0 1 8 -
C’s DV 2 1 0 3 1
D’s DV - - - - -
E’s DV 5 - 1 2 0
A B C D E
A’s DV 0 1 2 - 5
B’s DV - - - - -
C’s DV 2 1 0 - 1
D’s DV - 8 - 0 2
E’s DV 3 2 1 2 0
A B C D E
A’s DV - - - - -
B’s DV 1 0 1 8 -
C’s DV - - - - -
D’s DV 7 8 3 0 2
E’s DV 5 - 1 2 0
A B C D E
A’s DV 0 1 2 7 3
B’s DV 1 0 1 8 -
C’s DV 2 1 0 - 1
D’s DV - - - - -
E’s DV 5 - 1 2 0
DV Example
Copyright Rudra Dutta, NCSU, Fall 2013 27
DE
C
A B1
215
1
2
8
D(i,j) = mink {l(ik) + D(k,j)}
A B C D E
A’s DV 0 1 2 7 3
B’s DV 1 0 1 8 2
C’s DV 2 1 0 3 1
D’s DV 7 8 3 0 2
E’s DV - - - - -
A B C D E
A’s DV 0 1 2 7 3
B’s DV 1 0 1 8 2
C’s DV 2 1 0 3 1
D’s DV - - - - -
E’s DV 3 2 1 2 0
A B C D E
A’s DV 0 1 2 7 3
B’s DV - - - - -
C’s DV 2 1 0 3 1
D’s DV 7 8 3 0 2
E’s DV 3 2 1 2 0
A B C D E
A’s DV - - - - -
B’s DV 1 0 1 8 2
C’s DV - - - - -
D’s DV 7 8 3 0 2
E’s DV 3 2 1 2 0
A B C D E
A’s DV 0 1 2 7 3
B’s DV 1 0 1 8 2
C’s DV 2 1 0 3 1
D’s DV - - - - -
E’s DV 3 2 1 2 0
A B C D E
A’s DV 0 1 2 7 3
B’s DV 1 0 1 4 2
C’s DV 2 1 0 3 1
D’s DV 7 8 3 0 2
E’s DV - - - - -
A B C D E
A’s DV 0 1 2 7 3
B’s DV 1 0 1 8 2
C’s DV 2 1 0 3 1
D’s DV - - - - -
E’s DV 3 2 1 2 0
A B C D E
A’s DV 0 1 2 7 3
B’s DV - - - - -
C’s DV 2 1 0 3 1
D’s DV 7 8 3 0 2
E’s DV 3 2 1 2 0
A B C D E
A’s DV - - - - -
B’s DV 1 0 1 8 2
C’s DV - - - - -
D’s DV 5 4 3 0 2
E’s DV 3 2 1 2 0
A B C D E
A’s DV 0 1 2 5 3
B’s DV 1 0 1 8 2
C’s DV 2 1 0 3 1
D’s DV - - - - -
E’s DV 3 2 1 2 0
Copyright Rudra Dutta, NCSU, Fall 2013 28
DV Routing (cont'd) Events causing recalculation of the distance
vector– receive from a neighbor a distance vector containing
new info– when link goes down discard / disregard distance
vector from the neighbor on the other end of that link
On-demand Routing No pre-determined paths – make forwarding
decision at the time packet arrives– Need to constitute consistent and correct path
decisions May save some information about network
– Neighbors Requires query-response on-demand
– RREQ, RREP May utilize additional information to determine
“desirability”– Geographic routing
Copyright Rudra Dutta, NCSU, Fall 2013 29
30
Reactive & proactive protocols Reactive protocols
– Dynamic Source Routing (DSR) [Johnson96]– Ad Hoc On-Demand Distance Vector Routing
(AODV) [Perkins99Wmcsa]– Link reversal algorithm [Gafni81]
Proactive protocols– Optimized Link State Routing (OLSR)
[Jacquet00ietf,Jacquet99Inria]– Destination-Sequenced Distance-Vector (DSDV)
[Perkins94Sigcomm]
Copyright Rudra Dutta, NCSU, Fall 2013
31
Example – DSR operation When S wants to send a packet to D, but does
not know a route to D, S initiates a route discovery
Source node S floods Route Request (RREQ)
Each node appends own identifier when forwarding RREQ
Copyright Rudra Dutta, NCSU, Fall 2013
32
Route discovery in DSR
B
A
S EF
H
J
D
C
G
IK
Z
Y
Represents a node that has received RREQ for D from S
M
N
L
Copyright Rudra Dutta, NCSU, Fall 2013
33
Route discovery in DSR
B
A
S EF
H
J
D
C
G
IK
Represents transmission of RREQ
Z
YBroadcast transmission
M
N
L
[S]
[X,Y] Represents list of identifiers appended to RREQCopyright Rudra Dutta, NCSU, Fall 2013
34
Route discovery in DSR
B
A
S EF
H
J
D
C
G
IK
• Node H receives packet RREQ from two neighbors: potential for collision
Z
Y
M
N
L
[S,E]
[S,C]
Copyright Rudra Dutta, NCSU, Fall 2013
35
Route discovery in DSR
B
A
S EF
H
J
D
C
G
IK
• Node C receives RREQ from G and H, but does not forward it again, because node C has already forwarded RREQ once
Z
Y
M
N
L
[S,C,G]
[S,E,F]
Copyright Rudra Dutta, NCSU, Fall 2013
36
Route discovery in DSR
B
A
S EF
H
J
D
C
G
IK
Z
Y
M
• Nodes J and K both broadcast RREQ to node D• Since nodes J and K are hidden from each other, their transmissions may collide
N
L
[S,C,G,K]
[S,E,F,J]
Copyright Rudra Dutta, NCSU, Fall 2013
37
Route discovery in DSR
B
A
S EF
H
J
D
C
G
IK
Z
Y
• Node D does not forward RREQ, because node D is the intended target of the route discovery
M
N
L
[S,E,F,J,M]
Copyright Rudra Dutta, NCSU, Fall 2013
38
Route reply in DSR
Destination D on receiving the first RREQ, sends a Route Reply (RREP)
Route of RREP – reversing the route in received RREQ
RREP includes the route from S to D on which RREQ was received by node D
Copyright Rudra Dutta, NCSU, Fall 2013
39
Route reply in DSR
B
A
S EF
H
J
D
C
G
IK
Z
Y
M
N
L
RREP [S,E,F,J,D]
Represents RREP control message
Copyright Rudra Dutta, NCSU, Fall 2013
40
Route reply in DSR Reverse route assumes bi-directional links
– To ensure this, node only forward RREQ if its link is bi-directional
If allow unidirectional (asymmetric) links, then may need a route discovery for S from node D – Unless node D already knows a route to node S– If discover route from D to S, Route Reply is
piggybacked on Route Request from D.
Copyright Rudra Dutta, NCSU, Fall 2013
41
Data delivery in DSR Node S on receiving RREP, caches the route included in
the RREP
When node S sends a data packet to D, the entire route is included in the packet header– hence the name source routing
Intermediate nodes use the source route included in a packet to determine to whom a packet should be forwarded
Copyright Rudra Dutta, NCSU, Fall 2013
42
Data delivery in DSR
B
A
S EF
H
J
D
C
G
IK
Z
Y
M
N
L
DATA [S,E,F,J,D]
Packet header size grows with route length
Copyright Rudra Dutta, NCSU, Fall 2013
Copyright Rudra Dutta, NCSU, Fall 2013 43
Summary Network layer allows separate physical
networks to cooperate Context may or may not be utilized to minimize
forwarding effort Dual concerns of forwarding and routing Various fundamental approaches to routing
– Real strategies can be designed from combination of these approaches
Can incorporate in overlay networking applications
top related