|
From: IOhannes m z. <zmo...@ie...> - 2014-09-25 07:47:54
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
while you are generally right, ...
On 2014-09-19 16:31, to...@tr... wrote:
> -the sender *must* create chunks in order to send a continuous
> ("unlimited") datastream. the question is how large these chunks
> can be at max.
this - unfortunately - is either wrong or misses the point.
the "missing the point" part: the network-layer (e.g. "IP") does some
packetizing on it's own. but this is totally transparent to both the
sender and receiver (application). the maximum size of these chunks is
the MTU and has an upper limit of 65535 bytes.
the "wrong" part: it's fairly easy to create an OSC-message of
*unlimited* size on the sender side, when you are dealing with a
serial datastream that is SLIP-encoded:
<snip>
MARK[]=[0xCE]; // slip packet boundary
bundle[]=[0x23,0x62,0x75,0x6E,0x64,0x6C,0x65,0] // "#bundle"
timestamp[]=[0,0,0,0,0,0,0,0x1]; // now
msg[]=[47, 120, 0, 0, 44, 0, 0, 0]; // "/x"
send(MARK);
send(bundle);
send(timestamp);
while(true) {
send(len(msg);
send(msg);
}
</snip>
just make sure you never send an END-mark and the packet keeps growing
on the receiving side, due to the semantics of the OSC-bundle
(messages within the bundle are atomic, so you cannot simply output
them as you receive them instead you have to wait till the end of the
bundle).
the above code is a DoS attack that will eat away all the memory of a
receiver that does not impose a maximum OSC packet size.
fgmdr
IOhannes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAEBCAAGBQJUI8iOAAoJELZQGcR/ejb4HjYP/0INj5Ev0O+PZFTqRQA9EO4P
aV96CRWlP2sA88rY0OpNMDZZnm8Z5gsLy5Y/IaOJsHTymrWCPMTULTw8e4HG0Vwj
UUl+/+UOTzZAv5PGv+AJ/WkAPqOrF8H4N4BbXA3X4vVTCa0uVlud96YgaBV7tw0r
/6VszhR7ygXqUJCwKMDkn99Q8Sk0rZZ3rhsdx99i0O7yitoaFCMg4ayx2SPTmAB1
Kuir5akFKpmufThpMWX813+QZeXGhg7pw0b/Vo3EE57go0GCF8I/fXcDPE84rf1g
jVMMjrZq6AAP5Q0Mw1IPrIcNil39D+DqK0Df8ftA76fxt1TUoXmvP23NZvTBGp8I
mG0XznfFxFhuRj5WeOPi739CuhN2lI3iAY7plgwKkZUyM7BBs/SFPEGdDg4nMNVD
2egWSrJpILg97WQ36IvlKOt9l5pEEits/TrQiMW82MbWn+kzRp22rZktqmA/O1mR
mZwj1OmF98d7/wysEmcRe4iRrAGq+f+fTzILdyWo/LIhOfumcLBq2EbutGculPla
vQPVeOsLB1QHml5Q4sxohTaAWLR15x580/vonuFZSGaRJeATN3ci56Ne3CsIgjQ+
7/DawcGYZCXF9qDhiRllVoEVZxnQfjOMAhQTBxgOCPJFeT84d5x+pZah6uECYziQ
Or9zlPaVUVEdI8NYJCxH
=9GNF
-----END PGP SIGNATURE-----
|