xref: /freebsd/share/man/man4/ng_vjc.4 (revision 7f9d26bd9d1b2754da8429257edbde0a8237f84f)
14cf49a43SJulian Elischer.\" Copyright (c) 1996-1999 Whistle Communications, Inc.
24cf49a43SJulian Elischer.\" All rights reserved.
34cf49a43SJulian Elischer.\"
44cf49a43SJulian Elischer.\" Subject to the following obligations and disclaimer of warranty, use and
54cf49a43SJulian Elischer.\" redistribution of this software, in source or object code forms, with or
64cf49a43SJulian Elischer.\" without modifications are expressly permitted by Whistle Communications;
74cf49a43SJulian Elischer.\" provided, however, that:
84cf49a43SJulian Elischer.\" 1. Any and all reproductions of the source or object code must include the
94cf49a43SJulian Elischer.\"    copyright notice above and the following disclaimer of warranties; and
104cf49a43SJulian Elischer.\" 2. No rights are granted, in any manner or form, to use Whistle
114cf49a43SJulian Elischer.\"    Communications, Inc. trademarks, including the mark "WHISTLE
124cf49a43SJulian Elischer.\"    COMMUNICATIONS" on advertising, endorsements, or otherwise except as
134cf49a43SJulian Elischer.\"    such appears in the above copyright notice or in the software.
144cf49a43SJulian Elischer.\"
154cf49a43SJulian Elischer.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND
164cf49a43SJulian Elischer.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO
174cf49a43SJulian Elischer.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,
184cf49a43SJulian Elischer.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF
194cf49a43SJulian Elischer.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
204cf49a43SJulian Elischer.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY
214cf49a43SJulian Elischer.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS
224cf49a43SJulian Elischer.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.
234cf49a43SJulian Elischer.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES
244cf49a43SJulian Elischer.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING
254cf49a43SJulian Elischer.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
264cf49a43SJulian Elischer.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
274cf49a43SJulian Elischer.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
284cf49a43SJulian Elischer.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
294cf49a43SJulian Elischer.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
304cf49a43SJulian Elischer.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
314cf49a43SJulian Elischer.\" OF SUCH DAMAGE.
324cf49a43SJulian Elischer.\"
334cf49a43SJulian Elischer.\" Author: Archie Cobbs <archie@whistle.com>
344cf49a43SJulian Elischer.\"
354cf49a43SJulian Elischer.\" $FreeBSD$
364cf49a43SJulian Elischer.\" $Whistle: ng_vjc.8,v 1.4 1999/01/25 23:46:28 archie Exp $
374cf49a43SJulian Elischer.\"
384cf49a43SJulian Elischer.Dd January 19, 1999
394cf49a43SJulian Elischer.Dt NG_VJC 8
404cf49a43SJulian Elischer.Os FreeBSD 3
414cf49a43SJulian Elischer.Sh NAME
424cf49a43SJulian Elischer.Nm ng_vjc
434cf49a43SJulian Elischer.Nd Van Jacobsen compression netgraph node type
444cf49a43SJulian Elischer.Sh SYNOPSIS
454cf49a43SJulian Elischer.Fd #include <net/slcompress.h>
464cf49a43SJulian Elischer.Fd #include <netgraph/ng_vjc.h>
474cf49a43SJulian Elischer.Sh DESCRIPTION
484cf49a43SJulian ElischerThe
494cf49a43SJulian Elischer.Nm vjc
507f9d26bdSMike Pritchardnode type performs Van Jacobsen compression, which is used
514cf49a43SJulian Elischerover PPP, SLIP, and other point-to-point IP connections to
524cf49a43SJulian Elischercompress TCP packet headers.  The
534cf49a43SJulian Elischer.Dv ip
544cf49a43SJulian Elischerhook represents the uncompressed side of the node, while the
554cf49a43SJulian Elischer.Dv vjcomp ,
564cf49a43SJulian Elischer.Dv vjuncomp ,
574cf49a43SJulian Elischerand
584cf49a43SJulian Elischer.Dv vjip
594cf49a43SJulian Elischernodes represent the compressed side of the node. Packets received on the
604cf49a43SJulian Elischer.Dv ip
614cf49a43SJulian Elischerwill be compressed or passed through as appropriate. Packets received
624cf49a43SJulian Elischeron the other three hooks will be uncompressed as appropriate.
634cf49a43SJulian Elischer.Pp
644cf49a43SJulian ElischerVan Jacobsen compression only applies to TCP packets.
654cf49a43SJulian ElischerOnly ``normal'' (i.e., common case) TCP packets are actually compressed.
664cf49a43SJulian ElischerThese are output on the
674cf49a43SJulian Elischer.Dv vjcomp
684cf49a43SJulian Elischerhook. Other TCP packets are run through the state machine but not
694cf49a43SJulian Elischercompressed; these appear on the
704cf49a43SJulian Elischer.Dv vjuncomp
714cf49a43SJulian Elischerhook.
724cf49a43SJulian ElischerOther non-TCP IP packets are forwarded unchanged to
734cf49a43SJulian Elischer.Dv vjip .
744cf49a43SJulian Elischer.Pp
754cf49a43SJulian ElischerWhen connecting to a
764cf49a43SJulian Elischer.Xr ng_ppp 8
774cf49a43SJulian Elischernode, the
784cf49a43SJulian Elischer.Dv vjuncomp ,
794cf49a43SJulian Elischer.Dv vjcomp ,
804cf49a43SJulian Elischerand
814cf49a43SJulian Elischer.Dv vjip
824cf49a43SJulian Elischernodes should be connected to the
834cf49a43SJulian Elischer.Xr ng_ppp 8
844cf49a43SJulian Elischernode's
854cf49a43SJulian Elischer.Dv vjcomp ,
864cf49a43SJulian Elischer.Dv vjuncomp ,
874cf49a43SJulian Elischerand
884cf49a43SJulian Elischer.Dv ip
894cf49a43SJulian Elischernodes, respectively.
904cf49a43SJulian Elischer.Sh HOOKS
914cf49a43SJulian ElischerThis node type supports the following hooks:
924cf49a43SJulian Elischer.Pp
934cf49a43SJulian Elischer.Bl -tag -width foobarbazi
944cf49a43SJulian Elischer.It Dv ip
954cf49a43SJulian ElischerUpstream (uncompressed) IP packets.
964cf49a43SJulian Elischer.It Dv vjcomp
974cf49a43SJulian ElischerDownstream compressed TCP packets.
984cf49a43SJulian Elischer.It Dv vjuncomp
994cf49a43SJulian ElischerDownstream uncompressed TCP packets.
1004cf49a43SJulian Elischer.It Dv vjip
1014cf49a43SJulian ElischerDownstream uncompressed IP packets.
1024cf49a43SJulian Elischer.Sh CONTROL MESSAGES
1034cf49a43SJulian ElischerThis node type supports the generic control messages, plus the following:
1044cf49a43SJulian Elischer.Bl -tag -width foo
1054cf49a43SJulian Elischer.It Dv NGM_VJC_CONFIG
1064cf49a43SJulian ElischerThis command resets the compression state and configures it according
1074cf49a43SJulian Elischerto the supplied
1084cf49a43SJulian Elischer.Dv "struct ngm_vjc_config"
1094cf49a43SJulian Elischerargument. This structure contains the following fields:
1104cf49a43SJulian Elischer.Bd -literal -offset 4n
1114cf49a43SJulian Elischerstruct ngm_vjc_config {
1124cf49a43SJulian Elischer  u_char   enabled;       /* Enable compression/decompression */
1134cf49a43SJulian Elischer  u_char   numChannels;   /* Number of outgoing channels */
1144cf49a43SJulian Elischer  u_char   compressCID;   /* OK to compress outgoing CID's */
1154cf49a43SJulian Elischer};
1164cf49a43SJulian Elischer.Ed
1174cf49a43SJulian Elischer.Pp
1184cf49a43SJulian ElischerWhen
1194cf49a43SJulian Elischer.Dv enabled
1204cf49a43SJulian Elischeris set to zero, the node operates in ``pass through'' mode, only
1214cf49a43SJulian Elischeraccepting packets on the
1224cf49a43SJulian Elischer.Dv ip
1234cf49a43SJulian Elischerand
1244cf49a43SJulian Elischer.Dv vjip
1254cf49a43SJulian Elischerhooks.
1264cf49a43SJulian Elischer.Dv numChannels
1274cf49a43SJulian Elischershould be set to the number of compression channels, and is a value
1284cf49a43SJulian Elischerbetween 3 and 16, inclusive.
1294cf49a43SJulian Elischer.Pp
1304cf49a43SJulian ElischerThe
1314cf49a43SJulian Elischer.Dv compressCID
1324cf49a43SJulian Elischerfield indicates whether it is OK to compress the CID field for
1334cf49a43SJulian Elischeroutgoing compressed TCP packets. This value should be zero unless
1344cf49a43SJulian Elischereither (a) it not possible for an incoming frame to be lost, or
1354cf49a43SJulian Elischer(b) lost frames can be reliably detected and a
1364cf49a43SJulian Elischer.Dv NGM_VJC_RECV_ERROR
1377f9d26bdSMike Pritchardmessage is immediately sent whenever this occurs.
1384cf49a43SJulian Elischer.It Dv NGM_VJC_GET_STATE
1394cf49a43SJulian ElischerThis command returns the node's current state described by the
1404cf49a43SJulian Elischer.Dv "struct slcompress"
1414cf49a43SJulian Elischerstructure, which is defined in
1424cf49a43SJulian Elischer.Dv "net/slcompress.h" .
1434cf49a43SJulian Elischer.It Dv NGM_VJC_CLR_STATS
1444cf49a43SJulian ElischerClears the node statistics counters. Statistics are also cleared whenever the
1454cf49a43SJulian Elischer.Dv enabled
1464cf49a43SJulian Elischerfield is changed from zero to one by a
1474cf49a43SJulian Elischer.Dv NGM_VJC_CONFIG
1484cf49a43SJulian Elischercontrol message.
1494cf49a43SJulian Elischer.It Dv NGM_VJC_RECV_ERROR
1504cf49a43SJulian ElischerWhen the
1514cf49a43SJulian Elischer.Dv compressCID
1524cf49a43SJulian Elischeris set to one, this message must be sent to the node immediately
1537f9d26bdSMike Pritchardafter detecting that a received frame has been lost, due to a bad
1544cf49a43SJulian Elischerchecksum or for any other reason. Failing to do this can result
1554cf49a43SJulian Elischerin corrupted TCP stream data.
1564cf49a43SJulian Elischer.Sh SHUTDOWN
1574cf49a43SJulian ElischerThis node shuts down upon receipt of a
1584cf49a43SJulian Elischer.Dv NGM_SHUTDOWN
1594cf49a43SJulian Elischercontrol message, or when all hooks have been disconnected.
1604cf49a43SJulian Elischer.Sh BUGS
161b58a8a3bSJulian ElischerWhen used as a loadable kernel module, this node type requires that the file
1624cf49a43SJulian Elischer.Dv "net/slcompress.c"
1634cf49a43SJulian Elischerwas compiled into the kernel. Currently the only way to insure this
1644cf49a43SJulian Elischeris to include the
1654cf49a43SJulian Elischer.Dv slip ,
1664cf49a43SJulian Elischer.Dv ppp ,
1674cf49a43SJulian Elischeror
1684cf49a43SJulian Elischer.Dv i4bipr
1694cf49a43SJulian Elischerpseudo-devices in your kernel compilation. In the future there should
1704cf49a43SJulian Elischerbe a kernel option that causes inclusion of this file without requiring
1714cf49a43SJulian Elischerone of these drivers.
1724cf49a43SJulian Elischer.Sh SEE ALSO
1734cf49a43SJulian Elischer.Xr netgraph 4 ,
1744cf49a43SJulian Elischer.Xr ng_ppp 8 ,
1754cf49a43SJulian Elischer.Xr ng_iface 8 ,
1764cf49a43SJulian Elischer.Xr ngctl 8 .
1774cf49a43SJulian Elischer.Rs
1784cf49a43SJulian Elischer.%A V. Jacobsen
1794cf49a43SJulian Elischer.%T "Compressing TCP/IP Headers"
1804cf49a43SJulian Elischer.%O RFC 1144
1814cf49a43SJulian Elischer.Re
1824cf49a43SJulian Elischer.Rs
1834cf49a43SJulian Elischer.%A G. McGregor
1844cf49a43SJulian Elischer.%T "The PPP Internet Control Protocol (IPCP)"
1854cf49a43SJulian Elischer.%O RFC 1332
1864cf49a43SJulian Elischer.Re
1874cf49a43SJulian Elischer.Sh AUTHOR
1884cf49a43SJulian ElischerArchie Cobbs <archie@whistle.com>
189