Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • drasyl drasyl
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • SANE (Public)SANE (Public)
  • drasyldrasyl
  • Merge requests
  • !680

Broadcast-based LAN discovery

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged bornholdt requested to merge broadcast into master Feb 10, 2022
  • Overview 5
  • Commits 5
  • Pipelines 5
  • Changes 4

This MRs adds a broadcast-based LAN discovery. It can be used to discover other nodes within the LAN when IP multicast functionality is not available.

The broadcast discovery is currently only usable by programmatically altering the ChannelPipeline.

Here is an example snippet:

// replace LocalNetworkDiscovery to switch from MULTICAST_ADDRESS to BROADCAST_ADDRESS
p.replace(LocalNetworkDiscovery.class, "local_network_discovery", new LocalNetworkDiscovery(
        config.getNetworkId(),
        config.getRemotePingInterval().toMillis(),
        config.getRemotePingTimeout().toMillis(),
        identity.getIdentityPublicKey(),
        identity.getProofOfWork(),
        BROADCAST_ADDRESS
));
// replace UdpServer to switch SO_BROADCAST from false to true
p.replace(UdpServer.class, "udp_server", new UdpServer(
        new Bootstrap().option(SO_BROADCAST, true),
        new InetSocketAddress(0)
));
// replace UdpMulticastServer with UdpBroadcastServer
p.replace(UdpMulticastServer.class, "udp_broadcast_server", new UdpBroadcastServer());

If you would like to test this, check out the broadcast-test branch and start a node through the CLI.

Edited Feb 11, 2022 by bornholdt
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: broadcast