blob: 905f500fd55a8e15cb11c2b00ae5d69621648533 [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),
33 ODU4(100_000);
34
35 private final long bitRate;
36
37 OduSignalType(long bitRate) {
38 this.bitRate = bitRate;
39 }
40
41 /**
42 * Return the bit rate in Mbps of the port.
43 * @return bit rate
44 */
45 public long bitRate() {
46 return this.bitRate;
47 }
Rimon Ashkenazyf0699702016-01-17 19:28:49 +020048
49 /**
50 * Returns the number of tributary slots of the OduSignalType.
51 * Each TributarySlot is 1.25Gbps.
52 * @return number of tributary slots
53 */
54 public int tributarySlots() {
55 return (int) (this.bitRate() / OduSignalType.ODU0.bitRate());
56 }
57
Sho SHIMIZU014c33a2015-04-30 11:40:37 -070058}