wsdd(1)

πŸ“¦
version 0.8 Β· 2 versions
, in ubuntu questing, ubuntu resolute, ubuntu stonking

✨ wsdd ✨ β€” the manual page, but make it make sense πŸ’…

ok bestie so this is the wsdd(1) page from the General Commands Manual, and we're gonna walk through it together, no gatekeeping πŸ’–


πŸŽ€ NAME πŸŽ€

wsdd β€” a Web Service Discovery host and client daemon. that's the whole vibe.


πŸ¦‹ SYNOPSIS πŸ¦‹

wsdd [options]

short. sweet. iconic.


πŸ’œ DESCRIPTION πŸ’œ

okay so here's the tea β˜• β€” wsdd implements both a Web Service Discovery (WSD) host and a WSD client daemon. two modes, one little program, main character energy fr fr.

The host implementation is the one that lets (Samba) hosts β€” like your local NAS device, yes YOURS 🫢 β€” get found by Web Service Discovery clients like Windows. So Windows just sees your box on the network. slay.

The client mode is the other direction: it lets you go searching for other WSD hosts on the local network. like a little scavenger hunt but for servers πŸ”

Now the important part, listen up πŸ‘‘ β€” the default mode of operation is host mode. The client / discovery mode has to be enabled explicitely (that's the original spelling, we keep it, we don't fix it, that's the rules πŸ’…). Unless you configure it otherwise, the host mode is always active. And both modes can be used at the same time. multitasking queen behavior.


🌸 OPTIONS 🌸

⭐ General options ⭐

  • -4, --ipv4only β€” See below. (yes, that's literally what it says, keep reading bestie, -6 explains it πŸ’€)
  • -6, --ipv6only β€” Restrict to the given address family. And here's the catch 🚨 β€” if you specify both options, then no addresses will be available and wsdd will just... exit. like, it dips. so don't do that unless you want it to leave the group chat.
  • -A, --no-autostart β€” Do not start networking activities automatically when the program starts. The API interface (see below πŸ‘‡) can be used to start and stop the networking activities while the application is still running.
  • -c DIRECTORY, --chroot DIRECTORY β€” chroot into the given DIRECTORY after initialization has been performed, and right before the handling of incoming messages starts. The new root directory can be empty, no stress. Consider using the -u option as well (they're besties, they pair well 🫢).
  • -h, --help β€” Show help and exit. the classic.
  • -H HOPLIMIT, --hoplimit HOPLIMIT β€” Set the hop limit for multicast packets. The default is 1, which should prevent packets from leaving the local network segment. keeping it local, keeping it cozy 🏠
  • -i INTERFACE/ADDRESS, --interface INTERFACE/ADDRESS β€” Specify which interfaces wsdd will be listening on. If no interfaces are specified, all interfaces are used. Loop-back interfaces are never used β€” even when you explicitly specify them, sorry bestie, they said no πŸ™ˆ. For interfaces with IPv6 addresses, only link-local addresses will be used for announcing the host on the network. This option can be provided multiple times in order to restrict traffic to more than one interface. It also accepts IP addresses that the service should bind to. For IPv6, only link local addresses are actually considered, as noted above. so, one option, so many jobs πŸ’…
  • --metadata-timeout TIMEOUT β€” Set the timeout for HTTP-based metadata exchange. Default is 2.0 seconds. punctual queen ⏰
  • -s, --shortlog β€” Use a shorter logging format that only includes the level and the message. Super useful when the logging mechanism, like systemd on Linux, already automatically prepends a date, process name, and process ID to the log message. why repeat yourself, we hate redundancy ✨
  • -u USER[:GROUP], --user USER[:GROUP] β€” Change user (and group) when running, before handling network packets. Together with -c this option can be used to increase security if the execution environment β€” like the init system β€” cannot ensure this in another way. glow-up but for permissions πŸ”
  • -U UUID, --uuid UUID β€” okay this one's a whole paragraph so buckle up 🎒 The WSD specification requires a device to have a unique address that stays stable across reboots or changes in networks. In the context of the standard, it's assumed this is something like a serial number. wsdd attempts to read the machine ID from /etc/machine-id and /etc/hostid (in that order) before potentially chrooting into another environment. If reading the machine ID fails, wsdd falls back to a version 5 UUID with the DNS namespace and the host name of the local machine as inputs. Which means β€” the host name should be stable and not be modified, e.g. by DHCP, or your UUID goes rogue 😭. But if you want wsdd to use a specific UUID, you can use this option.
  • -v, --verbose β€” Additively increase verbosity of the log output. A single occurrence of -v/--verbose sets the log level to INFO. More -v options set the log level to DEBUG. so -v is "talk to me" and -vv is "tell me EVERYTHING" πŸ—£οΈ
  • -V, --version β€” Show the version number and exit.

πŸ‘‘ Host Mode Options πŸ‘‘

  • -d DOMAIN, --domain DOMAIN β€” Assume that the host running wsdd joined an ADS domain. This will make wsdd report the host as being a domain member. It disables workgroup membership reporting. The (provided) hostname is automatically converted to lower case. Use the -p option to change this behavior.
  • -n HOSTNAME, --hostname HOSTNAME β€” Override the host name wsdd uses during discovery. By default the machine's host name is used (look at hostname(1)). Only the host name part of a possible FQDN will be used in the default case. so it trims the drama off the end βœ‚οΈ
  • -o, --no-host β€” Disable host operation mode. If this option is provided, the host cannot be discovered by other (Windows) hosts. It can be useful when client/discovery mode is used and you don't want the host that runs wsdd to make an announcement. stealth mode, lowkey πŸ₯·
  • -p, --preserve-case β€” Preserve the hostname as it is. Without this option, the hostname gets converted as follows: for workgroup environments (see -w) the hostname is made upper case by default. Vice versa it's made lower case for usage in domains (see -d). pick your case, we support your choices πŸ’…
  • -t, --no-http β€” Do not service HTTP requests of the WSD protocol. This option is intended for debugging purposes, where another process may handle the Get messages. debug girlies, this one's for you πŸ”§
  • -w WORKGROUP, --workgroup WORKGROUP β€” By default wsdd reports the host is a member of a workgroup rather than a domain (use the -d/--domain option to override this). With -w/--workgroup the default workgroup name can be changed. The default work group name is WORKGROUP. The (provided) hostname is automatically converted to upper case. Use the -p option to change this behavior.

πŸ¦‹ Client/Discovery Mode Options πŸ¦‹

  • -D, --discovery β€” Enable discovery mode to search for other WSD hosts/servers. Found hosts are logged with INFO priority. The server interface (see below πŸ‘‡) can be used for a programatic interface (again, their spelling, we respect it πŸ’–). Refer to the man page for details of the server interface.
  • -l PATH/PORT, --listen PATH/PORT β€” Specify the location of the socket for the server programming interface. If the option value is numeric, it's interpreted as a numeric port for a TCP server port. Then, the server socket is bound to the localhost only. If the option value is non-numeric, it's assumed to be a path to a UNIX domain socket that a client can connect to. two flavors, one option, obsessed πŸ“

πŸ’« EXAMPLE USAGE πŸ’«

Handle traffic on eth0 and eth2 only, but only with IPv6 addresses

wsdd -i eth0 -i eth2 -6

or

wsdd --interface eth0 --interface eth2 --ipv6only

Set the Workgroup according to smb.conf, be verbose, run with dropped privileges, and change the root directory to an (empty) directory

SMB_GROUP=$(grep -i '^\s*workgroup\s*=' smb.conf | cut -f2 -d= | tr -d '[:blank:]')

wsdd -v -w $SMB_GROUP -u daemon:daemon -c /var/run/wsdd/chroot

look at that pipeline go 😭 she's beautiful


πŸ”₯ FIREWALL SETUP πŸ”₯

Traffic for the following ports, directions, and addresses must be allowed:

  • Incoming and outgoing traffic to udp/3702 with multicast destination: 239.255.255.250 for IPv4 and ff02::c for IPv6
  • Outgoing unicast traffic from udp/3702
  • Incoming traffic to tcp/5357

You should further restrict the traffic to the (link-)local subnet, e.g. by using the fe80::/10 address space for IPv6.

🚨 bestie listen β€” please note that IGMP traffic must be enabled in order to get IPv4 multicast traffic working. no IGMP, no multicast, no discovery. periodt.

πŸ’… API INTERFACE πŸ’…

wsdd provides a text-based, line-oriented API interface to query information and trigger actions. The interface can be used with TCP and UNIX domain sockets (see the -l/--listen option). The TCP socket is bound to the local host only.

The following commands can be issued:

clear β€” Clear list of discovered devices

Clears the list of all discovered devices. Use the probe command to search for devices again. This command does not return any data, and is only available in discover mode.

list [TYPE] β€” List discovered devices

Returns a tab-separated list of discovered devices of the provided TYPE (e.g. "pub:Computer") with the following information. If no type is provided, all discovered devices are listed. The possibly empty list of detected hosts is always terminated with a single dot (.) in an otherwise empty line. This command is only available in discover mode.

  • UUID β€” UUID of the discovered device. Note that a multi-homed device should appear only once, but with multiple addresses (see below).
  • name β€” The name reported by the device. For discovered Windows hosts, it's the configured computer name that gets reported here.
  • association β€” Specifies the domain or workgroup to which the discovered host belongs. The type of the association (workgroup or domain) is separated from its value by a colon.
  • last_seen β€” The date and time the device was last seen, as a consequence of Probe/Hello messages, provided in ISO8601 with seconds.
  • addresses β€” List of all transport addresses that were collected during the discovery process, delimited by commas. Addresses are provided along with the interface (separated by %) on which they were discovered. IPv6 addresses are reported in square brackets. Note that the reported addresses may not match the actual device on which the device may be reached.
  • types β€” Types of the detected device, delimited by commas.

probe [INTERFACE] β€” Search for devices

Triggers a Probe message on the provided INTERFACE (eth0, e.g.) to search for WSD hosts. If no interface is provided, all interfaces wsdd listens on are probed. A Probe message initiates the discovery message flow. It may take some time for hosts to be actually discovered. This command does not return any data, and is only available in discovery mode.

start β€” Start networking activities

This command starts the networking acitivies (their spelling again, iconic πŸŽ€) of wsdd if they haven't been started yet. "Hello" messages are emitted and the host is announced on the network(s) when the host mode is active. If the discovery mode is enabled, a probe process is also started.

stop β€” Stop networking activities

This is the reverse operation to start. When this command is received, "Bye" messages are sent in order to notify hosts in the network about the host's disappearance. All networking sockets used for the WSD protocol are closed as well. Activities can be restarted with the start operation. it's giving ✨ farewell era ✨


πŸ” SECURITY πŸ”

wsdd does not implement any security feature, e.g. by using TLS for the http service. This is because wsdd's intended usage is within private, i.e. home, LANs.

The Hello message contains the host's transport address, i.e. the IP address, which speeds up discovery (it avoids the Resolve message).

πŸ’€ no cap β€” that's the whole security section. it's a home-LAN girly. don't put her on the open internet, she is not built for that.

<div align="left">πŸ’– ✨ πŸŽ€ πŸ¦‹ 🌸 πŸ’… 🫢 😭 πŸ”₯ πŸ‘‘ 🌈 ⭐ πŸ’€ πŸ™ˆ πŸ“ 🧚 πŸ’œ</div>

and that's part one bestie β€” there's more coming, don't go anywhere πŸ’…βœ¨

πŸ¦‹ KNOWN ISSUES πŸ¦‹

Okay bestie, real talk β€” this software is iconic but nothing's perfect, and the maintainers were super upfront about the lil gremlins that live in here. Not me reading the bug notes like gossip πŸ’€. Here's the tea, fr fr.


🌸 Using only IPv6 on FreeBSD

So picture this: wsdd is vibing on FreeBSD and you've got it running with IPv6 only. In that situation, the host running wsdd might not get discovered reliably. Lowkey devastating, I know.

What's the actual cause? It appears to be that Windows just... is not always able to connect to the HTTP service, for reasons that are, quote unquote, unknown. We don't know why, nobody knows why, it's giving mystery. πŸ™ˆ

The glow-up fix: just run wsdd with IPv4 only. Workaround secured, problem dodged, we move. ✨


πŸŽ€ Tunnel/Bridge Interface

This one is the main character of the known-issues section, honestly, so buckle up.

If you've got tunnel or bridge interfaces hanging around β€” think the ones created by OpenVPN or Docker β€” they can absolutely interfere with wsdd if you run it without providing an interface that it should bind to (meaning it binds to all of them). 🫠

And here's what that messy situation looks like in practice:

  • The wsdd host does show up β€” but only after wsdd has been started. Slay, right? ✨
  • Then it disappears the moment an update of the Network view in Windows Explorer gets forced. And forcing it means either refreshing the view or rebooting the Windows machine. 😭

So it's there, and then it's not. Iconic behaviour, terrible outcome.

The fix, bestie: you need to specify the interface that is connected to the network on which the host should be announced, using the -i/--interface option. That prevents the tunnel/bridge interfaces from being used at all. Problem: solved. πŸ’…

🌈 The Background (iykyk)

Okay so why does this happen? The maintainers explain it and it's actually fascinating, so let's get into it:

Tunnel/bridge interfaces may cause Resolve requests from Windows hosts to be delivered to wsdd multiple times β€” meaning duplicates of such a request get created.

Now, if wsdd receives such a request first from a tunnel/bridge, it uses the transport address (that's the IP address) of that interface, and sends the response via unicast.

Further duplicates are not processed, thanks to the duplicate message detection, which is based on message UUIDs. Very demure, very mindful, very deduplicated. 🧚

But here's the plot twist: the Windows host that receives the response appears to detect a mismatch between:

  • the transport address in the ResolveMatch message (which is the tunnel/bridge address), and
  • the IP of the sending host/interface (the LAN IP, e.g.)

And subsequently? The wsdd host is ignored by Windows. πŸ’€ Betrayal. Absolute betrayal.

So yeah β€” if your host keeps ghosting Windows Explorer, it's probably not a you problem, it's a tunnel/bridge interface problem. Pass -i/--interface and reclaim your main character energy. πŸ‘‘

That's the whole page, bestie β€” you made it all the way to the end and I'm so proud of you. πŸ₯Ή This one's from the wsdd(1) manual, and yes, the footer really does just say wsdd(1) β€” no dramatic source, version or date drop to flex here, just the classic page reference. Go forth and be discoverable. πŸ¦‹βœ¨πŸ’–

πŸ“¦ where this page comes from