4 ms·
libswift.org is a nice place to start. It compacts and simplifies the tcp/bittorrent stack into 4k lines of cpp. I'm working through an educational port at the
by jamii 15y ago
libswift.org is a nice place to start. It compacts and simplifies the tcp/bittorrent stack into 4k lines of cpp. I'm working through an educational port at the moment and will blog about it as I go.
- tptacek 15y agoI'm not as optimistic as 'Locke1689 is that BT is the best primitive for a general-purpose overlay, as FEC is less useful for small filesizes and discrete messages. On the other hand, congestion control is easier to do for FEC-based protocols than it is for generic group messaging.
- jamii 15y agoFEC = Forward Error Correction? Could you expand on that? I'm not familiar with this whole area at all.
- tptacek 15y agoYes. Simplified: you take a message and break it into n blocks such that any unique subset of k many of those blocks reconstitutes the message, even those k is less than n. Think RAID parity (though it's more complicated than that). One thing that makes FEC attractive in wide-scale group messaging is that you have knobs to turn, in terms of how many simultaneous blocks you attempt to download to reconstitute the message. As you can imagine, this is an idea that works really well for ISOs and DVDRips, but is clunky for emails.
- jamii 15y agoAh, ok. Swift uses merkle hash trees for error detection which scales down quite nicely. Packets which don't match the hash are just dropped. They seem to be trying to avoid long request-response chains - most messages just cause a state transition and don't require a direct response. I've only just started working on understanding swift so I can't speak for its suitability for small content. It is much simpler than bittorrent at least.