Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement uTP #97

Open
jlouis opened this issue Feb 21, 2011 · 4 comments
Open

Implement uTP #97

jlouis opened this issue Feb 21, 2011 · 4 comments
Assignees
Labels

Comments

@jlouis
Copy link
Owner

jlouis commented Feb 21, 2011

The goal is to implment BEP29. Note that this BEP is not sufficient to understand the protocol at all. One must peruse source code. Nameiy:

https://github.com/bittorrent/libutp

It is a fairly complex implementation in C++ and unwrapping it to Erlang takes some time. Currently I've opted for the idea where I translate C++ code into Erlang and then figure out the real data flow. Another thing is to kill the delimited continuations present due to a call-back event implementation and substitute this with processes.

Current status is that I believe the process design is sound, but the internal state machine of a single connection is far from done. It should come as no surprise: We are essentially reimplementing TCP in userland :) After I have the low-level calls down and untangled the data flow, I'll start on the queue buffer code for sends and receives.

@baryluk
Copy link

baryluk commented Aug 19, 2011

Keeping etorrent pure erlang would be really sweet, from safety, fault-tollerance,portability and code maintaince standpoint. I know it is probably lots of work, but should be better way than wraping things up.

@ghost ghost assigned jlouis Aug 19, 2011
@jlouis
Copy link
Owner Author

jlouis commented Aug 19, 2011

Yep I agree. Take a look at the uTP branch if you want to see where we are currently. There should be a fairly grand todo.org TODO list in the apps/utp directory if you are interested.

I am currently working on stabilizing the core a bit. Then I can go and implement the last couple of missing features (namely SACKs and Nagle's algorithm.

@baryluk
Copy link

baryluk commented Aug 21, 2011

SACK and Nagle? Sounds like reimplementing TCP to me :) Shouldn't kernel do this, or we are talking here about user-space connection-like streams based on UDP? Anyway, SACK is important, but can be omitted at the beginning, as normal ACK will probably suffice for start.

Anyway will start looking into it.

@jlouis
Copy link
Owner Author

jlouis commented Aug 22, 2011

Right, they are built on top of UDP. And yes, both SACK and Nagle are important, but I'd rather get the other parts working first and then pile yet another layer on top of the protocol. I have done some refactoring runs on the code, but it could definitely do with some more in the long run.

The current focus is on instrumentation. I need to have ways to picture and plot internal counters while I am having a connection. That way, I can figure out if there is something wrong with the internals easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants