|
NAMEng_ppp —
PPP protocol netgraph node type
SYNOPSIS#include <sys/types.h>
#include <netgraph/ng_ppp.h>
DESCRIPTIONTheppp node type performs multiplexing for the PPP
protocol. It handles only packets that contain data, and forwards protocol
negotiation and control packets to a separate controlling entity (e.g., a
user-land daemon). This approach combines the fast dispatch of kernel
implementations with the configuration flexibility of a user-land
implementations. The PPP node type directly supports multi-link PPP, Van
Jacobson compression, PPP compression, PPP encryption, and the IP, IPX, and
AppleTalk protocols. A single PPP node corresponds to one PPP multi-link
bundle.
There is a separate hook for each PPP link in the bundle, plus
several hooks corresponding to the directly supported protocols. For
compression and encryption, separate attached nodes are required to do the
actual work. The node type used will of course depend on the algorithm
negotiated. There is also a ENABLING FUNCTIONALITYIn general, the PPP node enables a specific link or functionality when (a) aNGM_PPP_SET_CONFIG message has been received which
enables it, and (b) the corresponding hook(s) are connected. This allows the
controlling entity to use either method (a) or (b) (or both) to control the
node's behavior. When a link is connected but disabled, traffic can still flow
on the link via the bypass hook (see below).
LINK HOOKSDuring normal operation, the individual PPP links are connected to hookslink0 , link1 , etc. Up to
NG_PPP_MAX_LINKS links are supported. These
device-independent hooks transmit and receive full PPP frames, which include
the PPP protocol, address, control, and information fields, but no checksum or
other link-specific fields.
On outgoing frames, when protocol compression has been enabled and the protocol number is suitable for compression, the protocol field will be compressed (i.e., sent as one byte instead of two). Either compressed or uncompressed protocol fields are accepted on incoming frames. Similarly, if address and control field compression has been enabled for the link, the address and control fields will be omitted (except for LCP frames as required by the standards). Incoming frames have the address and control fields stripped automatically if present. Since all negotiation is handled outside the PPP node, the links
should not be connected and enabled until the corresponding link has reached
the network phase (i.e., LCP negotiation and authentication have completed
successfully) and the PPP node has been informed of the link parameters via
the When a link is connected but disabled, all received frames are
forwarded directly out the COMPRESSION AND ENCRYPTIONCompression is supported via two hooks,compress and
decompress . Compression and decompression can be
enabled by toggling the enableCompression and
enableDecompression fields of the node configuration
structure. (See below.) If enableCompression is set to
NG_PPP_COMPRESS_SIMPLE , then all outgoing frames are
sent to the compress hook and all packets received on
this hook are expected to be compressed, so the COMPD tag is put on them
unconditionally. If enableCompression is set to
NG_PPP_COMPRESS_FULL , then packets received on the
compress hook are resent as is. The compressor node
should put the tag, if the packet was compressed. If
enableDecompression is set to
NG_PPP_DECOMPRESS_SIMPLE , then the node will sent to
the decompress hook only those frames, that are marked
with the COMPD tag. If enableDecompression is set to
NG_PPP_DECOMPRESS_FULL , then the node will sent all
incoming packets to the decompress hook. Compression
and decompression can be completely disabled by setting the
enableCompression and
enableDecompression fields to the
NG_PPP_COMPRESS_NONE and
NG_PPP_DECOMPRESS_NONE , respectively.
Encryption works exactly analogously via the
Only bundle-level compression and encryption is directly supported; link-level compression and encryption can be handled transparently by downstream nodes. VAN JACOBSON COMPRESSIONWhen all of thevjc_ip ,
vjc_vjcomp , vjc_vjuncomp , and
vjc_vjip hooks are connected, and the corresponding
configuration flag is enabled, Van Jacobson compression and/or decompression
will become active. Normally these hooks connect to the corresponding hooks of
a single
ng_vjc(4)
node. The PPP node is compatible with the “pass through” modes
of the
ng_vjc(4)
node type.
BYPASS HOOKWhen a frame is received on a link with an unsupported protocol, or a protocol which is disabled or for which the corresponding hook is unconnected, the PPP node forwards the frame out thebypass hook, prepended
with a four byte prefix. This first two bytes of the prefix indicate the link
number on which the frame was received (in network order). For such frames
received over the bundle (i.e., encapsulated in the multi-link protocol), the
special link number NG_PPP_BUNDLE_LINKNUM is used.
After the two byte link number is the two byte PPP protocol number (also in
network order). The PPP protocol number is two bytes long even if the original
frame was protocol compressed.
Conversely, any data written to the Typically when the controlling entity receives an unexpected
packet on the MULTILINK OPERATIONTo enable multi-link PPP, the corresponding configuration flag must be set and at least one link connected. The PPP node will not allow more than one link to be connected if multi-link is not enabled, nor will it allow certain multi-link settings to be changed while multi-link operation is active (e.g., short sequence number header format).Since packets are sent as fragments across multiple individual
links, it is important that when a link goes down the PPP node is notified
immediately, either by disconnecting the corresponding hook or disabling the
link via the Each link has configuration parameters for latency (specified in milliseconds) and bandwidth (specified in tens of bytes per second). The PPP node can be configured for round-robin or optimized packet delivery. When configured for round-robin delivery, the latency and bandwidth values are ignored and the PPP node simply sends each frame as a single fragment, alternating frames across all the links in the bundle. This scheme has the advantage that even if one link fails silently, some packets will still get through. It has the disadvantage of sub-optimal overall bundle latency, which is important for interactive response time, and sub-optimal overall bundle bandwidth when links with different bandwidths exist in the same bundle. When configured for optimal delivery, the PPP node distributes the packet across the links in a way that minimizes the time it takes for the completed packet to be received by the far end. This involves taking into account each link's latency, bandwidth, and current queue length. Therefore these numbers should be configured as accurately as possible. The algorithm does require some computation, so may not be appropriate for very slow machines and/or very fast links. As a special case, if all links have identical latency and bandwidth, then the above algorithm is disabled (because it is unnecessary) and the PPP node simply fragments frames into equal sized portions across all of the links. HOOKSThis node type supports the following hooks:
CONTROL MESSAGESThis node type supports the generic control messages, plus the following:
This node type also accepts the control messages accepted by the
ng_vjc(4)
node type. When received, these messages are simply forwarded to the
adjacent
ng_vjc(4)
node, if any. This is particularly useful when the individual PPP links are
able to generate SHUTDOWNThis node shuts down upon receipt of aNGM_SHUTDOWN
control message, or when all hooks have been disconnected.
SEE ALSOnetgraph(4), ng_async(4), ng_iface(4), ng_mppc(4), ng_pppoe(4), ng_vjc(4), ngctl(8)W. Simpson, The Point-to-Point Protocol (PPP), RFC 1661. K. Sklower, B. Lloyd, G. McGregor, D. Carr, and T. Coradetti, The PPP Multilink Protocol (MP), RFC 1990. HISTORYTheng_ppp node type was implemented in
FreeBSD 4.0.
AUTHORSArchie Cobbs <archie@FreeBSD.org>
Visit the GSP FreeBSD Man Page Interface. |