Tribler / tribler

Privacy enhanced BitTorrent client with P2P content discovery
https://www.tribler.org
GNU General Public License v3.0
4.83k stars 447 forks source link

Blockchain Engineering - class of 2024 - Team Democracy-1: blockchain networking (a) #7911

Closed synctext closed 2 months ago

synctext commented 8 months ago

Project assignment for Delft University of Technology master course called "blockchain engineering". Democracy-1: Blockchain networking

Background reading:

Upcoming sprint assignment

Eragoneq commented 8 months ago

For the task to get the uTP transfer going, should we just make a completely fresh project and somehow already integrate it into the current project?

uTP Thesis - link

synctext commented 8 months ago

First task, get uTP working, minimal changes. No superapp integration yet.

synctext commented 8 months ago

Sprint goal this week: structural measurement table of uTP. read example table Quality of networking protocol determines the performance. Read background thesis with details investigate tc utility, or netem wrapper

Measurement environment with packet loss and latency with reproducible performance test. One script to produce the example table with various conditions: 2 laptop and 1% packet loss rate

synctext commented 8 months ago

ToDo:

PieterCarton commented 8 months ago

Varying Package size/mode image

Skipped packages needed before fast retransmit image

Target Delay of Congestion Control image

Test performed with 1% package loss under 250 ms latency, transfer speed taken as average of 10 runs

Benchmark Program Location: https://github.com/iiljkic/utp4j/blob/master/src/main/java/net/utp4j/examples/configtest/ConfigTestWrite.java

Eragoneq commented 8 months ago

We've actually contacted the author of the utp4j library and he personally suggested to rewrite it from scratch. Main reasons being code quality issues and being in quite experimental state.

Still in the contact about some other details, but this was his main reply about the maintenance/taking over the project. -- EDIT: After further conversation, the author agreed to transfer ownership (to me for now)

Current versions:

Current week progress update:

Current view in the app:

PieterCarton commented 7 months ago

Week Update:

Example: fast restransmission Benchmark without latency

image

Example: same fast restransmission Benchmark with 50ms latency

image

synctext commented 7 months ago
Eragoneq commented 7 months ago

Starting off this week updates:

CallumH2410 commented 7 months ago

Callum: Was sick for most of last week so will need to do some catching up the upcoming week(s). Some issues getting our forked repositories working based on space issues with my laptop (Michals contributions), got it working for physical device so managed to get some front-end changes in. Will be looking to pick up the lost hours of last week in the upcoming week(s).

PieterCarton commented 7 months ago

Weekly Update Benchmarking Team:

Benchmark results (performed on 4mB file): (Default parameters coloured blue) (Benchmark script: https://github.com/PieterCarton/UTPBenchmark/blob/186d5a8a10a0e6afb857330ed2d96cdbaac05663/benchmark.bash)

At 500ms delay, with 10ms jitter and 1% pkt loss image

At 50ms delay, with 2ms jitter and 1% pkt loss image

At 0ms delay with 1% pkt loss image

synctext commented 7 months ago
Eragoneq commented 7 months ago

This week:

PieterCarton commented 7 months ago

Week 6 Report Benchmarking team: Last week there were Prof. Pouwelse addressed some concerns about the complex piece of code that controls the congestion window

This week:

PieterCarton commented 7 months ago

Current UI Design Proof of Concept: image

grimadas commented 7 months ago

For the next week:

qstokkink commented 7 months ago

@qstokkink, what is the simplest and most elegant way to integrate UTP and IPv8?

These are two opposites. The simple way is not elegant and the elegant way is not simple.

First, the difficult/elegant way would be to have channel separation for control logic and data streaming. You would have to puncture the NAT in a separate community with a separate socket and "hand off" this socket to your uTP streaming protocol. In a fantasy world, this would be on a separate physical channel as well (but this is obviously not realistic for consumer connections). You would need to use some form of DHT to couple the peer identity in the streaming community to the identity in your control logic community.

Second, the simple way: create a new IPv8 message to wrap your uTP packets. You will not get optimal performance, you will hinder other communities, and you will not have nice logical separation.. but it works 🤷 If your goal is to "just get something running", pick this option.

Eragoneq commented 7 months ago

@qstokkink

I think that still the "difficult" solution would be actually easier if we're supposed to reuse the library code. As right now all the socket stuff, threads and listeners are quite coupled with the logic of uTP making it hard to just reuse the existing IPv8 socket. I've already attempted it and made quite a bit of progress, but still there would need to be quite a lot of refactoring required in the library to actually get it working well, which then makes it even less sense to use the library and probably just better to rewrite it from scratch with the separation (due to other known issues).

For now I was able to get the separate socket and everything working on local networks only reusing the IPv8 to exchange status messages about file transfer request and other metadata, then the separate socket is used to actually send binary data. I'm now considering what would be the way to actually properly get the NAT puncture to work. Do you have any suggestion on what to use for it to work in a simple way? I don't think it's possible to somehow open another port with the existing p2p connection, we'd still have to use 3rd party to establish the external ports and that's what I'm currently considering.

PieterCarton commented 7 months ago

Weekly update:

synctext commented 7 months ago
CallumH2410 commented 6 months ago

UTP_demo.webm

Here is the demo of how it looks at the moment, as soon as we receive a package from one of these peers, the status indicator should turn to green. Red: status idle Orange: sent Green: received.

Post-meeting notes: These will be changed to the following: Sent without ack: yellow Sent with ack: Green More than a minute without communication: yellow More than 3 minutes without communication: red

Eragoneq commented 6 months ago

This week progress:

grimadas commented 6 months ago

Great progress. The apk is working with speed up to 1 MB/s

For next week:

Eragoneq commented 6 months ago

Project content

Download APK here.

For documented details regarding the app usage, click here.

For documented details regarding benchmarking done over the course time, click here.

All relevant work for the project on respective repositories is linked below:

uTP4j

For documented details on relevant changes and benchmarking, click here.

trustchain-superapp

kotlin-ipv8

For more documented details about the uTP integration, click here

Overall project overview

Library

Benchmarking

App

IPv8