ethereum / utp

uTorrent transport protocol
MIT License
27 stars 13 forks source link

Test utp against utplib #72

Open carver opened 1 year ago

KolbyML commented 1 year ago

Here is a https://github.com/ethereum/utp/pull/74 PR with a basic send/recv for major implementations of utp except for a recv for nim.

Interesting obervations

An interesting obervations is libutp will send keep connection alive ack packets. Well ethereum/utp will try to shutdown the connection the first chance it gets instead of trying to be a long lived connection like TCP.

Concerns

We can find weird behavior from doing interop testing like this, but is it worth it? Since it seems like our main concern has to do with starvation of tokio async tasks + the interaction ethereum uTP idle timeout

KolbyML commented 1 year ago

I am going to look into why connect_with_id acts weird

KolbyML commented 1 year ago
    0x7fff4b7b7010:  fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
    0x7fff4b7b7020:  fe fe fe fe fe fe fe fe
��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������debug: Wrote 692 bytes, 0 left
debug: Received 20 byte UDP packet from 127.0.0.1:9077
    0x7fff4b7b6d60:  11 00 e3 45 dd db 23 f4 00 00 00 00 00 10 00 00
    0x7fff4b7b6d70:  97 f6 45 66
debug: state 3: UTP_STATE_EOF
4052Z DEBUG uTP{send=58181 recv=58180}: utp_rs::conn: uTP conn starting...
hi2023-06-13T20:41:55.796863Z DEBUG uTP{send=58181 recv=58180}: utp_rs::conn: uTP conn initiating shutdown...
2023-06-13T20:41:58.873119Z DEBUG uTP{send=58181 recv=58180}: utp_rs::conn: transmitting FIN seq=38902
2023-06-13T20:42:08.885867Z  WARN uTP{send=58181 recv=58180}: utp_rs::conn: idle timeout expired, closing... unacked=[]
2023-06-13T20:42:08.886484Z DEBUG uTP{send=58181 recv=58180}: utp_rs::conn: uTP conn closing... err=Some(TimedOut)
2023-06-13T20:42:08.886652Z DEBUG utp_rs::socket: uTP conn shutdown cid.send=58181 cid.recv=58180
2023-06-13T20:42:27.914907Z DEBUG utp_rs::socket: received uTP packet for non-existing conn cid=58180 packet=State seq=17767 ack=38901

I was able to cause a "timeout" quickly and reliably

c recv r sender let data = vec![0xfe; 1_000_000]; sent this

KolbyML commented 1 year ago

Removed tracking since this avenue is no longer under search