TCP/IP is a killer - Nagle Algorithm 
Author Message
 TCP/IP is a killer - Nagle Algorithm

We need to be able to turn off the Nagle Algorithm but I am not sure how to
do this.  It's a killer for us in an application we have involving TCP and
radio transmissions.

I know it is a winsock command involving TCP_NODELAY option.  Beyond that I
am at a loss.

Does anyone know what the instruction is?  Possibly with an example?  Where
I might find the information I need to implement it?

Any assistance would be greatly appreciated.

Thanks,
Jim McCormick



Sun, 27 Mar 2005 22:49:28 GMT  
 TCP/IP is a killer - Nagle Algorithm
Jim,

Quote:
> Does anyone know what the instruction is?  Possibly with an example?  Where
> I might find the information I need to implement it?

Article Q235624 at support.microsoft.com?

HTH

--
Arie Rens (RADventure B.V.)
Maarssen, the Netherlands
http://www.radventure.nl
SoftVelocity Distributor for the Benelux



Sun, 27 Mar 2005 23:57:28 GMT  
 TCP/IP is a killer - Nagle Algorithm
Thanks,

well check it out.

Regards,
Jim



Quote:
> Jim,

> > Does anyone know what the instruction is?  Possibly with an example?
Where
> > I might find the information I need to implement it?

> Article Q235624 at support.microsoft.com?

> HTH

> --
> Arie Rens (RADventure B.V.)
> Maarssen, the Netherlands
> http://www.radventure.nl
> SoftVelocity Distributor for the Benelux



Mon, 28 Mar 2005 01:51:03 GMT  
 TCP/IP is a killer - Nagle Algorithm

Quote:

> We need to be able to turn off the Nagle Algorithm but I am not sure how to
> do this.  It's a killer for us in an application we have involving TCP and
> radio transmissions.

> I know it is a winsock command involving TCP_NODELAY option.  Beyond that I
> am at a loss.

> Does anyone know what the instruction is?  Possibly with an example?  Where
> I might find the information I need to implement it?

> Any assistance would be greatly appreciated.

> Thanks,
> Jim McCormick

Hi
here is an example
from http://www.russitabank.ru/ik/ik_w.html (clwsock.exe)

Socket_Option function(p_Socket)

COptions   Group,pre(copt)
SO_ACCEPTCONN    long !b    Socket is in listen mode.
SO_BROADCAST     long !b    Socket is configured for the transmission of broadcast messages.
SO_DEBUG         long !b    Debugging is enabled.
SO_DONTLINGER    long !b    If true, the SO_LINGER option is disabled.
SO_DONTROUTE     long !b    Routing is disabled.
SO_ERROR         long !i    Retrieve error status and clear.
SO_KEEPALIVE     long !b    Keepalive messages are being sent.
SO_LINGER        ulong!p    struct linger FAR *    Returns the current linger options.
SO_OOBINLINE     long !b    Out-of-band data is being received in the normal data stream.
SO_RCVBUF        long !i    Buffer size for receive operations.
SO_REUSEADDR     long !b    The socket may be bound to an address that is already in use.
SO_SNDBUF        long !i    Buffer size for send operations.
SO_TYPE          long !i    The type of the socket (for example, SOCK_STREAM).
TCP_NODELAY      long !b    Disables the Nagle algorithm for send coalescing.
           .

NOptions  Group(COptions),pre(nopt).

local   group,pre(loc)
error    long
s        long
ProcName cstring('Socket_Option')
      .

Window WINDOW('Socket options'),AT(,,231,111),FONT('MS Sans Serif',8,,FONT:regular),CENTER,ICON('SB_LOGO.ICO'), |
         STATUS,SYSTEM,GRAY,MAX,RESIZE,MASK,MDI
       CHECK('SO_ACCEPTCONN'),AT(10,5),MSG('Socket is in listen mode.'),ALRT(enterkey),USE(nopt:SO_ACCEPTCONN)
       CHECK('SO_BROADCAST'),AT(10,15),MSG('Socket is configured for the transmission of broadcast messages.'), |
           ALRT(enterkey),USE(nopt:SO_BROADCAST)
       CHECK('SO_DEBUG'),AT(10,25),MSG('Debugging is enabled.'),ALRT(enterkey),USE(nopt:SO_DEBUG)
       CHECK('SO_DONTLINGER'),AT(10,35),MSG('If true, the SO_LINGER option is disabled.'),ALRT(enterkey), |
           USE(nopt:SO_DONTLINGER)
       CHECK('SO_DONTROUTE'),AT(10,45),MSG('Routing is disabled.'),ALRT(enterkey),USE(nopt:SO_DONTROUTE)
       CHECK('SO_KEEPALIVE'),AT(10,55),MSG('Keepalive messages are being sent.'),ALRT(enterkey),USE(nopt:SO_KEEPALIVE)
       CHECK('SO_OOBINLINE'),AT(10,65),MSG('Out-of-band data is being received in the normal data stream.'), |
           ALRT(enterkey),USE(nopt:SO_OOBINLINE)
       CHECK('SO_REUSEADDR'),AT(10,75),MSG('The socket may be bound to an address that is already in use.'), |
           ALRT(enterkey),USE(nopt:SO_REUSEADDR)
       CHECK('TCP_NODELAY'),AT(10,85),MSG('Disables the Nagle algorithm for send coalescing.'),ALRT(enterkey), |
           USE(nopt:TCP_NODELAY)
       PROMPT('SO_TYPE'),AT(102,5)

           USE(nopt:SO_TYPE),RIGHT(2),INS
       PROMPT('SO_ERROR'),AT(102,20)

           INS
       PROMPT('SO_RCVBUF'),AT(102,35)

           RIGHT(2),INS
       PROMPT('SO_SNDBUF'),AT(102,50)

           RIGHT(2),INS
       BUTTON('Close'),AT(95,92,60,15),USE(?Close),LEFT,ICON('EXIT.ICO'),STD(STD:CLOSE)
       BUTTON('Set'),AT(165,92,60,15),USE(?Set),LEFT,ICON('MARK2.ICO')
     END

!SO_LINGER        ulong!p    struct linger FAR *    Returns the current linger options.

  code
  open(window)
  window{prop:text} = clip(window{prop:text}) &' '&p_Socket
  display
  do getOptions
  nOptions = cOptions
  accept
    case field()
    of ?Set
      case event()
      of event:accepted
         do SetOptions
      .
    .
    case event()
    OF EVENT:AlertKey
      do check_enter
    .
  .
  close(window)

  return(0)

check_enter  routine
  if keycode() = EnterKey
     update(?)
     post(Event:Accepted,?)
     select(?+1)
  .

GetOptions  routine
   loc:s = size(copt:SO_ACCEPTCONN)
   loc:error = pGetSockOpt(WS:ptr[e_GetSockOpt],p_Socket,SOL_SOCKET,SO_ACCEPTCONN,address(copt:SO_ACCEPTCONN),address(loc:S))
   if loc:error = SOCKET_ERROR
      loc:error = pWSAGetLastError(WS:ptr[e_WSAGetLastError])
      if loc:error = WSAENOPROTOOPT
        disable(?nopt:SO_ACCEPTCONN)
      else
        message('Error GetSocketOpt SO_ACCEPTCONN = '&loc:error&'|'&NetErrorStr(loc:error),loc:ProcName,icon:hand)
      .
   .

   loc:s = size(copt:SO_BROADCAST)
   loc:error = pGetSockOpt(WS:ptr[e_GetSockOpt],p_Socket,SOL_SOCKET,SO_BROADCAST,address(copt:SO_BROADCAST),address(loc:S))
   if loc:error = SOCKET_ERROR
      loc:error = pWSAGetLastError(WS:ptr[e_WSAGetLastError])
      if loc:error = WSAENOPROTOOPT
        disable(?nopt:SO_BROADCAST)
      else
        message('Error GetSocketOpt SO_BROADCAST = '&loc:error&'|'&NetErrorStr(loc:error),loc:ProcName,icon:hand)
      .
   .

   loc:s = size(copt:SO_DEBUG)
   loc:error = pGetSockOpt(WS:ptr[e_GetSockOpt],p_Socket,SOL_SOCKET,SO_DEBUG,address(copt:SO_DEBUG),address(loc:S))
   if loc:error = SOCKET_ERROR
      loc:error = pWSAGetLastError(WS:ptr[e_WSAGetLastError])
      if loc:error = WSAENOPROTOOPT
        disable(?nopt:SO_DEBUG)
      else
        message('Error GetSocketOpt SO_DEBUG = '&loc:error&'|'&NetErrorStr(loc:error),loc:ProcName,icon:hand)
      .
   .

   loc:s = size(copt:SO_DONTLINGER)
   loc:error = pGetSockOpt(WS:ptr[e_GetSockOpt],p_Socket,SOL_SOCKET,SO_DONTLINGER,address(copt:SO_DONTLINGER),address(loc:S))
   if loc:error = SOCKET_ERROR
      loc:error = pWSAGetLastError(WS:ptr[e_WSAGetLastError])
      if loc:error = WSAENOPROTOOPT
        disable(?nopt:SO_DONTLINGER)
      else
        message('Error GetSocketOpt SO_DONTLINGER = '&loc:error&'|'&NetErrorStr(loc:error),loc:ProcName,icon:hand)
      .
   .

   loc:s = size(copt:SO_DONTROUTE)
   loc:error = pGetSockOpt(WS:ptr[e_GetSockOpt],p_Socket,SOL_SOCKET,SO_DONTROUTE,address(copt:SO_DONTROUTE),address(loc:S))
   if loc:error = SOCKET_ERROR
      loc:error = pWSAGetLastError(WS:ptr[e_WSAGetLastError])
      if loc:error = WSAENOPROTOOPT
        disable(?nopt:SO_DONTROUTE)
      else
        message('Error GetSocketOpt SO_DONTROUTE = '&loc:error&'|'&NetErrorStr(loc:error),loc:ProcName,icon:hand)
      .
   .

   loc:s = size(copt:SO_ERROR)
   loc:error = pGetSockOpt(WS:ptr[e_GetSockOpt],p_Socket,SOL_SOCKET,SO_ERROR,address(copt:SO_ERROR),address(loc:S))
   if loc:error = SOCKET_ERROR
      loc:error = pWSAGetLastError(WS:ptr[e_WSAGetLastError])
      if loc:error = WSAENOPROTOOPT
        disable(?nopt:SO_ERROR)
      else
        message('Error GetSocketOpt SO_ERROR = '&loc:error&'|'&NetErrorStr(loc:error),loc:ProcName,icon:hand)
      .
   .

   loc:s = size(copt:SO_KEEPALIVE)
   loc:error = pGetSockOpt(WS:ptr[e_GetSockOpt],p_Socket,SOL_SOCKET,SO_KEEPALIVE,address(copt:SO_KEEPALIVE),address(loc:S))
   if loc:error = SOCKET_ERROR
      loc:error = pWSAGetLastError(WS:ptr[e_WSAGetLastError])
      if loc:error = WSAENOPROTOOPT
        disable(?nopt:SO_KEEPALIVE)
      else
        message('Error GetSocketOpt SO_KEEPALIVE = '&loc:error&'|'&NetErrorStr(loc:error),loc:ProcName,icon:hand)
      .
   .

   loc:s = size(copt:SO_OOBINLINE)
   loc:error = pGetSockOpt(WS:ptr[e_GetSockOpt],p_Socket,SOL_SOCKET,SO_OOBINLINE,address(copt:SO_OOBINLINE),address(loc:S))
   if loc:error = SOCKET_ERROR
      loc:error = pWSAGetLastError(WS:ptr[e_WSAGetLastError])
      if loc:error = WSAENOPROTOOPT
        disable(?nopt:SO_OOBINLINE)
      else
        message('Error GetSocketOpt SO_OOBINLINE = '&loc:error&'|'&NetErrorStr(loc:error),loc:ProcName,icon:hand)
      .
   .

   loc:s = size(copt:SO_RCVBUF)
   loc:error = pGetSockOpt(WS:ptr[e_GetSockOpt],p_Socket,SOL_SOCKET,SO_RCVBUF,address(copt:SO_RCVBUF),address(loc:S))
   if loc:error = SOCKET_ERROR
      loc:error = pWSAGetLastError(WS:ptr[e_WSAGetLastError])
      if loc:error = WSAENOPROTOOPT
        disable(?nopt:SO_RCVBUF)
      else
        message('Error GetSocketOpt SO_RCVBUF = '&loc:error&'|'&NetErrorStr(loc:error),loc:ProcName,icon:hand)
      .
   .

   loc:s = size(copt:SO_REUSEADDR)
   loc:error = pGetSockOpt(WS:ptr[e_GetSockOpt],p_Socket,SOL_SOCKET,SO_REUSEADDR,address(copt:SO_REUSEADDR),address(loc:S))
   if loc:error = SOCKET_ERROR
      loc:error = pWSAGetLastError(WS:ptr[e_WSAGetLastError])
      if loc:error = WSAENOPROTOOPT
        disable(?nopt:SO_REUSEADDR)
      else
        message('Error GetSocketOpt SO_REUSEADDR = '&loc:error&'|'&NetErrorStr(loc:error),loc:ProcName,icon:hand)
      .
   .

   loc:s = size(copt:SO_SNDBUF)
   loc:error = pGetSockOpt(WS:ptr[e_GetSockOpt],p_Socket,SOL_SOCKET,SO_SNDBUF,address(copt:SO_SNDBUF),address(loc:S))
   if loc:error = SOCKET_ERROR
      loc:error = pWSAGetLastError(WS:ptr[e_WSAGetLastError])
      if loc:error = WSAENOPROTOOPT
        disable(?nopt:SO_SNDBUF)
      else
        message('Error GetSocketOpt SO_SNDBUF = '&loc:error&'|'&NetErrorStr(loc:error),loc:ProcName,icon:hand)
      .
   .

   loc:s = size(copt:SO_TYPE)
   loc:error = pGetSockOpt(WS:ptr[e_GetSockOpt],p_Socket,SOL_SOCKET,SO_TYPE,address(copt:SO_TYPE),address(loc:S))
   if loc:error = SOCKET_ERROR
      loc:error = pWSAGetLastError(WS:ptr[e_WSAGetLastError])
      if loc:error =
...

read more »



Mon, 28 Mar 2005 16:50:31 GMT  
 TCP/IP is a killer - Nagle Algorithm

Thanks, I'll see what we can do with this.

Regards,
Jim McCormick



Tue, 29 Mar 2005 20:34:23 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. does anyone have an example of a c++ TCP/IP client that works with labview TCP?IP server ??

2. How do I use dial up (PPP) TCP/IP port on a machine which also has TCP/IP LAN

3. TCP/IP for Smalltalk V

4. Interface Woes...Emulator/TCP/IP or GDDM?

5. TCP/IP AbtSocket connection problems

6. TCP/IP Under MVS: Assembler Interface

7. US - SE FL-***SMALLTALK/C++PROGRAMMER (DB2,MVS/TSO,AIX,TCP/IP)***-CONTRACT

8. TCP/IP, TN3270 & APL/370

9. APL communications via TCP/IP or DDE

10. VW 2.5 - TCP/IP on MS Windows

11. OT-Documentation for AWK+TCP/IP in SGML

12. TCP/IP Internetworking - want a copy?

 

 
Powered by phpBB® Forum Software