Re: [Tsvwg] SCTP stream EOF

Michael Tüxen <Michael.Tuexen@lurchi.franken.de> Fri, 19 September 2008 19:31 UTC

Return-Path: <tsvwg-bounces@ietf.org>
X-Original-To: tsvwg-archive@optimus.ietf.org
Delivered-To: ietfarch-tsvwg-archive@core3.amsl.com
Received: from [127.0.0.1] (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id DC07E3A6ABE; Fri, 19 Sep 2008 12:31:26 -0700 (PDT)
X-Original-To: tsvwg@core3.amsl.com
Delivered-To: tsvwg@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 860153A6ABE for <tsvwg@core3.amsl.com>; Fri, 19 Sep 2008 12:31:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.645
X-Spam-Level:
X-Spam-Status: No, score=0.645 tagged_above=-999 required=5 tests=[AWL=-2.594, BAYES_00=-2.599, FRT_STOCK2=3.988, HELO_EQ_DE=0.35, J_CHICKENPOX_33=0.6, J_CHICKENPOX_42=0.6, MIME_8BIT_HEADER=0.3]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7ywadALEMCqK for <tsvwg@core3.amsl.com>; Fri, 19 Sep 2008 12:31:24 -0700 (PDT)
Received: from mail-n.franken.de (mail-n.franken.de [193.175.24.27]) by core3.amsl.com (Postfix) with ESMTP id 0BC0C3A69EF for <tsvwg@ietf.org>; Fri, 19 Sep 2008 12:31:24 -0700 (PDT)
Received: from [IPv6:2002:508f:f817::21e:c2ff:fe00:76c8] (unknown [IPv6:2002:508f:f817:0:21e:c2ff:fe00:76c8]) by mail-n.franken.de (Postfix) with ESMTP id 888D21C0C0BD9; Fri, 19 Sep 2008 21:21:34 +0200 (CEST)
Message-Id: <5C46222F-E227-45EA-B45E-5ED4A2B35002@lurchi.franken.de>
From: Michael Tüxen <Michael.Tuexen@lurchi.franken.de>
To: Florian Niederbacher <florian.niederbacher@student.uibk.ac.at>
In-Reply-To: <48D3F106.7020201@student.uibk.ac.at>
Content-Type: text/plain; charset="US-ASCII"; format="flowed"; delsp="yes"
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Apple Message framework v929.2)
Date: Fri, 19 Sep 2008 21:21:32 +0200
References: <48D10AD3.10307@student.uibk.ac.at> <D914D831-188B-4194-835F-E2A6EDD495B3@lakerest.net> <48D11A2C.8020005@student.uibk.ac.at> <38B80FA2-E873-462A-8D6B-DD4A94DACEF2@lakerest.net> <48D3F106.7020201@student.uibk.ac.at>
X-Mailer: Apple Mail (2.929.2)
Cc: tsvwg@ietf.org, Randy Stewart <randall@lakerest.net>
Subject: Re: [Tsvwg] SCTP stream EOF
X-BeenThere: tsvwg@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Transport Area Working Group <tsvwg.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/tsvwg>, <mailto:tsvwg-request@ietf.org?subject=unsubscribe>
List-Archive: <https://www.ietf.org/mailman/private/tsvwg>
List-Post: <mailto:tsvwg@ietf.org>
List-Help: <mailto:tsvwg-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tsvwg>, <mailto:tsvwg-request@ietf.org?subject=subscribe>
Sender: tsvwg-bounces@ietf.org
Errors-To: tsvwg-bounces@ietf.org

On Sep 19, 2008, at 8:35 PM, Florian Niederbacher wrote:

> Randy Stewart schrieb:
>>
>> On Sep 17, 2008, at 10:54 AM, Florian Niederbacher wrote:
>>
>>> Randy Stewart schrieb:
>>>> Florian:
>>>>
>>>> What do you mean by an EOF?
>>> Same as EOF for files. That blocking recv and recvmsg can be  
>>> stopped.
>>>>
>>>> For messages there is a SCTP_EOR to tell you a "message" as ended.
>>> Yes, but only for message you pick up from recv- buffer if I  
>>> interpret it right from socket_api-spec.
>>> E.g. transfer Hello in to messages hel - lo. After 'lo' I get an  
>>> EOF.
>>> SCTP_EOR does only indicate that the message can be read in full  
>>> in one read/recv, or not? Because i get always SCTP_EOR in my app,  
>>> only if the messagesize is bigger then the buffer for recv\recv_msg.
>>
>> If I have a recv buffer of 2 bytes and you send me "hello\n"
>> I would get
>> read (he - no eor)
>> read (ll - no eor)
>> read (o\n - EOR)
>>
>> It depends on your read size...
>
> Yes, and it works in the following way if I use SCTP_EXPLICIT_EOR  
> with a buffer greater then sizeof("hello\n"), agree?
>
> setsocketopt(SCTP_EXPLICIT_EOR)
>
> send (he - no eor)  -> read (he - no eor)
> send (ll - no eor) ->  read(ll - no eor)
> send (o\n - no eor) -> read (o\n - no eor)
> send(EOR)   -> read(EOR)
You can not just send an EOR... An this requires that the recv buffer  
size is 2 byte.
So you must send the n\n with EOR.
>
>
> But in this way no transfer of other fragmented streams on the same  
> association is possible, right? Therefore an
Right.
> application causes nearly a similar HOL in SCTP, as TCP transmission  
> does if more files(file1, file2,..) over one TCP connection are  
> send. It could be very problematic if the records are really big.
SCTP is not optimized for large messages... It is originally designed  
for small messages.
>
> My scope was using the EOR for signaling the end of a data file  
> transmission. But with multiple streams this results up in blocking  
> other streams, because only one stream can have a fragmentation at  
> time (if I interpret it right from SCTP RFC).
Correct.
Why are you not signalling the end of transmission is the application  
layer protocol?
>
> The solution would be to use your new proposal with STREAM_RESET. It  
> does exactly what I would need. But also this solution has some  
> disadvantages. If an application needs a transfer of many files on  
> multiple streams and STREAM_RESET is used to signal a "READ_STOP" or  
> lets say an EOF, it can end up in many STREAM_RESET chunks on the  
> net. This causes a lot of traffic and slows down SCTP transfers. The  
> conclusion is that STREAM_RESET can be used but it should be avoided  
> in this case, because it can be handled in a better way.
If you want to transfer "multiple files", Why not signal the end of a  
file in the application layer.

For example you could send a message indicating the start of a  
transfer, then the is several messages
the file and finally an application layer message indicating the end  
of it. You could use, for example,
the PPID to distinguish between them or have a length indication in  
the start message or so.
Using "one message per file" is theoretically possible, but not very  
efficient...
>
>
> That what I have in mind would be to use and define an additional  
> new flag from the SCTP_DATA chunk. At the moment only UBE flags are  
> used(fortunately some space left). If an additional flag would be  
> introduced this could signal an EOF or "READ_STOP". It would help to  
> reduce the excessive sending of STREAM_RESET chunks and doesn't blow  
> up network traffic. I guess a lot of application in future would  
> benefit from the possibility to use an EOF or EOT(end of transfer)  
> on streams. TCP generates EOF only by closing the connection (close  
> socket). This is the EOF or EOT signal to stop blocking reads. SCTP  
> cannot do it in the same way if an application uses multistreaming.  
> MSG_EOF and MSG_ABORT from SCTP can also not be used, because it  
> results in starting up the initiation of the SHUTDOWN procedure.
Hmmm. I think your problem is that you are using a message for big  
things. You might rethink about this.

Please note that a STREAM RESET is not a READ_STOP which you can  
continue later, it is the end of
the file. So you can still not mix sending several files in parallel.

So signalling file boundaries by message boundaries should be avoided.
>
>
> These would be some the arguments for defining an additional flag in  
> SCTP.
>
> What are your thoughts and comments?
>
>
>
>>
>>
>>
>>>
>>>>
>>>>
>>>> If you were using stream reset, and the peer decides to "reset" a  
>>>> stream
>>>> and then use the stream for some other purpose (this is what I  
>>>> think you
>>>> are stating).... then the user would get a STREAM_RESET event for  
>>>> that
>>>> stream.
>>>>
>>>> I don't see the difference (other than name) in stream-x has been  
>>>> reset
>>>> vs stream X receives a EOF. Note that an app MAY choose to use a  
>>>> RESET
>>>> as a EOF.. but it can also mean something different to an app.. I  
>>>> am done
>>>> sending this type of message, I will now send other types of  
>>>> messages.
>>>> Which is different than an EOF....
>>> Yes I agree. I didn't know that STREAM_RESET is handled as event.  
>>> This would definitely solve my case. But is this already  
>>> implemented in LKSCTP?
>>>
>>
>>
>> We have it in FreeBSD but we as yet do not support adding more  
>> streams.. another
>> thing I need to add :)
>>
>> I don't know about LKSCTP at the last interop they did not support it
>>
>> R
>>
>>>>
>>>> Note also that the socket-api section is still missing (if I  
>>>> remember right) from
>>>> the stream-reconfig draft... I do need to add this. But I really  
>>>> think
>>>> the Stream-Reset serves the purpose you are looking for.
>>>>
>>>> R
>>>> On Sep 17, 2008, at 9:49 AM, Florian Niederbacher wrote:
>>>>
>>>>> Hi,
>>>>> I would ask what are you thinking about a definition for an EOF  
>>>>> on streams in SCTP. My problem is that I would need a signaling  
>>>>> method to report an EOF without closing the whole SCTP  
>>>>> association. If I am right, socket connections get only an EOF  
>>>>> if the connection will be closed (no sending of EOF on socktes  
>>>>> in another way is possible). In draft-stewart-tsvwg- 
>>>>> sctpstrrst-00 the possibility the reset of streams is discussed.  
>>>>> This would also be a solution if you can check the numbering  
>>>>> sequence in User Space.
>>>>> A proposal would be to generate an SCTP_EVENT e.g.  
>>>>> SCTP_STREAM_EOF to signal EOF on streams. In this way you can  
>>>>> stop receiving and also reuse the stream or at least continue in  
>>>>> multi-streamed network applications, if you use different  
>>>>> threads or processes for the receiving procedure on streams.  
>>>>> Maybe an other possibility exists to signal an EOF on SCTP  
>>>>> streams, but at the moment I can't find any solution to deal  
>>>>> with this problem. What are your proposals and comments?
>>>>>
>>>>> Best regards
>>>>> Florian Niederbacher
>>>>
>>>> -----
>>>> Randall Stewart
>>>> randall@lakerest.net
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> - Regards Florian
>>>
>>
>> -----
>> Randall Stewart
>> randall@lakerest.net
>>
>>
>>
>>
>>
> Regards
> Florian
>