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; |
| 17 | |
| 18 | import java.time.Duration; |
| 19 | |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 20 | import org.onosproject.incubator.net.l2monitoring.cfm.identifier.MepId; |
Sean Condon | 3a1efef | 2018-02-24 13:16:03 +0000 | [diff] [blame] | 21 | import org.onosproject.incubator.net.l2monitoring.cfm.Mep; |
| 22 | import org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementCreate; |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 23 | |
| 24 | /** |
| 25 | * A base interface with attributes that are common to both Delay and Loss Measurements. |
| 26 | */ |
| 27 | public interface MeasurementCreateBase { |
| 28 | /** |
| 29 | * The version of the PDUs used to perform Loss or Delay Measurement. |
| 30 | * The exact PDUs to use are specified by this object in combination with measurement-type |
| 31 | * @return The version of the PDUs |
| 32 | */ |
Sean Condon | 3a1efef | 2018-02-24 13:16:03 +0000 | [diff] [blame] | 33 | DelayMeasurementCreate.Version version(); |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 34 | |
| 35 | /** |
| 36 | * The remote MEP to perform the tests against. |
| 37 | * @return An ID of a MEP |
| 38 | */ |
| 39 | MepId remoteMepId(); |
| 40 | |
| 41 | /** |
| 42 | * The interval between Loss or Delay Measurement OAM message transmission. |
| 43 | * For Loss Measurement monitoring applications the default value is 1 sec. |
| 44 | * This object is not applicable if measurement-type is set to 'ccm' and is ignored for that Loss Measurement Type |
| 45 | * @return A java Duration |
| 46 | */ |
| 47 | Duration messagePeriod(); |
| 48 | |
| 49 | /** |
| 50 | * The priority of frames with Performance Monitoring OAM message information. |
| 51 | * @return A priority enumerated value 0-7 |
| 52 | */ |
Sean Condon | 3a1efef | 2018-02-24 13:16:03 +0000 | [diff] [blame] | 53 | Mep.Priority priority(); |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 54 | |
| 55 | /** |
| 56 | * The Loss Measurement frame size between 64 bytes and the maximum transmission unit of the EVC. |
| 57 | * The range of frame sizes from 64 through 2000 octets need to be supported, |
| 58 | * and the range of frame sizes from 2001 through 9600 octets is suggested be supported. |
| 59 | * The adjustment to the frame size of the standard frame size is accomplished |
| 60 | * by the addition of a Data or Test TLV. A Data or Test TLV is only added to |
| 61 | * the frame if the frame size is greater than 64 bytes |
| 62 | * @return frame size in bytes |
| 63 | */ |
| 64 | Short frameSize(); |
| 65 | |
| 66 | /** |
| 67 | * The LM data pattern included in a Data TLV. |
| 68 | * when the size of the LM frame is determined by the frame-size object and test-tlv-included is 'false'. |
| 69 | * If the frame size object does not define the LM frame size or |
| 70 | * test-tlv-included is 'true' the value of this object is ignored |
| 71 | * @return The data pattern - ones or zeroes |
| 72 | */ |
Sean Condon | 3a1efef | 2018-02-24 13:16:03 +0000 | [diff] [blame] | 73 | DelayMeasurementCreate.DataPattern dataPattern(); |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 74 | |
| 75 | /** |
| 76 | * Whether a Test TLV or Data TLV is included when the size of the LM frame is determined by the frame-size object. |
| 77 | * If the frame-size object does not define the LM frame size the value of |
| 78 | * this object is ignored. |
| 79 | * @return true indicates that the Test TLV is to be included, false indicates it is not |
| 80 | */ |
| 81 | boolean testTlvIncluded(); |
| 82 | |
| 83 | /** |
| 84 | * The type of test pattern to be sent in the LM frame Test TLV. |
| 85 | * when the size of LM PDU is determined by the frame-size object and |
| 86 | * test-tlv-included is 'true'. |
| 87 | * If the frame size object does not define the LM frame size or |
| 88 | * test-tlv-included is 'false' the value of this object is ignored |
| 89 | * @return A TLV pattern enum |
| 90 | */ |
Sean Condon | 3a1efef | 2018-02-24 13:16:03 +0000 | [diff] [blame] | 91 | DelayMeasurementCreate.TestTlvPattern testTlvPattern(); |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 92 | |
| 93 | /** |
| 94 | * The Measurement Interval for FLR statistics. |
| 95 | * A Measurement Interval of 15 minutes needs to be supported, other |
| 96 | * intervals may be supported. |
| 97 | * @return A java Duration |
| 98 | */ |
| 99 | Duration measurementInterval(); |
| 100 | |
| 101 | /** |
| 102 | * The number of completed measurement intervals to store in the history statistic table. |
| 103 | * At least 32 completed measurement intervals are to be stored. |
| 104 | * 96 measurement intervals are recommended to be stored |
| 105 | * @return The number to be stored. |
| 106 | */ |
| 107 | Short numberIntervalsStored(); |
| 108 | |
| 109 | /** |
| 110 | * Whether the measurement intervals for the Loss Measurement session are aligned with a zero offset to real time. |
| 111 | * The value 'true' indicates that each Measurement Interval starts at a time |
| 112 | * which is aligned to NE time source hour if the interval is a factor of an |
| 113 | * hour, i.e. 60min/15min = 4. For instance, a measurement time interval of |
| 114 | * 15 minutes would stop/start the measurement interval at 0, 15, 30, and 45 |
| 115 | * minutes of an hour. A measurement interval of 7 minutes would not align to |
| 116 | * the hour since 7 minutes is NOT a factor of an hour, i.e. 60min/7min = 8.6, |
| 117 | * and the behavior is the same as if the object is set to 'false'. |
| 118 | * The value 'false' indicates that each Measurement Interval starts at a time |
| 119 | * which is indicated by repetition-period. |
| 120 | * One side effect of the usage of this parameter is that if the value is true |
| 121 | * and the repetition-period is not a factor of an hour then the start of the |
| 122 | * next Measurement Interval will be delayed until the next factor of an hour. |
| 123 | * @return See above for the meaning of true and false |
| 124 | */ |
| 125 | boolean alignMeasurementIntervals(); |
| 126 | |
| 127 | /** |
| 128 | * The offset in minutes from the time of day value. |
| 129 | * if align-measurement-intervals is 'true' and the repetition time is a factor |
| 130 | * of 60 minutes. If not, the value of this object is ignored. |
| 131 | * If the Measurement Interval is 15 minutes and align-measurement-intervals |
| 132 | * is true and if this object was set to 5 minutes, the Measurement Intervals |
| 133 | * would start at 5, 20, 35, 50 minutes past each hour |
| 134 | * @return A java Duration |
| 135 | */ |
| 136 | Duration alignMeasurementOffset(); |
| 137 | |
| 138 | /** |
| 139 | * Defines the session start time. |
| 140 | * @return An object with the start time type and optionally an instant |
| 141 | */ |
| 142 | StartTime startTime(); |
| 143 | |
| 144 | /** |
| 145 | * Defines the session stop time. |
| 146 | * @return An object with the stop time type and optionally an instant |
| 147 | */ |
| 148 | StopTime stopTime(); |
| 149 | |
| 150 | /** |
| 151 | * Indicates whether the current session is defined to be 'proactive' or 'on-demand. |
| 152 | * @return An enumerated value |
| 153 | */ |
| 154 | SessionType sessionType(); |
| 155 | |
| 156 | /** |
Sean Condon | 3a1efef | 2018-02-24 13:16:03 +0000 | [diff] [blame] | 157 | * Builder for {@link MeasurementCreateBase}. |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 158 | */ |
| 159 | public interface MeasCreateBaseBuilder { |
| 160 | MeasCreateBaseBuilder messagePeriod( |
| 161 | Duration messagePeriod) throws SoamConfigException; |
| 162 | |
| 163 | MeasCreateBaseBuilder frameSize(Short frameSize) throws SoamConfigException; |
| 164 | |
Sean Condon | 3a1efef | 2018-02-24 13:16:03 +0000 | [diff] [blame] | 165 | MeasCreateBaseBuilder dataPattern(DelayMeasurementCreate.DataPattern dataPattern); |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 166 | |
| 167 | MeasCreateBaseBuilder testTlvIncluded(boolean testTlvIncluded); |
| 168 | |
Sean Condon | 3a1efef | 2018-02-24 13:16:03 +0000 | [diff] [blame] | 169 | MeasCreateBaseBuilder testTlvPattern(DelayMeasurementCreate.TestTlvPattern testTlvPattern); |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 170 | |
| 171 | MeasCreateBaseBuilder measurementInterval( |
| 172 | Duration measurementInterval) throws SoamConfigException; |
| 173 | |
| 174 | MeasCreateBaseBuilder numberIntervalsStored( |
| 175 | Short numberIntervalsStored) throws SoamConfigException; |
| 176 | |
| 177 | MeasCreateBaseBuilder alignMeasurementIntervals( |
| 178 | boolean alignMeasurementIntervals); |
| 179 | |
| 180 | MeasCreateBaseBuilder alignMeasurementOffset( |
| 181 | Duration alignMeasurementOffset) throws SoamConfigException; |
| 182 | |
| 183 | MeasCreateBaseBuilder startTime(StartTime startTime) throws SoamConfigException; |
| 184 | |
| 185 | MeasCreateBaseBuilder stopTime(StopTime stopTime) throws SoamConfigException; |
| 186 | |
| 187 | MeasCreateBaseBuilder sessionType(SessionType sessionType); |
| 188 | |
| 189 | } |
| 190 | |
| 191 | /** |
| 192 | * Supported session types. |
| 193 | * reference [MEF SOAM IA] R3 |
| 194 | */ |
| 195 | public enum SessionType { |
| 196 | /** |
| 197 | * The current session is 'proactive'. |
| 198 | */ |
| 199 | PROACTIVE, |
| 200 | /** |
| 201 | * The current session is 'on-demand'. |
| 202 | */ |
| 203 | ONDEMAND; |
| 204 | } |
| 205 | |
| 206 | } |