blob: bc3d18bb74acae19657f261aa61974134aa50db4 [file] [log] [blame]
wei wei89ddc322015-03-22 16:29:04 -05001/*
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 */
16package org.onosproject.net.tunnel;
17
jcc4a20a5f2015-04-30 15:43:39 +080018import org.onosproject.core.DefaultGroupId;
wei wei89ddc322015-03-22 16:29:04 -050019import org.onosproject.net.Annotated;
20import org.onosproject.net.NetworkResource;
21import org.onosproject.net.Provided;
wei wei89ddc322015-03-22 16:29:04 -050022
23/**
jcc4a20a5f2015-04-30 15:43:39 +080024 * Abstraction of a generalized Tunnel entity (bandwidth pipe) for either L3/L2
25 * networks or L1/L0 networks, representation of e.g., VLAN, GRE tunnel, MPLS
26 * LSP, L1 ODUk connection, WDM OCH, etc.. Each Tunnel is associated with at
27 * least two tunnel end point objects that model the logical ports essentially.
wei wei89ddc322015-03-22 16:29:04 -050028 * Note that it supports nested case.
29 */
wei wei89ddc322015-03-22 16:29:04 -050030public interface Tunnel extends Annotated, Provided, NetworkResource {
31
32 /**
jcc4a20a5f2015-04-30 15:43:39 +080033 * Tunnel technology type.
wei wei89ddc322015-03-22 16:29:04 -050034 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070035 enum Type {
wei wei89ddc322015-03-22 16:29:04 -050036 /**
jcc4a20a5f2015-04-30 15:43:39 +080037 * Signifies that this is a MPLS tunnel.
38 */
39 MPLS,
40 /**
wei wei89ddc322015-03-22 16:29:04 -050041 * Signifies that this is a L2 tunnel.
42 */
43 VLAN,
wei wei89ddc322015-03-22 16:29:04 -050044 /**
45 * Signifies that this is a DC L2 extension tunnel.
46 */
47 VXLAN,
wei wei89ddc322015-03-22 16:29:04 -050048 /**
49 * Signifies that this is a L3 tunnel.
50 */
51 GRE,
wei wei89ddc322015-03-22 16:29:04 -050052 /**
53 * Signifies that this is a L1 OTN tunnel.
54 */
jcc4a20a5f2015-04-30 15:43:39 +080055 ODUK,
wei wei89ddc322015-03-22 16:29:04 -050056 /**
57 * Signifies that this is a L0 OCH tunnel.
58 */
59 OCH
60 }
61
62 /**
63 * Representation of the tunnel state.
wei wei89ddc322015-03-22 16:29:04 -050064 */
jcc4a20a5f2015-04-30 15:43:39 +080065 public enum State {
wei wei89ddc322015-03-22 16:29:04 -050066 /**
67 * Signifies that a tunnel is currently in a initialized state.
68 */
69 INIT,
wei wei89ddc322015-03-22 16:29:04 -050070 /**
71 * Signifies that a tunnel is currently established but no traffic.
72 */
73 ESTABLISHED,
wei wei89ddc322015-03-22 16:29:04 -050074 /**
jcc4a20a5f2015-04-30 15:43:39 +080075 * Signifies that a tunnel is currently active. This state means that
76 * this tunnel is available. It can be borrowed by consumer.
wei wei89ddc322015-03-22 16:29:04 -050077 */
78 ACTIVE,
wei wei89ddc322015-03-22 16:29:04 -050079 /**
80 * Signifies that a tunnel is currently out of service.
81 */
82 FAILED,
wei wei89ddc322015-03-22 16:29:04 -050083 /**
jcc4a20a5f2015-04-30 15:43:39 +080084 * Signifies that a tunnel is currently inactive. This state means that
85 * this tunnel can not be borrowed by consumer.
wei wei89ddc322015-03-22 16:29:04 -050086 */
87 INACTIVE
wei wei89ddc322015-03-22 16:29:04 -050088 }
89
wei wei89ddc322015-03-22 16:29:04 -050090 /**
91 * Returns the tunnel state.
92 *
93 * @return tunnel state
94 */
95 State state();
96
97 /**
jcc4a20a5f2015-04-30 15:43:39 +080098 * the origin of a tunnel.
wei wei89ddc322015-03-22 16:29:04 -050099 *
jcc4a20a5f2015-04-30 15:43:39 +0800100 * @return the origin of a tunnel
wei wei89ddc322015-03-22 16:29:04 -0500101 */
jcc4a20a5f2015-04-30 15:43:39 +0800102 TunnelEndPoint src();
wei wei89ddc322015-03-22 16:29:04 -0500103
104 /**
jcc4a20a5f2015-04-30 15:43:39 +0800105 * the terminal of a tunnel.
wei wei89ddc322015-03-22 16:29:04 -0500106 *
jcc4a20a5f2015-04-30 15:43:39 +0800107 * @return the terminal of a tunnel
wei wei89ddc322015-03-22 16:29:04 -0500108 */
jcc4a20a5f2015-04-30 15:43:39 +0800109 TunnelEndPoint dst();
wei wei89ddc322015-03-22 16:29:04 -0500110
111 /**
jcc4a20a5f2015-04-30 15:43:39 +0800112 * Returns the tunnel type.
wei wei89ddc322015-03-22 16:29:04 -0500113 *
jcc4a20a5f2015-04-30 15:43:39 +0800114 * @return tunnel type
wei wei89ddc322015-03-22 16:29:04 -0500115 */
jcc4a20a5f2015-04-30 15:43:39 +0800116 Type type();
117
118 /**
119 * Returns group flow table id which a tunnel match up.
120 *
121 * @return OpenFlowGroupId
122 */
123 DefaultGroupId groupId();
124
125 /**
126 * Returns tunnel identify generated by ONOS as primary key.
127 *
128 * @return TunnelId
129 */
130 TunnelId tunnelId();
131
132 /**
133 * Return the name of a tunnel.
134 *
135 * @return Tunnel Name
136 */
137 TunnelName tunnelName();
138
139 /**
140 * Network resource backing the tunnel, e.g. lambda, VLAN id, MPLS tag.
141 *
142 * @return backing resource
143 */
144 NetworkResource resource();
145
wei wei89ddc322015-03-22 16:29:04 -0500146}