Download presentation
Presentation is loading. Please wait.
Published byOswald Hudson Modified over 9 years ago
1
The Networking Layer Rudra Dutta CSC 453 - Fall 2012
2
Copyright Rudra Dutta, NCSU, Fall 20132 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
3
Copyright Rudra Dutta, NCSU, Fall 20133 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
4
Copyright Rudra Dutta, NCSU, Fall 20134 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
5
System Components Copyright Rudra Dutta, NCSU, Fall 20135
6
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 ARD DLC PHY NET Forwarding Next-hop FIB Context
7
Copyright Fall 2013, Rudra Dutta, NCSU7 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 AD DLC PHY NET L7 “NET” TRANSPORT Forwarding Host TRANSPORT APP APPLICATION Next-hop FIB Context
8
Copyright Rudra Dutta, NCSU, Fall 20138 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 C’s FIBE’s FIB
9
Copyright Rudra Dutta, NCSU, Fall 20139 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?
10
Copyright Rudra Dutta, NCSU, Fall 201310 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
11
Copyright Rudra Dutta, NCSU, Fall 201311 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
12
Flooding Copyright Rudra Dutta, NCSU, Fall 201312 B C D E F G 2 2 3 1 3 4 5 1 5 7 2 A
13
Copyright Rudra Dutta, NCSU, Fall 201313 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
14
Copyright Rudra Dutta, NCSU, Fall 201314 LSA Routing Algorithm Each router does the following 1. “Meets the (immediately adjacent) neighbors” and learns their IDs 2. Builds an LSA containing IDs and distance to each of its neighbors 3. 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 LSAs 6. Computes routes (to store in forwarding table) from its local map of the topology
15
Copyright Rudra Dutta, NCSU, Fall 201315 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
16
Copyright Rudra Dutta, NCSU, Fall 201316 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 once generally, O (n) packets propagated Actually, could be more (simultaneity)
17
Copyright Rudra Dutta, NCSU, Fall 201317 “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”
18
Copyright Rudra Dutta, NCSU, Fall 201318 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”
19
∞ ∞ ∞ Copyright Rudra Dutta, NCSU, Fall 201319 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 2 1 8 1 5 2 ∞ ∞ ∞ ∞ ∞ 5 ∞ B E C F DG 5 7 3 2 1 8 1 5 2 0 ∞ ∞ ∞ 7 3 5 5 A B E C F DG At the end, previous nodes can be read off to find complete paths 0
20
Copyright Rudra Dutta, NCSU, Fall 201320 Dijkstra’s Algorithm A 5 7 3 2 1 8 1 5 2 5 7 3 2 1 8 1 5 2 5 7 3 2 1 8 1 5 2 5 7 3 2 1 8 1 5 2 0 0 0 ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ 7 3 5 7 3 4 6 3 4 4 4 5 5 5 5 ∞ B E C F DG A B E C F DG A B E C F DG A B E C F DG 0
21
Copyright Rudra Dutta, NCSU, Fall 201321 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
22
Copyright Rudra Dutta, NCSU, Fall 201322 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, trust neighbors’ claims D(i,j) = min k {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)
23
Copyright Rudra Dutta, NCSU, Fall 201323 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
24
DV Example Copyright Rudra Dutta, NCSU, Fall 201324 D E C A B 1 2 1 5 1 2 8 D(i,j) = min k {l(ik) + D(k,j)} ABCDE A’s DV----- B’s DV-0--- C’s DV----- D’s DV----- E’s DV----- ABCDE A’s DV----- B’s DV----- C’s DV--0-- D’s DV----- E’s DV----- ABCDE A’s DV----- B’s DV----- C’s DV----- D’s DV----- E’s DV----0 ABCDE A’s DV----- B’s DV----- C’s DV----- D’s DV---0- E’s DV----- ABCDE A’s DV0---- B’s DV----- C’s DV----- D’s DV----- E’s DV-----
25
DV Example Copyright Rudra Dutta, NCSU, Fall 201325 D E C A B 1 2 1 5 1 2 8 D(i,j) = min k {l(ik) + D(k,j)} ABCDE A’s DV----- B’s DV-0--- C’s DV----- D’s DV----- E’s DV----- ABCDE A’s DV----- B’s DV----- C’s DV--0-- D’s DV----- E’s DV----- ABCDE A’s DV----- B’s DV----- C’s DV----- D’s DV----- E’s DV----0 ABCDE A’s DV----- B’s DV----- C’s DV----- D’s DV---0- E’s DV----- ABCDE A’s DV0---- B’s DV----- C’s DV----- D’s DV----- E’s DV----- ABCDE A’s DV0---- B’s DV1018- C’s DV--0-- D’s DV---0- E’s DV----- ABCDE A’s DV0---- B’s DV-0--- C’s DV210-1 D’s DV----- E’s DV----0 ABCDE A’s DV0---- B’s DV----- C’s DV--0-- D’s DV---0- E’s DV5-120 ABCDE A’s DV----- B’s DV-0--- C’s DV----- D’s DV-8-02 E’s DV----0 ABCDE A’s DV012-5 B’s DV-0--- C’s DV--0-- D’s DV----- E’s DV----0
26
ABCDE A’s DV012-5 B’s DV----- C’s DV210-1 D’s DV-8-02 E’s DV5-120 DV Example Copyright Rudra Dutta, NCSU, Fall 201326 D E C A B 1 2 1 5 1 2 8 D(i,j) = min k {l(ik) + D(k,j)} ABCDE A’s DV012-5 B’s DV1018- C’s DV210-1 D’s DV-8-02 E’s DV----- ABCDE A’s DV012-5 B’s DV1018- C’s DV210-1 D’s DV----- E’s DV5-120 ABCDE A’s DV----- B’s DV1018- C’s DV----- D’s DV-8-02 E’s DV5-120 ABCDE A’s DV012-5 B’s DV1018- C’s DV210-1 D’s DV----- E’s DV5-120 ABCDE A’s DV012-5 B’s DV10182 C’s DV210-1 D’s DV-8-02 E’s DV----- ABCDE A’s DV012-5 B’s DV1018- C’s DV21031 D’s DV----- E’s DV5-120 ABCDE A’s DV012-5 B’s DV----- C’s DV210-1 D’s DV-8-02 E’s DV32120 ABCDE A’s DV----- B’s DV1018- C’s DV----- D’s DV78302 E’s DV5-120 ABCDE A’s DV01273 B’s DV1018- C’s DV210-1 D’s DV----- E’s DV5-120
27
DV Example Copyright Rudra Dutta, NCSU, Fall 201327 D E C A B 1 2 1 5 1 2 8 D(i,j) = min k {l(ik) + D(k,j)} ABCDE A’s DV01273 B’s DV10182 C’s DV21031 D’s DV78302 E’s DV----- ABCDE A’s DV01273 B’s DV10182 C’s DV21031 D’s DV----- E’s DV32120 ABCDE A’s DV01273 B’s DV----- C’s DV21031 D’s DV78302 E’s DV32120 ABCDE A’s DV----- B’s DV10182 C’s DV----- D’s DV78302 E’s DV32120 ABCDE A’s DV01273 B’s DV10182 C’s DV21031 D’s DV----- E’s DV32120 ABCDE A’s DV01273 B’s DV10142 C’s DV21031 D’s DV78302 E’s DV----- ABCDE A’s DV01273 B’s DV10182 C’s DV21031 D’s DV----- E’s DV32120 ABCDE A’s DV01273 B’s DV----- C’s DV21031 D’s DV78302 E’s DV32120 ABCDE A’s DV----- B’s DV10182 C’s DV----- D’s DV54302 E’s DV32120 ABCDE A’s DV01253 B’s DV10182 C’s DV21031 D’s DV----- E’s DV32120
28
Copyright Rudra Dutta, NCSU, Fall 201328 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
29
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 201329
30
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
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
32 Route discovery in DSR B A S E F H J D C G I K Z Y Represents a node that has received RREQ for D from S M N L Copyright Rudra Dutta, NCSU, Fall 2013
33
33 Route discovery in DSR B A S E F H J D C G I K Represents transmission of RREQ Z Y Broadcast transmission M N L [S] [X,Y] Represents list of identifiers appended to RREQ Copyright Rudra Dutta, NCSU, Fall 2013
34
34 Route discovery in DSR B A S E F H J D C G I K 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
35 Route discovery in DSR B A S E F H J D C G I K 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
36 Route discovery in DSR B A S E F H J D C G I K 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
37 Route discovery in DSR B A S E F H J D C G I K 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
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
39 Route reply in DSR B A S E F H J D C G I K Z Y M N L RREP [S,E,F,J,D] Represents RREP control message Copyright Rudra Dutta, NCSU, Fall 2013
40
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
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
42 Data delivery in DSR B A S E F H J D C G I K Z Y M N L DATA [S,E,F,J,D] Packet header size grows with route length Copyright Rudra Dutta, NCSU, Fall 2013
43
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.