Quantcast

TCP default?

classic Classic list List threaded Threaded
43 messages Options
123
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

TCP default?

amindfv
File this under "not urgent":

  - Networks are much faster than they were when the decision was made to have a UDP default

  - Many OSC messages are in fact "better late than never": e.g. dropping a /n_free can be a lot worse than eg a moment of audio dropping out. UDP can drop out or reorder even on localhost(!)

  - Most SC development is done on localhost, where TCP is plenty fast. We assume you have to do more tinkering when you use a machine not on localhost; maybe that tinkering would include considering the switch to UDP?

Any thoughts on switching at some point? (Or doing some exploratory benchmarking?)

Tom
_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: TCP default?

ogbornd
+1 !

Yours truly,
David

________________________________________
From: [hidden email] [[hidden email]] on behalf of [hidden email] [[hidden email]]
Sent: Monday, December 19, 2016 5:10 PM
To: [hidden email]
Subject: [sc-users] TCP default?

File this under "not urgent":

  - Networks are much faster than they were when the decision was made to have a UDP default

  - Many OSC messages are in fact "better late than never": e.g. dropping a /n_free can be a lot worse than eg a moment of audio dropping out. UDP can drop out or reorder even on localhost(!)

  - Most SC development is done on localhost, where TCP is plenty fast. We assume you have to do more tinkering when you use a machine not on localhost; maybe that tinkering would include considering the switch to UDP?

Any thoughts on switching at some point? (Or doing some exploratory benchmarking?)

Tom
_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TCP default?

Julian Rohrhuber-3
good point. Careful benchmarking really might be necessary to decide this, see e.g. http://stackoverflow.com/questions/47903/udp-vs-tcp-how-much-faster-is-it


> On 19.12.2016, at 22:15, Ogborn, David <[hidden email]> wrote:
>
> +1 !
>
> Yours truly,
> David
>
> ________________________________________
> From: [hidden email] [[hidden email]] on behalf of [hidden email] [[hidden email]]
> Sent: Monday, December 19, 2016 5:10 PM
> To: [hidden email]
> Subject: [sc-users] TCP default?
>
> File this under "not urgent":
>
>  - Networks are much faster than they were when the decision was made to have a UDP default
>
>  - Many OSC messages are in fact "better late than never": e.g. dropping a /n_free can be a lot worse than eg a moment of audio dropping out. UDP can drop out or reorder even on localhost(!)
>
>  - Most SC development is done on localhost, where TCP is plenty fast. We assume you have to do more tinkering when you use a machine not on localhost; maybe that tinkering would include considering the switch to UDP?
>
> Any thoughts on switching at some point? (Or doing some exploratory benchmarking?)
>
> Tom
> _______________________________________________
> sc-users mailing list
>
> info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
>
> _______________________________________________
> sc-users mailing list
>
> info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/


signature.asc (859 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TCP default?

Glen Fraser
Julian Rohrhuber-3 wrote
good point. Careful benchmarking really might be necessary to decide this, see e.g. http://stackoverflow.com/questions/47903/udp-vs-tcp-how-much-faster-is-it
For fun, I looked for some latency benchmarking tests.  I came across this.  He includes no UDP test, so I added one (submitted as a pull request to his repo; in the meantime you can see my forked version here).  A quick test of the TCP and (now) UDP latency tests, give results (on my MacBook Air) such as:

./tcp_lat 100 10000
message size: 100 octets
roundtrip count: 10000
average latency: 17770 ns
./udp_lat 100 10000
message size: 100 octets
roundtrip count: 10000
average latency: 17528 ns

On my machine, the UDP/TCP latencies tend to be very similar, for a given message size and iteration count.

Note that for the above test, the UNIX pipe latency was a mere 5400 ns whereas UNIX domain sockets achieved about 7300 ns, about 2-3 times faster than using localhost (TCP or UDP) network sockets.  Still, 18 microseconds isn't too bad either...

Also note that it would be useful to look at the min and max latencies, not just average.  If you only send one small packet, you'll see that the latency can be quite large, around a couple of hundred microseconds.  The average latencies go up when you do fewer roundtrips in a burst (i.e. this test is not exactly representative of how SC would be sending data).

Still, it might be useful, especially to see that (on my machine at least) the results look quite similar for TCP and UDP.

Glen.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TCP default?

Glen Fraser
Hmm, not sure why the test results didn’t show up in my mail (they do appear in the Nabble forum)… For the record, they should have read:

./tcp_lat 100 10000
message size: 100 octets
roundtrip count: 10000
average latency: 17770 ns
./udp_lat 100 10000
message size: 100 octets
roundtrip count: 10000
average latency: 17528 ns


On 20 Dec 2016, at 15:07, Glen Fraser <[hidden email]> wrote:

Julian Rohrhuber-3 wrote
good point. Careful benchmarking really might be necessary to decide this,
see e.g.
http://stackoverflow.com/questions/47903/udp-vs-tcp-how-much-faster-is-it

For fun, I looked for some latency benchmarking tests.  I came across  this
<https://github.com/rigtorp/ipc-bench>  .  He includes no UDP test, so I
added one (submitted as a pull request to his repo; in the meantime you can
see my forked version  here <https://github.com/totalgee/ipc-bench>  ).  A
quick test of the TCP and (now) UDP latency tests, give results (on my
MacBook Air) such as:



On my machine, the UDP/TCP latencies tend to be very similar, for a given
message size and iteration count.

Note that for the above test, the UNIX pipe latency was a mere 5400 ns
whereas UNIX domain sockets achieved about 7300 ns, about 2-3 times faster
than using localhost (TCP or UDP) network sockets.  Still, 18 microseconds
isn't too bad either...

Also note that it would be useful to look at the min and max latencies, not
just average.  If you only send one small packet, you'll see that the
latency can be quite large, around a couple of hundred microseconds.  The
average latencies go up when you do fewer roundtrips in a burst (i.e. this
test is not exactly representative of how SC would be sending data).

Still, it might be useful, especially to see that (on my machine at least)
the results look quite similar for TCP and UDP.

Glen.



--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/TCP-default-tp7629613p7629627.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TCP default?

amindfv
Thanks for the first batch of numbers, Glen!

I see very similar results testing TCP vs UDP in general (ie a ~0-3% time increase for TCP). I'm working on some simple SC tests too.

tom


El 20 dic 2016, a las 08:11, Glen Fraser <[hidden email]> escribió:

Hmm, not sure why the test results didn’t show up in my mail (they do appear in the Nabble forum)… For the record, they should have read:

./tcp_lat 100 10000
message size: 100 octets
roundtrip count: 10000
average latency: 17770 ns
./udp_lat 100 10000
message size: 100 octets
roundtrip count: 10000
average latency: 17528 ns


On 20 Dec 2016, at 15:07, Glen Fraser <[hidden email]> wrote:

Julian Rohrhuber-3 wrote
good point. Careful benchmarking really might be necessary to decide this,
see e.g.
http://stackoverflow.com/questions/47903/udp-vs-tcp-how-much-faster-is-it

For fun, I looked for some latency benchmarking tests.  I came across  this
<https://github.com/rigtorp/ipc-bench>  .  He includes no UDP test, so I
added one (submitted as a pull request to his repo; in the meantime you can
see my forked version  here <https://github.com/totalgee/ipc-bench>  ).  A
quick test of the TCP and (now) UDP latency tests, give results (on my
MacBook Air) such as:



On my machine, the UDP/TCP latencies tend to be very similar, for a given
message size and iteration count.

Note that for the above test, the UNIX pipe latency was a mere 5400 ns
whereas UNIX domain sockets achieved about 7300 ns, about 2-3 times faster
than using localhost (TCP or UDP) network sockets.  Still, 18 microseconds
isn't too bad either...

Also note that it would be useful to look at the min and max latencies, not
just average.  If you only send one small packet, you'll see that the
latency can be quite large, around a couple of hundred microseconds.  The
average latencies go up when you do fewer roundtrips in a burst (i.e. this
test is not exactly representative of how SC would be sending data).

Still, it might be useful, especially to see that (on my machine at least)
the results look quite similar for TCP and UDP.

Glen.



--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/TCP-default-tp7629613p7629627.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TCP default?

Julian Rohrhuber-3
that would be great. High density of small messages seems an important parameter (think granular synthesis, > 1000 messages/sec). Maybe you can add a test for broadcasting, too.


> On 20.12.2016, at 16:37, [hidden email] wrote:
>
> Thanks for the first batch of numbers, Glen!
>
> I see very similar results testing TCP vs UDP in general (ie a ~0-3% time increase for TCP). I'm working on some simple SC tests too.
>
> tom
>
>
> El 20 dic 2016, a las 08:11, Glen Fraser <[hidden email]> escribió:
>
>> Hmm, not sure why the test results didn’t show up in my mail (they do appear in the Nabble forum)… For the record, they should have read:
>>
>> ./tcp_lat
>>  100 10000
>> message size: 100 octets
>> roundtrip count: 10000
>> average latency: 17770 ns
>> ./
>> udp_lat
>>  100 10000
>> message size: 100 octets
>> roundtrip count: 10000
>> average latency: 17528 ns
>>
>>
>>
>>> On 20 Dec 2016, at 15:07, Glen Fraser <[hidden email]> wrote:
>>>
>>> Julian Rohrhuber-3 wrote
>>>> good point. Careful benchmarking really might be necessary to decide this,
>>>> see e.g.
>>>> http://stackoverflow.com/questions/47903/udp-vs-tcp-how-much-faster-is-it
>>>
>>> For fun, I looked for some latency benchmarking tests.  I came across  this
>>> <https://github.com/rigtorp/ipc-bench>  .  He includes no UDP test, so I
>>> added one (submitted as a pull request to his repo; in the meantime you can
>>> see my forked version  here <https://github.com/totalgee/ipc-bench>  ).  A
>>> quick test of the TCP and (now) UDP latency tests, give results (on my
>>> MacBook Air) such as:
>>>
>>>
>>>
>>> On my machine, the UDP/TCP latencies tend to be very similar, for a given
>>> message size and iteration count.
>>>
>>> Note that for the above test, the UNIX pipe latency was a mere 5400 ns
>>> whereas UNIX domain sockets achieved about 7300 ns, about 2-3 times faster
>>> than using localhost (TCP or UDP) network sockets.  Still, 18 microseconds
>>> isn't too bad either...
>>>
>>> Also note that it would be useful to look at the min and max latencies, not
>>> just average.  If you only send one small packet, you'll see that the
>>> latency can be quite large, around a couple of hundred microseconds.  The
>>> average latencies go up when you do fewer roundtrips in a burst (i.e. this
>>> test is not exactly representative of how SC would be sending data).
>>>
>>> Still, it might be useful, especially to see that (on my machine at least)
>>> the results look quite similar for TCP and UDP.
>>>
>>> Glen.
>>>
>>>
>>>
>>> --
>>> View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/TCP-default-tp7629613p7629627.html
>>> Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> sc-users mailing list
>>>
>>> info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
>>> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
>>> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
>>


signature.asc (859 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TCP default?

amindfv
Julian -- are the granular synthesis messages typically "batched" into bundles?

Tom


> El 20 dic 2016, a las 11:51, Julian Rohrhuber <[hidden email]> escribió:
>
> that would be great. High density of small messages seems an important parameter (think granular synthesis, > 1000 messages/sec). Maybe you can add a test for broadcasting, too.
>
>
>> On 20.12.2016, at 16:37, [hidden email] wrote:
>>
>> Thanks for the first batch of numbers, Glen!
>>
>> I see very similar results testing TCP vs UDP in general (ie a ~0-3% time increase for TCP). I'm working on some simple SC tests too.
>>
>> tom
>>
>>
>>> El 20 dic 2016, a las 08:11, Glen Fraser <[hidden email]> escribió:
>>>
>>> Hmm, not sure why the test results didn’t show up in my mail (they do appear in the Nabble forum)… For the record, they should have read:
>>>
>>> ./tcp_lat
>>> 100 10000
>>> message size: 100 octets
>>> roundtrip count: 10000
>>> average latency: 17770 ns
>>> ./
>>> udp_lat
>>> 100 10000
>>> message size: 100 octets
>>> roundtrip count: 10000
>>> average latency: 17528 ns
>>>
>>>
>>>
>>>> On 20 Dec 2016, at 15:07, Glen Fraser <[hidden email]> wrote:
>>>>
>>>> Julian Rohrhuber-3 wrote
>>>>> good point. Careful benchmarking really might be necessary to decide this,
>>>>> see e.g.
>>>>> http://stackoverflow.com/questions/47903/udp-vs-tcp-how-much-faster-is-it
>>>>
>>>> For fun, I looked for some latency benchmarking tests.  I came across  this
>>>> <https://github.com/rigtorp/ipc-bench>  .  He includes no UDP test, so I
>>>> added one (submitted as a pull request to his repo; in the meantime you can
>>>> see my forked version  here <https://github.com/totalgee/ipc-bench>  ).  A
>>>> quick test of the TCP and (now) UDP latency tests, give results (on my
>>>> MacBook Air) such as:
>>>>
>>>>
>>>>
>>>> On my machine, the UDP/TCP latencies tend to be very similar, for a given
>>>> message size and iteration count.
>>>>
>>>> Note that for the above test, the UNIX pipe latency was a mere 5400 ns
>>>> whereas UNIX domain sockets achieved about 7300 ns, about 2-3 times faster
>>>> than using localhost (TCP or UDP) network sockets.  Still, 18 microseconds
>>>> isn't too bad either...
>>>>
>>>> Also note that it would be useful to look at the min and max latencies, not
>>>> just average.  If you only send one small packet, you'll see that the
>>>> latency can be quite large, around a couple of hundred microseconds.  The
>>>> average latencies go up when you do fewer roundtrips in a burst (i.e. this
>>>> test is not exactly representative of how SC would be sending data).
>>>>
>>>> Still, it might be useful, especially to see that (on my machine at least)
>>>> the results look quite similar for TCP and UDP.
>>>>
>>>> Glen.
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/TCP-default-tp7629613p7629627.html
>>>> Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.
>>>>
>>>> _______________________________________________
>>>> sc-users mailing list
>>>>
>>>> info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
>>>> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
>>>> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
>

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TCP default?

Julian Rohrhuber-3
no, normally they come incrementally,

(
var dt = 1/1000;
fork { loop { dt.wait; s.sendBundle(0.2, ["/s_new", etc… ]) } };
)


> On 20.12.2016, at 20:20, [hidden email] wrote:
>
> Julian -- are the granular synthesis messages typically "batched" into bundles?
>
> Tom
>
>
>> El 20 dic 2016, a las 11:51, Julian Rohrhuber <[hidden email]> escribió:
>>
>> that would be great. High density of small messages seems an important parameter (think granular synthesis, > 1000 messages/sec). Maybe you can add a test for broadcasting, too.
>>
>>
>>> On 20.12.2016, at 16:37, [hidden email] wrote:
>>>
>>> Thanks for the first batch of numbers, Glen!
>>>
>>> I see very similar results testing TCP vs UDP in general (ie a ~0-3% time increase for TCP). I'm working on some simple SC tests too.
>>>
>>> tom
>>>
>>>
>>>> El 20 dic 2016, a las 08:11, Glen Fraser <[hidden email]> escribió:
>>>>
>>>> Hmm, not sure why the test results didn’t show up in my mail (they do appear in the Nabble forum)… For the record, they should have read:
>>>>
>>>> ./tcp_lat
>>>> 100 10000
>>>> message size: 100 octets
>>>> roundtrip count: 10000
>>>> average latency: 17770 ns
>>>> ./
>>>> udp_lat
>>>> 100 10000
>>>> message size: 100 octets
>>>> roundtrip count: 10000
>>>> average latency: 17528 ns
>>>>
>>>>
>>>>
>>>>> On 20 Dec 2016, at 15:07, Glen Fraser <[hidden email]> wrote:
>>>>>
>>>>> Julian Rohrhuber-3 wrote
>>>>>> good point. Careful benchmarking really might be necessary to decide this,
>>>>>> see e.g.
>>>>>> http://stackoverflow.com/questions/47903/udp-vs-tcp-how-much-faster-is-it
>>>>>
>>>>> For fun, I looked for some latency benchmarking tests.  I came across  this
>>>>> <https://github.com/rigtorp/ipc-bench>  .  He includes no UDP test, so I
>>>>> added one (submitted as a pull request to his repo; in the meantime you can
>>>>> see my forked version  here <https://github.com/totalgee/ipc-bench>  ).  A
>>>>> quick test of the TCP and (now) UDP latency tests, give results (on my
>>>>> MacBook Air) such as:
>>>>>
>>>>>
>>>>>
>>>>> On my machine, the UDP/TCP latencies tend to be very similar, for a given
>>>>> message size and iteration count.
>>>>>
>>>>> Note that for the above test, the UNIX pipe latency was a mere 5400 ns
>>>>> whereas UNIX domain sockets achieved about 7300 ns, about 2-3 times faster
>>>>> than using localhost (TCP or UDP) network sockets.  Still, 18 microseconds
>>>>> isn't too bad either...
>>>>>
>>>>> Also note that it would be useful to look at the min and max latencies, not
>>>>> just average.  If you only send one small packet, you'll see that the
>>>>> latency can be quite large, around a couple of hundred microseconds.  The
>>>>> average latencies go up when you do fewer roundtrips in a burst (i.e. this
>>>>> test is not exactly representative of how SC would be sending data).
>>>>>
>>>>> Still, it might be useful, especially to see that (on my machine at least)
>>>>> the results look quite similar for TCP and UDP.
>>>>>
>>>>> Glen.
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/TCP-default-tp7629613p7629627.html
>>>>> Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.
>>>>>
>>>>> _______________________________________________
>>>>> sc-users mailing list
>>>>>
>>>>> info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
>>>>> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
>>>>> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
>>
>
> _______________________________________________
> sc-users mailing list
>
> info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/


signature.asc (859 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TCP default?

Julian Rohrhuber-3
… sometimes each of these messages is an OSC bundle with a few messages.

> On 20.12.2016, at 19:57, Julian Rohrhuber <[hidden email]> wrote:
>
> no, normally they come incrementally,
>
> (
> var dt = 1/1000;
> fork { loop { dt.wait; s.sendBundle(0.2, ["/s_new", etc… ]) } };
> )
>
>
>> On 20.12.2016, at 20:20, [hidden email] wrote:
>>
>> Julian -- are the granular synthesis messages typically "batched" into bundles?
>>
>> Tom
>>
>>
>>> El 20 dic 2016, a las 11:51, Julian Rohrhuber <[hidden email]> escribió:
>>>
>>> that would be great. High density of small messages seems an important parameter (think granular synthesis, > 1000 messages/sec). Maybe you can add a test for broadcasting, too.
>>>
>>>
>>>> On 20.12.2016, at 16:37, [hidden email] wrote:
>>>>
>>>> Thanks for the first batch of numbers, Glen!
>>>>
>>>> I see very similar results testing TCP vs UDP in general (ie a ~0-3% time increase for TCP). I'm working on some simple SC tests too.
>>>>
>>>> tom
>>>>
>>>>
>>>>> El 20 dic 2016, a las 08:11, Glen Fraser <[hidden email]> escribió:
>>>>>
>>>>> Hmm, not sure why the test results didn’t show up in my mail (they do appear in the Nabble forum)… For the record, they should have read:
>>>>>
>>>>> ./tcp_lat
>>>>> 100 10000
>>>>> message size: 100 octets
>>>>> roundtrip count: 10000
>>>>> average latency: 17770 ns
>>>>> ./
>>>>> udp_lat
>>>>> 100 10000
>>>>> message size: 100 octets
>>>>> roundtrip count: 10000
>>>>> average latency: 17528 ns
>>>>>
>>>>>
>>>>>
>>>>>> On 20 Dec 2016, at 15:07, Glen Fraser <[hidden email]> wrote:
>>>>>>
>>>>>> Julian Rohrhuber-3 wrote
>>>>>>> good point. Careful benchmarking really might be necessary to decide this,
>>>>>>> see e.g.
>>>>>>> http://stackoverflow.com/questions/47903/udp-vs-tcp-how-much-faster-is-it
>>>>>>
>>>>>> For fun, I looked for some latency benchmarking tests.  I came across  this
>>>>>> <https://github.com/rigtorp/ipc-bench>  .  He includes no UDP test, so I
>>>>>> added one (submitted as a pull request to his repo; in the meantime you can
>>>>>> see my forked version  here <https://github.com/totalgee/ipc-bench>  ).  A
>>>>>> quick test of the TCP and (now) UDP latency tests, give results (on my
>>>>>> MacBook Air) such as:
>>>>>>
>>>>>>
>>>>>>
>>>>>> On my machine, the UDP/TCP latencies tend to be very similar, for a given
>>>>>> message size and iteration count.
>>>>>>
>>>>>> Note that for the above test, the UNIX pipe latency was a mere 5400 ns
>>>>>> whereas UNIX domain sockets achieved about 7300 ns, about 2-3 times faster
>>>>>> than using localhost (TCP or UDP) network sockets.  Still, 18 microseconds
>>>>>> isn't too bad either...
>>>>>>
>>>>>> Also note that it would be useful to look at the min and max latencies, not
>>>>>> just average.  If you only send one small packet, you'll see that the
>>>>>> latency can be quite large, around a couple of hundred microseconds.  The
>>>>>> average latencies go up when you do fewer roundtrips in a burst (i.e. this
>>>>>> test is not exactly representative of how SC would be sending data).
>>>>>>
>>>>>> Still, it might be useful, especially to see that (on my machine at least)
>>>>>> the results look quite similar for TCP and UDP.
>>>>>>
>>>>>> Glen.
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/TCP-default-tp7629613p7629627.html
>>>>>> Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.
>>>>>>
>>>>>> _______________________________________________
>>>>>> sc-users mailing list
>>>>>>
>>>>>> info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
>>>>>> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
>>>>>> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
>>>
>>
>> _______________________________________________
>> sc-users mailing list
>>
>> info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
>> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
>> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
>


signature.asc (859 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TCP default?

Chris Sattinger

Good article about why you should always use UDP for realtime games:
http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/


On Tue, Dec 20, 2016, 20:13 Julian Rohrhuber <[hidden email]> wrote:
… sometimes each of these messages is an OSC bundle with a few messages.

> On 20.12.2016, at 19:57, Julian Rohrhuber <[hidden email]> wrote:
>
> no, normally they come incrementally,
>
> (
> var dt = 1/1000;
> fork { loop { dt.wait; s.sendBundle(0.2, ["/s_new", etc… ]) } };
> )
>
>
>> On 20.12.2016, at 20:20, [hidden email] wrote:
>>
>> Julian -- are the granular synthesis messages typically "batched" into bundles?
>>
>> Tom
>>
>>
>>> El 20 dic 2016, a las 11:51, Julian Rohrhuber <[hidden email]> escribió:
>>>
>>> that would be great. High density of small messages seems an important parameter (think granular synthesis, > 1000 messages/sec). Maybe you can add a test for broadcasting, too.
>>>
>>>
>>>> On 20.12.2016, at 16:37, [hidden email] wrote:
>>>>
>>>> Thanks for the first batch of numbers, Glen!
>>>>
>>>> I see very similar results testing TCP vs UDP in general (ie a ~0-3% time increase for TCP). I'm working on some simple SC tests too.
>>>>
>>>> tom
>>>>
>>>>
>>>>> El 20 dic 2016, a las 08:11, Glen Fraser <[hidden email]> escribió:
>>>>>
>>>>> Hmm, not sure why the test results didn’t show up in my mail (they do appear in the Nabble forum)… For the record, they should have read:
>>>>>
>>>>> ./tcp_lat
>>>>> 100 10000
>>>>> message size: 100 octets
>>>>> roundtrip count: 10000
>>>>> average latency: 17770 ns
>>>>> ./
>>>>> udp_lat
>>>>> 100 10000
>>>>> message size: 100 octets
>>>>> roundtrip count: 10000
>>>>> average latency: 17528 ns
>>>>>
>>>>>
>>>>>
>>>>>> On 20 Dec 2016, at 15:07, Glen Fraser <[hidden email]> wrote:
>>>>>>
>>>>>> Julian Rohrhuber-3 wrote
>>>>>>> good point. Careful benchmarking really might be necessary to decide this,
>>>>>>> see e.g.
>>>>>>> http://stackoverflow.com/questions/47903/udp-vs-tcp-how-much-faster-is-it
>>>>>>
>>>>>> For fun, I looked for some latency benchmarking tests.  I came across  this
>>>>>> <https://github.com/rigtorp/ipc-bench>  .  He includes no UDP test, so I
>>>>>> added one (submitted as a pull request to his repo; in the meantime you can
>>>>>> see my forked version  here <https://github.com/totalgee/ipc-bench>  ).  A
>>>>>> quick test of the TCP and (now) UDP latency tests, give results (on my
>>>>>> MacBook Air) such as:
>>>>>>
>>>>>>
>>>>>>
>>>>>> On my machine, the UDP/TCP latencies tend to be very similar, for a given
>>>>>> message size and iteration count.
>>>>>>
>>>>>> Note that for the above test, the UNIX pipe latency was a mere 5400 ns
>>>>>> whereas UNIX domain sockets achieved about 7300 ns, about 2-3 times faster
>>>>>> than using localhost (TCP or UDP) network sockets.  Still, 18 microseconds
>>>>>> isn't too bad either...
>>>>>>
>>>>>> Also note that it would be useful to look at the min and max latencies, not
>>>>>> just average.  If you only send one small packet, you'll see that the
>>>>>> latency can be quite large, around a couple of hundred microseconds.  The
>>>>>> average latencies go up when you do fewer roundtrips in a burst (i.e. this
>>>>>> test is not exactly representative of how SC would be sending data).
>>>>>>
>>>>>> Still, it might be useful, especially to see that (on my machine at least)
>>>>>> the results look quite similar for TCP and UDP.
>>>>>>
>>>>>> Glen.
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/TCP-default-tp7629613p7629627.html
>>>>>> Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.
>>>>>>
>>>>>> _______________________________________________
>>>>>> sc-users mailing list
>>>>>>
>>>>>> info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
>>>>>> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
>>>>>> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
>>>
>>
>> _______________________________________________
>> sc-users mailing list
>>
>> info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
>> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
>> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TCP default?

Julian Rohrhuber-3

> On 30.12.2016, at 08:07, Chris Sattinger <[hidden email]> wrote:
>
> Good article about why you should always use UDP for realtime games:
> http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/

This seems to be a very good argument to just implement any necessary feature specifically on top of udp where you need it.

signature.asc (859 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TCP default?

Chris Sattinger
For instance ack and resend.

Really I don't think we have a problem. UDP works well. I don't think I've ever noticed a dropped message, but I'm sure this happens if you are on the real internet.

We can fix or improve TCP and people can find out in the real world if it's better for certain things.




On Fri, Dec 30, 2016 at 11:37 AM Julian Rohrhuber <[hidden email]> wrote:

> On 30.12.2016, at 08:07, Chris Sattinger <[hidden email]> wrote:
>
> Good article about why you should always use UDP for realtime games:
> http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/

This seems to be a very good argument to just implement any necessary feature specifically on top of udp where you need it.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TCP default?

Kuivila, Ronald
Hi Felix,

On a related note:

Does anyone out there have detailed knowledge about AVB (or Dante) networking?  
The synchronization, timing, and bandwidth guarantees those frameworks provide could
really simplify projects involving multiple computers on the same LAN.  

AVB allows WIFI while Dante requires wired connections. MOTU is doing AVB and 
has a relatively cheap AVB switch.   (On the other hand, sound system companies seem 
to be gravitating towards Dante.)


Cheers,

RJK



On Dec 30, 2016, at 4:56 AM, Chris Sattinger <[hidden email]> wrote:

For instance ack and resend.

Really I don't think we have a problem. UDP works well. I don't think I've ever noticed a dropped message, but I'm sure this happens if you are on the real internet.

We can fix or improve TCP and people can find out in the real world if it's better for certain things.




On Fri, Dec 30, 2016 at 11:37 AM Julian Rohrhuber <[hidden email]> wrote:

> On 30.12.2016, at 08:07, Chris Sattinger <[hidden email]> wrote:
>
> Good article about why you should always use UDP for realtime games:
> http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/

This seems to be a very good argument to just implement any necessary feature specifically on top of udp where you need it.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TCP default?

Julian Rohrhuber-3
In reply to this post by Chris Sattinger

> On 30.12.2016, at 12:56, Chris Sattinger <[hidden email]> wrote:
>
> For instance ack and resend.
>
> Really I don't think we have a problem. UDP works well. I don't think I've ever noticed a dropped message, but I'm sure this happens if you are on the real internet.

I’ve had a lot of connectivity problems in WLANs that were configured to be part of a larger intranet and/or that provide two networks (e.g. 5G and 3G). But I don’t assume this would become better with TCP.

>
> We can fix or improve TCP and people can find out in the real world if it's better for certain things.

Yes

>
>
>
>
> On Fri, Dec 30, 2016 at 11:37 AM Julian Rohrhuber <[hidden email]> wrote:
>
> > On 30.12.2016, at 08:07, Chris Sattinger <[hidden email]> wrote:
> >
> > Good article about why you should always use UDP for realtime games:
> > http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/
>
> This seems to be a very good argument to just implement any necessary feature specifically on top of udp where you need it.


signature.asc (859 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TCP default?

Glen Fraser
Just out of curiosity, is it possible to receive on a TCP connection in SC?  I know you can call “connect" on a NetAddr to connect with TCP (rather than UDP) and send messages on that connection…that much works for me.  But TCP is bidirectional, and I can’t see any way to set up SC to receive messages on the TCP connection…the NetAddr has a raw pointer to the socket, which isn’t very useful in sclang.  Is there any way to do this?

Thanks,
Glen.

On 30 Dec 2016, at 16:26, Julian Rohrhuber <[hidden email]> wrote:


On 30.12.2016, at 12:56, Chris Sattinger <[hidden email]> wrote:

For instance ack and resend.

Really I don't think we have a problem. UDP works well. I don't think I've ever noticed a dropped message, but I'm sure this happens if you are on the real internet.

I’ve had a lot of connectivity problems in WLANs that were configured to be part of a larger intranet and/or that provide two networks (e.g. 5G and 3G). But I don’t assume this would become better with TCP.


We can fix or improve TCP and people can find out in the real world if it's better for certain things.

Yes





On Fri, Dec 30, 2016 at 11:37 AM Julian Rohrhuber <[hidden email]> wrote:

On 30.12.2016, at 08:07, Chris Sattinger <[hidden email]> wrote:

Good article about why you should always use UDP for realtime games:
http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/

This seems to be a very good argument to just implement any necessary feature specifically on top of udp where you need it.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TCP default?

Noiseconformist
In reply to this post by Julian Rohrhuber-3

On 30.Dec 2016, at 16:26 , Julian Rohrhuber <[hidden email]> wrote:

> I’ve had a lot of connectivity problems in WLANs that were configured to be part of a larger intranet and/or that provide two networks (e.g. 5G and 3G). But I don’t assume this would become better with TCP.

that entirely depends on the reason for this “connectivity problems”.
if tcp doesn’t manage to collect the data required for a particular segment or session in time, software of the higher layers of the network stack should issue something like a timeout error for instance and act accordingly.
I wouldn’t know how to deal with that in SC but I’d reckon, on the bottom line it doesn’t make a big difference if tcp reports a problem and communication breaks in a controlled manner (tcp) or data just goes missing (udp).
But I think tcp’s recovery mechanisms, e.g. requesting retransmission, make a difference on a weak network link and could/would mitigate potential problems. then again, if timing is critical, tcp literally could be a show-stopper.
_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TCP default?

Noiseconformist
In reply to this post by Glen Fraser

On 30.Dec 2016, at 17:09 , Glen Fraser <[hidden email]> wrote:

> Just out of curiosity, is it possible to receive on a TCP connection in SC?  I know you can call “connect" on a NetAddr to connect with TCP (rather than UDP) and send messages on that connection…that much works for me.  But TCP is bidirectional, and I can’t see any way to set up SC to receive messages on the TCP connection…the NetAddr has a raw pointer to the socket, which isn’t very useful in sclang.  Is there any way to do this?

I never used that things in SC, so just had a brief look at NetAddr.
Looking at the example in the help doc, how’s that supposed to work?
What’s going to listen on the TCP-Port?

When doing

n = NetAddr("127.0.0.1", 57120); // 57120 is sclang default port
n.connect;

it returns a “connection refused”, which appears conclusive to me.
On Wireshark I can see an outgoing packet containing TCP trying to establish a connection which, of course,
gets a “reset” as an answer.
_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TCP default?

Julian Rohrhuber-3
In reply to this post by Noiseconformist

> On 30.12.2016, at 17:18, Michael Zacherl <[hidden email]> wrote:
>
> On 30.Dec 2016, at 16:26 , Julian Rohrhuber <[hidden email]> wrote:
>
>> I’ve had a lot of connectivity problems in WLANs that were configured to be part of a larger intranet and/or that provide two networks (e.g. 5G and 3G). But I don’t assume this would become better with TCP.
>
> that entirely depends on the reason for this “connectivity problems”.

Yes. Practically, it has occurred in collecting addresses through a broadcast address (255.255.255.255) of the router.

signature.asc (859 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TCP default?

Glen Fraser
In reply to this post by Noiseconformist
No, you need to choose the port of a TCP server (e.g. an external program you've written) that's listening for connections. You can connect to it using the NetAddr.connect instance method, but there seems to be no way to read from it.

(Hmm, unless you can just use the Netaddr.socket with some sclang file or serial port read function... I'll have to try doing that.)

Glen.

On Dec 30, 2016 17:34, "Michael Zacherl" <[hidden email]> wrote:

On 30.Dec 2016, at 17:09 , Glen Fraser <[hidden email]> wrote:

> Just out of curiosity, is it possible to receive on a TCP connection in SC?  I know you can call “connect" on a NetAddr to connect with TCP (rather than UDP) and send messages on that connection…that much works for me.  But TCP is bidirectional, and I can’t see any way to set up SC to receive messages on the TCP connection…the NetAddr has a raw pointer to the socket, which isn’t very useful in sclang.  Is there any way to do this?

I never used that things in SC, so just had a brief look at NetAddr.
Looking at the example in the help doc, how’s that supposed to work?
What’s going to listen on the TCP-Port?

When doing

n = NetAddr("127.0.0.1", 57120); // 57120 is sclang default port
n.connect;

it returns a “connection refused”, which appears conclusive to me.
On Wireshark I can see an outgoing packet containing TCP trying to establish a connection which, of course,
gets a “reset” as an answer.
_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
123
Loading...