
A client can switch a connection on an ordinary plaintext APRS-IS port to the IS2 protocol, without a separate IS2 port, and without knowing in advance whether the server supports IS2. It asks for the upgrade on a comment line before its login line, which servers that do not know of IS2 ignore: the client then logs in on plaintext as usual, with no extra round trip.
Work in progress, like IS2 itself.
The server does not announce the upgrade: it sends only its usual banner,
and the client finds out whether the upgrade is available by sending the
hello. A comment line after the banner should be harmless, since clients
are to ignore comment lines, but in practice some of them expect exactly
the lines the servers have always sent. The uplink code of existing aprsc
releases, connecting as a client to take a feed from another server,
expects the # logresp line right after the banner, and closes the
connection on anything else, so a server sending an extra line could not
have aprsc downstreams until all of them were upgraded. Other client
software may well be confused by an unexpected line the same way, and
there are many clients, so the server sends nothing a client has not
asked for.
A monitoring tool can find the servers and ports which support the upgrade the same way, without logging in: send the hello, read the answer, and disconnect.
To upgrade, the client sends a hello, followed by its normal login line right away, without waiting for an answer:
#is2 hello v=1
user N0CALL pass 12345 vers myclient 1.0
v lists the versions the client supports, separated by commas
(v=1,2). Like on the #is2-meta lines (see IS2PLAIN.md), the line
consists of space-separated key=value pairs after #is2 hello; keys
which are not known are ignored, so that later versions can add them.
The server answers in one of two ways:
A server which does not know of IS2, or does not offer the upgrade,
ignores the hello as a comment, and answers the login line with the
usual # logresp. The connection continues on plaintext. This is
also the answer if the server does not support any of the versions
offered.
A server which upgrades the connection answers with the version it picked, the highest one it supports from the list:
#is2 hello v=1
This is the last plaintext line from the server. It is followed by IS2 frames, starting with the server signature, as on an IS2 port. The server discards the login line and any other plaintext lines from the client until an IS2 frame starts, with the STX (0x02) byte at the beginning of a line. The client then logs in with an IS2 login request, as on an IS2 port.
So the client knows which way it went from the first of these two lines
it receives: #is2 hello or # logresp. Other comment lines may come
before it, such as the server's periodic keepalive comment, and are
ignored as usual. After the switch, the server may likewise send an IS2
keepalive ping before the login reply, which the client answers as at
any other time.
The hello is only accepted before the login. After it, #is2 hello is
an ordinary comment.
The passcode in the login line goes over the connection in plaintext before the upgrade, as it does on a plaintext connection. On a TLS port, the whole exchange is inside TLS.
A server built with IS2 support (the default, unless configured with
--disable-is2) offers the upgrade on its plaintext client ports over
TCP, TLS and SCTP, of all the port types (fullfeed, igate, clientonly,
dupefeed). The upgraded connection works like one on the corresponding
IS2 port type.
The upgrade is not offered, and the hello is ignored:
noIS2upgrade optionquirks_mode is enabled for all clients: the server then keeps
strictly to the plain protocol which the picky clients expectfake_version is configured, since the server is then
pretending to be some other softwareThe status JSON tells whether the upgrade is offered on each listener
(is2_upgrade), and the clients which have upgraded have "link": "is2"
in the client list, like the clients of IS2 ports.