You are currently offline, waiting for your internet to reconnect

Tuning TCP/IP for Performance

Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
The performance of Microsoft LAN Manager networks using TCP/IP canoften be increased significantly by carefully tuning several stackparameters:

  • tcpsegmentsize (the maximum size of a single TCP segment)
  • tcpwindowsize (the amount of data a receiving TCP stack can buffer)
  • nbsessions (the maximum number of NetBIOS sessions available)
  • tcpconnections (the maximum number of TCP connections available)
For optimum performance, tcpsegmentsize should be the size of theMTU (maximum transfer unit) the media can handle, minus all headers upthrough the IP layer. LAN Manager TCP/IP allows sizes of 1450 bytes orless to be assigned to this parameter.

Also for optimum performance, tcpwindowsize should typically be as largeas possible, in increments of tcpsegmentsize. Increasing tcpwindowsize,however, requires more memory, which can be a problem under MS-DOS. TheTCP driver must load into a single 64K segment of memory. The driver mustbe able to buffer "tcpwindowsize" bytes of data on EACH tcpconnection,so the tcpwindowsize and tcpconnections values must be balanced againsteach other to achieve the best overall performance and connectivity.
More information
When a Microsoft LAN Manager TCP/IP workstation connects to a resourceon a server, a TCP connection is established to the server unless onealready exists. Next, a NetBIOS session is established over that TCPconnection. If a second resource on the same server is requested, theSAME NetBIOS session and TCP connection are used, and activity forboth resources is multiplexed over that single session and connection.However, any connections made using the Microsoft TCP/IP utilities forLAN Manager to other resources use one TCP connection each.

So, tuning can be reduced to a simple process:

  1. Determine the number of TCP connections needed on your workstation.
  2. Set nbsessions and TCPUTILS.INI parameters as appropriate.
  3. Use the table below to choose the largest possible tcpwindowsize.


A "net use" command on the client shows:
Status      Local name     Remote nameOK          D:             \\server1\shareDOK          E:             \\server1\shareEOK          F:             \\server2\shareFOK          G:             \\server2\shareGOK          H:             \\server3\shareHOK          I:             \\server3\shareIOK          LPT1           \\server1\laserOK          LPT2           \\server1\lineprint				
Notice there are sessions to three servers, using three nbsessions, andthree tcpconnections. In addition, assume you have the Microsoft TCP/IPUtilities for LAN Manager installed, and you use one telnet session andthree sockets. By default, the value of nbsessions is 6, which allowssome headroom for sessions to more LAN Manager servers.

The formula used internally for tcpconnections is:
   tcpconnections = nbsessions + 1 + [nsessions + numsockets]				
Nsessions and numsockets exist only if the utilities are installed,and examining the TCPUTILS.INI file reveals their default values to be2 and 8, respectively. (In LAN Manager 2.2, the value for numsockets isscheduled to change to 4).

So, if you are using LAN Manager version 2.1a or earlier, the defaulttcpconnections are 6 + 1 + 2 + 8 = 17. You only need one telnet connectionand three sockets, so you should first reduce those parameters inTCPUTILS.INI. After the reduction, you are left with 6 + 1 + 1 + 3 = 11tcpconnections. The table below shows that you can support a tcpwindowsizeof no more than 2900 bytes on an MS-DOS client.
tcpconnections  tcpwindowsize  tcpsegmentsize  6 or less         5800           1450  7 - 8             4350           1450  9 - 11            2900           1450  <-- Optimum configuration 12 - 22            1450           1450      for 11 tcpconnections				
You can add these parameters to the PROTOCOL.INI file in the [TCPIP_XIF]section. You should also modify the MS OS/2 server for versions 2.1 and2.1a. In PROTOCOL.INI, set:
tcpsegmentsize=1450   (the same as for the clients)tcpwindowsize=4350    (MS OS/2 normally has plenty of memory for this)				
Microsoft no longer recommends setting the tcpconnections value inPROTOCOL.INI, and may remove the parameter in a future version. For thebest results, adjust the parameters that are used to calculatetcpconnections and allow it to adjust internally.

Note that if you don't have the utilities installed and aren't usingsockets or telnet, tcpconnections calculates to 6 + 1 = 7, so you wouldselect a tcpwindowsize of 4350 from the above table.

NOTE: If your network adapter card is incapable of handling a tcpwindowsizeburst of frames, it may drop one or more of them. If this occurs,performance will degrade seriously. Some older cards may be able to bufferonly one incoming frame at a time.

The tcpwindowsize should be as large as possible within the memoryconstraints of the systems involved. On MS OS/2, tcpwindowsize should workat 4350 in all cases, and this will be the new default in LAN Manager 2.2.Performance gains will be most significant on high-delay networks such asthose found in many WAN environments.
"Optimizing The Microsoft LAN Manager TCP/IP Protocol," a tech noteavailable from Microsoft Inside Sales.

Article ID: 93444 - Last Review: 05/26/2014 02:08:00 - Revision: 2.0

  • Microsoft LAN Manager 2.2 Standard Edition
  • kbnetwork KB93444