[avahi] How to debug avahi over subnets

Marc Haber mh+avahi at zugschlus.de
Mon Oct 8 14:23:30 UTC 2018


Hi Tom,

thanks for your answer, and please accept my apologies for not replying
in timely manner.

On Sun, Sep 23, 2018 at 09:26:45PM -0400, Tom Pusateri wrote:
> I am a little confused about your topology and how it was ever working. So maybe a few questions will clear things up and then it will be easier to provide advice.
> 
> .local is defined in RFC 6763 as link-local. From the RFC:
> 
> "Any DNS query for a name ending with ".local." MUST be sent to the mDNS IPv4 link-local multicast address 224.0.0.251 (or its IPv6 equivalent FF02::FB)”
> 
> Therefore, by definition (and design), the service advertisements (and mDNS queries and responses) will not pass through a router to a different IP subnet.

My router is running avahi-daemon as a reflector:

SECTION [REFLECTOR]
       enable-reflector=  Takes  a  boolean  value  ("yes" or "no"). If set to "yes" avahi-daemon will reflect incoming mDNS
       requests to all local network interfaces, effectively allowing clients to browse mDNS/DNS-SD services on all networks
       connected  to the gateway. The gateway is somewhat intelligent and should work with all kinds of mDNS traffic, though
       some functionality is lost (specifically the unicast reply bit, which is used rarely anyway). Make sure  to  not  run
       multiple reflectors between the same networks, this might cause them to play Ping Pong with mDNS packets. Defaults to
       "no".

       reflect-ipv= Takes a boolean value ("yes" or "no"). If set to "yes" and  enable-reflector  is  enabled,  avahi-daemon
       will forward mDNS traffic between IPv4 and IPv6, which is usually not recommended. Defaults to "no".

[reflector]
enable-reflector=yes

Things have been this way for years, and indeed after adding a "new"
printer in CUPS I can print again. It is only that the "old" printer
definition in cups is useless since my printer seems to have its name in
the .local domain changed.

Old printer definition, working for years, but not recently:
Connection:	dnssd://c534-ka51._printer._tcp.local/

New printer definition, created two weeks ago, working fine:
Connection:	dnssd://c534-ka51%20(3)._pdl-datastream._tcp.local/

At least this answers the question about the service name, which
actually introduces spaces as %20 into the actual host name. Mucho ugly.

> So maybe if you could provide IP addresses, prefix lengths, route information, domain name, and DNS resolver information about your printer, cups server, router, and client, it might be easier to track this down.

The issue is between CUPS server and the printer.

CUPS-Server:
1 [1/3379]mh at parada:~ $ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:ba:00:d0 brd ff:ff:ff:ff:ff:ff
    inet 192.168.181.165/24 brd 192.168.181.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 2a01:238:4071:3281:5054:ff:feba:d0/64 scope global deprecated mngtmpaddr noprefixroute dynamic
       valid_lft 86388sec preferred_lft 0sec
    inet6 2a01:238:4071:3281::a5:100/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:feba:d0/64 scope link
       valid_lft forever preferred_lft forever
[3/3381]mh at parada:~ $ host 192.168.181.165
165.181.168.192.in-addr.arpa domain name pointer parada.ka51.zugschlus.de.
[4/3382]mh at parada:~ $ host 2a01:238:4071:3281:5054:ff:feba:d0
Host 0.d.0.0.a.b.e.f.f.f.0.0.4.5.0.5.1.8.2.3.1.7.0.4.8.3.2.0.1.0.a.2.ip6.arpa not found: 3(NXDOMAIN)
1 [5/3383]mh at parada:~ $ host 2a01:238:4071:3281::a5:100
0.0.1.0.5.a.0.0.0.0.0.0.0.0.0.0.1.8.2.3.1.7.0.4.8.3.2.0.1.0.a.2.ip6.arpa domain name pointer parada.ka51.zugschlus.de.
1 [7/3385]mh at parada:~ $ host parada.ka51.zugschlus.de
parada.ka51.zugschlus.de has address 192.168.181.165
parada.ka51.zugschlus.de has IPv6 address 2a01:238:4071:3281::a5:100
1 [9/3387]mh at parada:~ $ ping parada.local
PING parada.local (192.168.181.165) 56(84) bytes of data.
64 bytes from parada.ka51.zugschlus.de (192.168.181.165): icmp_seq=1 ttl=64 time=0.032 ms
^C
--- parada.local ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.032/0.032/0.032/0.000 ms
[10/3388]mh at parada:~ $

The printer gets its IP address via DHCP, its current IP address is 192.168.183.240,
and the print server can print to
dnssd://c534-ka51%20(3)._pdl-datastream._tcp.local/ just fine. I cannot,
however ping c534-ka51%20(3)._pdl-datastream._tcp.local or
c534-ka51%20(3).local from the print server's shell. I suspect that some
component chokes either on the % or on the parenthesis in the host name.

> The fact that you are seeing (2) appended to your service name is an
> indication that maybe a loop has formed and the host advertising the
> service has seen that service name coming from another device
> (possibly the router?) and so it increments a suffix to create a
> unique name.

The host advertising the service is the printer itself.

>This makes me think that maybe the router is translating
> services between subnets as a feature. The software doing this on the
> router might be at fault.

The software on the router is avahi-daemon 0.6.32 from Debian stable
running with enable-reflector=yes. Unfortunately, it doesn't log too
much of its activity.

>Or there may be a bridge loop you’re not aware of.

Quite unlikely, that would affect many other things on the network as
well and would show up in the network load graphs.

>This also happens sometimes when a client or server has
> multiple interfaces (wired ethernet & wireless) on the same subnet and
> the software gets confused seeing the advertisements coming in on a
> different interface.

That does not apply to the print server which has only a single ethernet
interface, neither to the printer, which has only a single ethernet as
well.

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421


More information about the avahi mailing list