The DUAL protocol, with support for TCP/IP and compressed TCP/IP, has been implemented within the BSD Network Stack in the FreeBSD 1.1 operating system. We chose this system for several reasons:
As DUAL is a Link Layer (or more strictly as LLC layer), it was implemented as an `interface' in the network stack. We wanted DUAL to produce/receive KISS frames to be able to interface with KISS-mode TNCs, and as the KISS framing scheme is nearly identical to the SLIP framing scheme [Romkey 88], we began with the SLIP interface code.
After some consideration of the existing code in the BSD Network Stack, we realised that there were existing pieces of code that could be shared by SLIP and DUAL, and also PPP. These are:
Our first implementation task was to separate these functions in such a way that DUAL, SLIP and PPP could share them. The SLIP framing code was moved into a new file, net/if_slframe.c, with the remainder of SLIP left in net/if_sl.c. The HDLC checksum code was moved to net/hdlc_fcs.c, with PPP left untouched.
The TCP/IP header compression code in net/slcompress.c was already shared between SLIP and PPP, and we have not moved any code from this file, but we have substantially altered the code to make the scheme work as per Section 9.
With the shared pieces of code separated, we created net/if_dual.c and net/if_dual.h from the SLIP interface code, renamed all variables, functions and structures, and began to implement the DUAL protocol.