Opened 5 years ago

Closed 4 years ago

#1335 closed task (wontfix)

Datagrams without Payload Are Not Delivered

Reported by: ExtraBattery Owned by: mkvore
Priority: minor Milestone:
Component: apps/SAM Version: 0.9.13
Keywords: docs Cc:
Parent Tickets: Sensitive: no


As it is legal and possible to send UDP datagrams without any payload through the normal internet, I wondered if this is true for I2P as well. So I tried to send a datagram with zero bytes payload from
one I2P destination to another using SAM v3.0. I couldn't receive that datagram.

I noticed that there are two routines called checkSize() and checkDatagramSize() in "" that reject a payload size of zero. I don't know if this is the expected behavior of SAM or I2P in general or if this is just a mistake.

If zero length payload I2P datagrams are not meant to be delivered in general, you might want to add this piece of information to:

The documentation of SAM might also benefit from this info.

All tests were done using I2P 0.9.13-0 with the same semantics posted in the comment 2 of #1334, that is "SESSION CREATE …" and "DATAGRAM SEND …". I used repliable datagrams for my test.

While writing this post, I realized that there is probably a little more work to do regarding ticket #1318. I didn't re-open it though. See comment 23 there.


Change History (9)

comment:1 Changed 5 years ago by zzz


We don't know atm if this is just a SAM thing or a datagram lib thing or an I2CP thing.

A zero-length repliable datagram may be useful, but a zero-length raw datagram may not be.

comment:2 Changed 5 years ago by zzz

Docs updated in a56cc4f45cc2c0585bf5d7c7574317e87892c221

Leaving ticket open for investigation of 0-length support.

comment:3 Changed 5 years ago by ExtraBattery

I would simply allow zero size datagrams (repliable or not), since this is most compatible with clearnets and makes it easier to port applications to I2P. There is no real reason to forbid zero payloads, as an empty datagram can by itself represent information, depending on the context it arrives in. Be lenient.

Another thing: You could make it more noticeable in the datagram documentation that the payload is by default compressed using gzip. I feel it's easy to miss that important point.

comment:4 Changed 5 years ago by zzz

As I said in comment 2 above, haven't yet researched whether a zero-length payload makes it all the way through the stack.

As i said in comment 1 above, repliable may be useful, raw probably not.

Please explain why gzip is relevant to anything.

comment:5 Changed 5 years ago by ExtraBattery

The datagram documentation tells people that zero size payloads are allowed.

About gzip: If the payload of a datagram is compressed by default, application developers don't have to worry about compressing the payload themselves. That's why it's good to have them informed about what happens to the payload during transport.

comment:6 Changed 5 years ago by ExtraBattery

I've tested what happens when you change the checkDatagramSize() routine in SAM v3.1, to allow for zero length payloads. The empty datagram didn't come through. So there are probably other blockers somewhere.

At the end of the current datagram documentation there is a bad link ("important notes").

comment:7 Changed 5 years ago by zzz

Links fixed in 39a27fb362aae17afa390e66b2e99d107fce1d71 thank you.

comment:8 Changed 4 years ago by str4d

Keywords: docs added
Milestone: 0.9.15

comment:9 Changed 4 years ago by zzz

Resolution: wontfix
Status: newclosed

As stated above, SAM docs were fixed to specify 1 byte minimum.

Not going to fix delivery of empty datagrams all the way through I2P. No reason to. If anybody can think of an application that would need this, please reopen the ticket.

Note: See TracTickets for help on using tickets.