cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Open Networking Laboratory |
| 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 | */ |
| 31 | public static enum Type { |
| 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 | */ |
| 52 | public static enum Ability { |
| 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 | |
| 72 | public static enum PATHTYPE { |
| 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. |
| 87 | * |
| 88 | */ |
| 89 | public static enum PathState { |
| 90 | NORMAL, BROKEN |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * Returns the type of a tunnel. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 95 | * |
| 96 | * @return tunnel type |
| 97 | */ |
| 98 | public Type type(); |
| 99 | |
| 100 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 101 | * Returns the name of a tunnel. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 102 | * |
| 103 | * @return tunnel name |
| 104 | */ |
| 105 | public String name(); |
| 106 | |
| 107 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 108 | * Returns the device id of destination endpoint of a tunnel. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 109 | * |
| 110 | * @return device id |
| 111 | */ |
| 112 | public PcepDpid srcDeviceID(); |
| 113 | |
| 114 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 115 | * Returns the device id of source endpoint of a tunnel. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 116 | * |
| 117 | * @return device id |
| 118 | */ |
| 119 | public PcepDpid dstDeviceId(); |
| 120 | |
| 121 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 122 | * Returns source port of a tunnel. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 123 | * |
| 124 | * @return port number |
| 125 | */ |
| 126 | public long srcPort(); |
| 127 | |
| 128 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 129 | * Returns destination port of a tunnel. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 130 | * |
| 131 | * @return port number |
| 132 | */ |
| 133 | public long dstPort(); |
| 134 | |
| 135 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 136 | * Returns the bandwidth of a tunnel. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 137 | * |
| 138 | * @return bandwidth |
| 139 | */ |
| 140 | public long bandWidth(); |
| 141 | |
| 142 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 143 | * Returns the tunnel id. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 144 | * |
| 145 | * @return id of the PCEP tunnel |
| 146 | */ |
| 147 | public long id(); |
| 148 | |
| 149 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 150 | * Returns the detail hop list of a tunnel. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 151 | * |
| 152 | * @return hop list |
| 153 | */ |
| 154 | public List<PcepHopNodeDescription> getHopList(); |
| 155 | |
| 156 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 157 | * Returns the instance of a pcep tunnel,a instance is used to mark the times of |
| 158 | * a tunnel created. instance and id identify a tunnel together. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 159 | * |
| 160 | * @return the instance of a tunnel. |
| 161 | */ |
| 162 | public int getInstance(); |
| 163 | |
| 164 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 165 | * Returns the state of a path. |
| 166 | * |
| 167 | * @return normal or broken |
| 168 | */ |
| 169 | public PathState getPathState(); |
| 170 | |
| 171 | /** |
| 172 | * Returns the ability of a tunnel. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 173 | * |
| 174 | * @return ability of the tunenl |
| 175 | */ |
| 176 | public Ability getSla(); |
| 177 | |
| 178 | /** |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 179 | * 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] | 180 | * |
| 181 | * @return the type of a path, the preferred or alternate. |
| 182 | */ |
| 183 | public PATHTYPE getPathType(); |
| 184 | |
| 185 | /** |
| 186 | * Get the under lay tunnel id of VLAN tunnel. |
| 187 | * |
| 188 | * @return the tunnel id of a OCH tunnel under lay of a VLAN tunnel. |
| 189 | */ |
cheng fan | 93258c7 | 2015-06-02 23:42:32 +0800 | [diff] [blame] | 190 | public long underlayTunnelId(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 191 | |
| 192 | } |