1999-10-21 09:06:11 +00:00
|
|
|
.\" Copyright (c) 1996-1999 Whistle Communications, Inc.
|
|
|
|
.\" All rights reserved.
|
2001-07-14 19:41:16 +00:00
|
|
|
.\"
|
1999-10-21 09:06:11 +00:00
|
|
|
.\" Subject to the following obligations and disclaimer of warranty, use and
|
|
|
|
.\" redistribution of this software, in source or object code forms, with or
|
|
|
|
.\" without modifications are expressly permitted by Whistle Communications;
|
|
|
|
.\" provided, however, that:
|
|
|
|
.\" 1. Any and all reproductions of the source or object code must include the
|
|
|
|
.\" copyright notice above and the following disclaimer of warranties; and
|
|
|
|
.\" 2. No rights are granted, in any manner or form, to use Whistle
|
|
|
|
.\" Communications, Inc. trademarks, including the mark "WHISTLE
|
|
|
|
.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as
|
|
|
|
.\" such appears in the above copyright notice or in the software.
|
2001-07-14 19:41:16 +00:00
|
|
|
.\"
|
1999-10-21 09:06:11 +00:00
|
|
|
.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND
|
|
|
|
.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO
|
|
|
|
.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,
|
|
|
|
.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF
|
|
|
|
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
|
|
|
|
.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY
|
|
|
|
.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS
|
|
|
|
.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.
|
|
|
|
.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES
|
|
|
|
.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING
|
|
|
|
.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
|
|
|
.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
|
|
|
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
|
|
|
|
.\" OF SUCH DAMAGE.
|
2001-07-14 19:41:16 +00:00
|
|
|
.\"
|
2000-10-26 15:30:44 +00:00
|
|
|
.\" Author: Archie Cobbs <archie@FreeBSD.org>
|
1999-10-21 09:06:11 +00:00
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\" $Whistle: ng_vjc.8,v 1.4 1999/01/25 23:46:28 archie Exp $
|
|
|
|
.\"
|
|
|
|
.Dd January 19, 1999
|
2000-05-04 17:54:37 +00:00
|
|
|
.Dt NG_VJC 4
|
2001-07-10 15:31:11 +00:00
|
|
|
.Os
|
1999-10-21 09:06:11 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm ng_vjc
|
2000-08-05 20:17:04 +00:00
|
|
|
.Nd Van Jacobson compression netgraph node type
|
1999-10-21 09:06:11 +00:00
|
|
|
.Sh SYNOPSIS
|
2001-10-01 16:09:29 +00:00
|
|
|
.In net/slcompress.h
|
|
|
|
.In netgraph/ng_vjc.h
|
1999-10-21 09:06:11 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm vjc
|
2000-08-05 20:17:04 +00:00
|
|
|
node type performs Van Jacobson compression, which is used
|
1999-10-21 09:06:11 +00:00
|
|
|
over PPP, SLIP, and other point-to-point IP connections to
|
2004-07-03 18:29:24 +00:00
|
|
|
compress TCP packet headers.
|
|
|
|
The
|
1999-10-21 09:06:11 +00:00
|
|
|
.Dv ip
|
|
|
|
hook represents the uncompressed side of the node, while the
|
|
|
|
.Dv vjcomp ,
|
|
|
|
.Dv vjuncomp ,
|
|
|
|
and
|
|
|
|
.Dv vjip
|
2003-06-28 23:53:39 +00:00
|
|
|
hooks represent the compressed side of the node.
|
|
|
|
Packets received on the
|
1999-10-21 09:06:11 +00:00
|
|
|
.Dv ip
|
2003-06-28 23:53:39 +00:00
|
|
|
will be compressed or passed through as appropriate.
|
|
|
|
Packets received on the other three hooks will be uncompressed as appropriate.
|
1999-12-21 01:25:21 +00:00
|
|
|
This node also supports
|
|
|
|
.Dq always pass through
|
|
|
|
mode in either direction.
|
1999-10-21 09:06:11 +00:00
|
|
|
.Pp
|
2000-08-05 20:17:04 +00:00
|
|
|
Van Jacobson compression only applies to TCP packets.
|
1999-12-21 01:25:21 +00:00
|
|
|
Only
|
|
|
|
.Dq normal
|
|
|
|
(i.e., common case) TCP packets are actually compressed.
|
1999-10-21 09:06:11 +00:00
|
|
|
These are output on the
|
|
|
|
.Dv vjcomp
|
2003-06-28 23:53:39 +00:00
|
|
|
hook.
|
|
|
|
Other TCP packets are run through the state machine but not
|
1999-10-21 09:06:11 +00:00
|
|
|
compressed; these appear on the
|
|
|
|
.Dv vjuncomp
|
|
|
|
hook.
|
|
|
|
Other non-TCP IP packets are forwarded unchanged to
|
|
|
|
.Dv vjip .
|
|
|
|
.Pp
|
|
|
|
When connecting to a
|
2000-05-04 17:54:37 +00:00
|
|
|
.Xr ng_ppp 4
|
1999-10-21 09:06:11 +00:00
|
|
|
node, the
|
1999-11-07 05:16:27 +00:00
|
|
|
.Dv ip ,
|
1999-10-21 09:06:11 +00:00
|
|
|
.Dv vjuncomp ,
|
2001-07-14 19:41:16 +00:00
|
|
|
.Dv vjcomp ,
|
1999-10-21 09:06:11 +00:00
|
|
|
and
|
|
|
|
.Dv vjip
|
2000-01-03 18:36:42 +00:00
|
|
|
hooks should be connected to the
|
2000-05-04 17:54:37 +00:00
|
|
|
.Xr ng_ppp 4
|
1999-10-21 09:06:11 +00:00
|
|
|
node's
|
1999-11-07 05:16:27 +00:00
|
|
|
.Dv vjc_ip ,
|
|
|
|
.Dv vjc_vjcomp ,
|
|
|
|
.Dv vjc_vjuncomp ,
|
1999-10-21 09:06:11 +00:00
|
|
|
and
|
1999-11-07 05:16:27 +00:00
|
|
|
.Dv vjc_ip
|
2000-01-03 18:36:42 +00:00
|
|
|
hooks, respectively.
|
1999-10-21 09:06:11 +00:00
|
|
|
.Sh HOOKS
|
|
|
|
This node type supports the following hooks:
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -width foobarbazi
|
|
|
|
.It Dv ip
|
|
|
|
Upstream (uncompressed) IP packets.
|
|
|
|
.It Dv vjcomp
|
|
|
|
Downstream compressed TCP packets.
|
|
|
|
.It Dv vjuncomp
|
|
|
|
Downstream uncompressed TCP packets.
|
|
|
|
.It Dv vjip
|
|
|
|
Downstream uncompressed IP packets.
|
2000-12-29 09:18:45 +00:00
|
|
|
.El
|
1999-10-21 09:06:11 +00:00
|
|
|
.Sh CONTROL MESSAGES
|
|
|
|
This node type supports the generic control messages, plus the following:
|
|
|
|
.Bl -tag -width foo
|
1999-11-07 05:16:27 +00:00
|
|
|
.It Dv NGM_VJC_SET_CONFIG
|
1999-10-21 09:06:11 +00:00
|
|
|
This command resets the compression state and configures it according
|
|
|
|
to the supplied
|
|
|
|
.Dv "struct ngm_vjc_config"
|
2004-07-03 18:29:24 +00:00
|
|
|
argument.
|
|
|
|
This structure contains the following fields:
|
1999-10-21 09:06:11 +00:00
|
|
|
.Bd -literal -offset 4n
|
|
|
|
struct ngm_vjc_config {
|
1999-11-07 05:16:27 +00:00
|
|
|
u_char enableComp; /* Enable compression */
|
|
|
|
u_char enableDecomp; /* Enable decompression */
|
1999-11-10 06:17:51 +00:00
|
|
|
u_char maxChannel; /* Number of outgoing channels - 1 */
|
1999-10-21 09:06:11 +00:00
|
|
|
u_char compressCID; /* OK to compress outgoing CID's */
|
|
|
|
};
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
When
|
1999-11-07 05:16:27 +00:00
|
|
|
.Dv enableComp
|
|
|
|
is set to zero, all packets received on the
|
1999-10-21 09:06:11 +00:00
|
|
|
.Dv ip
|
1999-11-07 05:16:27 +00:00
|
|
|
hook are forwarded unchanged out the
|
1999-10-21 09:06:11 +00:00
|
|
|
.Dv vjip
|
2004-07-03 18:29:24 +00:00
|
|
|
hook.
|
|
|
|
Similarly, when
|
1999-11-07 05:16:27 +00:00
|
|
|
.Dv enableDecomp
|
|
|
|
is set to zero, all packets received on the
|
|
|
|
.Dv vjip
|
|
|
|
hook are forwarded unchanged out the
|
|
|
|
.Dv ip
|
|
|
|
hook, and packets are not accepted on the
|
|
|
|
.Dv vjcomp
|
|
|
|
and
|
|
|
|
.Dv vjuncomp
|
1999-10-21 09:06:11 +00:00
|
|
|
hooks.
|
1999-11-07 05:16:27 +00:00
|
|
|
When a node is first created,
|
|
|
|
both compression and decompression are disabled and the node is
|
1999-12-21 01:25:21 +00:00
|
|
|
therefore operating in bi-directional
|
|
|
|
.Dq pass through
|
|
|
|
mode.
|
1999-10-21 09:06:11 +00:00
|
|
|
.Pp
|
1999-11-07 05:16:27 +00:00
|
|
|
When enabling compression,
|
1999-11-10 06:17:51 +00:00
|
|
|
.Dv maxChannel
|
|
|
|
should be set to the number of outgoing compression channels minus one,
|
2003-06-28 23:53:39 +00:00
|
|
|
and is a value between 3 and 15, inclusive.
|
|
|
|
The
|
1999-10-21 09:06:11 +00:00
|
|
|
.Dv compressCID
|
2000-01-03 18:36:42 +00:00
|
|
|
field indicates whether it is OK to compress the CID header field for
|
2003-06-28 23:53:39 +00:00
|
|
|
outgoing compressed TCP packets.
|
|
|
|
This value should be zero unless
|
2000-01-03 18:36:42 +00:00
|
|
|
either (a) it is not possible for an outgoing frame to be lost, or
|
|
|
|
(b) lost frames can be reliably detected and immediately
|
|
|
|
reported to the peer's decompression engine (see
|
1999-10-21 09:06:11 +00:00
|
|
|
.Dv NGM_VJC_RECV_ERROR
|
2000-01-03 18:36:42 +00:00
|
|
|
below).
|
1999-10-21 09:06:11 +00:00
|
|
|
.It Dv NGM_VJC_GET_STATE
|
|
|
|
This command returns the node's current state described by the
|
|
|
|
.Dv "struct slcompress"
|
|
|
|
structure, which is defined in
|
2003-09-10 19:24:35 +00:00
|
|
|
.In net/slcompress.h .
|
1999-10-21 09:06:11 +00:00
|
|
|
.It Dv NGM_VJC_CLR_STATS
|
2003-06-28 23:53:39 +00:00
|
|
|
Clears the node statistics counters.
|
|
|
|
Statistics are also cleared whenever the
|
1999-11-07 05:16:27 +00:00
|
|
|
.Dv enableComp
|
|
|
|
or
|
|
|
|
.Dv enableDecomp
|
|
|
|
fields are changed from zero to one by a
|
|
|
|
.Dv NGM_VJC_SET_CONFIG
|
1999-10-21 09:06:11 +00:00
|
|
|
control message.
|
|
|
|
.It Dv NGM_VJC_RECV_ERROR
|
2000-01-03 18:36:42 +00:00
|
|
|
When the peer has CID header field compression enabled,
|
|
|
|
this message must be sent to the local
|
|
|
|
.Nm vjc
|
|
|
|
node immediately
|
1999-10-30 20:30:19 +00:00
|
|
|
after detecting that a received frame has been lost, due to a bad
|
2003-06-28 23:53:39 +00:00
|
|
|
checksum or for any other reason.
|
|
|
|
Failing to do this can result in corrupted TCP stream data.
|
2000-12-29 09:18:45 +00:00
|
|
|
.El
|
1999-10-21 09:06:11 +00:00
|
|
|
.Sh SHUTDOWN
|
|
|
|
This node shuts down upon receipt of a
|
|
|
|
.Dv NGM_SHUTDOWN
|
|
|
|
control message, or when all hooks have been disconnected.
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr netgraph 4 ,
|
2000-05-04 17:54:37 +00:00
|
|
|
.Xr ng_iface 4 ,
|
2001-07-06 16:46:48 +00:00
|
|
|
.Xr ng_ppp 4 ,
|
2000-05-04 17:54:37 +00:00
|
|
|
.Xr ngctl 8
|
1999-10-21 09:06:11 +00:00
|
|
|
.Rs
|
2000-08-05 20:17:04 +00:00
|
|
|
.%A V. Jacobson
|
1999-10-21 09:06:11 +00:00
|
|
|
.%T "Compressing TCP/IP Headers"
|
|
|
|
.%O RFC 1144
|
|
|
|
.Re
|
|
|
|
.Rs
|
|
|
|
.%A G. McGregor
|
|
|
|
.%T "The PPP Internet Control Protocol (IPCP)"
|
|
|
|
.%O RFC 1332
|
|
|
|
.Re
|
1999-12-21 01:25:21 +00:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
node type was implemented in
|
|
|
|
.Fx 4.0 .
|
|
|
|
.Sh AUTHORS
|
2000-10-26 15:30:44 +00:00
|
|
|
.An Archie Cobbs Aq archie@FreeBSD.org
|
2005-01-21 08:36:40 +00:00
|
|
|
.Sh BUGS
|
|
|
|
As the initialization routine in the kernel implementation of
|
|
|
|
Van Jacobson compression initializes both compression and decompression
|
|
|
|
at once, this node does not allow compression and decompression to
|
|
|
|
be enabled in separate operations.
|
|
|
|
In order to enable one when
|
|
|
|
the other is already enabled, first both must be disabled, then
|
|
|
|
both enabled.
|
|
|
|
This of course resets the node state.
|
|
|
|
This restriction may be lifted in a later version.
|
|
|
|
.Pp
|
|
|
|
When built as a loadable kernel module, this module includes the file
|
|
|
|
.Pa net/slcompress.c .
|
|
|
|
Although loading the module should fail if
|
|
|
|
.Pa net/slcompress.c
|
|
|
|
already exists in the kernel, currently it does not, and the duplicate
|
|
|
|
copies of the file do not interfere.
|
|
|
|
However, this may change in the future.
|