blob: 6a044ac8cdc732f77086b7044556e60339eec086 [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
18import org.onosproject.net.Annotated;
19import org.onosproject.net.NetworkResource;
20import org.onosproject.net.Provided;
Sho SHIMIZU63feca72015-05-07 10:44:25 -070021import org.onosproject.net.resource.BandwidthResource;
wei wei89ddc322015-03-22 16:29:04 -050022
23
24/**
25 * Abstraction of a generalized Tunnel entity (bandwidth pipe) for either L3/L2 networks or L1/L0 networks,
26 * representation of e.g., VLAN, GRE tunnel, MPLS LSP, L1 ODUk connection, WDM OCH, etc.. Each Tunnel is
27 * associated with at least two Label objects that model the logical ports essentially.
28 * Note that it supports nested case.
29 */
30
31public interface Tunnel extends Annotated, Provided, NetworkResource {
32
33 /**
34 * Coarse representation of the Tunnel types.
35 */
36 public enum Type {
37 /**
38 * Signifies that this is a L2 tunnel.
39 */
40 VLAN,
41
42 /**
43 * Signifies that this is a DC L2 extension tunnel.
44 */
45 VXLAN,
46
47 /**
48 * Signifies that this is a L3 tunnel.
49 */
50 GRE,
51
52 /**
53 * Signifies that this is a MPLS tunnel.
54 */
55 LSP,
56
57 /**
58 * Signifies that this is a L1 OTN tunnel.
59 */
60 ODUk,
61
62 /**
63 * Signifies that this is a L0 OCH tunnel.
64 */
65 OCH
66 }
67
68 /**
69 * Representation of the tunnel state.
70 *
71 */
72 public enum State {
73
74 /**
75 * Signifies that a tunnel is currently in a initialized state.
76 */
77 INIT,
78
79 /**
80 * Signifies that a tunnel is currently established but no traffic.
81 */
82 ESTABLISHED,
83
84 /**
85 * Signifies that a tunnel is currently serving the traffic.
86 */
87 ACTIVE,
88
89 /**
90 * Signifies that a tunnel is currently out of service.
91 */
92 FAILED,
93
94 /**
95 * Signifies that a tunnel is currently in maintenance state.
96 */
97 INACTIVE
98
99 }
100
101 TunnelId id();
102
103
104 /**
105 * Returns the tunnel source point (source Label object).
106 *
107 * @return source Label object
108 */
109 Label src();
110
111 /**
112 * Returns the tunnel destination point (destination Label object).
113 *
114 * @return destination Label object
115 */
116 Label dst();
117
118 /**
119 * Returns the tunnel type.
120 *
121 * @return tunnel type
122 */
123 Type type();
124
125 /**
126 * Returns the tunnel state.
127 *
128 * @return tunnel state
129 */
130 State state();
131
132 /**
133 * Indicates if the tunnel is to be considered durable.
134 *
135 * @return true if the tunnel is durable
136 */
137 boolean isDurable();
138
139
140 /**
141 * Indicates if the tunnel is to be considered Bidirectional.
142 *
143 * @return true if the tunnel is Bidirectional
144 */
145 boolean isBidirectional();
146
147 /**
148 * Return the tunnel bandwidth.
149 *
150 * @return tunnel bandwidth
151 */
Sho SHIMIZU63feca72015-05-07 10:44:25 -0700152 BandwidthResource bandwidth();
wei wei89ddc322015-03-22 16:29:04 -0500153}
154
155
156
157
158