1 .\" Copyright (c) 1996-1999 Whistle Communications, Inc.
2 .\" All rights reserved.
4 .\" Subject to the following obligations and disclaimer of warranty, use and
5 .\" redistribution of this software, in source or object code forms, with or
6 .\" without modifications are expressly permitted by Whistle Communications;
7 .\" provided, however, that:
8 .\" 1. Any and all reproductions of the source or object code must include the
9 .\" copyright notice above and the following disclaimer of warranties; and
10 .\" 2. No rights are granted, in any manner or form, to use Whistle
11 .\" Communications, Inc. trademarks, including the mark "WHISTLE
12 .\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as
13 .\" such appears in the above copyright notice or in the software.
15 .\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND
16 .\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO
17 .\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,
18 .\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF
19 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
20 .\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY
21 .\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS
22 .\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.
23 .\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES
24 .\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING
25 .\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26 .\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
27 .\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
28 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 .\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
33 .\" Author: Archie Cobbs <archie@FreeBSD.org>
36 .\" $Whistle: ng_ppp.8,v 1.3 1999/01/25 23:46:27 archie Exp $
43 .Nd PPP protocol netgraph node type
50 node type performs multiplexing for the PPP protocol.
51 It handles only packets that contain data, and forwards protocol negotiation
52 and control packets to a separate controlling entity (e.g., a
54 This approach combines the fast dispatch of
55 kernel implementations with the configuration flexibility of a
56 user-land implementations.
57 The PPP node type directly supports
58 multi-link PPP, Van Jacobson compression, PPP compression, PPP
59 encryption, and the IP, IPX, and AppleTalk protocols.
60 A single PPP node corresponds to one PPP multi-link bundle.
62 There is a separate hook for each PPP link in the bundle, plus
63 several hooks corresponding to the directly supported protocols.
64 For compression and encryption, separate attached nodes are required
65 to do the actual work.
66 The node type used will of course depend on the algorithm negotiated.
69 hook which is used to handle any protocol not directly supported
71 This includes all of the control protocols: LCP, IPCP,
73 Typically this node is connected to a user-land daemon via a
76 .Sh ENABLING FUNCTIONALITY
77 In general, the PPP node enables a specific link or functionality when
79 .Dv NGM_PPP_SET_CONFIG
80 message has been received which enables it, and
81 (b) the corresponding hook(s) are connected.
82 This allows the controlling entity to use either method (a) or (b)
83 (or both) to control the node's behavior.
84 When a link is connected but disabled, traffic can still flow on
89 During normal operation, the individual PPP links are connected to hooks
96 These device-independent hooks transmit and receive full PPP
97 frames, which include the PPP protocol, address, control, and
98 information fields, but no checksum or other link-specific fields.
100 On outgoing frames, when protocol compression
101 has been enabled and the protocol number is suitable for compression,
102 the protocol field will be compressed (i.e., sent as one byte
104 Either compressed or uncompressed protocol fields
105 are accepted on incoming frames.
106 Similarly, if address and control
107 field compression has been enabled for the link, the address and
108 control fields will be omitted (except for LCP frames as required
110 Incoming frames have the address and control fields
111 stripped automatically if present.
113 Since all negotiation is handled outside the PPP node, the links
114 should not be connected and enabled until the corresponding link
115 has reached the network phase (i.e., LCP negotiation and authentication
116 have completed successfully) and the PPP node has been informed of
117 the link parameters via the
118 .Dv NGM_PPP_LINK_CONFIG
121 When a link is connected but disabled, all received frames are forwarded
124 hook, and conversely, frames may be transmitted via the
127 This mode is appropriate for the link authentication phase.
128 As soon as the link is enabled, the PPP node will
129 begin processing frames received on the link.
130 .Sh COMPRESSION AND ENCRYPTION
131 Compression is supported via two hooks,
135 When enabled and connected, the PPP node writes outgoing frames on the
137 hook and expects to receive back the compressed frame on the same hook.
140 hook is used to uncompress incoming frames when decompression is
141 negotiated (compression and decompression are independently negotiable).
142 The type of node attached to these hooks should correspond
143 to the type of compression negotiated, e.g., Deflate, Predictor-1, etc.
145 Encryption works exactly analogously via the
150 Data is always compressed before being encrypted,
151 and decrypted before being decompressed.
153 Only bundle-level compression and encryption is directly supported;
154 link-level compression and encryption can be handled transparently
156 .Sh VAN JACOBSON COMPRESSION
163 hooks are connected, and the corresponding configuration flag is
164 enabled, Van Jacobson compression and/or decompression will become active.
165 Normally these hooks connect to the corresponding hooks of a single
168 The PPP node is compatible with the
174 When a frame is received on a link with an unsupported protocol,
175 or a protocol which is disabled or for which the corresponding hook
176 is unconnected, the PPP node forwards the frame out the
178 hook, prepended with a four byte prefix.
179 This first two bytes of
180 the prefix indicate the link number on which the frame was received
182 For such frames received over the bundle (i.e., encapsulated in the
183 multi-link protocol), the special link number
184 .Dv NG_PPP_BUNDLE_LINKNUM
186 After the two byte link number is the two byte PPP protocol number
187 (also in network order).
188 The PPP protocol number is two bytes long even if the original frame
189 was protocol compressed.
191 Conversely, any data written to the
193 hook is assumed to be in this same format.
194 The four byte header is
195 stripped off, the PPP protocol number is prepended (possibly compressed),
196 and the frame is delivered over the desired link.
197 If the link number is
198 .Dv NG_PPP_BUNDLE_LINKNUM
199 the frame will be delivered over the multi-link bundle; or, if multi-link
200 is disabled, over the (single) PPP link.
202 Typically when the controlling entity receives an unexpected packet on the
204 hook it responds either by dropping the frame (if it is not ready for
205 the protocol) or with an LCP protocol reject (if it does not recognize
206 or expect the protocol).
207 .Sh MULTILINK OPERATION
208 To enable multi-link PPP, the corresponding configuration flag must be set
209 and at least one link connected.
210 The PPP node will not allow more than
211 one link to be connected if multi-link is not enabled, nor will it allow
212 certain multi-link settings to be changed while multi-link operation is
213 active (e.g., short sequence number header format).
215 Since packets are sent as fragments across multiple individual links,
216 it is important that when a link goes down the PPP node is notified
217 immediately, either by disconnecting the corresponding hook or disabling
219 .Dv NGM_PPP_SET_CONFIG
222 Each link has configuration parameters for latency (specified in
223 milliseconds) and bandwidth (specified in tens of bytes per second).
224 The PPP node can be configured for
230 When configured for round-robin delivery, the latency and bandwidth
231 values are ignored and the PPP node simply sends each frame as a
232 single fragment, alternating frames across all the links in the
234 This scheme has the advantage that even if one link fails
235 silently, some packets will still get through.
236 It has the disadvantage
237 of sub-optimal overall bundle latency, which is important for
238 interactive response time, and sub-optimal overall bundle bandwidth
239 when links with different bandwidths exist in the same bundle.
241 When configured for optimal delivery, the PPP node distributes the
242 packet across the links in a way that minimizes the time it takes
243 for the completed packet to be received by the far end.
244 This involves taking into account each link's latency, bandwidth, and
245 current queue length.
246 Therefore these numbers should be configured as accurately as possible.
247 The algorithm does require
248 some computation, so may not be appropriate for very slow machines
249 and/or very fast links.
251 As a special case, if all links have identical latency and bandwidth,
252 then the above algorithm is disabled (because it is unnecessary)
253 and the PPP node simply fragments frames into equal sized portions
254 across all of the links.
256 This node type supports the following hooks:
258 .Bl -tag -compact -width vjc_vjuncomp
260 Individual PPP link number
263 Connection to compression engine
265 Connection to decompression engine
267 Connection to encryption engine
269 Connection to decryption engine
293 AppleTalk packet data
297 Bypass hook; frames have a four byte header consisting of
298 a link number and a PPP protocol number.
301 This node type supports the generic control messages, plus the following:
303 .It Dv NGM_PPP_SET_CONFIG
304 This command configures all aspects of the node.
305 This includes enabling
306 multi-link PPP, encryption, compression, Van Jacobson compression, and IP,
307 IPv6, AppleTalk, and IPX packet delivery.
308 It includes per-link configuration,
309 including enabling the link, setting latency and bandwidth parameters,
310 and enabling protocol field compression.
311 Note that no link or functionality
312 is active until the corresponding hook is also connected.
314 .Dv "struct ng_ppp_node_conf"
316 .Bd -literal -offset 0n
317 /* Per-link config structure */
318 struct ng_ppp_link_conf {
319 u_char enableLink; /* enable this link */
320 u_char enableProtoComp;/* enable protocol field compression */
321 u_char enableACFComp; /* enable addr/ctrl field compression */
322 u_int16_t mru; /* peer MRU */
323 u_int32_t latency; /* link latency (in milliseconds) */
324 u_int32_t bandwidth; /* link bandwidth (in bytes/second) */
327 /* Bundle config structure */
328 struct ng_ppp_bund_conf {
329 u_int16_t mrru; /* multilink peer MRRU */
330 u_char enableMultilink; /* enable multilink */
331 u_char recvShortSeq; /* recv multilink short seq # */
332 u_char xmitShortSeq; /* xmit multilink short seq # */
333 u_char enableRoundRobin; /* xmit whole packets */
334 u_char enableIP; /* enable IP data flow */
335 u_char enableIPv6; /* enable IPv6 data flow */
336 u_char enableAtalk; /* enable AppleTalk data flow */
337 u_char enableIPX; /* enable IPX data flow */
338 u_char enableCompression; /* enable PPP compression */
339 u_char enableDecompression; /* enable PPP decompression */
340 u_char enableEncryption; /* enable PPP encryption */
341 u_char enableDecryption; /* enable PPP decryption */
342 u_char enableVJCompression; /* enable VJ compression */
343 u_char enableVJDecompression; /* enable VJ decompression */
346 struct ng_ppp_node_conf {
347 struct ng_ppp_bund_conf bund;
348 struct ng_ppp_link_conf links[NG_PPP_MAX_LINKS];
352 .It Dv NGM_PPP_GET_CONFIG
353 Returns the current configuration as a
354 .Dv "struct ng_ppp_node_conf" .
355 .It Dv NGM_PPP_GET_LINK_STATS
356 This command takes a two byte link number as an argument and returns a
357 .Dv "struct ng_ppp_link_stat"
358 containing statistics for the corresponding link.
360 .Dv NG_PPP_BUNDLE_LINKNUM
361 is a valid link number corresponding to the multi-link bundle.
362 .It Dv NGM_PPP_CLR_LINK_STATS
363 This command takes a two byte link number as an argument and
364 clears the statistics for that link.
365 .It Dv NGM_PPP_GETCLR_LINK_STATS
367 .Dv NGM_PPP_GET_LINK_STATS ,
368 but also atomically clears the statistics as well.
371 This node type also accepts the control messages accepted by the
374 When received, these messages are simply forwarded to
378 This is particularly useful when the individual
379 PPP links are able to generate
380 .Dv NGM_VJC_RECV_ERROR
385 This node shuts down upon receipt of a
387 control message, or when all hooks have been disconnected.
398 .%T "The Point-to-Point Protocol (PPP)"
407 .%T "The PPP Multilink Protocol (MP)"
413 node type was implemented in
416 .An Archie Cobbs Aq archie@FreeBSD.org