Skip to contentSkip to conversation

TCP/IP Speed

DISCUSSION Dan Maas 2 participants 2 messages Jan 30, 2002 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Dan Maas

author
#1 lore raw
Quoted 7 lines

When I ping two linux machines on a private link, I get 0.1 ms delay. When I send large TCP/IP stream data between them, I get almost 10 megabytes per second on a 100-base link. Wonderful.

However, if I send 64 bytes from one machine and send it back, simple TCP/IP strean connection, it takes 1 millisecond to get it back? There seems to be some artifical delay somewhere. How do I turn this OFF?

Stupid question - did you turn Nagle off?

int one = 1;
setsockopt(fd, SOL_TCP, TCP_NDELAY, &one);

(I think; typing from memory...)

Regards,
Dan

#2 lore raw
Quoted 10 lines · Dan Maas
Quoted 7 lines

When I ping two linux machines on a private link, I get 0.1 ms delay. When I send large TCP/IP stream data between them, I get almost 10 megabytes per second on a 100-base link. Wonderful.

However, if I send 64 bytes from one machine and send it back, simple TCP/IP strean connection, it takes 1 millisecond to get it back? There seems to be some artifical delay somewhere. How do I turn this OFF?

Stupid question - did you turn Nagle off?

Quoted 8 lines

int one = 1;
setsockopt(fd, SOL_TCP, TCP_NDELAY, &one);

(I think; typing from memory...)

Regards,
Dan

I did, but I thought it was a TCP option, not a socket option. I will change it and see if it does anything. Currently, it seems like a no-op, no errors, but does nothing.

Early in code:

int on = 1;

#define ON &on

Where accept is called. Returned socket value is set to nodelay.

        len = sizeof(addr);
        if((hs = accept(s, SSAP &addr, &len))) == FAIL)
            ERRORS(Accept);
        if(setsockopt(hs, IPPROTO_TCP, TCP_NODELAY, ON, sizeof(on)) == FAIL)
            ERRORS(Setsockopt);

So, maybe it's supposed to be SOL_TCP? I'll look for it.

Cheers,
Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (797.90 BogoMips).

I was going to compile a list of innovations that could be attributed to Microsoft. Once I realized that Ctrl-Alt-Del was handled in the BIOS, I found that there aren't any.