Sho SHIMIZU | 014c33a | 2015-04-30 11:40:37 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Sho SHIMIZU | 014c33a | 2015-04-30 11:40:37 -0700 | [diff] [blame] | 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.net; |
| 17 | |
| 18 | /** |
| 19 | * Represents ODU (Optical channel Data Unit) signal type. |
| 20 | * |
| 21 | * <p> |
| 22 | * See ITU G.709 "Interfaces for the Optical Transport Network (OTN)" and |
| 23 | * Open Networking Foundation "Optical Transport Protocol Extensions Version 1.0". |
| 24 | * </p> |
| 25 | */ |
| 26 | public enum OduSignalType { |
Yuta HIGUCHI | 5ae8085 | 2017-02-13 18:30:15 -0800 | [diff] [blame] | 27 | // bit rate in Mbps |
Toru Furusawa | 72ee30c | 2016-01-08 13:29:04 -0800 | [diff] [blame] | 28 | ODU0(1_250), |
| 29 | ODU1(2_500), |
| 30 | ODU2(10_000), |
| 31 | ODU2e(10_000), |
| 32 | ODU3(40_000), |
Konstantinos Kanonakis | a004c7e | 2017-02-09 11:53:44 -0600 | [diff] [blame] | 33 | ODU4(100_000), |
| 34 | ODUC1(100_000), |
| 35 | ODUC2(200_000), |
| 36 | ODUC3(300_000), |
| 37 | ODUC4(400_000), |
| 38 | ODUC5(500_000), |
| 39 | ODUC6(600_000), |
| 40 | ODUC7(700_000), |
| 41 | ODUC8(800_000), |
| 42 | ODUC9(900_000); |
Toru Furusawa | 72ee30c | 2016-01-08 13:29:04 -0800 | [diff] [blame] | 43 | |
| 44 | private final long bitRate; |
| 45 | |
| 46 | OduSignalType(long bitRate) { |
| 47 | this.bitRate = bitRate; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Return the bit rate in Mbps of the port. |
| 52 | * @return bit rate |
| 53 | */ |
| 54 | public long bitRate() { |
| 55 | return this.bitRate; |
| 56 | } |
Rimon Ashkenazy | f069970 | 2016-01-17 19:28:49 +0200 | [diff] [blame] | 57 | |
| 58 | /** |
| 59 | * Returns the number of tributary slots of the OduSignalType. |
| 60 | * Each TributarySlot is 1.25Gbps. |
| 61 | * @return number of tributary slots |
| 62 | */ |
| 63 | public int tributarySlots() { |
| 64 | return (int) (this.bitRate() / OduSignalType.ODU0.bitRate()); |
| 65 | } |
| 66 | |
Sho SHIMIZU | 014c33a | 2015-04-30 11:40:37 -0700 | [diff] [blame] | 67 | } |