KISS (Keep It Simple, Stupid) is probably the most common protocol used to communicate between host systems and TNCs. It's simplicity has also made it a popular protocol for inter-application communication over pseudo-ttys. The protocol was originally developed by Phil Karn KA9Q. Due to better control of the transmitter and realtime communication 6PACK is the prefered protocol for use with TNC.
Configuring KISS on Linux
Kernel Compile Options: Amateur Radio support ---> [*] Amateur Radio support --- Packet Radio protocols <*> Amateur Radio AX.25 Level 2 protocol ... AX.25 network device drivers ---> --- AX.25 network device drivers <*> Serial port KISS driver ...
Probably the most common configuration will be for a KISS TNC on a serial port. You will need to have the TNC preconfigured and connected to your serial port. You can use a communications program like minicom or seyon to configure the TNC into kiss mode.
To create a KISS device you use the kissattach program. In it simplest form you can use the kissattach program as follows:
# /usr/sbin/kissattach /dev/ttyS0 radio 22.214.171.124 # kissparms -p radio -t 100 -s 100 -r 25
The kissattach command will create a KISS network device. These devices are called `ax[0-9]'. The first time you use the kissattach command it creates `ax0', the second time it creates `ax1' etc. Each KISS device has an associated serial port.
The kissparms command allows you to set various KISS parameters on a KISS device.
Specifically the example presented would create a KISS network device using the serial device `/dev/ttyS0' and the entry from the /etc/ax25/axports with a port name of `radio'. It then configures it with a txdelay and slottime of 100 milliseconds and a ppersist value of 25.
Please refer to the man pages for more information.
It is possible and occasionally useful to manually reissue the kissparms command, with your desired parameters as shown above, if you occasionally need to reload the specific parameters into a TNC that has had to be restarted or power-cycled, and the parameters are those that are not default for what the TNC comes up with when brought up cold. It can also be useful to include such a kissparms command on a crontab line so this happens periodically if the station is unattended and something goes wrong with the TNC. Kissparms output to the TNC also is displayed by the listen(1) monitoring command, if running with the -a switch which displays outgoing as well as incoming packets. -WB5AOH-
Configuring for Dual Port TNC's
The mkiss utility included in the ax25-utils distribution allows you to make use of both modems on a dual port TNC. Configuration is fairly simple. It works by taking a single serial device connected to a single multiport TNC and making it look like a number of devices each connected to a single port TNC. You do this before you do any of the AX.25 configuration. The devices that you then do the AX.25 configuration on are pseudo-TTY interfaces, (/dev/ttyq*), and not the actual serial device. Pseudo-TTY devices create a kind of pipe through which programs designed to talk to tty devices can talk to other programs designed to talk to tty devices. Each pipe has a master and a slave end. The master end is generally called `/dev/ptyq*' and the slave ends are called `/dev/ttyq*'. There is a one to one relationship between masters and slaves, so /dev/ptyq0 is the master end of a pipe with /dev/ttyq0 as its slave. You must open the master end of a pipe before opening the slave end. mkiss exploits this mechanism to split a single serial device into separate devices.
Example: if you have a dual port TNC and it is connected to your /dev/ttyS0 serial device at 9600 bps, the command:
# /usr/sbin/mkiss -s 9600 /dev/ttyS0 /dev/ptyq0 /dev/ptyq1 # /usr/sbin/kissattach /dev/ttyq0 port1 126.96.36.199 # /usr/sbin/kissattach /dev/ttyq1 port2 188.8.131.52
would create two pseudo-tty devices that each look like a normal single port TNC. You would then treat /dev/ttyq0 and /dev/ttyq1 just as you would a conventional serial device with TNC connected. This means you'd then use the kissattach command as described above, on each of those, in the example for AX.25 ports called port1 and port2. You shouldn't use kissattach on the actual serial device as the mkiss program uses it.
The mkiss command has a number of optional arguments that you may wish to use. They are summarized as follows:
- enables the addition of a one byte checksum to each KISS frame. This is not supported by most KISS implementations, it is supported by the G8BPG KISS ROM.
- -s <speed>
- sets the speed of the serial port.
- enables hardware handshaking on the serial port, it is off by default. Most KISS implementation do not support this, but some do.
- enables logging of information to the syslog log file.