1.\" $OpenBSD: sppp.4,v 1.9 2003/05/05 13:51:58 jmc Exp $
2.\"
3.\" Copyright (c) 1997 Joerg Wunsch
4.\"
5.\" All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26.\"
27.\"
28.Dd May 19, 1997
29.Dt SPPP 4
30.Os
31.Sh NAME
32.Nm sppp
33.Nd point to point protocol network layer for synchronous lines
34.Sh SYNOPSIS
35.Cd "pseudo-device sppp" Op Ar count
36.Sh DESCRIPTION
37The
38.Nm
39network layer implements the state machine and the Link Control
40Protocol (LCP) of the
41.Em point to point protocol (PPP)
42as described in RFC 1661.
43Note that this layer does not provide network interfaces of its own, it is
44rather intended to be layered on
45top of drivers providing a synchronous point-to-point connection that
46wish to run a PPP stack over it.
47The corresponding network interfaces have to be provided by these hardware
48drivers.
49.Pp
50The
51.Nm
52layer provides three basic modes of operation.
53The default mode, with no special flags to be set, is to create the
54PPP connection (administrative
55.Em Open
56event to the LCP layer) as soon as the interface is taken up with the
57.Xr ifconfig 8
58command.
59Taking the interface down again will terminate the LCP layer
60and thus all other layers on top.
61The link will also terminate itself as soon as no Network Control Protocol
62(NCP) is open anymore, indicating that the lower layers are no longer needed.
63.Pp
64Setting the link-level flag
65.Em link0
66with
67.Xr ifconfig 8
68will cause the respective network interface to go into
69.Em passive
70mode.
71This means the administrative
72.Em Open
73event to the LCP layer will be delayed until after the lower layers
74signals an
75.Em Up
76event (rise of
77.Dq carrier ) .
78This can be used by lower layers to support
79a dial-in connection where the physical layer isn't available
80immediately at startup, but only after some external event arrives.
81Receipt of a
82.Em Down
83event from the lower layer will not take the interface completely down
84in this case.
85.Pp
86Finally, setting the flag
87.Em link1
88will cause the interface to operate in
89.Em dial-on-demand
90mode.
91This is also only useful if the lower layer supports the notion
92of a carrier (like with an ISDN line).
93Upon configuring the respective interface, it will delay the administrative
94.Em Open
95event to the LCP layer until either an outbound network packet
96arrives, or until the lower layer signals an
97.Em Up
98event, indicating an inbound connection.
99As with passive mode, receipt of a
100.Em Down
101event (loss of carrier) will not automatically take the interface down,
102thus it remains available for further connections.
103.Pp
104The
105.Nm
106layer supports the
107.Em debug
108interface flag that can be set with
109.Xr ifconfig 8 .
110If this flag is set, the various control protocol packets being
111exchanged as well as the option negotiation between both ends of the
112link will be logged at level
113.Dv LOG_DEBUG .
114This can be helpful to examine configuration problems during the first
115attempts to set up a new configuration.
116Without this flag being set, only the major phase transitions will be
117logged at level
118.Dv LOG_INFO .
119.Pp
120It is possible to leave the local interface IP address open for
121negotiation by setting it to 0.0.0.0.
122This requires that the remote peer can correctly supply a value for it
123based on the identity of the caller, or on the remote address supplied
124by this side.
125Due to the way the IPCP option negotiation works, this address is being
126supplied late during the negotiation, which might cause the remote peer
127to make wrong assumptions.
128.Pp
129In a similar spirit the remote address can be set to the magical
130value 0.0.0.1 which means that we don't care what address the remote
131side will use, as long as it is not 0.0.0.0.
132This is useful if your ISP has several dial-in servers.
133You can of course
134.Ic route add something or other 0.0.0.1
135and it will do exactly what you would want it to.
136.Pp
137The PAP and CHAP authentication protocols as described in RFC 1334,
138and RFC 1994 resp., are also implemented.
139Their parameters are being controlled by the
140.Xr spppcontrol 8
141utility.
142.Sh DIAGNOSTICS
143.Bl -diag
144.It <ifname><ifnum>: <proto> illegal <event> in state <statename>
145An event happened that should not happen for the current state
146the respective control protocol is in.
147See RFC 1661 for a description of the state automaton.
148.It <ifname><ifnum>: loopback
149The state automaton detected a line loopback (that is, it was talking
150with itself).
151The interface will be temporarily disabled.
152.It <ifname><ifnum>: up
153The LCP layer is running again, after a line loopback had previously
154been detected.
155.It <ifname><ifnum>: down
156The keepalive facility detected the line being unresponsive.
157Keepalive must be explicitly requested by the lower layers in order to
158take place.
159.El
160.Sh SEE ALSO
161.Xr inet 4 ,
162.Xr ifconfig 8 ,
163.Xr ppp 8 ,
164.Xr spppcontrol 8
165.Rs
166.%A W. Simpson, Editor
167.%T "The Point-to-Point Protocol (PPP)"
168.%O RFC 1661
169.Re
170.Rs
171.%A G. McGregor
172.%T "The PPP Internet Protocol Control Protocol (IPCP)"
173.%O RFC 1332
174.Re
175.Rs
176.%A B. Lloyd, W. Simpson
177.%T "PPP Authentication Protocols"
178.%O RFC 1334
179.Re
180.Rs
181.%A W. Simpson
182.%T "PPP Challenge Handshake Authentication Protocol (CHAP)"
183.%O RFC 1994
184.Re
185.Sh AUTHORS
186The original implementation of
187.Nm
188was written in 1994 at Cronyx Ltd., Moscow by
189.An Serge Vakulenko Aq vak@cronyx.ru .
190.ie t J\(:org Wunsch
191.el Joerg Wunsch
192.Aq joerg_wunsch@uriah.heep.sax.de
193rewrote a large part in 1997 in order
194to fully implement the state machine as described in RFC 1661, so it
195could also be used for dialup lines.
196He also wrote this man page.
197Serge later on wrote a basic implementation for PAP and CHAP, which
198served as the base for the current implementation, done again by
199.ie t J\(:org Wunsch.
200.el Joerg Wunsch.
201.Sh BUGS
202Many.
203.Pp
204Currently, only the
205.Em IPCP
206control protocol and
207.Xr ip 4
208network protocol are supported.
209.Pp
210Negotiation loop avoidance is not fully implemented.
211If the negotiation doesn't converge, this can cause an endless loop.
212.Pp
213The various parameters that should be adjustable per RFC 1661 are
214currently hard-coded into the kernel, and should be made accessible
215through
216.Xr spppcontrol 8 .
217.Pp
218.Em Passive
219mode has not been tested extensively.
220.Pp
221More NCPs should be implemented, as well as other control protocols
222for authentication and link quality reporting.
223.Pp
224IPCP should support VJ header compression.
225.Pp
226Link-level compression protocols should be supported.
227