Symbian3/SDK/Source/GUID-8A678AE5-A133-58EA-A4DD-B5BFC94D3AEA.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-8A678AE5-A133-58EA-A4DD-B5BFC94D3AEA" xml:lang="en"><title> Variable
TCP Receive Window</title><shortdesc>Explains how to improve performance of TCP/IP stack.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>The performance of the existing Symbian platform TCP/IP stack is improved
by doing the following:</p>
<ul>
<li id="GUID-00E77774-7DC6-513E-9CC3-46B499B4C196"><p>Setting an initial TCP
receive window size that depends on the <xref href="GUID-8A678AE5-A133-58EA-A4DD-B5BFC94D3AEA.dita#GUID-8A678AE5-A133-58EA-A4DD-B5BFC94D3AEA/GUID-CDAA0409-6ECB-5ABB-A0E5-F7C5C58E6347">bearer
type</xref>. </p> <p> </p> </li>
<li id="GUID-22A70B8B-AD26-5898-8505-79F5434B5971"><p>Allowing the TCP receive
window size to dynamically resize when there is a change in modulation. For
example, GPRS to EDGE or 2G to 3G. </p> </li>
</ul>
<p>Bearers provide different bandwidth for data transmission using TCP/IP.
The connection setup between TCP hosts are through three-way handshake. The
TCP receive window size parameter is set during the connection startup. </p>
<p>To indicate the TCP receive window size, the TCP header contains a 16-bit
window field. The TCP receive window size denotes the maximum number of bytes
that a sender can send and a receiver can receive. The TCP header can have
any value between 0 and 64KB. Use the <xref href="http://www.ietf.org/rfc/rfc1323.txt" scope="external">TCP window scaling</xref> to increase the window size beyond
64kB. The sender and receiver must agree to the scaling factor. The scaling
factor can be multiplied at both the ends to increase the window size. For
example, if the scaling factor is 2 and the window size negotiated is 96KB,
then the stored window size is 48KB. Also a scaling factor of 2 yields the
effective size of 96KB. The TCP receive maximum window size is mentioned in <codeph>tcpip.ini</codeph> file. </p>
<p>At ROM build time, the (NetMCPR) plug-in configures the TCP receive window.
It is possible to enable or disable the adaptive window size based on the
bearer type. This helps some bearers to use adaptive window size and other
bearers to use fixed pre-defined windows. The <xref href="GUID-8A678AE5-A133-58EA-A4DD-B5BFC94D3AEA.dita#GUID-8A678AE5-A133-58EA-A4DD-B5BFC94D3AEA/GUID-E1123CF2-EA87-5F18-8F3C-3FD98DD6ABE8">lookup
table</xref> provides the information on TCP receive window size at licensees
specific MCPR (NetMCPR). Licensees are provided with the TCP receive window
interface. </p>
<p>TCP receive window must be changed due to the following reasons: </p>
<ul>
<li id="GUID-4E46CC4D-3CFA-5078-B801-9E0F20857CC8"><p>Change in modulation
due to the network change - modulation value for bearer varies in different
network. Modulation change in the network triggers the notification to change
the TCP receive window for the connected TCP sockets. For example, change
in network from 2.5G to 3G. </p> </li>
<li id="GUID-41F0FC86-3E72-5372-8C43-B59F3835DD48"><p>Change in bearer - Forces
the TCP/IP stack to supply a new TCP receive window that is specific to the
new bearer. </p> </li>
</ul>
<section id="GUID-CDAA0409-6ECB-5ABB-A0E5-F7C5C58E6347"><title>Bearer types</title> <p>The
following are the bearer types that support the TCP receive window: </p> <ul>
<li id="GUID-302F21B4-FDBA-5052-939E-7FE309C4A7DF"><p>General Packet Radio
Service (GPRS 2.5G) </p> </li>
<li id="GUID-F60D6AF2-0EAA-5693-982B-B0B531E22862"><p>Enhanced Data Rate for
GSM Evolution (EDGE 2.75G or 3G – depends on the modulation scheme) </p> </li>
<li id="GUID-07D37BB9-2BBE-5C22-9D5C-A3477F73E766"><p>Universal Mobile Telecommunications
System (UMTS 3G) </p> </li>
<li id="GUID-1677511B-C52E-5E4D-8657-075468587E97"><p>High-Speed Downlink
Packet Access (HSDPA 3G) </p> </li>
<li id="GUID-DF4013BE-A1DE-5ECA-9124-2376924345C8"><p>WLAN </p> </li>
</ul> </section>
<section id="GUID-E1123CF2-EA87-5F18-8F3C-3FD98DD6ABE8"><title>Lookup table</title> <p>The
lookup table contains the entries of TCP receive window size for each bearer
type. To set the TCP receive window size for bearer, licensees must override
the <xref href="GUID-5AC853D0-31FB-3944-8769-A59977F616B0.dita"><apiname>SetTcpWin()</apiname></xref> function. The licensees can define their
own TCP window lookup table and set the TCP receive window size for a bearer. </p> <p>Symbian
uses the following lookup table for testing purpose. The licensees can replace
the TCP receive window size with their own values: </p> <table id="GUID-0697063E-F323-5824-9775-FE4413399697">
<tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/>
<tbody>
<row>
<entry><p> <b>Bearer or Modulation</b>  </p> </entry>
<entry><p> <b>TCP receive window size</b>  </p> </entry>
</row>
<row>
<entry><p>GPRS </p> </entry>
<entry><p>12240 – 17520 </p> </entry>
</row>
<row>
<entry><p>EDGE </p> </entry>
<entry><p>21760 – 49640 </p> </entry>
</row>
<row>
<entry><p>UMTS </p> </entry>
<entry><p>29920 – 33580 </p> </entry>
</row>
<row>
<entry><p>HSDPA </p> </entry>
<entry><p>65535 or greater </p> </entry>
</row>
<row>
<entry><p>WLAN </p> </entry>
<entry><p>65535 or greater </p> </entry>
</row>
<row>
<entry><p>Ethernet </p> </entry>
<entry><p>65335 </p> </entry>
</row>
</tbody>
</tgroup>
</table> <p> </p> </section>
<section id="GUID-6A97BEE5-8236-40A3-899B-6A4173D51C97"><title>Handling TCP receive window in TCP/IP stack</title> <p>The
following are the scenarios to handle the TCP receive window: </p> <ul>
<li id="GUID-2E1E9EC2-F481-54AE-A648-D9EC50EF77C4"><p>Increase window size
- Change in the bearer increases the window size. </p> </li>
<li id="GUID-B6C3EC7E-E0A0-521C-8830-4FDB27B409B8"><p>Decrease window size
- Change in the bearer decreases the window size till it reaches the appropriate
size for the new bearer. </p> </li>
</ul> </section>
</conbody><related-links>
<link href="GUID-6822E7FA-D055-5693-8872-8D0E8554A734.dita"><linktext>Configuring
TCP Receive                 Window</linktext></link>
</related-links></concept>