blob: 8b80b86a04570e3101d690162fd02ab9370ba0e4 [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 */
Thomas Vachuskabf916ea2015-05-20 18:24:34 -070016
17package org.onosproject.incubator.net.tunnel;
wei wei89ddc322015-03-22 16:29:04 -050018
jcc4a20a5f2015-04-30 15:43:39 +080019import org.onosproject.core.DefaultGroupId;
wei wei89ddc322015-03-22 16:29:04 -050020import org.onosproject.net.Annotated;
21import org.onosproject.net.NetworkResource;
22import org.onosproject.net.Provided;
wei wei89ddc322015-03-22 16:29:04 -050023
24/**
jcc4a20a5f2015-04-30 15:43:39 +080025 * Abstraction of a generalized Tunnel entity (bandwidth pipe) for either L3/L2
26 * networks or L1/L0 networks, representation of e.g., VLAN, GRE tunnel, MPLS
27 * LSP, L1 ODUk connection, WDM OCH, etc.. Each Tunnel is associated with at
28 * least two tunnel end point objects that model the logical ports essentially.
wei wei89ddc322015-03-22 16:29:04 -050029 * Note that it supports nested case.
30 */
wei wei89ddc322015-03-22 16:29:04 -050031public interface Tunnel extends Annotated, Provided, NetworkResource {
32
33 /**
jcc4a20a5f2015-04-30 15:43:39 +080034 * Tunnel technology type.
wei wei89ddc322015-03-22 16:29:04 -050035 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070036 enum Type {
wei wei89ddc322015-03-22 16:29:04 -050037 /**
jcc4a20a5f2015-04-30 15:43:39 +080038 * Signifies that this is a MPLS tunnel.
39 */
40 MPLS,
41 /**
wei wei89ddc322015-03-22 16:29:04 -050042 * Signifies that this is a L2 tunnel.
43 */
44 VLAN,
wei wei89ddc322015-03-22 16:29:04 -050045 /**
46 * Signifies that this is a DC L2 extension tunnel.
47 */
48 VXLAN,
wei wei89ddc322015-03-22 16:29:04 -050049 /**
50 * Signifies that this is a L3 tunnel.
51 */
52 GRE,
wei wei89ddc322015-03-22 16:29:04 -050053 /**
54 * Signifies that this is a L1 OTN tunnel.
55 */
jcc4a20a5f2015-04-30 15:43:39 +080056 ODUK,
wei wei89ddc322015-03-22 16:29:04 -050057 /**
58 * Signifies that this is a L0 OCH tunnel.
59 */
60 OCH
61 }
62
63 /**
64 * Representation of the tunnel state.
wei wei89ddc322015-03-22 16:29:04 -050065 */
jcc4a20a5f2015-04-30 15:43:39 +080066 public enum State {
wei wei89ddc322015-03-22 16:29:04 -050067 /**
68 * Signifies that a tunnel is currently in a initialized state.
69 */
70 INIT,
wei wei89ddc322015-03-22 16:29:04 -050071 /**
72 * Signifies that a tunnel is currently established but no traffic.
73 */
74 ESTABLISHED,
wei wei89ddc322015-03-22 16:29:04 -050075 /**
jcc4a20a5f2015-04-30 15:43:39 +080076 * Signifies that a tunnel is currently active. This state means that
77 * this tunnel is available. It can be borrowed by consumer.
wei wei89ddc322015-03-22 16:29:04 -050078 */
79 ACTIVE,
wei wei89ddc322015-03-22 16:29:04 -050080 /**
81 * Signifies that a tunnel is currently out of service.
82 */
83 FAILED,
wei wei89ddc322015-03-22 16:29:04 -050084 /**
jcc4a20a5f2015-04-30 15:43:39 +080085 * Signifies that a tunnel is currently inactive. This state means that
86 * this tunnel can not be borrowed by consumer.
wei wei89ddc322015-03-22 16:29:04 -050087 */
88 INACTIVE
wei wei89ddc322015-03-22 16:29:04 -050089 }
90
wei wei89ddc322015-03-22 16:29:04 -050091 /**
92 * Returns the tunnel state.
93 *
94 * @return tunnel state
95 */
96 State state();
97
98 /**
jcc4a20a5f2015-04-30 15:43:39 +080099 * the origin of a tunnel.
wei wei89ddc322015-03-22 16:29:04 -0500100 *
jcc4a20a5f2015-04-30 15:43:39 +0800101 * @return the origin of a tunnel
wei wei89ddc322015-03-22 16:29:04 -0500102 */
jcc4a20a5f2015-04-30 15:43:39 +0800103 TunnelEndPoint src();
wei wei89ddc322015-03-22 16:29:04 -0500104
105 /**
jcc4a20a5f2015-04-30 15:43:39 +0800106 * the terminal of a tunnel.
wei wei89ddc322015-03-22 16:29:04 -0500107 *
jcc4a20a5f2015-04-30 15:43:39 +0800108 * @return the terminal of a tunnel
wei wei89ddc322015-03-22 16:29:04 -0500109 */
jcc4a20a5f2015-04-30 15:43:39 +0800110 TunnelEndPoint dst();
wei wei89ddc322015-03-22 16:29:04 -0500111
112 /**
jcc4a20a5f2015-04-30 15:43:39 +0800113 * Returns the tunnel type.
wei wei89ddc322015-03-22 16:29:04 -0500114 *
jcc4a20a5f2015-04-30 15:43:39 +0800115 * @return tunnel type
wei wei89ddc322015-03-22 16:29:04 -0500116 */
jcc4a20a5f2015-04-30 15:43:39 +0800117 Type type();
118
119 /**
120 * Returns group flow table id which a tunnel match up.
121 *
122 * @return OpenFlowGroupId
123 */
124 DefaultGroupId groupId();
125
126 /**
127 * Returns tunnel identify generated by ONOS as primary key.
128 *
129 * @return TunnelId
130 */
131 TunnelId tunnelId();
132
133 /**
134 * Return the name of a tunnel.
135 *
136 * @return Tunnel Name
137 */
138 TunnelName tunnelName();
139
140 /**
141 * Network resource backing the tunnel, e.g. lambda, VLAN id, MPLS tag.
142 *
143 * @return backing resource
144 */
145 NetworkResource resource();
146
wei wei89ddc322015-03-22 16:29:04 -0500147}