Download TCP Performance Issues in Ad Hoc Networks

Document related concepts

Network tap wikipedia , lookup

Distributed firewall wikipedia , lookup

Policies promoting wireless broadband in the United States wikipedia , lookup

Peering wikipedia , lookup

Zero-configuration networking wikipedia , lookup

RapidIO wikipedia , lookup

IEEE 802.1aq wikipedia , lookup

Asynchronous Transfer Mode wikipedia , lookup

Multiprotocol Label Switching wikipedia , lookup

Wake-on-LAN wikipedia , lookup

Computer network wikipedia , lookup

Wireless security wikipedia , lookup

Airborne Networking wikipedia , lookup

Deep packet inspection wikipedia , lookup

List of wireless community networks by region wikipedia , lookup

Piggybacking (Internet access) wikipedia , lookup

IEEE 1355 wikipedia , lookup

Routing in delay-tolerant networking wikipedia , lookup

Internet protocol suite wikipedia , lookup

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

TCP congestion control wikipedia , lookup

Transcript
CCM 4300 Lecture 6
Computer Networks: Wireless
and Mobile Communication
Systems
Dr E. Ever
School of Computing Science
Lesson objectives
• To acquire a basic understanding of performance issues of
TCP with wireless communication systems
-
to investigate enhancement schemes.
- explore the architecture of such technologies
- identify some of the advantages and disadvantages of using these
technologies.
•Understand TCP performance issues for Mobile Ad Hoc
Networks
- to investigate routing protocols in ad-hoc networks
TCP performance over wireless and mobile
networks
 Motivation
 TCP-mechanisms
 Slow start
 Congestion Control
 Classical approaches




Indirect TCP
Snooping TCP
Mobile TCP
SACK
 Additional
optimizations
 Fast handoffs
 Selective retransmission
 Hop-by-hop rate control
Typical mobile wireless scenario



FH: Fixed Host
MH: Mobile Host
BS: Base Station (gateway)
ACK lost
Timeout
Timeout
Timeout
Timeout
Timeout
Time
Timeout
Recovering from Error
Packet lost
Early timeout
DUPLICATE
PACKETS!!!
Sliding Windows
•The window size advertised by the receiver
•Tells the sender how much data, can be sent without waiting for
further acknowledgements.
6
Go-Back-N in Action
Don’t wait for an acknowledgement of each packet
Selective Repeat
Slow Start and Congestion Control
•When a TCP connection first begins, the Slow Start algorithm initializes a
congestion window to one segment.
•Congestion window doubles up to the maximum window size advertised by
the receiver.
•The sender can transmit the minimum of the congestion window and the
advertised window of the receiver.
•In the Congestion Avoidance algorithm a retransmission timer expiring or the
reception of duplicate ACKs (transmission window to one half of the current
window size).
•If congestion was indicated by a timeout (or three or more duplicate ACKs
are received), the congestion window is reset to one segment
9
After timeout
25
20
cwnd = 20
15
10
5
25
22
20
15
12
9
3
6
ssthresh = 8
0
0
Congestion window (segments)
Typical TCP behaviour
Time (round trips)
What is the case in your lab experiment?
(Time vs Sequence number)
Motivation I
 Transport protocols typically designed for
 Fixed end-systems
 Fixed, wired networks
 Research activities
 Performance
 Congestion control
 Efficient retransmissions
 TCP congestion control
 packet loss in fixed networks typically due to (temporary)
overload situations
 router have to discard packets as soon as the buffers are
full
 TCP recognizes congestion only indirectly via missing
acknowledgements, retransmissions unwise, they would
only contribute to the congestion and make it even worse
 slow-start algorithm as reaction
11
TCP Problems in wireless links
In Wire network: Packet Loss Congestion
In Mobile Networks: Packet Loss disconnections,
handoffs,
high bit error rates

TCP was designed to work well in networks with low
channel error rates, however Wireless links can
exhibit high & variable error rates due to attenuation,
fading, or interfering active radiation sources.

TCP has no means of detecting the nature of the
error, so losses due to channel errors also get treated
as congestion losses
TCP Performance Issues (Slow start)

Slow-start is used in conjunction with other algorithms to avoid sending more
data than the network is capable of transmitting
 Inappropriate reduction of congestion window
TCP backs off upon detection of packet loss
 Slow-start assumes that unacknowledged segments are due to
network congestion. While this is an acceptable assumption for many
networks, segments may be lost for other reasons, such as poor data
link layer transmission quality. Thus, slow-start can perform poorly in
situations with poor reception, such as wireless networks.
 Severe degradation in TCP throughput
TCP Congestion Control
Ehsan Hamadani (2004)
CWND
Three or more duplicates
Or
Time out
Congestion Avoidance
Packet
loss
Congestion Avoidance
Congestion Avoidance
Slow Start
halved
Congestion Avoidance
t
Congestion window size (CWND) limits the rate at which sender can send data traffic, in
order to avoid congestion situation in network.
congestion window is smaller when congestion is larger and vice versa
TCP Performance Issues (Cont.)
 Throughput loss
 WLAN
Frame Error Rate (FER)
 Cellular Communications systems
Increased processing delay due to interleaving
Widely varying RTT (round trip time)
Disruptions caused by link resets
suffer from severe error rates, due to external
interference
Interleaving (Bursty errors)
Error-free code words:
aaaabbbbccccddddeeeeffffgggg
Interleaved: abcdefgabcdefgabcdefgabcdefg
Transmission with a burst error:
abcdefgabcd____bcdefgabcdefg
Received code words after deinterleaving:
aa_abbbbccccdddde_eef_ffg_gg
Link Layer mechanisms


Forward Error Correction (FEC)
 Can be use to correct small number of errors
 Incurs overhead even when errors do not occur
 GSM uses block coding (40 bits redundancy),
Convolutional coding (various rates 1/2, 1/3 and 1/6 as
well as 244/456)
Link Level Retransmissions
 Retransmit a packet at the link layer, if errors are
detected
 Retransmission overhead incurred only if errors occur
TCP Enhancement Schemes
 Indirect TCP or I-TCP (Split TCP)
 Segments the connection
 No changes to the TCP protocol for hosts connected to the wired
Internet, millions of computers use (variants of) this protocol
 Optimized TCP protocol for mobile hosts
 Splitting of the TCP connection at, e.g., the foreign agent into 2
TCP connections, no real end-to-end connection any longer
 Hosts in the fixed part of the net do not notice the characteristics
of the wireless part
MSR – Mobility Source Router/ Base Station
mobile host
access point
(foreign agent)
wired Internet
standard TCP
wireless TCP
access point1
socket migration
and state transfer
Internet
access point2
mobile host
19
Indirect TCP operates in Transport layer
Ajay V. Bakre, B.R. Badrinath, “Implementation
and Performance Evaluation of Indirect TCP” ,
IEEE Transactions on Computers
20
Split Connection


1)
2)
Wireless related problems are isolated from the
existing network protocols.
Splitting the TCP connection into 2 independent
flow control between the mobile host and the
fixed host into two separate connections:
Wired connection between the fixed host and
the base station
Wireless connection between the base station
and the mobile host.
Fixed Host
BS
Mobile Host
Split Connection
Ajay V. Bakre, B.R. Badrinath, “Implementation and Performance
Evaluation of Indirect TCP” , IEEE Transactions on Computers
TCP Enhancement Schemes (Snooping)

Snooping TCP at BS
 Better than split TCP
 Confine retransmission to wireless paths only
 Foreign agent sits between fixed network and mobile network
 No need to modify fixed network
TCP connection
application
application
application
transport
transport
transport
network
network
network
link
link
link
physical
physical
physical
FH
BS
wireless
MH
Snooping TCP (cont)
 ”Transparent“ extension of TCP within the foreign agent
 buffering of packets sent to the mobile host
 lost packets on the wireless link (both directions!) will be
retransmitted immediately by the mobile host or foreign agent,
respectively (so called “local” retransmission)
 the foreign agent therefore “snoops” the packet flow and recognises
acknowledgements in both directions, it also filters ACKs
 It uses NACK to prompt retransmission
 changes of TCP only within the foreign agent
local retransmission
correspondent
host
foreign
agent
“ wired ” Internet
mobile
host
snooping of ACKs
buffering of data
end-to-end TCP connection
24
Snoop Protocol(2)


In the snoop protocol the base station monitors communication across the
connection in either direction and caches packets.
A packet loss is detected by the arrival of a small number of duplicate
acknowledgements from the receiver or by local timeout at the base
station.
Basic operation at BS:

Data from MH -> FH
Detect missing packets
Perform negative acknowledgements

Data from FH -> MH
Cache unacknowledged TCP data
Perform local retransmissions
MH
BS
FH
Performance – Effect of Bit Errors
Hari Balakrishnan, Venkata N. Padmanabhan, Srinivasan Seshan and Randy H.Katz, “A
Comparison of Mechanisms for Improving TCP Performance over Wireless Links”,
26
M-TCP



Special handling of lengthy and/or frequent disconnections
M-TCP splits as I-TCP does
 unmodified TCP fixed network to supervisory host (SH)
 optimized TCP SH to MH
Supervisory host
 no caching, no retransmission
 monitors all packets, if disconnection detected
 BS does not send an ack to FH, unless BS has received an ack from MH (maintains
end-to-end semantics)
 BS withholds ack for the last byte ack’d by MH. When BS does not receive ACK for
sometime, it chokes sender by setting advertise window to 0
Ack 999
FH
Ack 1000
BS
MH
M-TCP (2)




When a new ack is received with receiver’s advertised
window = 0, the sender enters persist mode
Sender does not send any data in persist mode
except when persist timer goes off
When a positive window advertisement is received,
sender exits persist mode
On exiting persist mode, cwnd are same as before the
persist mode.
Some other well known TCP Enhancement Schemes
 Notifying the causes of packet loss
 Explicit Loss Notification (ELN)
 Works well together with Snoop TCP
 Adding selective ACK to TCP
 SACK
 Combat multiple losses in one RTT
 Data receiver can inform the sender about all
segments that have arrived successfully, so the
sender need retransmit only the segments that have
actually been lost.
 SACK
 Combat multiple losses in one RTT
Comparison

Things need to consider when assessing TCP enhancement schemes
 End-to-end semantics (e.g. In I-TCP because the connection is split,
separate acknowledgements are generated )
 IP payload access
 Wireless gateway overhead
 Ease of deployment
Additional Approaches to Improve TCP Performance
 Fast hand-offs
The last packets before the handoff are
available with new BS as well.
HA uses multicast address to forward packets
Packets are automatically forwarded to BS
The new BS joins the multicast group before
hand-off occurs
The new BS buffers last few packets
The new BS starts forwarding the buffered
packets to the mobile host after hand-off
31
TCP/IP over Heterogeneous Wireless Sys.

Challenges




Multiple systems co-exist
Direct interoperability between different wireless
systems
Hierarchical cellular systems
Research projects



Multi-Service Link Layer (MSLL)
Wireless Internet Network (WINE)
Wireless Adaptation Layer (WAL)
Characteristics of Mobile Networks
 Cellular networks
Base station (BS) arbitrates channel allocation
Mobile hosts communicate with each other via
BSs
 Ad hoc networks
No BS
All mobile hosts act as routers
33
Mobile Ad hoc networks
Standard
Mobile IP needs an infrastructure
Home Agent/Foreign Agent
DNS,
routing etc. are not designed for mobility
Sometimes
remote
cost
in the fixed network
there is no infrastructure!
areas, ad-hoc meetings, disaster areas
can also be an argument against an infrastructure!
routing
no
default router available
every
node should be able to forward
34
Cellular vs Ad-hoc Networks
35
•IP
packets toofa Mobility
mobile node on
thatTCP
is outside
its home
Impacts
Performance
network are routed through the home agent.
 Blackouts
•Packets
from the mobile node to the correspondent nodes
 Location
are routed
directly (triangle routing)
 Fading
 Degrade TCP throughput
 Handoff latency
 Packet re-routing
 Bursty losses
 Degrade TCP throughput
 Triangular routing and large RTT
 Triangular causes extra delay
 TCP throughput inversely proportional to RTT
 Large RTT results in lesser throughput
36
Implications of using Normal TCP over Ad-Hoc Wireless N/W
• TCP does not distinguish between congestion and packet loss
due to transmission errors and route failures
• This inability results in performance degradation in ad hoc
networks
•Route re-computation takes a finite amount of time
• During this time no packet can reach the destination
through the existing route
• Packets and ACKs may get queued and possibly dropped
• In turn leads to timeouts at the source, which is
misinterpreted as congestion
37
Recall ….
Different approaches to improve the performance of TCP
over Ad-Hoc Networks
• in wireless networks we have:
– I-TCP
– Snoop TCP
– M-TCP
– SACK
• Ad hoc networks
– TCP-F
– ELFN
– ATCP
38
TCP Performance Issues in Ad Hoc NW
 Route failure
TCP may lose a congestion window of packets
Large RTT variation
Degrade TCP throughput
 Route Re-computation
Incur extra delay
Result in a more inflated re-transmission timeout
39
TCP Performance Issues in Ad Hoc Networks
 Network Partition
TCP may reset the connection if the
partition lasts for more than 100 sec.
TCP enters slow-start phase after cutting
down its window size to 1
Degrade TCP throughput
40
Impact of Multi-Hop Wireless Paths
1600
1400
1200
1000
800
600
400
200
0
TCP Throughtput
(Kbps)
1 2 3 4 5 6 7 8 9 10
Number of hops
TCP Throughput using 2 Mbps 802.11 MAC
Nael B. Abu-Ghazaleh , ” tcp over wireless”
Approaches for Improvement
 TCP-feedback and TCP-ELFN
Employ Explicit Link Failure Notification (ELFN)
A source node issues a route re-computation
request upon receipt of an ELFN
Reset TCP congestion window size to half its size
(instead of 1)
42
Approaches for Improvement (Cont.)
 Hop-by-hop rate control
Each router (mobile host) performs rate
control on each of its outgoing links based
on feedback from downstream routers
Feedback time is minimal
More responsive to route failures
43
ATCP – TCP for Mobile Ad Hoc Networks
•Thin layer between TCP and IP
• Treats loss due to congestion and medium differently
(notifications, network feedback)
• Functions efficiently even with high bit error rates
• Handles network partition gracefully
• Maintains end-to-end TCP semantics!
44
Modes of operation
• ATCP
– Normal
– Congested
– Loss
– Disconnected
• TCP
– Depending on it’s mode of operation ATCP sets
TCP in one of the following modes
• Normal
• Congested
• Persist
45
Ad Hoc Networks
Key question:
How do we provide connectivity between different
mobile wireless technologies in a mobile Ad-hoc
network (MANET)?
An Ad-Hoc network is defined as: Dynamically formed
mobile nodes, no central manager, no fixed topology,
and nodes can act as routers.
46
Connectivity – how to achieve it?
• “Mostly “Wireless:
• Router to wired network
• Mobile ad-hoc networks:
• MANET
• Examples
– Example 1
– cell 1 hosts use IEEE802.11 ….
– cell 2 hosts use Bluetooth
– host with one interface of each type acts as router
– Example 2
– some hosts in cell 1
– some hosts in cell 2
– cell-cell distance > Tx range
– host in cell 1 and cell 2 acts as router between cells
47
Routing in Ad hoc networks
Proactive:
Reactive:
“Normal”
routing
Create
routing tables
periodically:
oRoute
ready when
required
oComputation
oRouting
Topology
frequent
oDue
overhead
updates
changes may be
to mobility
Build
routes on demand
Need
to build routes
oRouting
information
evaluated only when needed
olatency
(due to path search)
oDiscover
route and
destination
Topology
frequent
oHow
fly
changes may be
to re-evaluate on the
oWhat
if flow is in progress
48
Reactive routing
Router
End system
•Route Discovery:
•Find path to destination
• define protocols for requests and responses
•Report reachability / nonreachability
•Data forwarding (routing):
•Forwarding Mechanism
•Depending on the algorithm
• Information (state) needed in routers
• Information (state) needed in packets
49
Reactive routing ….. Cont….
•Route Maintenance:
•Dealing with forwarding path outages (e.g. link breaks,
next hop “disappears”)
• Recovery procedures for finding alternative routes
•Signalling/reporting mechanisms
•State information in network:
•Hold in network (routers),
•What if router losses connectivity?
•Possible to keep information in the packets
50
Reactive routing … cont….
•State information in packets:
•Hold in packet header
•Waste of wireless capacity
•Complexity of algorithm
•Computational cost
•Energy/power expenditure
•Timeliness of routing update:
•Route maintenance
•Periodic probes may waste resources (similar to proactive)
•Use layer1 and 2 connectivity information to see if
forwarding path still up
•Scalability(?)
•Small network …. OK … but … what about large networks?
51
Mobile Ad hoc networks
Mobile
Router
Manet
Mobile
Devices
Mobile IP,
DHCP
Fixed
Network
Router
End system
52
Routing examples for ad-hoc networks
N1
N1
N2
N3
N4
N4
N5
time = t1
N3
N2
good link
weak link
N5
time = t2
•Asymmetric links
•Redundant links
•Interference
•Dynamic topology
53
Dynamic Source Routing…. DSR
•Split
routing into discovering a path and maintaining a path,
Discover a path
only
if a path for sending packets to a certain
destination is needed and no path is currently
available
Maintaining a path
only
while the path is in use one has to make sure
that it can be used continuously
No periodic updates needed!
54
Discover a path (A-G)
B
A-B-D-G
A-B-D-G
A-B
A
A-B-D-G
A-B-D
D
A
G
A-C-E
A
H
E
A-C-E
A-C-E
C
A-C
F
55
Maintain a path (A-G)
B
RERR
RERR
G
D
G
A
Route Cache (A)
G: A, B, D, G
H
E
G: A, C, E, H, G
F: B, C, F
C
F
56
Dynamic Source Routing (DSR)
•Route for packet:
•list of IP addresses (hops) in IP header (option header)
•Route discovery
•Source Broadcasts
•ROUTE_REQ with destination address and ID number,
i.e., id = 45, Target = G (Slide 55)
•At intermediate node:
•check ID for duplicates (if same request, discard)
•if route unknown, add your address to packet header and
flood
•if route to destination known, send ROUTE_REPLY back
to source
57
DSR ….. Cont…..
•At destination:
•send ROUTE_REPLY, containing all address in
ROUTE_REQ, back to source
•backward learn
•At source:
•check ID number for duplicates
•add route to route cache
58
source broadcasts a packet containing address of source and destination
source
(1,4)
1
4
The destination sends a reply packet to source.
8 destination
(1,3)
3
(1,2)
2
7
(1,4,7)
The node discards the packets having been seen
5
(1,3,5)
6
(1,3,5,6)
The route looks up its route caches to look for a route to destination
If not find, appends its address into the packet
59
DSR … continues …
•Data forwarding:
•source puts route (list of IP addresses – hops –
to destination) from route cache in IP header
•Intermediate hops forward to next IP address in list
and forwards
•Route maintenance:
•upstream hop should monitor transmission from
downstream hop to see if downstream is “alive”
60
DSR .. Continues …
•error message generated giving information about
break in route
•source restarts route discovery for destination
•Simple
•Only useful for small networks:
•Only need to use it for small networks
•Inefficient (too complicated)
61
Ad hoc On demand distance vector routing: AODV
Distance Vector routing:
•(hop count) on demand evaluation
•Route Discovery
•source broadcasts –
•ROUTE_REQ:
•destination sequence number (DSN) used to
detect old routs
•Intermediate node:
•sends ROUTE_REPLY if it knows route to
destination and has a “newer” DSN for that route
62
AODV ….. Continues
•Destination:
•sends ROUTE_REPLY
Data forwarding
•Next hop forwarding:
•routing tables kept by all nodes
Route Maintenance
•HELLO packets:
•broadcast periodically by all nodes – “heart beat”
•If link is dead, ROUTE-REPLY using poisoned reverse
for all routes that use that link
63
AODV …. Continues
•Use of poisoned reverse: a route is no longer reachable
and should be removed from their routing tables
•avoids count-to-infinity
•Use of DSN:
•avoids looping
•DSN associated with each routing table entry
•DSN incremented on new route discovery
64
AODV – the benefits
•No need for multiple route discovery:
•Routers established some state from HELLO
packets
•More scalable than DSR
•More complex than DSR:
•computationally expensive
•energy usage
65
Other Protocols
•Single stability routing protocol (SSA)
•DSDV (Destination Sequenced Distance Vector)
•Zone routing protocol (ZRP)
•On-Demand Multicast Routing Protocol (ODMRP)
•(plus others)
66
Recap
•Ad hoc routing:
•Proactive
•Reactive
•Reactive routing examples:
•DSR
•AODV (early work) •(other protocols exist)
67
Summary
• wireless networks
–I-TCP – Indirect TCP
– Snoop TCP
–M-TCP – SACK
• Ad-hoc networks
–TCP-Feedback (TCP-F)
–TCP with Explicit Link Failure Notification (ELFN)
–ATCP – TCP for Mobile Ad-hoc Networks
68
Further Correction of error on UDP Checksum
My previous explanation of how the UDP checksum worked was incorrect. Here is the correct version.
1.
Segment is divided into consecutive 16 bit words
2.
The words are summed up using 1’s complement addition
3.
The final sum from step 2 is then complemented. The resulting 16 bit word is the Checksum.
What is 1’s
1.
2.
3.
4.
5.
complement addition?
Sum the numbers normally
The carry of the sum is whatever bits are to the left of the rightmost 16 bits.
If carry=0 then the normal sum is the 1’s complement sum.
If carry!=0 then add the carry back into normal sum to get 1’s complement sum.
Examples below use 8 bits
1’s complement is actually a way of adding signed numbers (but we will not discuss this)
1 0 0 0 1 0 0 1 Word 1
1 0 1 1 1 0 0 0 Word 2
------------------------------------1 0 1 0 0 0 0 0 1 Normal Sum (note carry to remove)
1 Remove carry and add it back
------------------------------------0 1 0 0 0 0 1 0 1’s complement sum
0 0 1 0 1 0 0 1 Word 1
1 0 1 1 1 0 0 0 Word 2
--------------------------------1 1 1 0 0 0 0 1 1’s complement sum
Checksum example
1
1
0
1
0
1
0
0
0
1
1
1
0
1
1
0
1
0
1
0
0
0
1
0
0
0
0
0
1
0
0
1
Input
Input
Input
Input
Word
Word
Word
Word
1
2
3
4
1 0 0 0 1 0 0 1 W1
1 1 1 1 0 0 0 0 W2
--------------------------------------------------------------------1 0 1 1 1 1 0 0 1 Normal sum
1 Carry
--------------------------------------------------------------------0 1 1 1 1 0 1 0 1’s Comp sum W1, W2
00111100
W3
--------------------------------------------------------------------1 0 1 1 0 1 1 0 1’s Comp sum W1, W2, W3
10100001
W4
--------------------------------------------------------------------1 0 1 0 1 0 1 1 1 Normal sum
1 Carry
--------------------------------------------------------------------0 1 0 1 1 0 0 0 1’s Comp sum W1, W2, W3, W4
1 0 1 0 0 1 1 1 complement
= checksum of W1-W4