]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/ng_pptpgre.4
MFC r340135: Make ng_pptpgre(8) netgraph node be able to restore order
[FreeBSD/FreeBSD.git] / share / man / man4 / ng_pptpgre.4
1 .\" Copyright (c) 1996-1999 Whistle Communications, Inc.
2 .\" All rights reserved.
3 .\"
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.
14 .\"
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
31 .\" OF SUCH DAMAGE.
32 .\"
33 .\" Author: Archie Cobbs <archie@FreeBSD.org>
34 .\"
35 .\" $FreeBSD$
36 .\" $Whistle: ng_pptpgre.8,v 1.2 1999/12/08 00:20:53 archie Exp $
37 .\"
38 .Dd November 4, 2018
39 .Dt NG_PPTPGRE 4
40 .Os
41 .Sh NAME
42 .Nm ng_pptpgre
43 .Nd PPTP GRE protocol netgraph node type
44 .Sh SYNOPSIS
45 .In sys/types.h
46 .In netgraph/ng_pptpgre.h
47 .Sh DESCRIPTION
48 The
49 .Nm pptpgre
50 node type performs Generic Routing Encapsulation (GRE) over IP
51 for the PPTP protocol as specified by RFC 2637.
52 This involves packet
53 encapsulation, sequencing, acknowledgement, and an adaptive timeout
54 sliding window mechanism.
55 This node type does not handle any of
56 the TCP control protocol or call negotiation defined by PPTP.
57 .Pp
58 This node type expects to receive complete IP packets,
59 including the IP header, on the
60 .Dq Li lower
61 hook, but it transmits outgoing frames without any IP header.
62 The typical use for this node type would be to connect the
63 .Dq Li upper
64 hook to one of the link hooks of a
65 .Xr ng_ppp 4
66 node, and the
67 .Dq Li lower
68 hook to the
69 .Dq Li "inet/raw/gre"
70 hook of a
71 .Xr ng_ksocket 4
72 node.
73 .Sh HOOKS
74 This node type supports the following hooks:
75 .Bl -tag -width ".Va session_hhhh"
76 .It Va session_hhhh
77 Session 0xhhhh data packets to the upper protocol layers
78 .It Va upper
79 Same as session_hhhh, but for single session with configurable cid (legacy)
80 .It Va lower
81 Connection to the lower protocol layers
82 .El
83 .Sh CONTROL MESSAGES
84 This node type supports the generic control messages, plus the following:
85 .Bl -tag -width foo
86 .It Dv NGM_PPTPGRE_SET_CONFIG Pq Ic setconfig
87 This command resets and configures hook for a session.
88 If corresponding
89 session_hhhh hook is not connected, upper hook will be configured.
90 This command takes a
91 .Vt "struct ng_pptpgre_conf"
92 as an argument:
93 .Bd -literal
94 /* Configuration for a session */
95 struct ng_pptpgre_conf {
96     u_char      enabled;          /* enables traffic flow */
97     u_char      enableDelayedAck; /* enables delayed acks */
98     u_char      enableAlwaysAck;  /* always include ack with data */
99     u_char      enableWindowing;  /* enable windowing algorithm */
100     uint16_t    cid;              /* my call id */
101     uint16_t    peerCid;          /* peer call id */
102     uint16_t    recvWin;          /* peer recv window size */
103     uint16_t    peerPpd;          /* peer packet processing delay
104                                      (in 1/10 of a second) */
105 };
106 .Ed
107 .Pp
108 The
109 .Va enabled
110 field enables traffic flow through the node.
111 The
112 .Va enableDelayedAck
113 field enables delayed acknowledgement (maximum 250 milliseconds), which
114 is a useful optimization and should generally be turned on.
115 .Va enableAlwaysAck
116 field enables sending acknowledgements with every data packet, which
117 is probably helpful as well.
118 .Pp
119 .Va enableWindowing
120 enables the PPTP packet windowing mechanism specified by the protocol.
121 Disabling this will cause the node to violate the protocol, possibly
122 confusing other PPTP peers, but often results in better performance.
123 The windowing mechanism is a design error in the PPTP protocol;
124 L2TP, the successor to PPTP, removes it.
125 .Pp
126 The remaining fields are as supplied by the PPTP virtual call setup process.
127 .It Dv NGM_PPTPGRE_GET_CONFIG Pq Ic getconfig
128 Takes two byte argument as cid and returns the current configuration as a
129 .Vt "struct ng_pptpgre_conf" .
130 .It Dv NGM_PPTPGRE_GET_STATS Pq Ic getstats
131 This command returns a
132 .Vt "struct ng_pptpgre_stats"
133 containing various node statistics.
134 .It Dv NGM_PPTPGRE_CLR_STATS Pq Ic clrstats
135 This command resets the node statistics.
136 .It Dv NGM_PPTPGRE_GETCLR_STATS Pq Ic getclrstats
137 This command atomically gets and resets the node statistics, returning a
138 .Vt "struct ng_pptpgre_stats" .
139 .El
140 .Sh SHUTDOWN
141 This node shuts down upon receipt of a
142 .Dv NGM_SHUTDOWN
143 control message, or when both hooks have been disconnected.
144 .Sh SYSCTL VARIABLES
145 A set of
146 .Xr sysctl 8
147 variables controls ability of this node to deal with some
148 amount of packet reorder that sometimes happens in transit.
149 Packet reorder results in packet drops (unless the order is restored)
150 as PPP protocol can not deliver reordered data.
151 These variables are shown below together
152 with their default value and meaning:
153 .Bl -tag -width indent
154 .It Va net.graph.pptpgre.reorder_max: 1
155 Defines maximum length of node's private reorder queue
156 used to keep data waiting for late packets.
157 Zero value disables reordering.
158 Default value allows the node to restore the order for two packets swapped
159 in transit.
160 Greater values allow the node to deliver packets being late after more
161 packets in sequence at cost of increased kernel memory usage.
162 .It Va net.graph.pptpgre.reorder_timeout: 1
163 Defines time value in miliseconds used to wait for late packets.
164 .El
165 .Sh SEE ALSO
166 .Xr netgraph 4 ,
167 .Xr ng_ksocket 4 ,
168 .Xr ng_ppp 4 ,
169 .Xr ngctl 8 ,
170 .Xr sysctl 8
171 .Rs
172 .%A K. Hamzeh
173 .%A G. Pall
174 .%A W. Verthein
175 .%A J. Taarud
176 .%A W. Little
177 .%A G. Zorn
178 .%T "Point-to-Point Tunneling Protocol (PPTP)"
179 .%O RFC 2637
180 .Re
181 .Rs
182 .%A S. Hanks
183 .%A T. \&Li
184 .%A D. Farinacci
185 .%A P. Traina
186 .%T "Generic Routing Encapsulation over IPv4 networks"
187 .%O RFC 1702
188 .Re
189 .Sh HISTORY
190 The
191 .Nm
192 node type was implemented in
193 .Fx 4.0 .
194 .Sh AUTHORS
195 .An Archie Cobbs Aq Mt archie@FreeBSD.org
196 .Sh BUGS
197 The node should not expect incoming GRE packets to have an IP header.
198 This behavior is inherited from the (converse) behavior of raw IP sockets.
199 An intermediate node that strips IP headers in one direction
200 should be used instead.