2 .\" Copyright (c) 2004, Sun Microsystems Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH TOKENMT 7IPP "April 9, 2016"
8 tokenmt \- Single and Two Rate Three Conformance Level Meter
11 The \fBtokenmt\fR module can be configured as a Single or a Two Rate meter.
12 Packets are deemed to belong to one of the three levels - Red, Yellow or Green
13 - depending on the configured rate(s) and the burst sizes. When configured as a
14 Single Rate meter, \fBtokenmt\fR can operate with just the Green and Red
18 Configuration parameters for \fBtokenmt\fR correspond to definitions in \fIRFC-
19 2697\fR and \fIRFC- 2698\fR as follows:
22 Configuring \fBtokenmt\fR as a Single Rate meter (from \fIRFC- 2697\fR):
37 (thus 'peak_burst' for a single rate meter is actually the 'excess burst' in
38 the RFC. However, throughout the text the parameter name "peak burst" is used.)
41 Configuring tokenmt as a Two Rate meter (from \fIRFC- 2698\fR):
60 The meter is implemented using token buckets C and P, which initially hold
61 tokens equivalent to committed and peak burst sizes (bits) respectively. When a
62 packet of size \fI B\fR bits arrive at time \fI t\fR, the following occurs:
66 When operating as a Single Rate meter, the outcome (level)
67 is decided as follows:
68 - Update tokens in C and P
69 o Compute no. of tokens accumulated since the
70 last time packet was seen at the committed rate as
71 T(t) = committed rate * (t - t')
72 (where t' is the time the last packet was seen)
73 o Add T tokens to C up to a maximum of committed burst
74 size. Add remaining tokens ((C+T) - Committed Burst),
75 if any, to P, to a maximum of peak burst size.
78 o If B <= C, outcome is GREEN and C -= B.
79 o Else, if B <= P, outcome is YELLOW and P -= B.
80 o Else, outcome is Red.
82 o obtain DSCP from packet
83 o obtain color from color_map, color_map[DSCP]
84 o if (color is GREEN) and (B <= C), outcome is
86 o Else, if (color is GREEN or YELLOW) and
87 (B <= P), outcome is YELLOW and P -= B.
88 o Else, outcome is RED.
89 Note that if peak_burst and yellow_next_actions are
90 not specified (that is, a single rate meter with two
91 outcomes), the outcome is never YELLOW.
97 When operating as a Two Rate meter, the outcome (level) is decided as follows:
101 - Update tokens in C and P
102 o Compute no. of tokens accumulated since the last time a
103 packet was seen at the committed and peak rates as
104 Tc(t) = committed rate * (t - t')
105 Tp(t) = peak rate * (t - t')
106 (where t' is the time the last packet was seen)
107 o Add Tc to C up to a maximum of committed burst size
108 o Add Tp to P up to a maximum of peak burst size
111 o If B > P, outcome is RED.
112 o Else, if B > C, outcome is YELLOW and P -= B
113 o Else, outcome is GREEN and C -= B & P -= B
115 o obtain DSCP from packet
116 o obtain color from color_map, color_map[DSCP]
117 o if (color is RED) or (B > P), outcome is RED
118 o Else, if (color is YELLOW) or (B > C),
119 outcome is YELLOW and P -= B
120 o Else, outcome is GREEN and C -= B & P -= B
126 The \fBtokenmt\fR module exports the following statistics through \fBkstat\fR:
133 module: tokenmt instance: <action id>
134 name: tokenmt statistics class <action name>
135 epackets <number of packets in error>
136 green_bits <number of bits in green>
137 green_packets <number of packets in green>
138 red_bits <number of bits in red>
139 red_packets <number of packets in red>
140 yellow_bits <number of bits in yellow>
141 yellow packets <number of packets in yellow>
148 \fB\fB/kernel/ipp/sparcv9/tokenmt\fR\fR
152 64-bit module (SPARC only.)
157 \fBipqosconf\fR(1M), \fBdlcosmk\fR(7ipp), \fBdscpmk\fR(7ipp),
158 \fBflowacct\fR(7ipp), \fBipqos\fR(7ipp), \fBipgpc\fR(7ipp),
162 \fIRFC 2697, A Single Rate Three Color Marker\fR J. Heinanen, R. Guerin \(em
163 The Internet Society, 1999
166 \fIRFC 2698, A Two Rate Three Color Marker\fR J. Heinanen, R. Guerin \(em The
167 Internet Society, 1999