Re: Internal TCP/IP send buffer?
From: Alun Jones [MSFT] (alunj_at_online.microsoft.com)
Date: 10/22/04
- Next message: Dan Mitchell: "Listening port -> process ID?"
- Previous message: Alun Jones [MSFT]: "Re: UDP Broadcast issues."
- In reply to: Marton Anka: "Re: Internal TCP/IP send buffer?"
- Next in thread: Arkady Frenkel: "Re: Internal TCP/IP send buffer?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 22 Oct 2004 14:14:34 -0700
"Marton Anka" <marton@03am.com> wrote in message
news:e8CCHxFuEHA.3860@TK2MSFTNGP09.phx.gbl...
> No - Nagle can be both a blessing and a curse. That's why there's an
> option to disable it. It's simply there to help with bandwidth efficiency
> when throughput is preferred over latency. In this case I need to minimize
> latency.
IMHO, it's a rare application that truly needs to use TCP and disable Nagle.
> I'm not trying to work around them. If the buffer I'm talking about is
> indeed the TCP window, then how do I go about adjusting its size for the
> current connection?
It's a part of the negotiation between server and client - I don't know that
it's something you can successfully control directly. There are some
registry entries for changing the window on a system-wide basis, but I doubt
that this is the only application you'll be running.
> Actually, it will solve my problem. If you can show me where UDP
> guarantees delivery, orders packets and controls data flow then yes, it
> would be better
But you're specifically asking to _not_ guarantee delivery. You're asking
that, if a piece of data cannot reach its destination in a small time, it
should be discarded as 'outdated'. Ordering packets is dead easy, you
simply attach a sequence number to each packet - but then again, all you
appear to be asking for is the ability to take the most recent data,
discarding the old stuff. For this, a time-stamp is more useful than a
sequence number. Just add it to the data structure that embodies your data.
> to use it. At this point however it seems like I'm asking for this
> non-existent UDP to behave more like TCP. So I might as well use TCP the
> way it was intended to be used, but how can I control that pesky buffer?
Given a choice between trying to get TCP to drop some features, or trying to
add features to UDP, it's usual to find that the former is not something
that you're given the tools to do, so you have to do the latter.
"That pesky buffer" is an intrinsic part of TCP's operation.
> Client is connected to Proxy over the internet, possibly with a very slow
> connection. Server is connected to Proxy over gigabit ethernet. Server is
> sending small chunks of data to Proxy that gets forwarded to Client. TCP
> buffering between Proxy and Server is causing problems with the data being
> out of date by the time it is recv()-d by Proxy. Proxy has no knowledge of
> the protocol used between Client and Server, and even if it did it could
> not do anything with it as the data is encrypted.
You still haven't outlined specifically what you plan on doing with data
that is "out of date".
If you intend to discard it in favour of more recent data, then TCP is a
clear loss, and UDP is a clear win. That's because UDP allows you (by
requiring you to write your own retransmission algorithm) to choose not to
retransmit older data. It also has the advantage (in your case) that
individual packets of data travel on their own, without being crammed in
with other packets to form a larger IP packet.
Yes, it's a bit of work to write your own retransmission routine, and
another bit of work to add timestamps / sequencing information in your data,
but TCP is tuned for a scenario that doesn't include you. Go with UDP, is
my advice. To achieve what you're trying to do, using published APIs, you'd
pretty much have to write your own TCP layer in NDIS. Now that's really
hard work.
Alun.
~~~~
- Next message: Dan Mitchell: "Listening port -> process ID?"
- Previous message: Alun Jones [MSFT]: "Re: UDP Broadcast issues."
- In reply to: Marton Anka: "Re: Internal TCP/IP send buffer?"
- Next in thread: Arkady Frenkel: "Re: Internal TCP/IP send buffer?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|