30
June 17, 2004 PCCA 1 TCP Window Size for WWAN Jim Panian Qualcomm

TCP Window Size for WWAN - Portable Computer and

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

June 17, 2004 PCCA 1

TCP Window Size for WWAN

Jim Panian Qualcomm

June 17, 2004 PCCA 2

TCP Window Size for WWAN

• Role of TCP Windowing

• Calculation of Optimum Window Size

• WWAN Window Size Requirements

• WWAN and Long Fat Networks

• Conclusions

June 17, 2004 PCCA 3

Role of TCP Windowing

TCP Windowing serves three purposes:

1) Optimize the data flow through the pipe

2) Flow Control

3) Congestion Control

June 17, 2004 PCCA 4

TCP Windowing reflects the number of segments in transit that have not been acknowledged

Host A Host B

Segment 4

5 6 7 8

ACK 4

1 2 3 4 5 6 7 8 9 10

1 2 3 4 5 6 7 8 9 10

9

June 17, 2004 PCCA 5

TCP Windowing optimizes data flow under normal conditions

Host A Host B

Window Size is just right

8 7 6 5 4

Window Size is too small

5 4

June 17, 2004 PCCA 6

TCP Window size reflects the size of the receive buffer on receiving host

Host A Host B

TCP Segment (Receive Window Size)

or TCP ACK (Receive Window Size)

Host B provides feedback on Receive Window Size.

June 17, 2004 PCCA 7

TCP Windowing provides flow control

Host A Host B

TCP ACK (Smaller Receive Window Size)

Host B can shrink the Receive Window Size if it has less buffer space. Used to prevent buffer overruns.

June 17, 2004 PCCA 8

TCP Windowing provides congestion control

Host A Host B

Congestion may occur when an intermediate host has a buffer overrun and drops IP datagrams containing TCP segments.

Intermediate

Host Segment 5

June 17, 2004 PCCA 9

TCP Windowing provides congestion control

Host A Host B

Segment 5

6

7 8

ACK 5

1 2 3 4 5 6 7 8 9 10

1 2 3 4 5 6 7 8 9 10

5 6

June 17, 2004 PCCA 10

Max TCP Receive Window Size (MRWS) is 64 KBytes

Host A Host B

TCP Segment (WS=TCP MRWS)

or TCP ACK (WS=TCP MRWS)

Theoretical maximum receive window size is 64KBytes.

Lower values of maximum receive window size may be configured.

June 17, 2004 PCCA 11

Role of TCP Windowing – The maximum receive window size can be set by the Operating System

• Example: Microsoft Windows provides registry parameters

• TcpWindowSize ­ This parameter determines the maximum TCP receive window size offered. This parameter is both a per­interface parameter and a global parameter, depending upon where the registry key is located. Overrides GlobalMaxTcpWindowSize.

• GlobalMaxTcpWindowSize ­ This parameter can be used to set a global limit for the TCP window size on a system­wide basis.

June 17, 2004 PCCA 12

Role of TCP Windowing – The maximum receive window size can also be set by the application

• Example: Microsoft Windows provides the setsockopt Windows Sockets function (on a per­socket basis).

• Question: How does an application know how to set Window size intelligently?

Host B

Application

Ex. FTP

June 17, 2004 PCCA 13

Calculation of Max Receive Window Size

Host A Host B

Window Size is just right

8 7 6 5 4

Max Receive Window Size = Bandwidth x Delay

(Bandwidth Delay Product)

June 17, 2004 PCCA 14

Why calculate the Max Receive Window Size?

• If the Max Receive Window Size is too small, it can constrain throughput.

• If the Max Receive Window Size is too big, then when IP datagrams are lost due to congestion more TCP segments may have to be retransmitted which is a drag on performance.

• Max Receive Window Size = N x Maximum Segment Size (MSS) to avoid fragmentation. Example: (1460 X 16, 1460 X 32, 1460 X 40 and so on).

June 17, 2004 PCCA 15

Calculation of Max Receive Window Size

Max Receive Window Size = Bandwidth x Delay

• The Bandwidth is how fast the transmission medium is of the slowest link in the path.

– Example: Bandwidth for Ethernet is 10 Mbits/second.

• Delay (round trip) is caused by a number of factors: – Serialization delay of the individual circuits or networks – Transmission delay of the individual circuits or networks – Processing delay of the network devices – Can be measured using PING

June 17, 2004 PCCA 16

Application layer flow control with smaller window size or chattiness can negate the effect of Receive Window Size

Host A Host B

Application Application

Segment 4

5 6 7 8

ACK 4

1 2 3 4 5 6 7 8 9 10

9

June 17, 2004 PCCA 17

Window Size Calculation for Ethernet

• Example: The default Max Receive Window Size for Windows 2000 is designed for Ethernet LANs and is 17.5 KBytes (MSSx12).

• Assumptions: Bandwidth = 10 Mbits/second; Delay = 10 msecs.

• Calculate Minimum Window Size:

Minimum Window Size = 10 Mbits/second x .01 seconds 8 bits/Byte

= 12 KBytes < 17.5 KBytes

• So a MRWS of 17.5 KBytes is suitable for Ethernet

June 17, 2004 PCCA 18

WWAN Window Size Requirements – WWAN throughput must not be constrained by a small Window size

• A small Window Size can constrain a high throughput wireless link

• Example: The default Windows 2000 Max Receive Window Size is designed for Ethernet LANs and is 17.5 KBytes.

• Using PING, it is determined that CDMA 2000 1xEVDO has an average round trip delay of 269 msecs.

• Maximum Throughput limited by Window Size – 65 KBytes/second (520 Kbits/second) = 17.5 KBytes / 269 msecs

• CDMA 1xEVDO has exhibited download speeds of: – 87 KBytes/second (694 Kbits/second)

June 17, 2004 PCCA 19

Wireless Max Receive Window Size (MRWS) versus Operating System

OK Too small Too small 23.34 269 86.78 CDMA 2000

1xEVDO

OK OK Too small 4.85 340 14.25 UMTS

OK OK Too small 10.13 600 16.88 EDGE

OK OK Too small 4.31 1404 3.07 GPRS

OK OK OK 0.54 717 0.747 CDPD

Win XP MRWS

64 KBytes

Win 2K MRWS

17.5 KBytes

Win 98 MRWS

2 KBytes

Theoretical MRWS (KBytes)

Delay (msec)

BW (KBytes/sec)

Wireless Technology

June 17, 2004 PCCA 20

Wireless Max Receive Window Size (MRWS) versus Operating System • CDPD, GPRS, EDGE numbers taken from previously published PCCA Workshop

results on members only site.

• UMTS numbers taken from http://www.comnets.uni­ bremen.de/itg/itgfg521/aktuelles/fg­treffen­ 200204/ITG_FG521_Hamburg_200204_TimmGeil.pdf

• CDMA 2000 1xEVDO numbers observed from my own testing.

• Windows 98 number observed on my own personal computer. Windows XP number obtained from my work computer. Windows 2K number obtained from http://www.microsoft.com/technet/itsolutions/network/deploy/depovg/tcpip2k.asp

• The numbers on the previous page are not meant to necessarily represent typical networks but show the potential diversity of characteristics across wireless networks and devices. It is advised that IT professionals take their own measurements to perform technology evaluations.

June 17, 2004 PCCA 21

Recommendation: IT professionals adjust TCP Max Receive Window Size for Wireless Data Modems

• It is recommended that IT professionals determine the optimum Window Size for their wireless data technology of choice and adjust settings in the computer if needed.

• The concepts are too obtuse for end­users to deal with.

June 17, 2004 PCCA 22

Recommendation: IT professionals adjust TCP Max Receive Window Size for Wireless Data Modems

• A possible procedure: 1) Set the TCP Maximum Receive Window Size to N x Maximum Segment

Size in the operating system. Start high (close to 64K). 2) Measure delay by PING. 3) Measure throughput by performing FTP on non­compressible ZIP files. 4) Calculate the theoretical TCP Maximum Receive Window Size based

upon available data. 5) Repeat 1­4 making the Window size smaller to verify that throughput is

not adversely affected by a Window Size that is too large.

6) Final setting – Set TCP Maximum Receive Window Size for the device to a value greater than the theoretical value: 1) Adjust either in the operating system (Registry) or through application

settings. 2) Make an even number multiple of maximum segment size (ex. N x 1460

bytes) to avoid fragmentation.

June 17, 2004 PCCA 23

Recommendation: IT professionals adjust TCP Max Receive Window Size for Wireless Data Modems

• IT professionals should also analyze their applications for application level flow control or excessive chattiness. Both effects can negate the Max TCP Window Size Setting.

June 17, 2004 PCCA 24

Will future 3G Wireless Data Networks be considered Long Fat Networks (LFNs)?

Host A Host B

Long = High Delay

High Delay is typically due to long geographic distance of the pipe.

Fat = High Throughput

LFNs require Max Receive Window Size > 64KBytes.

June 17, 2004 PCCA 25

1 Gig Ethernet is a Long Fat Network

Host A Host B

Long = High Delay (70 msecs)

Example: 1G Ethernet feeds into a 2.4 Gbps OC­48 link that goes cross­country.

Fat = High Throughput (1 Gbits/second)

8.75 MBytes Max Receive Window Size > 64KBytes.

June 17, 2004 PCCA 26

Will future 3G Wireless Data Networks become Long Fat Networks?

• A Long Fat Network (LFN) has a

Max Receive Window Size > 64KBytes – Example: 1G Ethernet.

• RFC 1323 provides Window Scaling – Enables Max Receive Window Size to be scaled from 64KBytes to

1GBytes.

• Does 3G WWAN approach LFN? – If TCP Max Receive Window Size exceeds 64K then RFC1323 extensions

are required.

June 17, 2004 PCCA 27

Will future 3G Wireless Data Networks become Long Fat Networks?

169 269 625 5.0 CDMA 2000 Double DO

104 269 388 3.1 CDMA 2000 1xEVDO

Revision A

85 340 250 2.0 UMTS

Theoretical Physical

Layer MRWS (KBytes)

Delay (msec)

Max Physical Layer BW

(KBytes/sec)

Max Physical Layer BW (Mbits/sec)

Wireless Technology

June 17, 2004 PCCA 28

It is unclear if future 3G Wireless Data Networks will become Long Fat Networks

• If simply considering Theoretical Physical Layer MRWS, then future 3G networks would be LFNs.

• However, actual TCP throughput used to calculate MRWS is typically less than the physical layer throughput because of:

– Higher layer protocol overhead; .

– Time division multiplexing of the radio resource within a cell across multiple users;

– Signal to noise ratio of the WWAN modem may affect throughput.

June 17, 2004 PCCA 29

Operating Systems currently support RFC 1323 Extensions for Window Scaling

• Example: Microsoft Windows provides registry parameters

• TcpWindowSize, GlobalMaxTcpWindowSize

• Tcp1323Opts ­ This parameter controls RFC 1323 time stamps and window­scaling options.

0 (disable RFC 1323 options) 1 (window scale enabled only) 2 (timestamps enabled only) 3 (both options enabled)

June 17, 2004 PCCA 30

Conclusions

• TCP Max Receive Window Size must be configured to be large enough to not constrain the throughput over the wireless network.

• Wireless networks have different requirements for TCP Max Receive Window Size due to varying throughput and delay characteristics.

• Different operating systems and computers have different default settings for TCP Max Receive Window Size.

• TCP Max Receive Window Size should be calculated by an IT person and set correctly in computers using wireless modems.

• If possible, the setting should either be per device or per connection but not global.