PPP(4) BSD Programmer's Manual PPP(4)
NAME
ppp - Point-to-Point Protocol (PPP)
SYNOPSIS
#include <sys/types.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <net/pppioctl.h>
options PPP
DESCRIPTION
The Point-to-Point Protocol (PPP) provides a method for transmitting
datagrams over serial point-to-point links. The current implementation
supports dedicated synchronous and asynchronous circuits as well as dial-
up telephone links.
The kernel configuration option PPP should be defined to include the rel-
evant code in the kernel.
PROTOCOL OPTIONS
There are a number of configurable PPP options which may be set or exam-
ined with interface request ioctl(2) calls. Before loading or examina-
tion of the options the ifreq structure should be initialized as:
struct ifreq ifr;
struct ppp_ioctl *pio = ifr_pppioctl(&ifr);
...
strncpy(ifr.ifr_name, interface_name, sizeof ifr.ifr_name);
ioctl(socket, PPPIOCGPAR, &ifr);
The ppp_ioctl structure is defined as:
struct ppp_ioctl {
u_long ppp_cmap;
u_short ppp_mru;
u_short ppp_idletime;
u_char ppp_flags;
u_char ppp_maxconf;
u_char ppp_maxterm;
u_char ppp_timeout;
};
The fields represent the following:
ppp_cmap A map of the control characters which should be avoided on
asynchronous lines in case the equipment uses some of them
for flow control or link control or inserts characters for
time fill. The least significant bit corresponds to the
null character and the most significant bit to the charac-
ter with code 037 (US). The default all-zero mask will al-
low transmission of all control characters.
ppp_mru The maximal packet size the local side is willing to re-
ceive. This option can be useful on packet-switching links
to prevent link-level packet fragmentation or in case of
problems with hardware flow control. The default value for
ppp_mru is 1500 (bytes).
ppp_idletime The time after which the idle timer drops the connection if
no outgoing data packets were processed. A zero value dis-
ables the idle timer.
ppp_flags Protocol options flags; see description below.
ppp_maxconf The limit on attempts to negotiate PPP control protocol op-
tions. After the specified number of unsuccessful attempts
the connection will be dropped. A zero value allows unlim-
ited attempts to negotiate. This option is useful on dial-
up links to cause the connection to drop in the event of
malfunction on the remote side. The default value on asyn-
chronous lines is 10 and 0 on synchronous lines.
ppp_maxterm The limit on attempts to terminate the link gracefully; the
default is 3 attempts before unilaterally dropping the con-
nection.
ppp_timeout The interval between attempts to configure/terminate a con-
nection, in tenths of a second. The default value is 30 (3
seconds).
The following protocol option flags are supported:
PPP_PFC Protocol field compression. This option eliminates an extra
byte in the PPP packet header which can be useful on slow
links but can cause computing overhead on fast synchronous
links.
PPP_ACFC Address and control fields compression. This option reduces
the size of the PPP packet header by two bytes, which can be
useful on slow links but can cause computing overhead on fast
synchronous links.
PPP_TCPC Van Jacobson's TCP header compression. This option enables
the compression of TCP headers by eliminating the redundant
information in the headers of consecutive TCP packets, reduc-
ing the protocol overhead by up to 100 bytes per packet which
may be really critical for performance of interactive tel-
net(1) or rlogin(1) sessions. However, VJ TCP compression re-
quires keeping state information about every TCP session on
both ends (up to 16 simultaneous sessions) and is not really
useful on fast links connecting large networks. The TCP com-
pression does not affect UDP and ICMP packets.
PPP_FTEL Priority queuing. This flag enables high-priority queueing of
``interactive'' TCP packets (with source or destination ports
assigned to services like telnet or the control connection of
ftp(1)), effectively giving them precedence over all other IP
packets. This can reduce response time on links with mixed
file transfer and interactive traffic.
PPP_TRACE State tracing. This flag enables printing of trace informa-
tion for PPP control packets and protocol finite state machine
transitions. This option is effective only if the kernel is
configured to include the PPP trace printing code (i.e. the
option PPP_DEBUG is included in the kernel configuration
file). The default value for this option is defined by the
value of PPP_DEBUG: a zero value disables tracing by default,
a one value enables it.
The default flags on asynchronous links are PPP_PFC, PPP_ACFC, PPP_TCPC
and PPP_FTEL; on synchronous links, the default is PPP_FTEL. The default
value for PPP_TRACE can be configured (usually PPP tracing is not avail-
able or off by default).
The PPP protocol parameters can be divided into three groups: initial pa-
rameters which are used before negotiation with the remote side,
negotiated parameters which both sides agreed on (if the link is not ac-
tive, these parameters are the same as initial), and non-negotiable pa-
rameters which cannot be changed during the negotiation phase of a PPP
connection. The negotiated parameters cannot be changed directly; the
only way to affect them is to load the initial parameters and configure
the link down and up forcing re-negotiation. The non-negotiable parame-
ters may be changed at any time and the change takes effect immediately.
The following parameters and flags are non-negotiable: ppp_idletime,
ppp_maxconf, ppp_maxterm, ppp_timeout, PPP_FTEL, PPP_TRACE.
PROTOCOL CONTROL OPERATIONS
The following ioctl(2) requests are supported:
PPPIOCGPAR Get the initial protocol parameters.
PPPIOCSPAR Load the initial protocol parameters.
PPPIOCNPAR Get the negotiated protocol parameters.
PPPIOCWAIT Wait on the interface until an outgoing data packet will be
deferred or dropped because the link-level protocol and/or
physical link are not active. This operation is useful for
servicing dial-on-demand PPP links. Packets dropped because
the interface is administratively down (i.e. the interface
flag IFF_UP is not asserted) will not interrupt the waiting.
Since synchronous interfaces support more than one link-level protocol,
PPP must be selected before the above ioctl requests can be used.
Switching the interface link-level protocol loads the default parameters.
Currently, to select PPP on synchronous interfaces the interface flag
IFF_LINK0 must be asserted (see ifconfig(8)).
SEE ALSO
ioctl(2), socket(2), intro(4), appp(4), ifconfig(8), pppconfig(8),
pppattach(8), ppp(8)
W. Simpson, The Point-to-Point Protocol (PPP) for the Transmission of
Multi-protocol Datagrams over Point-to-Point Links, RFC 1331, May 1992.
G. McGregor, The PPP Internet Protocol Control Protocol (IPCP), RFC 1332,
May 1992.
BUGS
Currently only the IP transport level is supported; future releases may
be extended to include OSI and Xerox NS.
BSD/386 March 27, 1993 3