Viewing entries tagged with 'w-cdma'

Mobile Internet: TCP networking considerations

Posted by Calum Fitzgerald on 2 December 2010 | 0 Comments

Tags: , , , , , ,

After several false sunrises the era of the mobile internet appears to be finally upon us. With large coverage in the press, the rise of the iPhone with Apple App store & Google Android with Android Market, increased talk with clients and important conferences, such as Velocity, planning talks on the subject it seemed an appropriate time to examine the considerations that need to be taken, with respects to the mobile internet, in terms of performance.
br
This post is going to take a brief look at the networking considerations of using the TCP protocol over mobile networks, in particular 2.5G & 3G technologies that are used in the UK.
br
1. UK Mobile Technologies
br
2.5G   GPRS
3G      W-CMDA
br
2. Latency
br
Typical Round Trip Times (RTTs - Latency)
2.5G    300-1000 milliseconds
3G      300-1000 milliseconds
br
Mobile connections, as well as having large initial latency considerations, are susceptible to sudden increases in latency during the lifetime of a connection.
br
Things that can cause sudden increases in latency in data transmission, delay spikes, exceeding the typical RTTs for such data transmission are:
br
1. Temporary degradation of mobile network signal (going through a tunnel, riding in a lift).
2. The handover process when moving between network cells of the same technology (3G - 3G).
3. The handover process when moving between network cells of differing technologies (3G - 2.5G).
4. Internal rerouting of packets by the network to ensure seamless mobility when moving between network cells.
5. Blocking on the mobile network by high-priority traffic. Data traffic for browsing is not considered high-priority.
6. The network scheduler suspending low-priority data traffic in deference to high-priority users.
br
These delay spikes can cause unexpected TCP timeouts, reduced throughput by causing the TCP congestion window size to be decreased and unnecessary retransmission of data.
br
3. Bandwidth
br
Bandwidth Delay Product (BDP - inflight data that has not been acknowledged)
1-5KB   GPRS
8-50KB   W-CDMA
br
Due to the differing BDPs the 2.5G & 3G technologies fall into 2 different categorisation of networks: GPRS (2.5G) can be considered a long thin network (LTN); W-CDMA (3G) can be considered a long fat network (LFN) similar to internet connections delivered by satellite.
br
TCP window size is important for bandwidth in both LFNs and LTNs but for differing reasons:
1. LFNs require a large TCP window size to utilise the available bandwidth.
2. LTNs require a TCP window size that is big enough to hold at least 4 segments for efficient loss recovery.
br
With respects to efficient loss recovery, the use of selective acknowledgements (SACK) with the TCP connection means that the TCP window size must be scoped bigger than the size necessary for just efficient bandwidth utilisation to include the overhead for SACK.
br
The bandwidth for a mobile connection is considered to be dynamic due to other connections on the mobile network and the fact that it is by nature mobile.
br
Things that affect mobile connection bandwidth:
br
1. Arriving and departing connections to the mobile network cell decrease and increase the available bandwidth of the cell respectively.
2. Distance from the mobile network cell base station affects the link quality with increasing distance decreasing the amount of bandwidth.
3. Moving between network cells.
   i. Going from Low bandwidth cell - HIgh bandwidth cell the TCP congestion control mechanism can cause under-utilisation of available bandwidth due to slow ramp up.
   ii. Going from High bandwidth cell - Low bandwidth cell if the TCP window size has been set to a large size congestion can occur resulting in overbuffering.
br
The network scheduler plays a very important part in determining the amount of bandwidth available to a mobile connection. There is a limited amount of radio frequency (RF) spectrum available to a network that has to be shared out to dynamic numbers of concurrent connections. To handle this sharing out of resource the network scheduler allocates and deallocates resource (bandwidth) to the individual connections on a periodic basis. This allocation/deallocation process is termed bandwidth oscillation. The achievable throughput for a mobile TCP connection (assuming that TCP parameters for the connection are fixed) is determined by the frequency of the network bandwidth oscillation. At a high frequency of the bandwidth oscillation there is no throughput degradation. A slower frequencies bandwidth oscillation can be the single most important factor in limiting the throughput of the mobile connection.
br
4. TCP options that can help improve performance
br
1. Max TCP Window Size: set to be greater than the BDP. Not so much an issue for 2.5G networks. More of an issue for 3G networks as the receivers (eg. phones) most probably have a setting of 16-32KB for the TCP Window. Setting this to 64 KB would be best for 3G networks. Requires sender and receiver TCP stack support.
2. Initial TCP Window Size: Set this to be 4 times the maximum segment size (MSS), with a maximum size of 4KB. This is a good setting for frequent small data transfers. Does not impact large data transfers. Requires sender TCP stack support.
3. Enable Limited Transmit: This cuts down on data retransmission. Applicable to both 2.5G and 3G connections. Requires sender TCP stack support.
4. MTU size: With 3G connections setting a larger MTU allows for the TCP congestion window to be increased at a faster rate. Not as applicable for 2.5G connections.
5. Enable Path MTU Discovery. This allows the sender to determine what the maximum MTU can be. Applicable to both 2.5G and 3G connections. Requires sender and mobile network provider TCP stack support.
6. Enable SACK: This allows for efficient loss recovery in the case of packet loss. Applicable to both 2.5G and 3G connections. Requires sender and receiver TCP stack support.
7. Enable ECN (should SACK not be available): This allows for efficient loss recovery in the case of packet loss. Requires sender, receiver & mobile network provider TCP stack support.
8. Enable TCP Timestamps: Allows for better estimation of RTTs and therefore less timeouts due to better timeout settings. Applicable to 2.5G & 3G. Requires sender and receiver TCP stack support.
9. Disable TCP header compression: In environments with potentially high packet loss this mechanism prevents efficient loss recovery. This has to be done at the wireless host (mobile network provider) level unfortunately.
br
5. Discussion
br
To provide an optimised TCP experience for a mobile end user looks to be a tricky affair. There are a number of factors that need to be taken into consideration in for each connection. These include, in no particular order:
1. TCP feature set of receiver
2. TCP feature set of mobile network provider
3. TCP feature set of sender
4. Mobile technology of initial connection (2.5G or 3G)
5. Bandwidth oscillation frequency of the mobile network provider network scheduler
6. Current load of mobile network cell.
7. Mobile technology of surrounding mobile network cells (2.5G or 3G). Assuming mobility what is the likelihood of intersystem (eg. 2.5G to 3G) handover?
br

0 comments | Read the full post