blob: 8549bb33516984f94f4092a6e3a67c124af5767f [file] [log] [blame]
cheng fan48e832c2015-05-29 01:54:47 +08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
cheng fan48e832c2015-05-29 01:54:47 +08003 *
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
17package org.onosproject.pcep.api;
18
19import java.util.List;
20
21/**
cheng fan93258c72015-06-02 23:42:32 +080022 * Abstraction of a generalized PCEP Tunnel entity (bandwidth pipe) for L2
23 * networks or L1/L0 networks, representation of e.g., VLAN, L1 ODUk connection,
24 * WDM OCH, etc..
cheng fan48e832c2015-05-29 01:54:47 +080025 */
26public interface PcepTunnel extends PcepOperator {
27
28 /**
29 * Describe the type of a tunnel.
30 */
chengfan373aac52015-08-17 15:36:44 -050031 enum Type {
cheng fan48e832c2015-05-29 01:54:47 +080032
33 /**
34 * Signifies that this is a L0 OCH tunnel.
35 */
36 OCH,
37
38 /**
39 * Signifies that this is a L1 OTN tunnel.
40 */
41 OTN,
42
43 /**
44 * Signifies that this is a L2 tunnel.
45 */
46 UNI,
47 }
48
49 /**
50 * The ability of a tunnel.
51 */
chengfan373aac52015-08-17 15:36:44 -050052 enum Ability {
cheng fan48e832c2015-05-29 01:54:47 +080053 /**
54 * no protected tunnel,if the tunnel is broken ,then the user is out of
55 * service.
56 */
57 NOPROTECTED,
58
59 /**
60 * tunnel with rerouter ability.if a tunnel is broken, the tunnel will
61 * try to find another path to provider service.
62 */
63 SILVER,
64
65 /**
66 * tunnel with 1 + 1 rerouter ability.if a tunnel is broken, there'll be
67 * another tunnel providing service at once.
68 */
69 DIAMOND
70 }
71
Jonathan Hart51539b82015-10-29 09:53:04 -070072 enum PathType {
cheng fan48e832c2015-05-29 01:54:47 +080073
74 /**
cheng fan93258c72015-06-02 23:42:32 +080075 * Indicates path is the preferred path.
cheng fan48e832c2015-05-29 01:54:47 +080076 */
77 FIRST,
78
79 /**
cheng fan93258c72015-06-02 23:42:32 +080080 * Indicates path is the alternate path.
cheng fan48e832c2015-05-29 01:54:47 +080081 */
82 SECOND
83 }
84
85 /**
cheng fan93258c72015-06-02 23:42:32 +080086 * Represents state of the path, work normally or broken down.
cheng fan93258c72015-06-02 23:42:32 +080087 */
chengfan373aac52015-08-17 15:36:44 -050088 enum PathState {
cheng fan93258c72015-06-02 23:42:32 +080089 NORMAL, BROKEN
90 }
91
92 /**
93 * Returns the type of a tunnel.
cheng fan48e832c2015-05-29 01:54:47 +080094 *
95 * @return tunnel type
96 */
chengfan373aac52015-08-17 15:36:44 -050097 Type type();
cheng fan48e832c2015-05-29 01:54:47 +080098
99 /**
cheng fan93258c72015-06-02 23:42:32 +0800100 * Returns the name of a tunnel.
cheng fan48e832c2015-05-29 01:54:47 +0800101 *
102 * @return tunnel name
103 */
chengfan373aac52015-08-17 15:36:44 -0500104 String name();
cheng fan48e832c2015-05-29 01:54:47 +0800105
106 /**
cheng fan93258c72015-06-02 23:42:32 +0800107 * Returns the device id of destination endpoint of a tunnel.
cheng fan48e832c2015-05-29 01:54:47 +0800108 *
109 * @return device id
110 */
chengfan373aac52015-08-17 15:36:44 -0500111 PcepDpid srcDeviceID();
cheng fan48e832c2015-05-29 01:54:47 +0800112
113 /**
cheng fan93258c72015-06-02 23:42:32 +0800114 * Returns the device id of source endpoint of a tunnel.
cheng fan48e832c2015-05-29 01:54:47 +0800115 *
116 * @return device id
117 */
chengfan373aac52015-08-17 15:36:44 -0500118 PcepDpid dstDeviceId();
cheng fan48e832c2015-05-29 01:54:47 +0800119
120 /**
cheng fan93258c72015-06-02 23:42:32 +0800121 * Returns source port of a tunnel.
cheng fan48e832c2015-05-29 01:54:47 +0800122 *
123 * @return port number
124 */
chengfan373aac52015-08-17 15:36:44 -0500125 long srcPort();
cheng fan48e832c2015-05-29 01:54:47 +0800126
127 /**
cheng fan93258c72015-06-02 23:42:32 +0800128 * Returns destination port of a tunnel.
cheng fan48e832c2015-05-29 01:54:47 +0800129 *
130 * @return port number
131 */
chengfan373aac52015-08-17 15:36:44 -0500132 long dstPort();
cheng fan48e832c2015-05-29 01:54:47 +0800133
134 /**
cheng fan93258c72015-06-02 23:42:32 +0800135 * Returns the bandwidth of a tunnel.
cheng fan48e832c2015-05-29 01:54:47 +0800136 *
137 * @return bandwidth
138 */
chengfan373aac52015-08-17 15:36:44 -0500139 long bandWidth();
cheng fan48e832c2015-05-29 01:54:47 +0800140
141 /**
cheng fan93258c72015-06-02 23:42:32 +0800142 * Returns the tunnel id.
cheng fan48e832c2015-05-29 01:54:47 +0800143 *
144 * @return id of the PCEP tunnel
145 */
chengfan373aac52015-08-17 15:36:44 -0500146 long id();
cheng fan48e832c2015-05-29 01:54:47 +0800147
148 /**
cheng fan93258c72015-06-02 23:42:32 +0800149 * Returns the detail hop list of a tunnel.
cheng fan48e832c2015-05-29 01:54:47 +0800150 *
151 * @return hop list
152 */
chengfan373aac52015-08-17 15:36:44 -0500153 List<PcepHopNodeDescription> getHopList();
cheng fan48e832c2015-05-29 01:54:47 +0800154
155 /**
cheng fan93258c72015-06-02 23:42:32 +0800156 * Returns the instance of a pcep tunnel,a instance is used to mark the times of
157 * a tunnel created. instance and id identify a tunnel together.
cheng fan48e832c2015-05-29 01:54:47 +0800158 *
159 * @return the instance of a tunnel.
160 */
chengfan373aac52015-08-17 15:36:44 -0500161 int getInstance();
cheng fan48e832c2015-05-29 01:54:47 +0800162
163 /**
cheng fan93258c72015-06-02 23:42:32 +0800164 * Returns the state of a path.
165 *
166 * @return normal or broken
167 */
chengfan373aac52015-08-17 15:36:44 -0500168 PathState getPathState();
cheng fan93258c72015-06-02 23:42:32 +0800169
170 /**
171 * Returns the ability of a tunnel.
cheng fan48e832c2015-05-29 01:54:47 +0800172 *
173 * @return ability of the tunenl
174 */
chengfan373aac52015-08-17 15:36:44 -0500175 Ability getSla();
cheng fan48e832c2015-05-29 01:54:47 +0800176
177 /**
cheng fan93258c72015-06-02 23:42:32 +0800178 * Returns the path type of a path if the tunnel's ability is diamond .
cheng fan48e832c2015-05-29 01:54:47 +0800179 *
180 * @return the type of a path, the preferred or alternate.
181 */
Jonathan Hart51539b82015-10-29 09:53:04 -0700182 PathType getPathType();
cheng fan48e832c2015-05-29 01:54:47 +0800183
184 /**
185 * Get the under lay tunnel id of VLAN tunnel.
186 *
187 * @return the tunnel id of a OCH tunnel under lay of a VLAN tunnel.
188 */
chengfan373aac52015-08-17 15:36:44 -0500189 long underlayTunnelId();
cheng fan48e832c2015-05-29 01:54:47 +0800190
191}