xref: /freebsd/share/man/man4/ng_ppp.4 (revision c60bda17f2a9ed4a8c1ef6483ee7b8f207de7129)
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.\"
33eddc45e7SJeroen Ruigrok van der Werven.\" Author: Archie Cobbs <archie@FreeBSD.org>
344cf49a43SJulian Elischer.\"
354cf49a43SJulian Elischer.\" $FreeBSD$
364cf49a43SJulian Elischer.\" $Whistle: ng_ppp.8,v 1.3 1999/01/25 23:46:27 archie Exp $
374cf49a43SJulian Elischer.\"
38*c60bda17SJoel Dahl.Dd November 13, 2012
39bec35b9aSArchie Cobbs.Dt NG_PPP 4
403d45e180SRuslan Ermilov.Os
414cf49a43SJulian Elischer.Sh NAME
424cf49a43SJulian Elischer.Nm ng_ppp
4310c2a9dbSArchie Cobbs.Nd PPP protocol netgraph node type
444cf49a43SJulian Elischer.Sh SYNOPSIS
45fbad9e2dSRuslan Ermilov.In sys/types.h
4632eef9aeSRuslan Ermilov.In netgraph/ng_ppp.h
474cf49a43SJulian Elischer.Sh DESCRIPTION
484cf49a43SJulian ElischerThe
494cf49a43SJulian Elischer.Nm ppp
50b5e7e999SRuslan Ermilovnode type performs multiplexing for the PPP protocol.
51b5e7e999SRuslan ErmilovIt handles only packets that contain data, and forwards protocol negotiation
5210c2a9dbSArchie Cobbsand control packets to a separate controlling entity (e.g., a
53b5e7e999SRuslan Ermilovuser-land daemon).
54b5e7e999SRuslan ErmilovThis approach combines the fast dispatch of
5510c2a9dbSArchie Cobbskernel implementations with the configuration flexibility of a
56b5e7e999SRuslan Ermilovuser-land implementations.
57b5e7e999SRuslan ErmilovThe PPP node type directly supports
589dcab530SArchie Cobbsmulti-link PPP, Van Jacobson compression, PPP compression, PPP
59b5e7e999SRuslan Ermilovencryption, and the IP, IPX, and AppleTalk protocols.
60b5e7e999SRuslan ErmilovA single PPP node corresponds to one PPP multi-link bundle.
61d1f183b5SArchie Cobbs.Pp
62d1f183b5SArchie CobbsThere is a separate hook for each PPP link in the bundle, plus
63d1f183b5SArchie Cobbsseveral hooks corresponding to the directly supported protocols.
64d1f183b5SArchie CobbsFor compression and encryption, separate attached nodes are required
65b5e7e999SRuslan Ermilovto do the actual work.
66b5e7e999SRuslan ErmilovThe node type used will of course depend on the algorithm negotiated.
67b5e7e999SRuslan ErmilovThere is also a
68d1f183b5SArchie Cobbs.Dv bypass
69d1f183b5SArchie Cobbshook which is used to handle any protocol not directly supported
70b5e7e999SRuslan Ermilovby the node.
71b5e7e999SRuslan ErmilovThis includes all of the control protocols: LCP, IPCP,
72b5e7e999SRuslan ErmilovCCP, etc.
73b5e7e999SRuslan ErmilovTypically this node is connected to a user-land daemon via a
74bec35b9aSArchie Cobbs.Xr ng_socket 4
75d1f183b5SArchie Cobbstype node.
7610c2a9dbSArchie Cobbs.Sh ENABLING FUNCTIONALITY
7710c2a9dbSArchie CobbsIn general, the PPP node enables a specific link or functionality when
7810c2a9dbSArchie Cobbs(a) a
7910c2a9dbSArchie Cobbs.Dv NGM_PPP_SET_CONFIG
8010c2a9dbSArchie Cobbsmessage has been received which enables it, and
8110c2a9dbSArchie Cobbs(b) the corresponding hook(s) are connected.
8210c2a9dbSArchie CobbsThis allows the controlling entity to use either method (a) or (b)
8310c2a9dbSArchie Cobbs(or both) to control the node's behavior.
84d1f183b5SArchie CobbsWhen a link is connected but disabled, traffic can still flow on
85d1f183b5SArchie Cobbsthe link via the
86d1f183b5SArchie Cobbs.Dv bypass
87d1f183b5SArchie Cobbshook (see below).
8810c2a9dbSArchie Cobbs.Sh LINK HOOKS
8910c2a9dbSArchie CobbsDuring normal operation, the individual PPP links are connected to hooks
9010c2a9dbSArchie Cobbs.Dv link0 ,
9110c2a9dbSArchie Cobbs.Dv link1 ,
925203edcdSRuslan Ermilovetc.
935203edcdSRuslan ErmilovUp to
9410c2a9dbSArchie Cobbs.Dv NG_PPP_MAX_LINKS
9510c2a9dbSArchie Cobbslinks are supported.
9610c2a9dbSArchie CobbsThese device-independent hooks transmit and receive full PPP
9771cb548dSArchie Cobbsframes, which include the PPP protocol, address, control, and
9871cb548dSArchie Cobbsinformation fields, but no checksum or other link-specific fields.
9971cb548dSArchie Cobbs.Pp
10010c2a9dbSArchie CobbsOn outgoing frames, when protocol compression
10110c2a9dbSArchie Cobbshas been enabled and the protocol number is suitable for compression,
10210c2a9dbSArchie Cobbsthe protocol field will be compressed (i.e., sent as one byte
103b5e7e999SRuslan Ermilovinstead of two).
104b5e7e999SRuslan ErmilovEither compressed or uncompressed protocol fields
105b5e7e999SRuslan Ermilovare accepted on incoming frames.
106b5e7e999SRuslan ErmilovSimilarly, if address and control
10771cb548dSArchie Cobbsfield compression has been enabled for the link, the address and
10871cb548dSArchie Cobbscontrol fields will be omitted (except for LCP frames as required
109b5e7e999SRuslan Ermilovby the standards).
110b5e7e999SRuslan ErmilovIncoming frames have the address and control fields
11171cb548dSArchie Cobbsstripped automatically if present.
1124cf49a43SJulian Elischer.Pp
11310c2a9dbSArchie CobbsSince all negotiation is handled outside the PPP node, the links
11410c2a9dbSArchie Cobbsshould not be connected and enabled until the corresponding link
11510c2a9dbSArchie Cobbshas reached the network phase (i.e., LCP negotiation and authentication
11610c2a9dbSArchie Cobbshave completed successfully) and the PPP node has been informed of
11710c2a9dbSArchie Cobbsthe link parameters via the
11810c2a9dbSArchie Cobbs.Dv NGM_PPP_LINK_CONFIG
11910c2a9dbSArchie Cobbsmessage.
120d1f183b5SArchie Cobbs.Pp
121d1f183b5SArchie CobbsWhen a link is connected but disabled, all received frames are forwarded
122d1f183b5SArchie Cobbsdirectly out the
123d1f183b5SArchie Cobbs.Dv bypass
124d1f183b5SArchie Cobbshook, and conversely, frames may be transmitted via the
125d1f183b5SArchie Cobbs.Dv bypass
126b5e7e999SRuslan Ermilovhook as well.
127b5e7e999SRuslan ErmilovThis mode is appropriate for the link authentication phase.
128d1f183b5SArchie CobbsAs soon as the link is enabled, the PPP node will
129d1f183b5SArchie Cobbsbegin processing frames received on the link.
13010c2a9dbSArchie Cobbs.Sh COMPRESSION AND ENCRYPTION
13110c2a9dbSArchie CobbsCompression is supported via two hooks,
13210c2a9dbSArchie Cobbs.Dv compress
13310c2a9dbSArchie Cobbsand
13410c2a9dbSArchie Cobbs.Dv decompress .
13550928713SGleb SmirnoffCompression and decompression can be enabled by toggling the
13650928713SGleb Smirnoff.Vt enableCompression
13750928713SGleb Smirnoffand
13850928713SGleb Smirnoff.Vt enableDecompression
13950928713SGleb Smirnofffields of the node configuration structure.
14050928713SGleb Smirnoff(See below.)
14150928713SGleb SmirnoffIf
14250928713SGleb Smirnoff.Vt enableCompression
14350928713SGleb Smirnoffis set to
14450928713SGleb Smirnoff.Dv NG_PPP_COMPRESS_SIMPLE ,
14550928713SGleb Smirnoffthen all outgoing frames are sent to the
14650928713SGleb Smirnoff.Dv compress
14750928713SGleb Smirnoffhook and all packets received on this hook are expected to be
14850928713SGleb Smirnoffcompressed, so the COMPD tag is put on them unconditionally.
14950928713SGleb SmirnoffIf
15050928713SGleb Smirnoff.Vt enableCompression
15150928713SGleb Smirnoffis set to
15250928713SGleb Smirnoff.Dv NG_PPP_COMPRESS_FULL ,
15350928713SGleb Smirnoffthen packets received on the
15450928713SGleb Smirnoff.Dv compress
15550928713SGleb Smirnoffhook are resent as is.
15650928713SGleb SmirnoffThe compressor node should put the tag, if the packet was compressed.
15750928713SGleb SmirnoffIf
15850928713SGleb Smirnoff.Vt enableDecompression
15950928713SGleb Smirnoffis set to
16050928713SGleb Smirnoff.Dv NG_PPP_DECOMPRESS_SIMPLE ,
16150928713SGleb Smirnoffthen the node will sent to the
16210c2a9dbSArchie Cobbs.Dv decompress
16350928713SGleb Smirnoffhook only those frames, that are marked with the COMPD tag.
16450928713SGleb SmirnoffIf
16550928713SGleb Smirnoff.Vt enableDecompression
16650928713SGleb Smirnoffis set to
16750928713SGleb Smirnoff.Dv NG_PPP_DECOMPRESS_FULL ,
16850928713SGleb Smirnoffthen the node will sent all incoming packets to the
16950928713SGleb Smirnoff.Dv decompress
17050928713SGleb Smirnoffhook.
17150928713SGleb SmirnoffCompression and decompression can be completely disabled by setting the
17250928713SGleb Smirnoff.Vt enableCompression
17350928713SGleb Smirnoffand
17450928713SGleb Smirnoff.Vt enableDecompression
17550928713SGleb Smirnofffields to the
17650928713SGleb Smirnoff.Dv NG_PPP_COMPRESS_NONE
17750928713SGleb Smirnoffand
17850928713SGleb Smirnoff.Dv NG_PPP_DECOMPRESS_NONE ,
17950928713SGleb Smirnoffrespectively.
18010c2a9dbSArchie Cobbs.Pp
18110c2a9dbSArchie CobbsEncryption works exactly analogously via the
18210c2a9dbSArchie Cobbs.Dv encrypt
18310c2a9dbSArchie Cobbsand
18410c2a9dbSArchie Cobbs.Dv decrypt
185b5e7e999SRuslan Ermilovnodes.
186b5e7e999SRuslan ErmilovData is always compressed before being encrypted,
18710c2a9dbSArchie Cobbsand decrypted before being decompressed.
18810c2a9dbSArchie Cobbs.Pp
18910c2a9dbSArchie CobbsOnly bundle-level compression and encryption is directly supported;
19010c2a9dbSArchie Cobbslink-level compression and encryption can be handled transparently
19110c2a9dbSArchie Cobbsby downstream nodes.
192dd1e305cSArchie Cobbs.Sh VAN JACOBSON COMPRESSION
19310c2a9dbSArchie CobbsWhen all of the
19410c2a9dbSArchie Cobbs.Dv vjc_ip ,
19510c2a9dbSArchie Cobbs.Dv vjc_vjcomp ,
19610c2a9dbSArchie Cobbs.Dv vjc_vjuncomp ,
19710c2a9dbSArchie Cobbsand
19810c2a9dbSArchie Cobbs.Dv vjc_vjip
19910c2a9dbSArchie Cobbshooks are connected, and the corresponding configuration flag is
2009dcab530SArchie Cobbsenabled, Van Jacobson compression and/or decompression will become active.
20110c2a9dbSArchie CobbsNormally these hooks connect to the corresponding hooks of a single
202bec35b9aSArchie Cobbs.Xr ng_vjc 4
2035203edcdSRuslan Ermilovnode.
2045203edcdSRuslan ErmilovThe PPP node is compatible with the
20551291597SJulian Elischer.Dq pass through
20651291597SJulian Elischermodes of the
207bec35b9aSArchie Cobbs.Xr ng_vjc 4
20810c2a9dbSArchie Cobbsnode type.
20910c2a9dbSArchie Cobbs.Sh BYPASS HOOK
21010c2a9dbSArchie CobbsWhen a frame is received on a link with an unsupported protocol,
21110c2a9dbSArchie Cobbsor a protocol which is disabled or for which the corresponding hook
21210c2a9dbSArchie Cobbsis unconnected, the PPP node forwards the frame out the
2134cf49a43SJulian Elischer.Dv bypass
214b5e7e999SRuslan Ermilovhook, prepended with a four byte prefix.
215b5e7e999SRuslan ErmilovThis first two bytes of
21610c2a9dbSArchie Cobbsthe prefix indicate the link number on which the frame was received
21710c2a9dbSArchie Cobbs(in network order).
21810c2a9dbSArchie CobbsFor such frames received over the bundle (i.e., encapsulated in the
21910c2a9dbSArchie Cobbsmulti-link protocol), the special link number
22010c2a9dbSArchie Cobbs.Dv NG_PPP_BUNDLE_LINKNUM
2215203edcdSRuslan Ermilovis used.
2225203edcdSRuslan ErmilovAfter the two byte link number is the two byte PPP protocol number
22310c2a9dbSArchie Cobbs(also in network order).
22410c2a9dbSArchie CobbsThe PPP protocol number is two bytes long even if the original frame
22510c2a9dbSArchie Cobbswas protocol compressed.
2264cf49a43SJulian Elischer.Pp
22710c2a9dbSArchie CobbsConversely, any data written to the
2284cf49a43SJulian Elischer.Dv bypass
229b5e7e999SRuslan Ermilovhook is assumed to be in this same format.
230b5e7e999SRuslan ErmilovThe four byte header is
23110c2a9dbSArchie Cobbsstripped off, the PPP protocol number is prepended (possibly compressed),
23210c2a9dbSArchie Cobbsand the frame is delivered over the desired link.
23310c2a9dbSArchie CobbsIf the link number is
23410c2a9dbSArchie Cobbs.Dv NG_PPP_BUNDLE_LINKNUM
23510c2a9dbSArchie Cobbsthe frame will be delivered over the multi-link bundle; or, if multi-link
23610c2a9dbSArchie Cobbsis disabled, over the (single) PPP link.
23710c2a9dbSArchie Cobbs.Pp
238a3fef8dfSArchie CobbsTypically when the controlling entity receives an unexpected packet on the
239a3fef8dfSArchie Cobbs.Dv bypass
24036a142c4SRuslan Ermilovhook it responds either by dropping the frame (if it is not ready for
2410227791bSRuslan Ermilovthe protocol) or with an LCP protocol reject (if it does not recognize
24210c2a9dbSArchie Cobbsor expect the protocol).
24310c2a9dbSArchie Cobbs.Sh MULTILINK OPERATION
24410c2a9dbSArchie CobbsTo enable multi-link PPP, the corresponding configuration flag must be set
245b5e7e999SRuslan Ermilovand at least one link connected.
246b5e7e999SRuslan ErmilovThe PPP node will not allow more than
24710c2a9dbSArchie Cobbsone link to be connected if multi-link is not enabled, nor will it allow
24810c2a9dbSArchie Cobbscertain multi-link settings to be changed while multi-link operation is
24910c2a9dbSArchie Cobbsactive (e.g., short sequence number header format).
25010c2a9dbSArchie Cobbs.Pp
251b5e7e999SRuslan ErmilovSince packets are sent as fragments across multiple individual links,
25210c2a9dbSArchie Cobbsit is important that when a link goes down the PPP node is notified
25310c2a9dbSArchie Cobbsimmediately, either by disconnecting the corresponding hook or disabling
25410c2a9dbSArchie Cobbsthe link via the
25510c2a9dbSArchie Cobbs.Dv NGM_PPP_SET_CONFIG
25610c2a9dbSArchie Cobbscontrol message.
25710c2a9dbSArchie Cobbs.Pp
25810c2a9dbSArchie CobbsEach link has configuration parameters for latency (specified in
2597f9d26bdSMike Pritchardmilliseconds) and bandwidth (specified in tens of bytes per second).
26010c2a9dbSArchie CobbsThe PPP node can be configured for
26110c2a9dbSArchie Cobbs.Em round-robin
26210c2a9dbSArchie Cobbsor
26310c2a9dbSArchie Cobbs.Em optimized
26410c2a9dbSArchie Cobbspacket delivery.
26510c2a9dbSArchie Cobbs.Pp
26610c2a9dbSArchie CobbsWhen configured for round-robin delivery, the latency and bandwidth
26710c2a9dbSArchie Cobbsvalues are ignored and the PPP node simply sends each frame as a
26810c2a9dbSArchie Cobbssingle fragment, alternating frames across all the links in the
269b5e7e999SRuslan Ermilovbundle.
270b5e7e999SRuslan ErmilovThis scheme has the advantage that even if one link fails
271b5e7e999SRuslan Ermilovsilently, some packets will still get through.
272b5e7e999SRuslan ErmilovIt has the disadvantage
27310c2a9dbSArchie Cobbsof sub-optimal overall bundle latency, which is important for
27410c2a9dbSArchie Cobbsinteractive response time, and sub-optimal overall bundle bandwidth
27510c2a9dbSArchie Cobbswhen links with different bandwidths exist in the same bundle.
27610c2a9dbSArchie Cobbs.Pp
27710c2a9dbSArchie CobbsWhen configured for optimal delivery, the PPP node distributes the
27810c2a9dbSArchie Cobbspacket across the links in a way that minimizes the time it takes
279b5e7e999SRuslan Ermilovfor the completed packet to be received by the far end.
280b5e7e999SRuslan ErmilovThis involves taking into account each link's latency, bandwidth, and
281b5e7e999SRuslan Ermilovcurrent queue length.
282b5e7e999SRuslan ErmilovTherefore these numbers should be configured as accurately as possible.
283b5e7e999SRuslan ErmilovThe algorithm does require
28410c2a9dbSArchie Cobbssome computation, so may not be appropriate for very slow machines
28510c2a9dbSArchie Cobbsand/or very fast links.
28610c2a9dbSArchie Cobbs.Pp
28710c2a9dbSArchie CobbsAs a special case, if all links have identical latency and bandwidth,
28810c2a9dbSArchie Cobbsthen the above algorithm is disabled (because it is unnecessary)
28910c2a9dbSArchie Cobbsand the PPP node simply fragments frames into equal sized portions
29010c2a9dbSArchie Cobbsacross all of the links.
2914cf49a43SJulian Elischer.Sh HOOKS
2924cf49a43SJulian ElischerThis node type supports the following hooks:
293*c60bda17SJoel Dahl.Bl -tag -width ".Va vjc_vjuncomp"
294*c60bda17SJoel Dahl.It Va link<N>
29510c2a9dbSArchie CobbsIndividual PPP link number
29610c2a9dbSArchie Cobbs.Dv <N>
297*c60bda17SJoel Dahl.It Va compress
29810c2a9dbSArchie CobbsConnection to compression engine
299*c60bda17SJoel Dahl.It Va decompress
30010c2a9dbSArchie CobbsConnection to decompression engine
301*c60bda17SJoel Dahl.It Va encrypt
30210c2a9dbSArchie CobbsConnection to encryption engine
303*c60bda17SJoel Dahl.It Va decrypt
30410c2a9dbSArchie CobbsConnection to decryption engine
305*c60bda17SJoel Dahl.It Va vjc_ip
30610c2a9dbSArchie CobbsConnection to
307bec35b9aSArchie Cobbs.Xr ng_vjc 4
30810c2a9dbSArchie Cobbs.Dv ip
30910c2a9dbSArchie Cobbshook
310*c60bda17SJoel Dahl.It Va vjc_vjcomp
31110c2a9dbSArchie CobbsConnection to
312bec35b9aSArchie Cobbs.Xr ng_vjc 4
31310c2a9dbSArchie Cobbs.Dv vjcomp
31410c2a9dbSArchie Cobbshook
315*c60bda17SJoel Dahl.It Va vjc_vjuncomp
31610c2a9dbSArchie CobbsConnection to
317bec35b9aSArchie Cobbs.Xr ng_vjc 4
31810c2a9dbSArchie Cobbs.Dv vjuncomp
31910c2a9dbSArchie Cobbshook
320*c60bda17SJoel Dahl.It Va vjc_vjip
32110c2a9dbSArchie CobbsConnection to
322bec35b9aSArchie Cobbs.Xr ng_vjc 4
32310c2a9dbSArchie Cobbs.Dv vjip
32410c2a9dbSArchie Cobbshook
325*c60bda17SJoel Dahl.It Va inet
32610c2a9dbSArchie CobbsIP packet data
327*c60bda17SJoel Dahl.It Va ipv6
3289e2e2b9cSAlexander MotinIPv6 packet data
329*c60bda17SJoel Dahl.It Va atalk
33010c2a9dbSArchie CobbsAppleTalk packet data
331*c60bda17SJoel Dahl.It Va ipx
33210c2a9dbSArchie CobbsIPX packet data
333*c60bda17SJoel Dahl.It Va bypass
33410c2a9dbSArchie CobbsBypass hook; frames have a four byte header consisting of
33510c2a9dbSArchie Cobbsa link number and a PPP protocol number.
3364cf49a43SJulian Elischer.El
3374cf49a43SJulian Elischer.Sh CONTROL MESSAGES
3384cf49a43SJulian ElischerThis node type supports the generic control messages, plus the following:
3394cf49a43SJulian Elischer.Bl -tag -width foo
340*c60bda17SJoel Dahl.It Dv NGM_PPP_SET_CONFIG Pq Ic setconfig
341b5e7e999SRuslan ErmilovThis command configures all aspects of the node.
342b5e7e999SRuslan ErmilovThis includes enabling
3439dcab530SArchie Cobbsmulti-link PPP, encryption, compression, Van Jacobson compression, and IP,
3444e0768b6SBjoern A. ZeebIPv6, AppleTalk, and IPX packet delivery.
345b5e7e999SRuslan ErmilovIt includes per-link configuration,
34610c2a9dbSArchie Cobbsincluding enabling the link, setting latency and bandwidth parameters,
347b5e7e999SRuslan Ermilovand enabling protocol field compression.
348b5e7e999SRuslan ErmilovNote that no link or functionality
34910c2a9dbSArchie Cobbsis active until the corresponding hook is also connected.
35010c2a9dbSArchie CobbsThis command takes a
3514e0768b6SBjoern A. Zeeb.Dv "struct ng_ppp_node_conf"
35271cb548dSArchie Cobbsas an argument:
3533f610476SRuslan Ermilov.Bd -literal -offset 0n
35471cb548dSArchie Cobbs/* Per-link config structure */
3554e0768b6SBjoern A. Zeebstruct ng_ppp_link_conf {
35671cb548dSArchie Cobbs  u_char    enableLink;     /* enable this link */
35771cb548dSArchie Cobbs  u_char    enableProtoComp;/* enable protocol field compression */
35871cb548dSArchie Cobbs  u_char    enableACFComp;  /* enable addr/ctrl field compression */
3596b99842aSEd Schouten  uint16_t  mru;            /* peer MRU */
3606b99842aSEd Schouten  uint32_t  latency;        /* link latency (in milliseconds) */
361*c60bda17SJoel Dahl  uint32_t  bandwidth;      /* link bandwidth (in bytes/sec/10) */
36271cb548dSArchie Cobbs};
36371cb548dSArchie Cobbs
3644e0768b6SBjoern A. Zeeb/* Bundle config structure */
3654e0768b6SBjoern A. Zeebstruct ng_ppp_bund_conf {
3666b99842aSEd Schouten  uint16_t  mrru;                   /* multilink peer MRRU */
36771cb548dSArchie Cobbs  u_char    enableMultilink;        /* enable multilink */
36871cb548dSArchie Cobbs  u_char    recvShortSeq;           /* recv multilink short seq # */
36971cb548dSArchie Cobbs  u_char    xmitShortSeq;           /* xmit multilink short seq # */
37071cb548dSArchie Cobbs  u_char    enableRoundRobin;       /* xmit whole packets */
37171cb548dSArchie Cobbs  u_char    enableIP;               /* enable IP data flow */
3724e0768b6SBjoern A. Zeeb  u_char    enableIPv6;             /* enable IPv6 data flow */
37371cb548dSArchie Cobbs  u_char    enableAtalk;            /* enable AppleTalk data flow */
37471cb548dSArchie Cobbs  u_char    enableIPX;              /* enable IPX data flow */
37571cb548dSArchie Cobbs  u_char    enableCompression;      /* enable PPP compression */
37671cb548dSArchie Cobbs  u_char    enableDecompression;    /* enable PPP decompression */
37771cb548dSArchie Cobbs  u_char    enableEncryption;       /* enable PPP encryption */
37871cb548dSArchie Cobbs  u_char    enableDecryption;       /* enable PPP decryption */
37971cb548dSArchie Cobbs  u_char    enableVJCompression;    /* enable VJ compression */
38071cb548dSArchie Cobbs  u_char    enableVJDecompression;  /* enable VJ decompression */
3814e0768b6SBjoern A. Zeeb};
3824e0768b6SBjoern A. Zeeb
3834e0768b6SBjoern A. Zeebstruct ng_ppp_node_conf {
3844e0768b6SBjoern A. Zeeb  struct ng_ppp_bund_conf   bund;
3854e0768b6SBjoern A. Zeeb  struct ng_ppp_link_conf   links[NG_PPP_MAX_LINKS];
38671cb548dSArchie Cobbs};
38771cb548dSArchie Cobbs.Ed
38871cb548dSArchie Cobbs.Pp
389*c60bda17SJoel Dahl.It Dv NGM_PPP_GET_CONFIG Pq Ic getconfig
39010c2a9dbSArchie CobbsReturns the current configuration as a
3914e0768b6SBjoern A. Zeeb.Dv "struct ng_ppp_node_conf" .
392*c60bda17SJoel Dahl.It Dv NGM_PPP_GET_LINK_STATS Pq Ic getstats
39310c2a9dbSArchie CobbsThis command takes a two byte link number as an argument and returns a
39410c2a9dbSArchie Cobbs.Dv "struct ng_ppp_link_stat"
3955203edcdSRuslan Ermilovcontaining statistics for the corresponding link.
3965203edcdSRuslan ErmilovHere
39710c2a9dbSArchie Cobbs.Dv NG_PPP_BUNDLE_LINKNUM
39810c2a9dbSArchie Cobbsis a valid link number corresponding to the multi-link bundle.
399*c60bda17SJoel Dahl.It Dv NGM_PPP_GET_LINK_STATS64 Pq Ic getstats64
400d6fe462aSAlexander MotinSame as NGM_PPP_GET_LINK_STATS but returns
401d6fe462aSAlexander Motin.Dv "struct ng_ppp_link_stat64"
402d6fe462aSAlexander Motincontaining 64bit counters.
403*c60bda17SJoel Dahl.It Dv NGM_PPP_CLR_LINK_STATS Pq Ic clrstats
40410c2a9dbSArchie CobbsThis command takes a two byte link number as an argument and
405d1f183b5SArchie Cobbsclears the statistics for that link.
406*c60bda17SJoel Dahl.It Dv NGM_PPP_GETCLR_LINK_STATS Pq Ic getclrstats
407d1f183b5SArchie CobbsSame as
408d1f183b5SArchie Cobbs.Dv NGM_PPP_GET_LINK_STATS ,
409d1f183b5SArchie Cobbsbut also atomically clears the statistics as well.
410*c60bda17SJoel Dahl.It Dv NGM_PPP_GETCLR_LINK_STATS64 Pq Ic getclrstats64
411d6fe462aSAlexander MotinSame as NGM_PPP_GETCLR_LINK_STATS but returns
412d6fe462aSAlexander Motin.Dv "struct ng_ppp_link_stat64"
413d6fe462aSAlexander Motincontaining 64bit counters.
41410c2a9dbSArchie Cobbs.El
41510c2a9dbSArchie Cobbs.Pp
41610c2a9dbSArchie CobbsThis node type also accepts the control messages accepted by the
417bec35b9aSArchie Cobbs.Xr ng_vjc 4
4185203edcdSRuslan Ermilovnode type.
4195203edcdSRuslan ErmilovWhen received, these messages are simply forwarded to
42010c2a9dbSArchie Cobbsthe adjacent
421bec35b9aSArchie Cobbs.Xr ng_vjc 4
4225203edcdSRuslan Ermilovnode, if any.
4235203edcdSRuslan ErmilovThis is particularly useful when the individual
42471cb548dSArchie CobbsPPP links are able to generate
42571cb548dSArchie Cobbs.Dv NGM_VJC_RECV_ERROR
42671cb548dSArchie Cobbsmessages (see
427bec35b9aSArchie Cobbs.Xr ng_vjc 4
42871cb548dSArchie Cobbsfor a description).
4294cf49a43SJulian Elischer.Sh SHUTDOWN
4304cf49a43SJulian ElischerThis node shuts down upon receipt of a
4314cf49a43SJulian Elischer.Dv NGM_SHUTDOWN
4324cf49a43SJulian Elischercontrol message, or when all hooks have been disconnected.
4334cf49a43SJulian Elischer.Sh SEE ALSO
4344cf49a43SJulian Elischer.Xr netgraph 4 ,
435bec35b9aSArchie Cobbs.Xr ng_async 4 ,
436bec35b9aSArchie Cobbs.Xr ng_iface 4 ,
437bec35b9aSArchie Cobbs.Xr ng_mppc 4 ,
438bec35b9aSArchie Cobbs.Xr ng_pppoe 4 ,
439bec35b9aSArchie Cobbs.Xr ng_vjc 4 ,
440bec35b9aSArchie Cobbs.Xr ngctl 8
4414cf49a43SJulian Elischer.Rs
4424cf49a43SJulian Elischer.%A W. Simpson
4434cf49a43SJulian Elischer.%T "The Point-to-Point Protocol (PPP)"
4444cf49a43SJulian Elischer.%O RFC 1661
4454cf49a43SJulian Elischer.Re
44610c2a9dbSArchie Cobbs.Rs
44710c2a9dbSArchie Cobbs.%A K. Sklower
44810c2a9dbSArchie Cobbs.%A B. Lloyd
44910c2a9dbSArchie Cobbs.%A G. McGregor
45010c2a9dbSArchie Cobbs.%A D. Carr
45110c2a9dbSArchie Cobbs.%A T. Coradetti
45210c2a9dbSArchie Cobbs.%T "The PPP Multilink Protocol (MP)"
45310c2a9dbSArchie Cobbs.%O RFC 1990
45410c2a9dbSArchie Cobbs.Re
45551291597SJulian Elischer.Sh HISTORY
45651291597SJulian ElischerThe
45751291597SJulian Elischer.Nm
45851291597SJulian Elischernode type was implemented in
45951291597SJulian Elischer.Fx 4.0 .
46051291597SJulian Elischer.Sh AUTHORS
461eddc45e7SJeroen Ruigrok van der Werven.An Archie Cobbs Aq archie@FreeBSD.org
462