Subject: [Tsvwg] Re: zero length send

From: [email-masked]
Date: Sun, 27 Jan 2002 23:05:29 EST

Even if TCP did send an empty packet for a zero length write, wouldn't it be 
essentially identical to a 'keep alive' packet, and so of little signaling 
value?  If it did affect the receiving end, a zero length read might be 
mistaken for EOF.  I once coded this on a UNIX pipe, to test if the reading 
process was alive, but all I did was trick the recipient into closing the 
pipe.

It seems proper that UDP sends an empty datagram, as that is just a very 
trivial case of a datagram.  It's most obvious use would be as an application 
level 'keep alive' to support a virtual connection.

If a protocol sends and receives messages, an empty message is valid, but if 
it is a stream of primitives (words, bytes, bits), then an empty write should 
put nothing on the stream.  Historically, such a write has either been 
ignored, illegal, or impossible (assigning the length 0 to mean 2^n, thereby 
gaining an enticingly round but tiny bit of range at the cost of a bunch of 
counter-intuitiveness).  I like 'ignored,' as it generates less code.  It's 
nice to decide, and tell users explicitly what to expect.  It hardly seems 
worth making the behavior explicitly implementation dependent or implicitly 
laissez-faire.

---

From: Randall Stewart <[email-masked]>
Date: Mon, 28 Jan 2002 08:16:35 -0600

Comments below..

[email-masked] wrote:
> 
> Even if TCP did send an empty packet for a zero length write, wouldn't
> it be essentially identical to a 'keep alive' packet, and so of little
> signaling value?  If it did affect the receiving end, a zero length
> read might be mistaken for EOF.  I once coded this on a UNIX pipe, to
> test if the reading process was alive, but all I did was trick the
> recipient into closing the pipe.

Yes, this is (if I remember right) why the IESG had us
make it illegal to send a 0 length chunk... i.e. it might
be mistaken for a EOF...

> 
> It seems proper that UDP sends an empty datagram, as that is just a
> very trivial case of a datagram.  It's most obvious use would be as an
> application level 'keep alive' to support a virtual connection.
> 
> If a protocol sends and receives messages, an empty message is valid,
> but if it is a stream of primitives (words, bytes, bits), then an
> empty write should put nothing on the stream.  Historically, such a
> write has either been ignored, illegal, or impossible (assigning the
> length 0 to mean 2^n, thereby gaining an enticingly round but tiny bit
> of range at the cost of a bunch of counter-intuitiveness).  I like
> 'ignored,' as it generates less code.  It's nice to decide, and tell
> users explicitly what to expect.  It hardly seems worth making the
> behavior explicitly implementation dependent or implicitly
> laissez-faire.

True, we probably should add something that says either
that an error should be returned or it should be accepted
and discarded .. I don't really care which.. 

R

-- 
Randall R. Stewart
[email-masked] 815-342-5222 (cell phone)

_______________________________________________
tsvwg mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/tsvwg