Deleted Added
full compact
ng_car.4 (233648) ng_car.4 (242997)
1.\" Copyright (c) 2005 Nuno Antunes <nuno.antunes@gmail.com>
2.\" Copyright (c) 2007 Alexander Motin <mav@FreeBSD.org>
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
1.\" Copyright (c) 2005 Nuno Antunes <nuno.antunes@gmail.com>
2.\" Copyright (c) 2007 Alexander Motin <mav@FreeBSD.org>
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.\" $FreeBSD: head/share/man/man4/ng_car.4 233648 2012-03-29 05:02:12Z eadler $
26.\" $FreeBSD: head/share/man/man4/ng_car.4 242997 2012-11-13 20:41:36Z joel $
27.\"
27.\"
28.Dd March 11, 2007
28.Dd November 13, 2012
29.Dt NG_CAR 4
30.Os
31.Sh NAME
32.Nm ng_car
33.Nd Committed Access Rate netgraph node type
34.Sh SYNOPSIS
35.In netgraph/ng_car.h
36.Sh DESCRIPTION

--- 8 unchanged lines hidden (view full) ---

45Two rate three color marker as described in RFC 2698,
46.It
47RED-like rate limit algorithm used by Cisco,
48.It
49Traffic shaping with RED.
50.El
51.Sh HOOKS
52This node type supports the following hooks:
29.Dt NG_CAR 4
30.Os
31.Sh NAME
32.Nm ng_car
33.Nd Committed Access Rate netgraph node type
34.Sh SYNOPSIS
35.In netgraph/ng_car.h
36.Sh DESCRIPTION

--- 8 unchanged lines hidden (view full) ---

45Two rate three color marker as described in RFC 2698,
46.It
47RED-like rate limit algorithm used by Cisco,
48.It
49Traffic shaping with RED.
50.El
51.Sh HOOKS
52This node type supports the following hooks:
53.Bl -tag -width indent
53.Bl -tag -width ".Va upper"
54.It Va upper
55Hook leading to upper layer protocols.
56.It Va lower
57Hook leading to lower layer protocols.
58.El
59.Pp
60Traffic flowing from
61.Va upper

--- 6 unchanged lines hidden (view full) ---

68.Va lower
69to
70.Va upper
71is considered
72.Sy upstream
73traffic.
74.Sh MODES OF OPERATION
75Each hook can operate in one of the following modes:
54.It Va upper
55Hook leading to upper layer protocols.
56.It Va lower
57Hook leading to lower layer protocols.
58.El
59.Pp
60Traffic flowing from
61.Va upper

--- 6 unchanged lines hidden (view full) ---

68.Va lower
69to
70.Va upper
71is considered
72.Sy upstream
73traffic.
74.Sh MODES OF OPERATION
75Each hook can operate in one of the following modes:
76.Bl -tag -width indent
76.Bl -tag -width foo
77.It Dv NG_CAR_SINGLE_RATE
78Single rate three color marker as described in RFC 2697.
79Committed burst packets are counted as green, extended burst packets are
80counted as yellow and exceeding packets are counted as red.
81Committed burst getting refilled with CIR (Committed Information Rate) speed.
82When it is full, exceeded burst getting refilled.
83.It Dv NG_CAR_DOUBLE_RATE
84Two rate three color marker as described in RFC 2698.

--- 24 unchanged lines hidden (view full) ---

109consumes additional system resources for queue processing.
110.El
111By default, all information rates are measured in bits per second and bursts
112are measured in bytes. But when NG_CAR_COUNT_PACKETS option is enabled,
113rates are measured in packets per second and bursts are in packets.
114.Sh CONTROL MESSAGES
115This node type supports the generic control messages and the following
116specific messages.
77.It Dv NG_CAR_SINGLE_RATE
78Single rate three color marker as described in RFC 2697.
79Committed burst packets are counted as green, extended burst packets are
80counted as yellow and exceeding packets are counted as red.
81Committed burst getting refilled with CIR (Committed Information Rate) speed.
82When it is full, exceeded burst getting refilled.
83.It Dv NG_CAR_DOUBLE_RATE
84Two rate three color marker as described in RFC 2698.

--- 24 unchanged lines hidden (view full) ---

109consumes additional system resources for queue processing.
110.El
111By default, all information rates are measured in bits per second and bursts
112are measured in bytes. But when NG_CAR_COUNT_PACKETS option is enabled,
113rates are measured in packets per second and bursts are in packets.
114.Sh CONTROL MESSAGES
115This node type supports the generic control messages and the following
116specific messages.
117.Bl -tag -width indent
118.It Dv NGM_CAR_SET_CONF Pq Li setconf
117.Bl -tag -width foo
118.It Dv NGM_CAR_SET_CONF Pq Ic setconf
119Set node configuration to the specified at
120.Vt "struct ng_car_bulkconf"
119Set node configuration to the specified at
120.Vt "struct ng_car_bulkconf"
121.It Dv NGM_CAR_GET_CONF Pq Li getconf
121.It Dv NGM_CAR_GET_CONF Pq Ic getconf
122Return current node configuration as
123.Vt "struct ng_car_bulkconf"
124.Bd -literal
125struct ng_car_hookconf {
122Return current node configuration as
123.Vt "struct ng_car_bulkconf"
124.Bd -literal
125struct ng_car_hookconf {
126 uint64_t cbs; /* Committed burst size */
127 uint64_t ebs; /* Exceeded/Peak burst size */
128 uint64_t cir; /* Committed information rate */
129 uint64_t pir; /* Peak information rate */
126 uint64_t cbs; /* Commited burst size (bytes) */
127 uint64_t ebs; /* Exceeded/Peak burst size (bytes) */
128 uint64_t cir; /* Commited information rate (bits/s) */
129 uint64_t pir; /* Peak information rate (bits/s) */
130 uint8_t green_action; /* Action for green packets */
131 uint8_t yellow_action; /* Action for yellow packets */
132 uint8_t red_action; /* Action for red packets */
130 uint8_t green_action; /* Action for green packets */
131 uint8_t yellow_action; /* Action for yellow packets */
132 uint8_t red_action; /* Action for red packets */
133 uint8_t mode; /* operation mode */
134 uint8_t opt; /* mode options */
133 uint8_t mode; /* single/double rate, ... */
134 uint8_t opt; /* color-aware or color-blind */
135};
136
137/* possible actions (..._action) */
138enum {
139 NG_CAR_ACTION_FORWARD = 1,
140 NG_CAR_ACTION_DROP
141};
142

--- 8 unchanged lines hidden (view full) ---

151/* mode options (opt) */
152#define NG_CAR_COUNT_PACKETS 2
153
154struct ng_car_bulkconf {
155 struct ng_car_hookconf upstream;
156 struct ng_car_hookconf downstream;
157};
158.Ed
135};
136
137/* possible actions (..._action) */
138enum {
139 NG_CAR_ACTION_FORWARD = 1,
140 NG_CAR_ACTION_DROP
141};
142

--- 8 unchanged lines hidden (view full) ---

151/* mode options (opt) */
152#define NG_CAR_COUNT_PACKETS 2
153
154struct ng_car_bulkconf {
155 struct ng_car_hookconf upstream;
156 struct ng_car_hookconf downstream;
157};
158.Ed
159.It Dv NGM_CAR_GET_STATS Pq Li getstats
159.It Dv NGM_CAR_GET_STATS Pq Ic getstats
160Return node statistics as
161.Vt "struct ng_car_bulkstats"
162.Bd -literal
163struct ng_car_hookstats {
160Return node statistics as
161.Vt "struct ng_car_bulkstats"
162.Bd -literal
163struct ng_car_hookstats {
164 uint64_t passed_pkts;
165 uint64_t droped_pkts;
166 uint64_t green_pkts;
167 uint64_t yellow_pkts;
168 uint64_t red_pkts;
169 uint64_t errors;
164 uint64_t passed_pkts; /* Counter for passed packets */
165 uint64_t droped_pkts; /* Counter for droped packets */
166 uint64_t green_pkts; /* Counter for green packets */
167 uint64_t yellow_pkts; /* Counter for yellow packets */
168 uint64_t red_pkts; /* Counter for red packets */
169 uint64_t errors; /* Counter for operation errors */
170};
171
172struct ng_car_bulkstats {
173 struct ng_car_hookstats upstream;
174 struct ng_car_hookstats downstream;
175};
176.Ed
170};
171
172struct ng_car_bulkstats {
173 struct ng_car_hookstats upstream;
174 struct ng_car_hookstats downstream;
175};
176.Ed
177.It Dv NGM_CAR_CLR_STATS Pq Li clrstats
177.It Dv NGM_CAR_CLR_STATS Pq Ic clrstats
178Clear node statistics.
178Clear node statistics.
179.It Dv NGM_CAR_GETCLR_STATS Pq Li getclrstats
179.It Dv NGM_CAR_GETCLR_STATS Pq Ic getclrstats
180Atomically return and clear node statistics.
181.El
182.Sh SHUTDOWN
183This node shuts down upon receipt of a
184.Dv NGM_SHUTDOWN
185control message, or when all hooks have been disconnected.
186.Sh EXAMPLES
187Limit outgoing data rate over fxp0 Ethernet interface to 20Mbit/s

--- 27 unchanged lines hidden ---
180Atomically return and clear node statistics.
181.El
182.Sh SHUTDOWN
183This node shuts down upon receipt of a
184.Dv NGM_SHUTDOWN
185control message, or when all hooks have been disconnected.
186.Sh EXAMPLES
187Limit outgoing data rate over fxp0 Ethernet interface to 20Mbit/s

--- 27 unchanged lines hidden ---