Neighbor Discovery
The DTN reference implementation supports dynamic neighbor discovery agents for IP and Bluetooth.
discovery add <discovery_name> <address_family> <port=N> [<addr=A.B.C.D> <local_addr=A.B.C.D> <multicast_ttl=N> <channel=N> <unicast=true|false>]
Delete an agent (remove any announce registrations and shut down the listening port)
discovery del <discovery_name>
Agent
The IP agent listens for UDP beacons on the configured port. Multicast options are available.
The Bluetooth agent polls for neighbors using Bluetooth's hardware-native Inquiry. No polling occurs until at least one announcement is registered. The Bluetooth agent uses the interval from the announcement to determine its polling frequency.
Announce
To advertise a CL, register with the discovery announce command.
discovery announce <cl_name> <discovery_name> <cl_type> <interval=N> [<cl_addr=A.B.C.D> <cl_port=N>]
The announce command registers the convergence layer with the beacon agent. This registration serves two purposes:
- determines how often to send out the CL's advertisement
- determines how to respond to beacons received
To remove the CL's registration:
discovery remove <name>
Operation
When an Agent receives an Announce beacon (or discovers a Bluetooth neighbor by polling Inquiry), the event is processed the base Discovery class, which finds or creates a new Link using the discovered addressing information, then posts a LinkStateChangeRequest to make the link AVAILABLE. The end result is a dynamically configured Link, delivered to the Bundling system as a ContactUpEvent.
To show a list of configured Neighbor Discovery components
discovery list
Example configuration
To set up IP-based discovery for a TCP CL, first configure the TCPCL (by default, binds to INADDR_ANY and listens on TCP 4556)
interface add tcp0 tcp
Now set up the discovery agent. (There is no standard port for the discovery subsystem. 6789 is just a random number. However, some port number MUST be specified.)
discovery add ipdisc0 ip port=6789
Now register the TCPCL from above (defaults are same as TCPCL).
discovery announce announce-tcp0 ipdisc0 tcp interval=30
This ties together the discovery agent (ipdisc0) to an announcement (announce-tcp0) for the TCPCL (tcp0) with a beacon that goes out every 30 seconds.
Bluetooth Hints
In order for neighbor discovery to dynamically discover Bluetooth links, each Bluetooth node must be configured as discoverable. In the various revisions of BlueZ/Linux, the name and configuration of this parameter changes from system to system. As a point of reference, Fedora Core 6 stores this setting in /etc/bluetooth/hcid.conf under the device stanza; make sure the phrase iscan enable; is not commented.
Recent changes to BlueZ defaults place a default expiration on discoverability. To disable this expiration (insert security disclaimer here), add the phrase discovto 0; to the hcid.conf file and restart your bluetooth services.
For further hints and suggestions, please post your query to dtn-users.