Skip to content

norayr/ybb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Yggdrasil-Bonjour Bridge

An utility that bridgen Bonjour/mDNS discovery accross Yggdrasil mesh network, allowing local discovery protocols to work over IPv6 mesh network.

Problem

Bonjour (XEP-0174) only works on local networks. Applications like Pidgin, Adium, Gajim, etc use Bonjour for serverless local messaging, but this limits communication to devices on the same LAN.

Yggdrasil provides an IPv6 mesh network where all nodes can reach each other directly, but Bonjour-enabled applications don't know how to discover peers over Yggdrasil.

Solution

This bridge "fakes" local Bonjour presence for remote Yggdrasil contacts. It:

  • Monitors connectivity to remote Yggdrasil peers
  • Advertises them as local when they're reachable
  • Removes advertisements when they go offline
  • Tricks Bonjour clients into thinking remote peers are on the local network

When your Bonjour client connects to these "local" contacts, it actually connects over Yggdrasil IPv6 addresses.

How it works

[pidgin] <--local--> [avahi-daemon] <--ygg-bonjour--> [yggdrasil network] <---> [remote pidgin]
                              ^
                              |
                    ygg-bonjour advertises
                    remote contact as local

Currently, the bridge uses avahi-publish-address and avahi-publish-service to advertise remote contacts with their Yggdrasil IPv6 addresses, making them appear as local Bonjour services.

Requirements

  • Yggdrasil mesh network daemon (that is configured in a way you can see your contacts IPv6 addresses)
  • Avahi mDNS/DNS-SD daemon (avahi-daemon running)
  • Root access required for avahi-publish commands.
  • Any Bonjour client that listens on 5298 port (later we'll make the port configurable)

So should work on Linux, BSD systems, everywhere you can have Pidgin/Bonjour (or other Bonjour client), Avahi, Yggdrasil and FreePascal compiler.

Installation

fpc ybb.pas

or type

make

you need to have FreePascal installed. (:

Configuration

You need a config file that lists remote Yggdrasil contacts:

201:b570:cb42:54ee:9b56:dfa0:7ba1:f4b5,pinephone,alice
202:f0b8:b922:8c76:8393:1954:ed69:ae2,laptop,bob
203:1234:5678:9abc:def0:1234:5678:9abc,desktop,kermit

Each line represents a remote contact that will be advertised as local when reachable.

Usage

sudo ./ybb contacts.conf

or

doas ./ybb contacts.conf

The program will:

  • Check connectivity every 10 seconds
  • Start advertising when contact is reachable
  • Stop advertising when contact goes offline
  • Handle Ctrl+C gracefully for cleanup

Setting up Pidgin

On both machines.

  1. Enable Bonjour account
  • Accounts -> Manage Accounts -> Add
  • Protocol: Bonjour
  • Username: somename
  • Advanced tab: make sure port is 5298
  1. Ensure Yggdrasil is running:

  2. Run the bride

doas ./ybb contacts.conf

Do the same on the other machine.

  1. Check Pidgin on both machines Remote contact should appear in your Bonjour buddy list as if they were local!

Troubleshooting

Contact not appearing

Ping contact's Yggdrasil IP. Does it respond?

Then telnet to the contact's IPv6 and its port:

telnet yggip 5298

Can you connect?

If not, try to see if the other party's client actually listens on Yggdrasil IP. For example:

netstat -anp | grep pidgin

Notes

IMPORTANT: The other party's name in Pidgin (or other Bonjour client) should be the same as you have been written in your config file.

Other, not very important:

We have noticed that Adium does not listen on IPv6 addresses. :( So in theory if ybb gets ported to MacOS, Adium won't work anyway.

MacOS uses own dns-sd and not avahi, so this won't run on MacOS anyway. For now. If you know how to do the same we did by using avahi on MacOS, do a pull request, or open an issue and describe how.

License

As always, GPL-3.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published