1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
.\"
.\" Copyright (c) 2006, Alexander Motin <mav@alkar.net>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice unmodified, this list of conditions, and the following
.\" disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd December 24, 2006
.Dt NG_PRED1 4
.Os
.Sh NAME
.Nm ng_pred1
.Nd Predictor-1 PPP compression (RFC 1978) netgraph node type
.Sh SYNOPSIS
.In sys/types.h
.In netgraph/ng_pred1.h
.Sh DESCRIPTION
The
.Nm pred1
node type implements the Predictor-1 sub-protocols of the Compression Control
Protocol (CCP).
.Pp
The node has two hooks,
.Va comp
for compression and
.Va decomp
for decompression.
Only one of them can be connected at the same time, specifying node's
operation mode.
Typically that hooks would be connected to the
.Xr ng_ppp 4
node type hook of the same name.
.Sh HOOKS
This node type supports the following hooks:
.Pp
.Bl -tag -compact -width ".Va decomp"
.It Va comp
Connection to
.Xr ng_ppp 4
.Va compress
hook.
Incoming frames are compressed and sent back out the same hook.
.It Va decomp
Connection to
.Xr ng_ppp 4
.Va decompress
hook.
Incoming frames are decompressed and sent back out the same hook.
.El
.Pp
Only one hook can be connected at the same time,
specifying node's operation mode.
.Sh CONTROL MESSAGES
This node type supports the generic control messages, plus the following:
.Bl -tag -width foo
.It Dv NGM_PRED1_CONFIG Pq Ic config
This command resets and configures the node for a session
(i.e., for compression or decompression).
This command takes a
.Vt "struct ng_pred1_config"
as an argument:
.Bd -literal -offset 0n
struct ng_pred1_config {
u_char enable; /* node enabled */
};
.Ed
The
.Ft enable
field enables traffic flow through the node.
.It Dv NGM_PRED1_RESETREQ Pq Ic resetreq
This message contains no arguments, and is bi-directional.
If an error is detected during decompression, this message is sent by the
node to the originator of the
.Dv NGM_PRED1_CONFIG
message that initiated the session.
The receiver should respond by sending a PPP CCP Reset-Request to the peer.
.Pp
This message may also be received by this node type when a CCP Reset-Request
or Reset-Ack is received by the local PPP entity.
The node will respond by flushing its compression state so the sides
can resynchronize.
.It Dv NGM_PRED1_GET_STATS Pq Ic getstats
This control message obtains statistics for a given hook.
The statistics are returned in
.Vt "struct ng_pred1_stats" :
.Bd -literal
struct ng_pred1_stats {
uint64_t FramesPlain;
uint64_t FramesComp;
uint64_t FramesUncomp;
uint64_t InOctets;
uint64_t OutOctets;
uint64_t Errors;
};
.Ed
.It Dv NGM_PRED1_CLR_STATS Pq Ic clrstats
This control message clears statistics for a given hook.
.It Dv NGM_PRED1_GETCLR_STATS Pq Ic getclrstats
This control message obtains and clears statistics for a given hook.
.El
.Sh SHUTDOWN
This node shuts down upon receipt of a
.Dv NGM_SHUTDOWN
control message, or when hook have been disconnected.
.Sh SEE ALSO
.Xr netgraph 4 ,
.Xr ng_ppp 4 ,
.Xr ngctl 8
.Rs
.%A D. Rand
.%T "PPP Predictor Compression Protocol"
.%O RFC 1978
.Re
.Rs
.%A W. Simpson
.%T "The Point-to-Point Protocol (PPP)"
.%O RFC 1661
.Re
.Sh AUTHORS
.An Alexander Motin Aq Mt mav@alkar.net
.Sh BUGS
Due to nature of netgraph PPP implementation there are possible race conditions
between data packet and ResetAck CCP packet in case of packet loss.
As result,
packet loss can produce bigger performance degradation than supposed by protocol.
|