pktfec-tnc is a software terminal node controller (TNC) for a new digimode meant to be transmitted over FM or NBFM channels. pktfec-tnc provides:

  • a low-density parity-check (LDPC) matrix for forward error correction (FEC),
  • puncturing to reduce overhead for messages that are not a multiple of the used block size,
  • an interleaver to reduce the impact of burst errors,
  • quadrature amplitude modulation (QAM) with a selectable number of bits per symbol (2, 4, 6, 8, ...) and smooth transition to limit audio bandwidth to frequencies between approximately 960 and 2880 Hz (1.9 kHz audio bandwidth to be transported over a 6 to 25 kHz wide FM channel),
  • net bitrates from 1200 bit/s (QPSK with 2 bits per symbol) up to 3600 bit/s (QAM64 with 6 bits per symbol) and more,
  • a TCP/IP server that supports multiple clients to receive and send messages via a simplified version of the KISS protocol (data frames only).

Additionally, an IP tunneling daemon ("hamtunnel") is provided, which connects to a TUN device and prepends IP packets with a null-terminated radio call sign and a null-terminated protocol identifier ("IP4" or "IP6") and sends them to a KISS server for transmission and receives packets in the reverse.


pktfec-tnc requires SoX (see for audio input and output.



  • 2021-01-12: Version beta3
    • Support for external carrier detection using a serial handshake line or external shell command (to avoid collisions on radio band)
    • Increased audio response time in default configuration by removing channel remixing through SoX
    • Make extra synchronization time configurable and reduce from 250 milliseconds to 100 milliseconds as new default
    • Increased averaging time for RX audio level test from 250 milliseconds to 500 milliseconds
    • Fixed command line help to properly reflect default for -b option
    • Show usage information on some more command line errors
    • Declared some buffers as static (allocation on heap) to avoid exhaustion of stack memory when stack is too small
    • Use CLOCK_REALTIME instead of CLOCK_MONOTONIC to initialize random generator
  • 2021-01-07: Version beta2
    • Improved packet dropping mechanism when queue is full
  • 2021-01-05: Version beta1
    • Bugfix: Avoid crash on gracefully closed client connection
    • Revised transmission blocking and queueing mechanism
    • Improved debug output
    • Use syslog
    • Improved README
  • 2020-12-28: Version alpha9
    • Bugfixes regarding frame alignment in case of partial reads
    • Fixed wrong initialization of serial device (correctly switch to noncanonical mode)
    • Added automatic resynchronization of KISS frames when receiving 0xC0 immediately followed by another 0xC0 byte
    • Improved README
  • 2020-12-27: Version alpha8
    • Bugfixes and improvements for hamtunnel
      • Use syslog and stderr for log output (use -v or --vv to increase log level)
      • Fixed bug where strcmp() might read a few bytes beyond buffer end
      • Properly handle EOF from TNC or TUN device (terminates program)
      • Fixed broken handling of oversized KISS frames and treat them as fatal error
      • Fixed bug when receiving multiple KISS frames at once
      • Renamed long option --tun to --tundev
  • 2020-12-26: Version alpha7
    • Fixed syntax error introduced in version alpha6, which stopped packets being parsed by hamtunnel
    • Reset "min" and "time" settings of serial device during initialization
  • 2020-12-26: Version alpha6
    • Modified transmission format of hamtunnel IP tunneling (reduces packet size by one byte)
    • hamtunnel supports serial hardware TNCs now
  • 2020-03-10: Version alpha5
    • Improved functions to send test signal and to measure dB level of incoming signal
  • 2020-03-10: Version alpha4
    • Allow sending successive packets without gap
    • Command line switches to send test signal and to measure dB level of incoming signal
  • 2020-03-08: Version alpha3
    • Bugfixes in TNC
      • Set bits per symbol to 4 by default (as documented in help)
      • Properly handle receiving multiple KISS frames at the same time
      • Properly handle KISS frames which exceed maximum size
      • Replaced unsafe use of memcpy() with memmove()
      • Fixed wrong calculation of random TX block time
      • Throw error when getting unexpected (non-option) argument
    • Added an IP tunneling daemon
  • 2019-02-15: Version alpha2
    • Some corrections in README file (including correct audio bandwidth)
    • Stricter synchronization requirement (reduce false positives)
    • Allow carrier frequency (baud-rate is half of carrier frequency) to be set on command-line of TNC
  • 2019-02-12: Initial release of version alpha1