blob: 16242040e601acdee365df29210a513680d6fc7a [file] [log] [blame]
Sean Condon0e89bda2017-03-21 14:23:19 +00001/*
2 * Copyright 2017-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.incubator.net.l2monitoring.soam.loss;
17
18import java.util.Collection;
19
20import org.onosproject.incubator.net.l2monitoring.soam.MilliPct;
21import org.onosproject.incubator.net.l2monitoring.soam.SoamId;
22
23/**
24 * Object to support the setting of Loss Measurement Thresholds.
25 *
26 * The main purpose of the threshold configuration is to configure threshold
27 * alarm notifications indicating that a specific performance metric is not being met
28 */
29public interface LossMeasurementThreshold {
30 /**
31 * The index of the threshold number for the specific LM threshold entry.
32 * An index value of '1' needs to be supported. Other index values can also be supported
33 * @return The threshold Id
34 */
35 SoamId thresholdId();
36
37 /**
38 * A vector of bits that indicates the type of SOAM LM thresholds notifications that are enabled.
39 * A present but enables the specific SOAM LM threshold notification and
40 * when the specific counter is enabled and the threshold is crossed a
41 * notification is generated.
42 * A not present bit disables the specific SOAM LM threshold notification.
43 * If a particular SOAM LM threshold is not supported the BIT value is not present
44 * @return A collection of bit options
45 */
46 Collection<ThresholdOption> thresholds();
47
48 /**
49 * The measured forward frame loss ratio threshold value.
50 * that will be used to determine if a threshold notification is generated
51 * @return Units are in milli-percent, where 1 indicates 0.001 percent
52 */
53 MilliPct measuredFlrForward();
54
55 /**
56 * The maximum forward frame loss ratio threshold value.
57 * that will be used to determine if a threshold notification is generated
58 * @return Units are in milli-percent, where 1 indicates 0.001 percent
59 */
60 MilliPct maxFlrForward();
61
62 /**
63 * The average forward frame loss ratio threshold value.
64 * that will be used to determine if a threshold notification is generated
65 * @return Units are in milli-percent, where 1 indicates 0.001 percent
66 */
67 MilliPct averageFlrForward();
68
69 /**
70 * The measured backward frame loss ratio threshold value.
71 * that will be used to determine if a threshold notification is generated
72 * @return Units are in milli-percent, where 1 indicates 0.001 percent
73 */
74 MilliPct measuredFlrBackward();
75
76 /**
77 * The maximum backward frame loss ratio threshold value.
78 * that will be used to determine if a threshold notification is generated
79 * @return Units are in milli-percent, where 1 indicates 0.001 percent
80 */
81 MilliPct maxFlrBackward();
82
83 /**
84 * The average backward frame loss ratio threshold value.
85 * that will be used to determine if a threshold notification is generated
86 * @return Units are in milli-percent, where 1 indicates 0.001 percent
87 */
88 MilliPct averageFlrBackward();
89
90 /**
91 * The forward high loss threshold value.
92 * that will be used to determine if a threshold notification is generated.
93 * @return The threshold value
94 */
95 Long forwardHighLoss();
96
97 /**
98 * The consecutive forward high loss threshold value.
99 * that will be used to determine if a threshold notification is generated
100 * @return The threshold value
101 */
102 Long forwardConsecutiveHighLoss();
103
104 /**
105 * The backward high loss threshold value.
106 * that will be used to determine if a threshold notification is generated.
107 * @return The threshold value
108 */
109 Long backwardHighLoss();
110
111 /**
112 * The consecutive backward high loss threshold value.
113 * that will be used to determine if a threshold notification is generated
114 * @return The threshold value
115 */
116 Long backwardConsecutiveHighLoss();
117
118 /**
119 * The forward unavailability threshold value.
120 * that will be used to determine if a threshold notification is generated
121 * @return The threshold value
122 */
123 Long forwardUnavailableCount();
124
125 /**
126 * The forward availability/total time ratio threshold value.
127 * that will be used to determine if a threshold notification is generated
128 * if the ratio drops below the configured value.
129 * The ratio value is expressed as a percent with a value of 0 (ratio 0.00)
130 * through 100000 (ratio 1.00)
131 * @return Units are in milli-percent, where 1 indicates 0.001 percent
132 */
133 MilliPct forwardAvailableRatio();
134
135 /**
136 * The backward unavailability threshold value.
137 * that will be used to determine if a threshold notification is generated
138 * @return The threshold value
139 */
140 Long backwardUnavailableCount();
141
142 /**
143 * The backward availability/total time ratio threshold value.
144 * that will be used to determine if a threshold notification is generated
145 * if the ratio drops below the configured value.
146 * The ratio value is expressed as a percent with a value of 0 (ratio 0.00)
147 * through 100000 (ratio 1.00)
148 * @return Units are in milli-percent, where 1 indicates 0.001 percent
149 */
150 MilliPct backwardAvailableRatio();
151
152 /**
153 * Builder for {@link org.onosproject.incubator.net.l2monitoring.soam.loss.LossMeasurementThreshold}.
154 */
155 public interface LmThresholdBuilder {
156
157 LmThresholdBuilder addToThreshold(ThresholdOption threshold);
158
159 LmThresholdBuilder measuredFlrForward(MilliPct measuredFlrForward);
160
161 LmThresholdBuilder maxFlrForward(MilliPct maxFlrForward);
162
163 LmThresholdBuilder averageFlrForward(MilliPct averageFlrForward);
164
165 LmThresholdBuilder measuredFlrBackward(MilliPct measuredFlrBackward);
166
167 LmThresholdBuilder maxFlrBackward(MilliPct maxFlrBackward);
168
169 LmThresholdBuilder averageFlrBackward(MilliPct averageFlrBackward);
170
171 LmThresholdBuilder forwardHighLoss(Long forwardHighLoss);
172
173 LmThresholdBuilder forwardConsecutiveHighLoss(Long forwardConsecutiveHighLoss);
174
175 LmThresholdBuilder backwardHighLoss(Long backwardHighLoss);
176
177 LmThresholdBuilder backwardConsecutiveHighLoss(Long backwardConsecutiveHighLoss);
178
179 LmThresholdBuilder forwardUnavailableCount(Long forwardUnavailableCount);
180
181 LmThresholdBuilder forwardAvailableRatio(MilliPct forwardAvailableRatio);
182
183 LmThresholdBuilder backwardUnavailableCount(Long backwardUnavailableCount);
184
185 LmThresholdBuilder backwardAvailableRatio(MilliPct backwardAvailableRatio);
186
187 LossMeasurementThreshold build();
188 }
189
190 /**
191 * Set of enumerated threshold options.
192 */
193 public enum ThresholdOption {
194 MEASURED_FLR_FORWARD,
195 MAX_FLR_FORWARD,
196 AVERAGE_FLR_FORWARD,
197 MEASURED_FLR_BACKWARD,
198 MAX_FLR_BACKWARD,
199 AVERAGE_FLR_BACKWARD,
200 FORWARD_HIGH_LOSS,
201 FORWARD_CONSECUTIVE_HIGH_LOSS,
202 BACKWARD_HIGH_LOSS,
203 BACKWARD_CONSECUTIVE_HIGH_LOSS,
204 FORWARD_UNAVAILABLE_COUNT,
205 FORWARD_AVAILABLE_RATIO,
206 BACKWARD_UNAVAILABLE_COUNT,
207 BACKWARD_AVAILABLE_RATIO;
208 }
209}