1 cse524: lecture 11 network layer functions. 2 exam
TRANSCRIPT
1
CSE524: Lecture 11
Network Layer
Functions
2
Exam
3
Where we’re at…• Internet architecture and history• Internet protocols in practice• Application layer• Transport layer• Network layer
– Network-layer functions– Specific network layer protocols (IP) and devices
• Data-link layer• Physical layer
4
Network layer functions• Transport packet from
sending to receiving hosts
• Network layer protocols in every host, router
• Important functions:– Addressing: address
assignment– Delivery semantics: unicast,
multicast, anycast, broadcast, ordering
– Security: provide privacy, authentication, etc. at the network layer
– Fragmentation: break-up packets based on data-link layer properties
– Quality-of-service: provide predictable performance
– Routing: path selection and packet forwarding
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
5
NL: Demux to upper layer
• Sends payload to the next layer in protocol stack – Usually transport layer– Can be other layers (recall tunneling discussion)
6
NL: Error detection
• Protection of data and/or header at the network layer– Provide extra protection on top of data-link layer and
below transport layer– End-to-end principle
• Is this necessary?
• IPv6 answer =>No
7
NL: Delivery semantics
• Communication modes– Unicast (One source to one destination)
– Anycast (One source to any of a set of destinations)
– Multicast (One or more sources to a set of destinations)
– Broadcast (One source to all destinations)
• Ordering– In-order vs. out-of-order delivery
– Recall ATM service models
• If time permits, we will look at multicast at the end of the course.
8
NL: Security
• Secrecy– No eavesdropping
• Integrity– No man-in-the-middle attacks
• Authenticity– Ensure identity of source
• If time permits, we will look at network security at the end of course…..
9
NL: Fragmentation
• Different link-layers have different MTUs
– Split packets into multiple fragments– Where to do reassembly?
• End nodes – avoids unnecessary work
• Dangerous to do at intermediate nodes– Buffer space
– Must assume single path through network
– May be re-fragmented later on in the route again
10
NL: Fragmentation is Harmful
• Uses resources poorly– Forwarding costs per packet– Best if we can send large chunks of data– Worst case: packet just bigger than MTU
• Poor end-to-end performance– Loss of a fragment
• Reassembly is hard– Buffering constraints
11
NL: Fragmentation
• References– Characteristics of Fragmented IP Traffic on Internet Links.
Colleen Shannon, David Moore, and k claffy -- CAIDA, UC San Diego. ACM SIGCOMM Internet Measurement Workshop 2001. http://www.aciri.org/vern/sigcomm-imeas-2001.program.html
– C. A. Kent and J. C. Mogul, "Fragmentation considered harmful," in Proceedings of the ACM Workshop on Frontiers in Computer Communications Technology, pp. 390--401, Aug. 1988. http://www.research.compaq.com/wrl/techreports/abstracts/87.3.html
12
NL: Fragmentation
• Remove fragmentation from the network (IPv6)• Path MTU Discovery
– Network layer does no fragmentation– Host does Path MTU discovery– ICMP message for oversized packets
13
NL: Quality-of-Service
Q: What service model for “channel” transporting packets from sender to receiver?
• guaranteed bandwidth?• preservation of inter-packet
timing (no jitter)?• loss-free delivery?• in-order delivery?• congestion feedback to
sender?
? ??virtual circuit
or datagram?
The most important abstraction provided
by network layer:
serv
ice a
bst
ract
ion
14
NL: Connection-oriented virtual circuits• Phone circuit abstraction (recall ATM discussion)
– Model
• call setup and signaling for each call before data can flow
• guaranteed performance during call
• call teardown and signaling to remove call
– Network support
• each packet carries circuit identifier (not destination host ID)
• every router on source-dest path maintains “state” for each passing circuit
• link, router resources (bandwidth, buffers) allocated to VC to guarantee circuit-like performance
applicationtransportnetworkdata linkphysical
application
transportnetworkdata linkphysical
1. Initiate call2. incoming call
3. Accept call4. Call connected5. Data flow begins 6. Receive data
15
NL: Connectionless datagram service• Postal service abstraction (Internet)
– Model
• no call setup or teardown at network layer
• no service guarantees
– Network support
• packets carry only destination host ID
• no state within network on end-to-end connections
• packets between same source-dest pair may take different paths
application
transportnetworkdata linkphysical
application
transportnetworkdata linkphysical
1. Send data 2. Receive data
16
NL: Best of both worlds?
• Adding circuits to the Internet
– Intserv, Diffserv (at the end of course if time permits)
– Chapter 6 in book
• Start from scratch and redesign
– ATM
17
NL: Addressing
• Hierarchical vs. flat– Routing table size
• Global vs. local– Applications (NAT)– Processing speed
• Variable-length vs. fixed-length– Flexibility– Processing costs – Header size
18
NL: Routing
• The most complicated and important function the network layer provides– Directing data from source to destination
• Routing algorithms and architectures– Link state algorithms– Distance vector algorithms
• Routing hierarchies– Area routing– Landmark routing (at end of course time-permitting)
19
NL: Routing algorithms
Graph abstraction for routing algorithms:
• graph nodes are routers
• graph edges are physical links– link cost
• Delay
• $ cost
• congestion level
Goal: determine “good” path
(sequence of routers) thru network from source to
dest.
Routing protocol
A
ED
CB
F
2
2
13
1
1
2
53
5
• “good” path:– typically means
minimum cost path
– other def’s possible
20
NL: Routing algorithms
Global or decentralized information?
Global:• all routers have complete
topology, link cost info• “link state” algorithmsDecentralized: • router knows physically-
connected neighbors, link costs to neighbors
• iterative process of computation, exchange of info with neighbors
• “distance vector” algorithms
Static or dynamic?Static:
• routes change slowly over time
Dynamic:
• routes change more quickly
– periodic update
– in response to link cost changes
21
NL: What to look for in routing algorithms
• Communication costs
• Processing costs
• Optimality
• Stability– Convergence time– Loop freedom– Oscillation damping
22
NL: Link state routing algorithms
• Used in OSPF (intra-domain routing protocol)• Basic steps• Start condition
– Each node assumed to know state of links to its neighbors
• Step 1– Each node broadcasts its local link states to all other nodes– Reliable flooding mechanism
• Step 2– Each node locally computes shortest paths to all other nodes
from global state– Dijkstra’s shortest path tree (SPT) algorithm
23
NL: Step 1
• Link State Packets (LSPs) to broadcast state to all nodes
• Periodically, each node creates a link state packet containing:– Node ID– List of neighbors and link cost– Sequence number– Time to live (TTL)– Node outputs LSP on all its links
24
NL: Step 1
• Reliable Flooding – When node J receives LSP from node K
• If LSP is the most recent LSP from K that J has seen so far, J saves it in database and forwards a copy on all links except link LSP was received on
• Otherwise, discard LSP
– How to tell more recent• Use sequence numbers
– Same method as sliding window protocols
– Needed to avoid stale information from flood
– Problem: sequence number wrap-around
» Lollipop sequence space
25
NL: Step 1 and wrapped sequence numbers
• Wrapped sequence numbers– 0-N where N is large– If difference between numbers is large, assume a
wrap– A is older than B if….
• A < B and |A-B| < N/2 or…• A > B and |A-B| > N/2
• What about new nodes or rebooted nodes that are out of sync with sequence number space?– Lollipop sequence (Perlman 1983)
26
NL: Step 1 and lollipop sequence numbers
• Divide sequence number space• Special negative sequence for recovering from reboot
– New and rebooted nodes use negative sequence numbers
– Upon receipt of negative number, other nodes inform these nodes of current “up-to-date” sequence number
• A older than B if – A < 0 and A < B– A > 0, A < B and (B – A) < N/4– A > 0, A > B and (A – B) > N/4
0-N/2
N/2 - 1
27
NL: Step 2
Dijkstra’s algorithm• all link costs on the network
are known• all nodes have same info• computes least cost paths
from one node (‘source”) to all other nodes– gives routing table for that
node• iterative: after k iterations,
know least cost path to k destinations
Notation:• c(i,j): link cost from node i
to j. cost infinite if not direct neighbors
• D(v): current value of cost of path from source to dest. V
• p(v): predecessor node along path from source to v, that is next v
• N: set of nodes whose least cost path definitively known
A Link-state routing algorithm
28
NL: Step 2 (Dijkstra’s algorithm example)
1 Initialization: 2 N = {A} 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v) 6 else D(v) = infinity 7 8 Loop 9 find w not in N such that D(w) is a minimum 10 add w to N 11 update D(v) for all v adjacent to w and not in N: 12 D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N
29
NL: Step 2 (Dijkstra’s algorithm example)
A F
B
D E
C2
2
2
3
1
1
1
3
5
step SPT D(b), P(b) D(c), P(c) D(d), P(d) D(e), P(e) D(f), P(f)
0 A 2, A 5, A 1, A ~ ~
5
B C D E F
30
NL: Step 2 (Dijkstra’s algorithm example)
A F
B
D E
C2
2
2
3
1
1
1
3
5
step SPT D(b), P(b) D(c), P(c) D(d), P(d) D(e), P(e) D(f), P(f)0 A 2, A 5, A 1, A ~ ~1 AD 2, A 4, D 2, D ~
5
B C D E F
31
NL: Step 2 (Dijkstra’s algorithm example)
A F
B
D E
C2
2
2
3
1
1
1
3
5
step SPT D(b), P(b) D(c), P(c) D(d), P(d) D(e), P(e) D(f), P(f)0 A 2, A 5, A 1, A ~ ~1 AD 2, A 4, D 2, D ~2 ADE 2, A 3, E 4, E
5
B C D E F
32
NL: Step 2 (Dijkstra’s algorithm example)
A F
B
D E
C2
2
2
3
1
1
1
3
5
step SPT D(b), P(b) D(c), P(c) D(d), P(d) D(e), P(e) D(f), P(f)0 A 2, A 5, A 1, A ~ ~1 AD 2, A 4, D 2, D ~2 ADE 2, A 3, E 4, E3 ADEB 3, E 4, E
5
B C D E F
33
NL: Step 2 (Dijkstra’s algorithm example)
A F
B
D E
C2
2
2
3
1
1
1
3
5
step SPT D(b), P(b) D(c), P(c) D(d), P(d) D(e), P(e) D(f), P(f)0 A 2, A 5, A 1, A ~ ~1 AD 2, A 4, D 2, D ~2 ADE 2, A 3, E 4, E3 ADEB 3, E 4, E4 ADEBC 4, E
5
B C D E F
34
NL: Step 2 (Dijkstra’s algorithm example)
A F
B
D E
C2
2
2
3
1
1
1
3
5
step SPT D(b), P(b) D(c), P(c) D(d), P(d) D(e), P(e) D(f), P(f)0 A 2, A 5, A 1, A ~ ~1 AD 2, A 4, D 2, D ~2 ADE 2, A 3, E 4, E3 ADEB 3, E 4, E4 ADEBC 4, E5 ADEBCF
5
B C D E F