Libtorrent: Questions about the UTP protocol

Created on 19 Apr 2020  路  10Comments  路  Source: arvidn/libtorrent

@arvidn
I already checked and fixed this library: https://sourceforge.net/projects/javautp/files/.
It works great. I'll post my code a little later.

1.I have a problem with the speed of my downloads.
After the connection and handshake, I send about 150 request messages to get the data.
These messages are all split into two UDP packets of 1400 bytes and sent.
I start receiving the data instantly. Do I need to send a response ACK Status message to each incoming data packet? Or only the ones that come incorrectly?
Now the maximum speed I have reached is 20 Megabit\sec.
Data packets come in about 1400 bytes in size. Maybe we should increase it somehow?

I just checked. LibreTorrent downloads the same data in sequential mode from one peer at 150 Megabit\sec. How does it do that?

I noticed that the flags at Handshake change and in the process of downloading is reconnected with another set of flags. What flags affect speed?

2)What algorithm is used to distribute incoming packets over UTP channels?
I have a system buffer for incoming packets. For example, it can hold 300 UDP packets. This is transparent for the application.
I have a ServerSocket thread receiving the packets.
It's her job to distribute the packets.
Do I have to have an incoming buffer for each channel? Or shouldn't it be different threads at all? Could it be one thread that receives and processes incoming packets?
How exactly should this work?

My Library Speed: Three incoming UDP packets are processed in 1 millisecond and written to circular buffers.
UTPSocket.zip

All 10 comments

you have to apply engineering practices to understand what your computer is doing and then fix your program appropriately. I don't think it's reasonable to ask me to do this for you.

2)What algorithm is used to distribute incoming packets over UTP channels?

Are you talking about how to demux the packet stream into individual uTP socket? that's what the connection ID is for. This is covered in the BEP.

I would highly recommend you read a text book explaining TCP. Understanding TCP will make you understand ~90% of uTP as well.

@arvidn That's why I opened the previous line of discussion. https://github.com/arvidn/libtorrent/issues/4543

You are the author: https://www.bittorrent.org/beps/bep_0029.html.

I'm trying to use it. But I can't do it. Because there's very little information in the manual.
How can I use it if even the author of the manual can't help me?
I go to the doctor for treatment, and he tells me to go get a medical diploma, and then come.

The task of writing this library is not mine, but yours. I'm doing your job, and you don't want to help me either.
It's immoral! It's rude!

The task of writing this library is not mine, but yours. I'm doing your job, and you don't want to help me either.

I'm not following. I'm pretty sure it's not my job to write your library. But if it isn't yours, why are you doing it?

@arvidn why aren't you helping? Are you ready to talk about anything for weeks, but you can't give a real answer?

I'm not following. I'm pretty sure it's not my job to write your library. But if it isn't yours, why are you doing it?

This is not my library. If its source code is open, anyone can use it. I do it so that anyone could easily use the UTP protocol in their projects instead of studying c++ and your incomplete instructions.
I'm working for the people. I thought you were doing it, too.

If "this library" refers to libtorrent, sure, let's say that's my job. This ticket doesn't seem to be about work on libtorrent though. (I got the impression "this library" in your sentence referred to the java library you say you're working on).
I'm happy to answer questions whose answers are difficult to learn by reading up on the subject. You don't really demonstrate having tried. If you were interested in working on libtorrent I would probably be more likely to mentor, but so far you mostly seem to be complaining about libtorrent.

@arvidn You make me do things that I don't understand. I'm going to lose a lot of time. While I've already written my library on pure Java. And I improve it every day and move forward.
While with your library, I'll be constantly waiting for your answers and I'll lose a lot of time before it turns out that what I need is impossible.
After programming in c++, I'll have to complete the java code again. Correct the FrostByte skeleton.

My Java library can be used by all Android programmers.

Arvidn, I agree to use your library, if you yourself add this functionality to your library and upload it to the new version.
This is very easy for you. I am sure it is.
Plus, it will make your library even more popular.
I'll explain in detail what's required.
This group of optimizations can be called "streaming mode".
What do you think about my idea?

@arvidn 1) Today I reached the speed of receiving data 50 Megabit\sec. via UTP. On Pure Java.
Problems were due to the lack of inbound and outbound buffers. I'm using 255 data requests.

2) Good news on package distribution. It didn't work well because of an error in thread synchronization. Now I have fixed it and the distribution works about the same as one UTP socket.
Thank you, Arvidn. I guess I can't expect any help from you.
I found the answers to all the questions myself. Thought you could help me save some time.

@arvidn Yesterday I was able to reach the necessary 100 Megabit speed for my project via UTP. I compared it to the libtorrent implementation. My version works more stable.

@master255

Yesterday I was able to reach the necessary 100 Megabit speed for my project via UTP.

Good for you. libtorrent can also do that though, and much more if needed.

My version works more stable.

Under what metric? Care to share the benchmark? And would you be interested in contributing back the improvements/ideas, or do you just want to be toxic?

@FranciscoPombal Hey, programmer. I don't see any answers in this branch. Are you calling me toxic? You are writing complex algorithms and not answering questions about them.
So tolerate all my messages, or answer the questions.
This is the first time I've seen so many lazy programmers. I understand that this is probably not true, but now it looks like this.

Soon, I'll be putting my library out to the public. But I don't think anyone can help me improve it. There are no programmers for that.

Was this page helpful?
0 / 5 - 0 ratings