kissattach and its QST packet

In my last post I was wondering about a transmission that Linux always makes when I connect my radio. It shows up in Dire Wolf as a bunch of unintelligible binary. It’s addressed to “QST”, which is not a real call sign but an amateur radio Q Code that signifies a broadcast.

direwolf-qst

In hindsight I feel like I should been able to guess what it was. Wireshark told me the full story: it’s a gratuitous ARP packet. Linux is announcing to everything in a 15 kilometre radius that my PC, with hardware address VK7NTK-1, has the IP address 44.128.1.1 (the AMPRNet equivalent of 192.168.0.1). Yippee.

wireshark-qst

Now where the heck did “QST” come from? That’s an amateur radio thing that I certainly didn’t type in. I found the answer in the Linux kernel in ax25_addr.c.

/*
* The default broadcast address of an interface is QST-0; the default address
* is LINUX-1.  The null address is defined as a callsign of all spaces with
* an SSID of zero.
*/

const ax25_address ax25_bcast =
        {{'Q' << 1, 'S' << 1, 'T' << 1, ' ' << 1, ' ' << 1, ' ' << 1, 0 << 1}};

There we have it—in exactly the same way we use ff:ff:ff:ff:ff:ff as a broadcast hardware address on Ethernet, whoever wrote the Linux driver simply picked something. And why not “QST”? At least it makes sense.

It is also interesting to notice that the address hex in wireshark doesn’t seem to correspond to the ASCII values. They’re too big to be alphabetical letters. There’s something going on though: the three spaces in “QST ” have come out as 0x40, which is kind of like 0x20. The answer is further down the same file in the asc2ax function. All of the ASCII values are shifted to the left by 1 bit, then have the least significant bit cleared. It is ASCII after all, just not as we know it!

Now, I just wanted my radio to shut up, and none of this helped very much. Linux has quite a few ARP-related knobs in /proc/sys/net but as far as I can tell none of them prevent Linux from excitedly showing off its new IP address.

The solution was to be found in the humblest of places—the kissattach man page. As it explains in broken English:

The optional inetaddr argument is the IP address of the new interface. Some time it was mandatory argument (although due to historical reasons this restriction is lifted if the old -i option is used). But there’s really not a need for the interface to have an IP address assigned to.

This is true. I don’t need an IP address at all yet. It just turns out that every guide I’ve read assumes that supplying one to kissattach is mandatory.

# Old command
kissattach /dev/ptmx radio 44.128.1.1
# New command, no ARP broadcast
kissattach /dev/ptmx radio

How easy is that.


Post a comment

All comments are held for moderation; basic HTML formatting accepted.

Name: (required)
E-mail: (required, not published)
Website: (optional)
This blog's name is?
"tinkering down _____"
(required)