Demo: robot discovery using UDP multicast messages

Let’s describe a situation with which every seasoned roboticist is familiar with: You’re deploying your robot in a DHCP managed wireless network. Unless your robot is configured with a static IP address, you won`t know be able to know which dynamic IP address will be assigned by the DHCP server.

Since many robots expose a SSH server (and indeed wanting to know the robots IP address has much to do with wanting to establishi a SSH connection) one simple trick is to use nmap in order to locate SSH servers on the local network:

1
nmap -sV 192.168.8.0/24 -p 22 -open

However, there’s a drawback: when multiple robots are roaming within the same wireless network you’ll have to manually try every single listed IP. nmap can also list MAC addresses (-n), but this approach still necessitates a priori knowlegde of your robots MAC. Also, if you’re using an external wireless network interface the MAC will change when devices are replaced.

In this article I want to show a different solution implemented in the L4XZ autonomy stack: A discovery server on every robot is using UDP multicast messages to broadcast a unique id. Multicast messages enable one-to-many communication (as opposed to broadcast, which enable one-to-all) and are therefore well suited to transmit a discovery packet to interested listeners.

UDP multicast network architecture

The discovery packet contains a 16-byte unique id and up to 64 byte (null-terminated) description string, which is sent periodically by the robot. (And no, sending a discovery packet containing a non-terminated description string will not cause a stack overflow.)

1
2
3
4
5
6
7
8
9
union DiscoveryPacket
{
  struct __attribute__((packed))
  {
    uint8_t unique_id[16];
    char    server_description[64];
  } field;
  uint8_t data[16 + 64];
};

A separate device in the same wireless network is subscribing to and displaying the content of received discovery packets. Connecting to the robot is then simply a matter of selecting the desired robot from a selection.

UDP multicast robot discovery


Demo: robot discovery using UDP multicast messages

Alexander Entinger is a highly experienced embedded engineer with a focus on robotic systems. By providing hard-won expertise designing embedded systems for real-world embedded applications Alexander Entinger is helping companies developing robotic systems or components for robotic systems to achieve their desired business outcomes.