Multicast module

The multicast module allows Tribler nodes (Next-share nodes) to automatically discover nodes and communicate on the local network. Both IPv4 and IPv6 as well as dual-stack operation is supported.


The idea is to allow a group of nodes collaborate on a local network to provide the users with a better experience. For example a user with several computers on his home network would like that all his computers collaborate. This could be as simple as bulk-data transfers throttling themselves while he watches a live stream. The nodes should of course also be able to gossip more often if locally available, and should make available files for each other (say stream a video directly).


Allow nodes to send anonymized information about what they are doing (say 'bulk data transfer' or 'live streaming', possibly with some bandwidth estimations or something). Recipient nodes can then base their own throttling and operations based also on other local nodes.

It would also be possible to make some simple local search, e.g. "what's streaming locally", search for a file (allow direct streaming/download). Notice that privacy is not going to be implemented in the multicast package for now.


The current implementation has a few main functions:

  1. Node discovery - Let nodes discover each other autonomously on a local network
  2. Node announcements - Announce the node (push style)
  3. Send/receive a variable size list (touple) over local multicast
  4. Multicast ping - measure multicast speeds on the network
  5. All messages should be signed and verified

Multiple callback functions can be registered to handle local multicast communication. The node discovery is performed automatically if allowed by the configuration, or a node discovery callback function can be registered to handle multicast node announcements.


To mature and expand this code we need a clear and simple application. First stage could be to simply expose to the user if other local running instances of Tribler/Next-Share are found and allow 1-click friends making.

Next step could be:

  • Network weather sharing (collaborative congestion/throttling detection)
    • Measurement local upload speed
    • Throttle low-priority traffic if another node has high priority traffic
    • Local sharing or discovery of resources, combined with local data exchange (streaming)
    • Sharing of upload data to detect congestion or throttling
    • Combine measurements of 1 or dozens of other people
    • Show to user the Internet Gateway congestion

This would be fully in line with P2P-Next task 4.2.1 Network-awareness modeling, probing, and reasoning.

Current state

  • Base implementation is available, with some tests
  • Code is fairly well documented and gathered in a python module (help multicast)
  • Code in svn (‚Äč
  • Not integrated with Tribler. Functional test integration with Tribler.
    • Initiates buddycast exchange for locally discovered nodes.
    • Flags already known nodes as local if discovered locally
      • Does not remove the local flag at any point
    • Must flag nodes as local internally for additional functionality. Added to peer database as "is_local" flag.
    • Shows as "local" in green text (in stead of "online") if node is online or in black text if node is local but offline.
    • Perform local multicast search? Searching does not provide expected results (consistent replies with other local nodes) Adds a selection of local nodes to queries.
  • Message integrity is not implemented yet - should be based on permid and existing crypto
  • Must decide if communication should be allowed from all nodes, or just a selected set


As I (Njaal) don't want to check in these patches yet, I've simply attached it here... Also check out the multicast module from svn (listed above) and put it under "Tribler/Core".