Network Layer Overview ECE 256 Spring 2008 - PowerPoint PPT Presentation

Loading...

PPT – Network Layer Overview ECE 256 Spring 2008 PowerPoint presentation | free to download - id: 15d6c8-ZDc1Z



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

Network Layer Overview ECE 256 Spring 2008

Description:

USA FedEx does not have international map, also no permission to operate outside ... Gets price quote from Germany FedEx, Japan FedEx etc. to route to India ... – PowerPoint PPT presentation

Number of Views:65
Avg rating:3.0/5.0
Slides: 94
Provided by: romitroyc6
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Network Layer Overview ECE 256 Spring 2008


1
Network Layer Overview ECE 256 Spring 2008
Romit Roy Choudhury Dept. of ECE and CS
2
Communication through Layers and Nodes
  • Transport segment from sending to receiving host
  • Segment encapsulated with header at each layer
  • Datagram routed through intermediate nodes
    (routers)
  • Segments do not reach higher layers at
    intermediate nodes
  • Segment reaches destination and passed to
    transport and application layer

3
Routing - Why Difficult ?
  • Several algorithmic problems
  • Many many paths - which is the best?
  • Each path has changing characteristics
  • Queuing time varies, losses happen, router down
  • How do you broadcast (find where someone is)
  • How do you multicast (webTV, conference call)
  • How do routers perform routing at GBbps scale
  • Several management problems
  • How do you detect/diagnose faults
  • How do you do pricing, accounting

4
Two types of Network Architecture
  • Connection-Oriented and Connection-Less

Virtual Circuit Switching ExampleATM,
X.25 Analogy Telephone
Datagram forwarding Example IP
networks Analogy Postal service
5
Interplay between routing and forwarding
6
Datagram Forwarding Table
4 billion possible entries
Destination Address Range
Link
Interface 11001000 00010111 00010000
00000000
through
0 11001000
00010111 00010111 11111111 11001000
00010111 00011000 00000000
through
1
11001000 00010111 00011000 11111111
11001000 00010111 00011001 00000000
through

2 11001000 00010111 00011111 11111111
otherwise

3
7
The Internet Network layer
  • Host, router network layer functions

Transport layer TCP, UDP
Network layer
Link layer
physical layer
8
IP Addressing introduction
223.1.1.1
  • IP address 32-bit identifier for host, router
    interface
  • interface connection between host/router and
    physical link
  • routers typically have multiple interfaces
  • host typically has one interface
  • IP addresses associated with each interface

223.1.2.9
223.1.1.4
223.1.1.3
223.1.1.1 11011111 00000001 00000001 00000001
223
1
1
1
9
Subnets
223.1.1.1
  • IP address
  • subnet part (high order bits)
  • host part (low order bits)
  • Whats a subnet ?
  • device interfaces with same subnet part of IP
    address
  • can physically reach each other without
    intervening router

223.1.2.1
223.1.1.2
223.1.2.9
223.1.1.4
223.1.2.2
223.1.1.3
223.1.3.27
subnet
223.1.3.2
223.1.3.1
network consisting of 3 subnets
10
Hierarchical addressing route aggregation
Hierarchical addressing allows efficient
advertisement of routing information
Organization 0
Organization 1
Send me anything with addresses beginning
200.23.16.0/20
Organization 2
Fly-By-Night-ISP
Internet
Organization 7
Send me anything with addresses beginning
199.31.0.0/16
ISPs-R-Us
11
Graph abstraction
Graph G (N,E) N set of routers u, v, w,
x, y, z E set of links (u,v), (u,x),
(v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z)
Remark Graph abstraction is useful in other
network contexts Example P2P, where N is set of
peers and E is set of TCP connections
12
Graph abstraction costs
What factors influence this cost ?
Should costs be only on links ?
Cost of path (x1, x2, x3,, xp) c(x1,x2)
c(x2,x3) c(xp-1,xp)
Question Whats the least-cost path between u
and z ?
Routing algorithm algorithm that finds
least-cost path
13
Routing Algorithm classification
  • 2 main classes
  • Centralized
  • all routers have complete topology, link cost
    info
  • link state algorithms
  • Distributed
  • Each router knows link costs to neighbor routers
    only
  • distance vector algorithms

14
A Link-State Routing Algorithm
  • Dijkstras algorithm
  • Link costs known to all nodes
  • computes least cost paths from one node
    (source) to all other nodes
  • gives forwarding table for that node
  • iterative after k iterations, know least cost
    path to k dest.s

15
Dijkstras Algorithm
  • Notation
  • c(x,y) link cost from node x to y 8 if not
    direct neighbors
  • D(v) current value of cost of path from source
    to dest. v

1 Initialization 2 N' u 3 for all
nodes v 4 if v adjacent to u 5
then D(v) c(u,v) 6 else D(v) 8 7 8
Loop 9 find w not in N' s.t. 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'
16
Dijkstras algorithm example (2)
Resulting shortest-path tree from u
Resulting forwarding table in u
17
Distributed Distance Vector
  • To find D, node S asks each neighbor X
  • How far X is from D
  • X says C(X,D)
  • Node S deduces C(S,D) C(S,X) C(X,D)
  • S chooses neighbor Xi that provides min C(S,D)
  • Later, Xj may find better route to D
  • Xj advertizes C(Xj,D)
  • All nodes update their cost to D if new min found

18
Distance Vector Algorithm
  • Bellman-Ford Equation (dynamic programming)
  • Define
  • dx(y) cost of least-cost path from x to y
  • Then
  • dx(y) min c(x,v) dv(y)
  • where min is taken over all neighbors v of x

v1
y
x
v2
v
19
Bellman-Ford example
Clearly, dv(z) 5, dx(z) 3, dw(z) 3
B-F equation says
du(z) min c(u,v) dv(z),
c(u,x) dx(z), c(u,w)
dw(z) min 2 5,
1 3, 5 3 4
Node that achieves minimum is next hop in
shortest path ? forwarding table
20
Distance Vector link cost changes
  • Link cost changes
  • if DV changes, notify neighbors

At time t0, y detects the link-cost change,
updates its DV, and informs its neighbors. At
time t1, z receives the update from y and updates
its table. It computes a new least cost to x
and sends its neighbors its DV. At time t2, y
receives zs update and updates its distance
table. ys least costs do not change and hence y
does not send any message to z.
When can it get complicated ?
21
Distance Vector link cost changes
  • Link cost changes
  • Y thinks Zs best cost is 5
  • Thus C(y,x) 5 1 6
  • Announces this cost
  • Z thinks C(z,x) 6 1
  • Poissoned reverse
  • If Z routes through Y to get to X
  • Z tells Y its (Zs) distance to X is infinite (so
    Y wont route to X via Z)
  • will this completely solve count to infinity
    problem?

Food for thought Will this converge ? If so,
after how many rounds ? How can this be
solved? Should Y announce change from 4 to 60?
22
Routing in Internet
  • Similar to international FedEx routing
  • FedEx figures out best route within country
  • Uses google maps say
  • This is link state -- All info available
  • USA FedEx does not have international map, also
    no permission to operate outside USA
  • Gets price quote from Germany FedEx, Japan FedEx
    etc. to route to India
  • Chooses minimum price and handles package to say
    Germany (Distance Vector)
  • Germany has country map (link state)
  • Germany asks for cost from Egypt, South Africa

23
Internet Routing
  • Think of each country FedEx as ISPs
  • Routing on internet very similar to prior example
  • The link state and DV routing protocols used in
    internet routing
  • RIP (routing information protocol)
  • OSPF (Open shortest path first)
  • BGP (Border gateway protocol)
  • They utilize the concepts of
  • Link state
  • Distance vector routing

24
How is this different in wireless?
25
Routing in wireless Mobile Networks
  • Imagine hundreds of hosts moving
  • Routing algorithm needs to cope up with varying
    wireless channel and node mobility

Wheres RED guy
26
  • Questions ?

27
Networking Primer - Transport Layer ECE 256
Spring 2008
Romit Roy Choudhury Dept. of ECE and CS
28
Recall 1 PHY and MAC
MAC
MAC
PHY
PHY
  • Spread Spectrum radios (DS and FH)
  • RTS/CTS and Carrier Sensing for Hidden Terminals
  • Directional antennas to reduce interference
  • Rate control to extract max capacity from
    available SINR
  • Power control for spatial reuse energy savings
    topology control
  • TDMA scheduling, multi-channel use, encryption
    security
  • and many more

29
Recall 2 Network Layer
  • The first view of the network
  • Coping up with (uncontrolled) user mobility
  • Flooding the network reactively, or proactive
    updation
  • Mobile IP, coping with handoffs, etc.
  • Ad hoc routing discovery, optimal metric,
    maintenance, caching
  • Secure routing Routes bypassing malicious nodes

30
We have a route, now what ?
Data
NETWORK
Data
Data
Need to ensure that packets are actually going
through
31
  • Why need additional layer for that?
  • Why not ensure that over MAC/Routing?

32
Some transmission methods
  • Stop Wait
  • Pipelined
  • Go Back N
  • Selective Repeat

33
Stop-and-wait operation
sender
receiver
first packet bit transmitted, t 0
last packet bit transmitted, t L / R
first packet bit arrives
RTT
last packet bit arrives, send ACK
ACK arrives, send next packet, t RTT L / R
34
Pipelined protocols
  • Pipelining sender allows multiple, in-flight,
    yet-to-be-acknowledged pkts
  • range of sequence numbers must be increased
  • buffering at sender and/or receiver
  • Two generic forms of pipelined protocols
    go-Back-N, selective repeat

35
Pipelining increased utilization
sender
receiver
first packet bit transmitted, t 0
last bit transmitted, t L / R
first packet bit arrives
RTT
last packet bit arrives, send ACK
last bit of 2nd packet arrives, send ACK
last bit of 3rd packet arrives, send ACK
ACK arrives, send next packet, t RTT L / R
Increase utilization by a factor of 3!
36
Go-Back-N
  • Sender
  • k-bit seq in pkt header
  • window of up to N, consecutive unacked pkts
    allowed
  • ACK(n) ACKs all pkts up to, including seq n -
    cumulative ACK
  • may receive duplicate ACKs (see receiver)
  • timer for each in-flight pkt
  • timeout(n) retransmit pkt n and all higher seq
    pkts in window

37
GBN in action
38
Selective Repeat
  • receiver individually acknowledges all correctly
    received pkts
  • buffers pkts, as needed, for eventual in-order
    delivery to upper layer
  • sender only resends pkts for which ACK not
    received
  • sender timer for each unACKed pkt
  • sender window
  • N consecutive seq s
  • again limits seq s of sent, unACKed pkts

39
Selective repeat sender, receiver windows
40
Selective repeat in action
41
Ok, now we know how to ensure reliable
transmission end to end
  • But is that enough?

42
More Questions
  • At what rate should we transmit?
  • Is that rate time/traffic independent?
  • Is that rate receiver independent?

43
TCP Connection-Oriented Transport
  • TCP has 3 main components
  • Reliable transmission
  • Congestion Control
  • Flow Control

44
The TCP Intuition
Pour water
Collect water
45
The Control Problem
  • Two main components in TCP
  • Flow Control and Congestion Control
  • Flow Control
  • If receivers bucket filling up, pour less water
  • Congestion Control
  • Dont pour too much if there are leaks in
    intermediate pipes
  • Regulate your flow based on how much is leaking
    out
  • Aggressive pouring ? calls for retransmission of
    lost packets
  • Conservative pouring ? lower e2e capacity
  • Challenge At what rate(t) should you pour ?

Why ?
46
The TCP Protocol (in a nutshell)
  • T transmits few packets, waits for ACK
  • Called slow start
  • R acknowledges all packet till seq i by ACK i
    (optimizations possible)
  • ACK sent out only on receiving a packet
  • Can be Duplicate ACK if expected packet not
    received
  • ACK reaches T ? indicator of more capacity
  • T transmits larger burst of packets (self
    clocking) so on
  • Burst size increased until packet drops (i.e.,
    DupACK)
  • When T gets DupACK or waits for longer than RTO
  • Assumes congestion ? reduces burst size
    (congestion window)

47
TCP Timeline
Host A
Host B
Think of a blind person trying to stand up in a
low ceiling room Objective Dont bang
your head, but stand up quickly
one segment
RTT
two segments
four segments
48
When waited for gt RTO
After RTO timeout
cwnd 20
ssthresh 10
ssthresh 8
49
The TCP Protocol (in a nutshell)
  • DupACK not necessarily indicator of congestion
  • Can happen due to out of order (OOO) delivery of
    packets
  • If 3 OOO pkts, then CW need not be cut
    drastically
  • The DupACK packet retransmitted
  • Continue with same pace of transmission as before
  • (fast recovery)
  • R advertizes its receiver window in ACKs
  • If filling up, T reduces congestion window

Why ?
50
Fast Recovery on 3 OOO DupACKs
After fast recovery
Receivers advertized window
51
Timeout -- function of RTT
  • Q how to estimate RTT?
  • SampleRTT measured time from segment
    transmission until ACK receipt
  • SampleRTT will vary, want estimated RTT
    smoother
  • average several recent measurements, not just
    current SampleRTT
  • Q how to set TCP timeout value?
  • longer than RTT
  • but RTT varies
  • too short premature timeout
  • unnecessary retransmissions
  • too long slow reaction to segment loss

52
TCP Round Trip Time and Timeout
EstimatedRTT (1- ?)EstimatedRTT ?SampleRTT
  • Exponential weighted moving average
  • influence of past sample decreases exponentially
    fast
  • typical value ? 0.125

53
Example RTT estimation
54
TCP Round Trip Time and Timeout
  • Setting the timeout
  • EstimtedRTT plus safety margin
  • large variation in EstimatedRTT -gt larger safety
    margin
  • first estimate of how much SampleRTT deviates
    from EstimatedRTT

DevRTT (1-?)DevRTT
?SampleRTT-EstimatedRTT (typically, ? 0.25)
Then set timeout interval
TimeoutInterval EstimatedRTT 4DevRTT
55
When waited for gt RTO
After RTO timeout
cwnd 20
ssthresh 10
ssthresh 8
double CongWin every RTT done by incrementing
CongWin for every ACK received
56
The TCP Protocol (in a nutshell)
  • DupACK not necessarily indicator of congestion
  • Can happen due to out of order (OOO) delivery of
    packets
  • If 3 OOO pkts, then CW need not be cut
    drastically
  • The DupACK packet retransmitted
  • Continue with same pace of transmission as before
  • (fast recovery)
  • R advertizes its receiver window in ACKs
  • If filling up, T reduces congestion window

Why ?
57
Fast Recovery on 3 OOO DupACKs
After fast recovery
Receivers advertized window
58
Why is TCP fair?
  • Two competing sessions
  • Additive increase gives slope of 1, as throughout
    increases
  • multiplicative decrease decreases throughput
    proportionally

R
equal bandwidth share
loss decrease window by factor of 2
congestion avoidance additive increase
Connection 2 throughput
loss decrease window by factor of 2
congestion avoidance additive increase
Connection 1 throughput
R
59
TCP Flow Control
  • Problem Definition
  • The receiver has limits on buffer
  • If many nodes transmitting to same receiver
  • Losses may happen at receiver
  • Need to avoid such losses
  • Solution
  • Receiver tells transmitter how much space left
  • Transmitter chooses its congestion window
    accordingly

60
TCP Flow control how it works
  • Rcvr advertises spare room by including value of
    RcvWindow in segments
  • Sender limits unACKed data to RcvWindow
  • guarantees receive buffer doesnt overflow
  • (Suppose TCP receiver discards out-of-order
    segments)
  • spare room in buffer
  • RcvWindow
  • RcvBuffer-LastByteRcvd - LastByteRead

61
  • If all that did not make sense,
  • or too heavy for total recall,
  • then here is a visual example
  • Thanks to Nitin Vaidya for tutorial slides
  • (Highly recommended for those interested in TCP)

62
Cumulative Acknowledgements
  • A new cumulative acknowledgement is generated
    only on receipt of a new in-sequence packet

40
39
37
38
35
33
36
34
41
40
38
39
35
37
36
34
i
data
ack
i
63
Delayed Acknowledgements
  • An ack is delayed until
  • another packet is received, or
  • delayed ack timer expires (200 ms typical)
  • Reduces ack traffic

New ack not produced on receipt of packet 36, but
on receipt of 37
40
39
37
38
35
33
41
40
38
39
35
37
64
Duplicate Acknowledgements
  • A dupack is generated whenever an
  • out-of-order segment arrives at the receiver

65
Duplicate Acknowledgements
  • Duplicate acks are not delayed
  • Duplicate acks may be generated when
  • a packet is lost, or
  • a packet is delivered out-of-order (OOO)

40
39
38
37
36
34
41
40
37
39
36
36
Dupack
On receipt of 38
66
Number of dupacks depends on how much OOO a
packet is
40
39
38
37
36
34
New Ack
New Ack
41
40
37
39
36
36
34
Dupack
New Ack
New Ack
42
41
39
40
36
36
38
New Ack
Dupack
New Ack
67
  • Several flavors of TCP combines options /
    optimizations
  • Reno, Vegas, Eifel, Westwood
  • Overall TCP has worked well proven on the
    internet
  • Then why study it again
  • for wireless networks ?

68
Why is it different in Wireless?
69
  • Questions?

70
Reliable Transmission
  • TCP is connection-oriented
  • Sender sends control packets (SYN) and receiver
    replies (ACK)
  • Receiver also opens a similar connection
  • Sender sends a small burst of packets
  • Receiver ACKs ACK contains the next expected
    packet (actually byte)
  • Sender receives ACK, and sends a bigger burst
  • Called Self-clocking behavior

71
TCP seq. s and ACKs
  • Seq. s
  • byte stream number of first byte in segments
    data
  • ACKs
  • seq of next byte expected from other side
  • cumulative ACK
  • Q how receiver handles out-of-order segments
  • A TCP spec doesnt say, - up to implementor

Host B
Host A
User types C
Seq42, ACK79, data C
host ACKs receipt of C, echoes back C
Seq79, ACK43, data C
host ACKs receipt of echoed C
Seq43, ACK80
simple telnet scenario
72
Reliable Transmission
  • If train of packets lost
  • Sender will not get any ACKs
  • Will timeout (gets alarmed)
  • Retransmit from first un-ACK-ed packet,
  • Drastically reduces window size
  • If packet n lost, but (n1) successful
  • Receiver will send Duplicate ACK
  • If many DupACKs, then receiver not alarmed
  • Resends (n1)
  • Cuts window size by half

73
TCP Connection Management (cont.)
  • After session over,
  • Both sender and receiver exchange control signals
    to terminate the connection

74
Congstion Control
75
TCP Congestion Control
  • Problem Definition
  • How much data should I pump into the network to
    ensure
  • Intermediate router queues not filling up
  • Fairness achieved among multiple TCP flows
  • Why is this problem difficult?
  • TCP cannot have information about the network
  • Only TCP receiver can give some feedbacks

76
The TCP Intuition
Pour water
Collect water
77
The TCP Protocol (in a nutshell)
  • T transmits few packets, waits for ACK
  • Called slow start
  • R acknowledges all packet till seq i by ACK i
    (optimizations possible)
  • ACK sent out only on receiving a packet
  • Can be Duplicate ACK if expected packet not
    received
  • ACK reaches T ? indicator of more capacity
  • T transmits larger burst of packets (self
    clocking) so on
  • Burst size increased until packet drops (i.e.,
    DupACK)
  • When T gets DupACK or waits for longer than RTO
  • Assumes congestion ? reduces burst size
    (congestion window)

78
TCP Timeline
Host A
Host B
Think of a blind person trying to stand up in a
low ceiling room Objective Dont bang
your head, but stand up quickly
one segment
RTT
two segments
four segments
79
Timeout -- function of RTT
  • Q how to estimate RTT?
  • SampleRTT measured time from segment
    transmission until ACK receipt
  • SampleRTT will vary, want estimated RTT
    smoother
  • average several recent measurements, not just
    current SampleRTT
  • Q how to set TCP timeout value?
  • longer than RTT
  • but RTT varies
  • too short premature timeout
  • unnecessary retransmissions
  • too long slow reaction to segment loss

80
TCP Round Trip Time and Timeout
EstimatedRTT (1- ?)EstimatedRTT ?SampleRTT
  • Exponential weighted moving average
  • influence of past sample decreases exponentially
    fast
  • typical value ? 0.125

81
Example RTT estimation
82
TCP Round Trip Time and Timeout
  • Setting the timeout
  • EstimtedRTT plus safety margin
  • large variation in EstimatedRTT -gt larger safety
    margin
  • first estimate of how much SampleRTT deviates
    from EstimatedRTT

DevRTT (1-?)DevRTT
?SampleRTT-EstimatedRTT (typically, ? 0.25)
Then set timeout interval
TimeoutInterval EstimatedRTT 4DevRTT
83
When waited for gt RTO
After RTO timeout
cwnd 20
ssthresh 10
ssthresh 8
double CongWin every RTT done by incrementing
CongWin for every ACK received
84
The TCP Protocol (in a nutshell)
  • DupACK not necessarily indicator of congestion
  • Can happen due to out of order (OOO) delivery of
    packets
  • If 3 OOO pkts, then CW need not be cut
    drastically
  • The DupACK packet retransmitted
  • Continue with same pace of transmission as before
  • (fast recovery)
  • R advertizes its receiver window in ACKs
  • If filling up, T reduces congestion window

Why ?
85
Fast Recovery on 3 OOO DupACKs
After fast recovery
Receivers advertized window
86
Why is TCP fair?
  • Two competing sessions
  • Additive increase gives slope of 1, as throughout
    increases
  • multiplicative decrease decreases throughput
    proportionally

R
equal bandwidth share
loss decrease window by factor of 2
congestion avoidance additive increase
Connection 2 throughput
loss decrease window by factor of 2
congestion avoidance additive increase
Connection 1 throughput
R
87
TCP Flow Control
  • Problem Definition
  • The receiver has limits on buffer
  • If many nodes transmitting to same receiver
  • Losses may happen at receiver
  • Need to avoid such losses
  • Solution
  • Receiver tells transmitter how much space left
  • Transmitter chooses its congestion window
    accordingly

88
TCP Flow control how it works
  • Rcvr advertises spare room by including value of
    RcvWindow in segments
  • Sender limits unACKed data to RcvWindow
  • guarantees receive buffer doesnt overflow
  • (Suppose TCP receiver discards out-of-order
    segments)
  • spare room in buffer
  • RcvWindow
  • RcvBuffer-LastByteRcvd - LastByteRead

89
Announcements
  • Reviews
  • Please send as plain text in email
  • No other data in the review email
  • Class ppt
  • Almost filling up
  • I need to create some more openings
  • Will discuss this next week

90
Transport services and protocols
  • logical communication between processes
  • transport protocols run in end systems
  • breaks app messages into segments
  • reassembles segments into messages, passes to
    app layer
  • more than one transport protocol available to
    apps
  • Internet TCP and UDP

91
TCP, UDP transport-layer protocols
  • reliable, in-order delivery (TCP)
  • congestion control
  • flow control
  • connection setup
  • unreliable, unordered delivery UDP
  • no-frills extension of best-effort IP
  • services not available
  • delay guarantees
  • bandwidth guarantees

92
Agenda
  • Transport Layer
  • Multiplexing / Demultiplexing
  • Reliable Transport
  • Stop-and-wait
  • Pipelined
  • Go back N
  • Selective Request
  • TCP
  • Congestion Control
  • Flow Control

93
Need for Transport Layer
  • Network Layer offers connections
  • Connections not reliable
  • Losses, delays due to out-of-order, queue
    overflow,
  • Transport Layer performs
  • End to end reliability
  • Segmentation / Desegmentation (of app data)
  • Error recovery
  • Advanced operations
  • Congestion control
  • Flow control
About PowerShow.com