Comments (7)
@the8472 , I have a question regarding MSE, that, I believe, you might help me with.
The question is:
Is there any alternative of crypto_flags
(which is used to indicate encryption support on a per-peer basis in HTTP tracker response) for UDP trackers? http://bittorrent.org/beps/bep_0015.html states that additional fields may be appended to the end of the message (i.e. for announce response that would be after the list of address/port pairs). And http://bittorrent.org/beps/bep_0041.html provides support for passing URL query parameters to UDP trackers (in this case supportcrypto=1
). So it should be trivial to add support for crypto_flags for UDP trackers, but surprisingly it's not present in popular clients/trackers (for now I've looked in libtorrent's code only). Am I correct?
Thanks in advance!
from bt.
Is there any alternative of crypto_flags (which is used to indicate encryption support on a per-peer basis in HTTP tracker response) for UDP trackers?
No. Currently the most reliable source for encryption preference flags is the extended handshake which is then propagated through PEX.
So it should be trivial to add support for crypto_flags for UDP trackers, but surprisingly it's not present in popular clients/trackers (for now I've looked in libtorrent's code only). Am I correct?
Since the UDP tracker protocol is a binary protocol it would require the definition of an new packet layout to get such flags into an announce response.
from bt.
@the8472 , thanks for a quick response!
No. Currently the most reliable source for encryption preference flags is the extended handshake which is then propagated through PEX.
Do you happen to know how the encryption support should be advertised in the extended handshake? It's mentioned in http://bittorrent.org/beps/bep_0011.html:
Flags are defined as follows:
0x01 prefers encryption, as indicated by e field in extension handshake
I assume this e
field should be in the message root (not in the m
dictionary), but what are the allowed values?
Since the UDP tracker protocol is a binary protocol it would require the definition of an new packet layout to get such flags into an announce response.
Yeah, certainly, but it seems like the future changes were expected:
Do not expect packets to be exactly of a certain size. Future extensions could increase the size of packets.
Extension bits or a version field are not included. Clients and trackers should not assume packets to be of a certain size. This way, additional fields can be added without breaking compatibility.
Basically, possibility of adding something to the end of the announce response depends on whether the length of the list of peers (address/port pairs) is a well-defined function of numwant
and IP address family. Say, numwant * 6
and numwant * 18
with zero-padding (in case there are insufficient peers) for IPv4 and IPv6 respectively. Though I'm not sure that existing clients/trackers use this math and not just treat all trailing bytes as a list of peers.
By the way, why MSE hasn't been officially made a BEP?
from bt.
Do you happen to know how the encryption support should be advertised in the extended handshake?
Found this:
https://trac.transmissionbt.com/browser/trunk/extras/extended-messaging.txt
So e
flag is just an int with possible values being 1 or 0. Nothing fancy here.
However it's not clear whether it makes sense for a client that participates in a plaintext connection to drop it and re-connect in case of receiving an extended handshake with e
being set to 1. One obvious condition is whether the peer is reachable (i.e. client's connection is outbound). Less obvious is peer's "ban" strategy: abruptly dropping a connection might cause the client to be "blacklisted" by the peer for some time. I guess I need to experiment with different approaches.
from bt.
By the way, why MSE hasn't been officially made a BEP?
Well, it's not deemed as important anymore as it used to be. It was mostly designed in the wake of comcast injecting RST packets to terminate bittorrent connections. Aggressive traffic shaping vs. obfuscation is an arms race. The companies that profit from such boxes have invested additional time, so after a while they - presumably - switched to traffic flow matching and similar heuristics. On the bittorrent side interest in fighting that arms race wasn't that big. So the usefulness of encryption has declined over time.
µTP is seen as carrot approach instead of a stick.
However it's not clear whether it makes sense for a client that participates in a plaintext connection to drop it and re-connect in case of receiving an extended handshake with e being set to 1.
It's not really required. If the peer that wants encryption wants to do it they can do it. The peer that merely supports encryption but does not require it shouldn't waste resources on reestablishing connections.
from bt.
Finally got everything working, no bittorrent traffic in Wireshark, only TCP PSHs and ACKs, and occasional SMTP packets in between 😸 Doesn't seem to have affected the throughput at all.
Still need to brush things up a bit and write more tests and docs. Hopefully I'll be able to add this to master by the end of the next week and follow up with creating a dedicated tutorial page on the project's website. Phew!
from bt.
Added to master and posted a tutorial at http://atomashpolskiy.github.io/bt/encryption/
from bt.
Related Issues (20)
- [BUG] Many Incoming Encryption fail with InvalidMessage HOT 1
- [BUG] Weird metainfo validation error in CLI HOT 3
- [BUG] springboot use HOT 1
- how to download the file range pieces? HOT 2
- [BUG] Something does not work as it should
- Gradle issues with cling dependency library (upnp module) HOT 3
- Running CliClient.java Locally Reports an Error HOT 1
- java.lang.NoSuchMethodError: No virtual method getAnnotatedSuperclass()Ljava/lang/reflect/AnnotatedType; in class Ljava/lang/Class; or its super classes (declaration of 'java.lang.Class' appears in /apex/com.android.art/javalib/core-oj.jar) HOT 2
- Vulnerable dependencies
- [BUG] Cling 2.2.1 not found in Maven Central HOT 3
- How to access DHT Database at runtime? HOT 1
- Stopping client and stopWhenDownloaded() throws java.lang.RuntimeException HOT 1
- How can I get the info.files[0].filehash info
- [BUG] Something does not work as it should
- Dependency org.yaml:snakeyaml, leading to CVE problem
- Does it support Android?
- [BUG] Android - only maxSimultaneouslyAssignedPieces are downloaded if PieceSelector.getNextPieces supplies subset of all pieces in torrent HOT 3
- [QUESTION] Code affecting the performance HOT 2
- [BUG] Cannot decode torrent due to validation error
- [Request] Implement a getter-interface for events that receives Peer from an event
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bt.