cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | ce2a03d | 2017-08-03 19:21:03 -0700 | [diff] [blame^] | 2 | * Copyright 2015-present Open Networking Foundation |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [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 | |
| 17 | package org.onosproject.pcep.api; |
| 18 | |
| 19 | import java.util.List; |
| 20 | |
| 21 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 22 | * 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 fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 25 | */ |
| 26 | public interface PcepTunnel extends PcepOperator { |
| 27 | |
| 28 | /** |
| 29 | * Describe the type of a tunnel. |
| 30 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 31 | enum Type { |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 32 | |
| 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 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 52 | enum Ability { |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 53 | /** |
| 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 Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 72 | enum PathType { |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 73 | |
| 74 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 75 | * Indicates path is the preferred path. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 76 | */ |
| 77 | FIRST, |
| 78 | |
| 79 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 80 | * Indicates path is the alternate path. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 81 | */ |
| 82 | SECOND |
| 83 | } |
| 84 | |
| 85 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 86 | * Represents state of the path, work normally or broken down. |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 87 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 88 | enum PathState { |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 89 | NORMAL, BROKEN |
| 90 | } |
| 91 | |
| 92 | /** |
| 93 | * Returns the type of a tunnel. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 94 | * |
| 95 | * @return tunnel type |
| 96 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 97 | Type type(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 98 | |
| 99 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 100 | * Returns the name of a tunnel. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 101 | * |
| 102 | * @return tunnel name |
| 103 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 104 | String name(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 105 | |
| 106 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 107 | * Returns the device id of destination endpoint of a tunnel. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 108 | * |
| 109 | * @return device id |
| 110 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 111 | PcepDpid srcDeviceID(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 112 | |
| 113 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 114 | * Returns the device id of source endpoint of a tunnel. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 115 | * |
| 116 | * @return device id |
| 117 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 118 | PcepDpid dstDeviceId(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 119 | |
| 120 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 121 | * Returns source port of a tunnel. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 122 | * |
| 123 | * @return port number |
| 124 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 125 | long srcPort(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 126 | |
| 127 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 128 | * Returns destination port of a tunnel. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 129 | * |
| 130 | * @return port number |
| 131 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 132 | long dstPort(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 133 | |
| 134 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 135 | * Returns the bandwidth of a tunnel. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 136 | * |
| 137 | * @return bandwidth |
| 138 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 139 | long bandWidth(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 140 | |
| 141 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 142 | * Returns the tunnel id. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 143 | * |
| 144 | * @return id of the PCEP tunnel |
| 145 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 146 | long id(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 147 | |
| 148 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 149 | * Returns the detail hop list of a tunnel. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 150 | * |
| 151 | * @return hop list |
| 152 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 153 | List<PcepHopNodeDescription> getHopList(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 154 | |
| 155 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 156 | * 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 fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 158 | * |
| 159 | * @return the instance of a tunnel. |
| 160 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 161 | int getInstance(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 162 | |
| 163 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 164 | * Returns the state of a path. |
| 165 | * |
| 166 | * @return normal or broken |
| 167 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 168 | PathState getPathState(); |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 169 | |
| 170 | /** |
| 171 | * Returns the ability of a tunnel. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 172 | * |
| 173 | * @return ability of the tunenl |
| 174 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 175 | Ability getSla(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 176 | |
| 177 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 178 | * Returns the path type of a path if the tunnel's ability is diamond . |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 179 | * |
| 180 | * @return the type of a path, the preferred or alternate. |
| 181 | */ |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 182 | PathType getPathType(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 183 | |
| 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 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 189 | long underlayTunnelId(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 190 | |
| 191 | } |