1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
<table class="head">
<tr>
<td class="head-ltitle">NG_VJC(4)</td>
<td class="head-vol">Device Drivers Manual</td>
<td class="head-rtitle">NG_VJC(4)</td>
</tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">ng_vjc</code> — <span class="Nd">Van
Jacobson compression netgraph node type</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp"><code class="In">#include
<<a class="In">sys/types.h</a>></code>
<br/>
<code class="In">#include <<a class="In">netinet/in.h</a>></code>
<br/>
<code class="In">#include <<a class="In">netinet/in_systm.h</a>></code>
<br/>
<code class="In">#include <<a class="In">netinet/ip.h</a>></code>
<br/>
<code class="In">#include <<a class="In">net/slcompress.h</a>></code>
<br/>
<code class="In">#include
<<a class="In">netgraph/ng_vjc.h</a>></code></p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">The <code class="Nm">vjc</code> node type performs Van Jacobson
compression, which is used over PPP, SLIP, and other point-to-point IP
connections to compress TCP packet headers. The <code class="Dv">ip</code>
hook represents the uncompressed side of the node, while the
<code class="Dv">vjcomp</code>, <code class="Dv">vjuncomp</code>, and
<code class="Dv">vjip</code> hooks represent the compressed side of the
node. Packets received on the <code class="Dv">ip</code> will be compressed
or passed through as appropriate. Packets received on the other three hooks
will be uncompressed as appropriate. This node also supports “always
pass through” mode in either direction.</p>
<p class="Pp">Van Jacobson compression only applies to TCP packets. Only
“normal” (i.e., common case) TCP packets are actually
compressed. These are output on the <code class="Dv">vjcomp</code> hook.
Other TCP packets are run through the state machine but not compressed;
these appear on the <code class="Dv">vjuncomp</code> hook. Other non-TCP IP
packets are forwarded unchanged to <code class="Dv">vjip</code>.</p>
<p class="Pp">When connecting to a <a class="Xr">ng_ppp(4)</a> node, the
<code class="Dv">ip</code>, <code class="Dv">vjuncomp</code>,
<code class="Dv">vjcomp</code>, and <code class="Dv">vjip</code> hooks
should be connected to the <a class="Xr">ng_ppp(4)</a> node's
<code class="Dv">vjc_ip</code>, <code class="Dv">vjc_vjcomp</code>,
<code class="Dv">vjc_vjuncomp</code>, and <code class="Dv">vjc_ip</code>
hooks, respectively.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="HOOKS"><a class="permalink" href="#HOOKS">HOOKS</a></h1>
<p class="Pp">This node type supports the following hooks:</p>
<dl class="Bl-tag">
<dt id="ip"><var class="Va">ip</var></dt>
<dd>Upstream (uncompressed) IP packets.</dd>
<dt id="vjcomp"><var class="Va">vjcomp</var></dt>
<dd>Downstream compressed TCP packets.</dd>
<dt id="vjuncomp"><var class="Va">vjuncomp</var></dt>
<dd>Downstream uncompressed TCP packets.</dd>
<dt id="vjip"><var class="Va">vjip</var></dt>
<dd>Downstream uncompressed IP packets.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="CONTROL_MESSAGES"><a class="permalink" href="#CONTROL_MESSAGES">CONTROL
MESSAGES</a></h1>
<p class="Pp">This node type supports the generic control messages, plus the
following:</p>
<dl class="Bl-tag">
<dt id="NGM_VJC_SET_CONFIG"><a class="permalink" href="#NGM_VJC_SET_CONFIG"><code class="Dv">NGM_VJC_SET_CONFIG</code></a>
(<code class="Ic">setconfig</code>)</dt>
<dd>This command resets the compression state and configures it according to
the supplied <code class="Dv">struct ngm_vjc_config</code> argument. This
structure contains the following fields:
<div class="Bd Pp Bd-indent Li">
<pre>struct ngm_vjc_config {
u_char enableComp; /* Enable compression */
u_char enableDecomp; /* Enable decompression */
u_char maxChannel; /* Number of outgoing channels - 1 */
u_char compressCID; /* OK to compress outgoing CID's */
};</pre>
</div>
<p class="Pp">When <code class="Dv">enableComp</code> is set to zero, all
packets received on the <code class="Dv">ip</code> hook are forwarded
unchanged out the <code class="Dv">vjip</code> hook. Similarly, when
<code class="Dv">enableDecomp</code> is set to zero, all packets
received on the <code class="Dv">vjip</code> hook are forwarded
unchanged out the <code class="Dv">ip</code> hook, and packets are not
accepted on the <code class="Dv">vjcomp</code> and
<code class="Dv">vjuncomp</code> hooks. When a node is first created,
both compression and decompression are disabled and the node is
therefore operating in bi-directional “pass through”
mode.</p>
<p class="Pp">When enabling compression, <code class="Dv">maxChannel</code>
should be set to the number of outgoing compression channels minus one,
and is a value between 3 and 15, inclusive. The
<code class="Dv">compressCID</code> field indicates whether it is OK to
compress the CID header field for outgoing compressed TCP packets. This
value should be zero unless 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
<code class="Dv">NGM_VJC_RECV_ERROR</code> below).</p>
</dd>
<dt id="NGM_VJC_GET_STATE"><a class="permalink" href="#NGM_VJC_GET_STATE"><code class="Dv">NGM_VJC_GET_STATE</code></a>
(<code class="Ic">getstate</code>)</dt>
<dd>This command returns the node's current state described by the
<code class="Dv">struct slcompress</code> structure, which is defined in
<code class="In"><<a class="In">net/slcompress.h</a>></code>.</dd>
<dt id="NGM_VJC_CLR_STATS"><a class="permalink" href="#NGM_VJC_CLR_STATS"><code class="Dv">NGM_VJC_CLR_STATS</code></a>
(<code class="Ic">clrstats</code>)</dt>
<dd>Clears the node statistics counters. Statistics are also cleared whenever
the <code class="Dv">enableComp</code> or
<code class="Dv">enableDecomp</code> fields are changed from zero to one
by a <code class="Dv">NGM_VJC_SET_CONFIG</code> control message.</dd>
<dt id="NGM_VJC_RECV_ERROR"><a class="permalink" href="#NGM_VJC_RECV_ERROR"><code class="Dv">NGM_VJC_RECV_ERROR</code></a>
(<code class="Ic">recverror</code>)</dt>
<dd>When the peer has CID header field compression enabled, this message must
be sent to the local <code class="Nm">vjc</code> node immediately after
detecting that a received frame has been lost, due to a bad checksum or
for any other reason. Failing to do this can result in corrupted TCP
stream data.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="SHUTDOWN"><a class="permalink" href="#SHUTDOWN">SHUTDOWN</a></h1>
<p class="Pp">This node shuts down upon receipt of a
<code class="Dv">NGM_SHUTDOWN</code> control message, or when all hooks have
been disconnected.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<p class="Pp"><a class="Xr">netgraph(4)</a>, <a class="Xr">ng_iface(4)</a>,
<a class="Xr">ng_ppp(4)</a>, <a class="Xr">ngctl(8)</a></p>
<p class="Pp"><cite class="Rs"><span class="RsA">V. Jacobson</span>,
<span class="RsT">Compressing TCP/IP Headers</span>, <span class="RsO">RFC
1144</span>.</cite></p>
<p class="Pp"><cite class="Rs"><span class="RsA">G. McGregor</span>,
<span class="RsT">The PPP Internet Control Protocol (IPCP)</span>,
<span class="RsO">RFC 1332</span>.</cite></p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">The <code class="Nm">ng_vjc</code> node type was implemented in
<span class="Ux">FreeBSD 4.0</span>.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
<p class="Pp"><span class="An">Archie Cobbs</span>
<<a class="Mt" href="mailto:archie@FreeBSD.org">archie@FreeBSD.org</a>></p>
</section>
<section class="Sh">
<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1>
<p class="Pp">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.</p>
<p class="Pp">When built as a loadable kernel module, this module includes the
file <span class="Pa">net/slcompress.c</span>. Although loading the module
should fail if <span class="Pa">net/slcompress.c</span> 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.</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">January 19, 1999</td>
<td class="foot-os">FreeBSD 15.0</td>
</tr>
</table>
|