blob: 6779d3e4ab8a864786fc7aed4ebe218712cecee7 [file] [log] [blame]
Sho SHIMIZU014c33a2015-04-30 11:40:37 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Sho SHIMIZU014c33a2015-04-30 11:40:37 -07003 *
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.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 */
26public enum OduSignalType {
Toru Furusawa72ee30c2016-01-08 13:29:04 -080027 /** bit rate in Mbps. */
28 ODU0(1_250),
29 ODU1(2_500),
30 ODU2(10_000),
31 ODU2e(10_000),
32 ODU3(40_000),
Konstantinos Kanonakisa004c7e2017-02-09 11:53:44 -060033 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 Furusawa72ee30c2016-01-08 13:29:04 -080043
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 Ashkenazyf0699702016-01-17 19:28:49 +020057
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 SHIMIZU014c33a2015-04-30 11:40:37 -070067}