Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package org.onosproject.incubator.net.l2monitoring.soam.delay; |
| 17 | |
| 18 | import java.util.Collection; |
| 19 | |
| 20 | import org.onosproject.incubator.net.l2monitoring.soam.MeasurementCreateBase; |
| 21 | import org.onosproject.incubator.net.l2monitoring.soam.SoamConfigException; |
| 22 | |
| 23 | /** |
| 24 | * A model of Delay Measurement from ITU Y.1731 Chapter 8.2, MEF 17, MEF 36.1 and MEF 39. |
| 25 | * |
| 26 | * In this model delay measurements entries are returned as a collection in the |
| 27 | * MepEntry. In this way Delay Measurements are created by calling on the |
| 28 | * Create Delay Measurement function, passing this DelayMeasurementCreate object |
| 29 | * and any other arguments needed. |
| 30 | * The Delay Measurement Entry is a result and not configured or |
| 31 | * persisted in ONOS, but instead is is passed on to some analytics system |
| 32 | */ |
| 33 | public interface DelayMeasurementCreate extends MeasurementCreateBase { |
| 34 | /** |
| 35 | * The type of Delay Measurement is to be performed. |
| 36 | * The exact PDUs to use are specified by this object in combination with version |
| 37 | * @return enumerated type |
| 38 | */ |
| 39 | DmType dmCfgType(); |
| 40 | |
| 41 | /** |
| 42 | * A vector of bits that indicates the type of SOAM DM counters that are enabled. |
| 43 | * A present bit enables the specific SOAM DM counter. |
| 44 | * A not present bit disables the SOAM DM counter. |
| 45 | * If a particular SOAM DM counter is not supported the BIT value is not present. |
| 46 | * Not all SOAM DM counters are supported for all SOAM DM types. |
| 47 | * @return A collection of options |
| 48 | */ |
| 49 | Collection<MeasurementOption> measurementsEnabled(); |
| 50 | |
| 51 | /** |
| 52 | * The number of measurement bins per Measurement Interval for Frame Delay measurements. |
| 53 | * At least 3 bins are to be supported; at least 10 bins are recommended to be supported |
| 54 | * @return the number of bins |
| 55 | */ |
| 56 | Short binsPerFdInterval(); |
| 57 | |
| 58 | /** |
| 59 | * The number of measurement bins per Measurement Interval for Inter-Frame Delay Variation measurements. |
| 60 | * The minimum number of measurement bins to be supported is 2. The desired |
| 61 | * number of measurements bins to be supported is 10 |
| 62 | * @return the number of bins |
| 63 | */ |
| 64 | Short binsPerIfdvInterval(); |
| 65 | |
| 66 | /** |
| 67 | * The selection offset for Inter-Frame Delay Variation measurements. |
| 68 | * If this value is set to n, then the IFDV is calculated by taking the |
| 69 | * difference in frame delay between frame F and frame (F+n). |
| 70 | * reference: MEF-SOAM-PM-MIB.mefSoamDmCfgInterFrameDelayVariationSelectionOffset |
| 71 | * @return The selection offset |
| 72 | */ |
| 73 | Short ifdvSelectionOffset(); |
| 74 | |
| 75 | /** |
| 76 | * The number of measurement bins per Measurement Interval for Frame Delay Range measurements. |
| 77 | * @return the number of bins |
| 78 | */ |
| 79 | Short binsPerFdrInterval(); |
| 80 | |
| 81 | /** |
| 82 | * The Delay Measurement threshold configuration values for DM Performance Monitoring. |
| 83 | * The main purpose of the threshold configuration list is to configure |
| 84 | * threshold alarm notifications indicating that a specific performance metric |
| 85 | * is not being met |
| 86 | * @return a collection of Thresholds |
| 87 | */ |
| 88 | Collection<DelayMeasurementThreshold> thresholds(); |
| 89 | |
| 90 | /** |
| 91 | * Builder for {@link org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementCreate}. |
| 92 | */ |
| 93 | public interface DmCreateBuilder extends MeasCreateBaseBuilder { |
| 94 | |
| 95 | DmCreateBuilder addToMeasurementsEnabled( |
| 96 | MeasurementOption measurementEnabled); |
| 97 | |
| 98 | DmCreateBuilder binsPerFdInterval(Short binsPerFdInterval) |
| 99 | throws SoamConfigException; |
| 100 | |
| 101 | DmCreateBuilder binsPerIfdvInterval(Short binsPerIfdvInterval) |
| 102 | throws SoamConfigException; |
| 103 | |
| 104 | DmCreateBuilder ifdvSelectionOffset(Short ifdvSelectionOffset) |
| 105 | throws SoamConfigException; |
| 106 | |
| 107 | DmCreateBuilder binsPerFdrInterval(Short binsPerFdrInterval) |
| 108 | throws SoamConfigException; |
| 109 | |
| 110 | DmCreateBuilder addToThresholds(DelayMeasurementThreshold threshold); |
| 111 | |
| 112 | DelayMeasurementCreate build(); |
| 113 | } |
| 114 | |
| 115 | /** |
| 116 | * Enumerated options for Delay Measurement Types. |
| 117 | */ |
| 118 | public enum DmType { |
| 119 | /** |
| 120 | * DMM SOAM PDU generated, DMR responses received (one-way or two-way measurements). |
| 121 | */ |
| 122 | DMDMM, |
| 123 | /** |
| 124 | * 1DM SOAM PDU generated (one-way measurements are made by the receiver). |
| 125 | */ |
| 126 | DM1DMTX, |
| 127 | /** |
| 128 | * 1DM SOAM PDU received and tracked (one-way measurements). |
| 129 | */ |
| 130 | DM1DMRX |
| 131 | } |
| 132 | |
| 133 | /** |
| 134 | * Supported Versions of Y.1731. |
| 135 | */ |
| 136 | public enum Version { |
| 137 | Y17312008("Y.1731-2008"), |
| 138 | Y17312011("Y.1731-2011"); |
| 139 | |
| 140 | private String literal; |
| 141 | private Version(String literal) { |
| 142 | this.literal = literal; |
| 143 | } |
| 144 | |
| 145 | public String literal() { |
| 146 | return literal; |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | /** |
| 151 | * Selection of Measurement types. |
| 152 | */ |
| 153 | public enum MeasurementOption { |
| 154 | SOAM_PDUS_SENT, |
| 155 | SOAM_PDUS_RECEIVED, |
| 156 | FRAME_DELAY_TWO_WAY_BINS, |
| 157 | FRAME_DELAY_TWO_WAY_MIN, |
| 158 | FRAME_DELAY_TWO_WAY_MAX, |
| 159 | FRAME_DELAY_TWO_WAY_AVERAGE, |
| 160 | FRAME_DELAY_FORWARD_BINS, |
| 161 | FRAME_DELAY_FORWARD_MIN, |
| 162 | FRAME_DELAY_FORWARD_MAX, |
| 163 | FRAME_DELAY_FORWARD_AVERAGE, |
| 164 | FRAME_DELAY_BACKWARD_BINS, |
| 165 | FRAME_DELAY_BACKWARD_MIN, |
| 166 | FRAME_DELAY_BACKWARD_MAX, |
| 167 | FRAME_DELAY_BACKWARD_AVERAGE, |
| 168 | INTER_FRAME_DELAY_VARIATION_FORWARD_BINS, |
| 169 | INTER_FRAME_DELAY_VARIATION_FORWARD_MIN, |
| 170 | INTER_FRAME_DELAY_VARIATION_FORWARD_MAX, |
| 171 | INTER_FRAME_DELAY_VARIATION_FORWARD_AVERAGE, |
| 172 | INTER_FRAME_DELAY_VARIATION_BACKWARD_BINS, |
| 173 | INTER_FRAME_DELAY_VARIATION_BACKWARD_MIN, |
| 174 | INTER_FRAME_DELAY_VARIATION_BACKWARD_MAX, |
| 175 | INTER_FRAME_DELAY_VARIATION_BACKWARD_AVERAGE, |
| 176 | INTER_FRAME_DELAY_VARIATION_TWO_WAY_BINS, |
| 177 | INTER_FRAME_DELAY_VARIATION_TWO_WAY_MIN, |
| 178 | INTER_FRAME_DELAY_VARIATION_TWO_WAY_MAX, |
| 179 | INTER_FRAME_DELAY_VARIATION_TWO_WAY_AVERAGE, |
| 180 | FRAME_DELAY_RANGE_FORWARD_BINS, |
| 181 | FRAME_DELAY_RANGE_FORWARD_MAX, |
| 182 | FRAME_DELAY_RANGE_FORWARD_AVERAGE, |
| 183 | FRAME_DELAY_RANGE_BACKWARD_BINS, |
| 184 | FRAME_DELAY_RANGE_BACKWARD_MAX, |
| 185 | FRAME_DELAY_RANGE_BACKWARD_AVERAGE, |
| 186 | FRAME_DELAY_RANGE_TWO_WAY_BINS, |
| 187 | FRAME_DELAY_RANGE_TWO_WAY_MAX, |
| 188 | FRAME_DELAY_RANGE_TWO_WAY_AVERAGE, |
| 189 | MEASURED_STATS_FRAME_DELAY_TWO_WAY, |
| 190 | MEASURED_STATS_FRAME_DELAY_FORWARD, |
| 191 | MEASURED_STATS_FRAME_DELAY_BACKWARD, |
| 192 | MEASURED_STATS_INTER_FRAME_DELAY_VARIATION_TWO_WAY, |
| 193 | MEASURED_STATS_INTER_FRAME_DELAY_VARIATION_FORWARD, |
| 194 | MEASURED_STATS_INTER_FRAME_DELAY_VARIATION_BACKWARD; |
| 195 | } |
| 196 | |
| 197 | /** |
| 198 | * Selection of Data Patterns. |
| 199 | */ |
| 200 | public enum DataPattern { |
| 201 | ZEROES, |
| 202 | ONES; |
| 203 | } |
| 204 | |
| 205 | /** |
| 206 | * Selection of Test TLV Patterns. |
| 207 | */ |
| 208 | public enum TestTlvPattern { |
| 209 | /** |
| 210 | * This test pattern is a Null signal without CRC-32. |
| 211 | */ |
| 212 | NULL_SIGNAL_WITHOUT_CRC_32, |
| 213 | /** |
| 214 | * This test pattern is a Null signal with CRC-32. |
| 215 | */ |
| 216 | NULL_SIGNAL_WITH_CRC_32, |
| 217 | /** |
| 218 | * This test pattern is a PRBS 2^31-1 without CRC-32. |
| 219 | */ |
| 220 | PRBS_2311_WITHOUT_CRC_32, |
| 221 | /** |
| 222 | * This test pattern is a PRBS 2^31-1 with CRC-32. |
| 223 | */ |
| 224 | PRBS_2311_WITH_CRC_32; |
| 225 | } |
| 226 | } |