Moved Tunnel subsystem to ONOS core incubator area.

Change-Id: I03f90b068013fbf0490af5277b33459ccc0514ec
diff --git a/incubator/api/pom.xml b/incubator/api/pom.xml
index 1a0e8ef..df4b52c 100644
--- a/incubator/api/pom.xml
+++ b/incubator/api/pom.xml
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
 <!--
   ~ Copyright 2015 Open Networking Laboratory
   ~
@@ -14,6 +15,7 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License.
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/DefaultOpticalTunnelEndPoint.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/DefaultOpticalTunnelEndPoint.java
new file mode 100644
index 0000000..c6e4119
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/DefaultOpticalTunnelEndPoint.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.incubator.net.tunnel;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+import java.util.Objects;
+import java.util.Optional;
+
+import org.onosproject.net.AbstractModel;
+import org.onosproject.net.Annotations;
+import org.onosproject.net.ElementId;
+import org.onosproject.net.PortNumber;
+import org.onosproject.net.provider.ProviderId;
+
+/**
+ * Default optical tunnel point model implementation.
+ */
+public class DefaultOpticalTunnelEndPoint extends AbstractModel implements OpticalTunnelEndPoint {
+    private final Optional<ElementId> elementId;
+    private final Optional<PortNumber> portNumber;
+    private final Optional<OpticalTunnelEndPoint> parentPoint;
+    private final Type type;
+    private final OpticalLogicId id;
+    private final boolean isGlobal;
+
+    /**
+     * Creates a optical tunnel point attributed to the specified provider (may be null).
+     * if provider is null, which means the optical tunnel point is not managed by the SB.
+     *
+     * @param providerId  tunnelProvider Id
+     * @param elementId   parent network element
+     * @param number      port number
+     * @param parentPoint parent port or parent label
+     * @param type        port type
+     * @param id          LabelId
+     * @param isGlobal    indicator whether the label is global significant or not
+     * @param annotations optional key/value annotations
+     */
+    public DefaultOpticalTunnelEndPoint(ProviderId providerId, Optional<ElementId> elementId,
+                        Optional<PortNumber> number, Optional<OpticalTunnelEndPoint> parentPoint,
+                        Type type, OpticalLogicId id, boolean isGlobal, Annotations... annotations) {
+        super(providerId, annotations);
+        checkNotNull(type, "type cannot be null");
+        checkNotNull(id, "id cannot be null");
+        checkNotNull(isGlobal, "isGlobal cannot be null");
+        this.elementId = elementId;
+        this.portNumber = number;
+        this.parentPoint = parentPoint;
+        this.id = id;
+        this.type = type;
+        this.isGlobal = isGlobal;
+    }
+
+    @Override
+    public OpticalLogicId id() {
+        return id;
+    }
+
+    @Override
+    public Optional<ElementId> elementId() {
+        return elementId;
+    }
+
+    @Override
+    public Optional<PortNumber> portNumber() {
+        return portNumber;
+    }
+
+    @Override
+    public Optional<OpticalTunnelEndPoint> parentPoint() {
+        return parentPoint;
+    }
+
+    @Override
+    public boolean isGlobal() {
+        return isGlobal;
+    }
+
+    @Override
+    public Type type() {
+        return type;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(elementId, portNumber, parentPoint, id);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof DefaultOpticalTunnelEndPoint) {
+            final DefaultOpticalTunnelEndPoint other = (DefaultOpticalTunnelEndPoint) obj;
+            return Objects.equals(this.id, other.id) &&
+                   Objects.equals(this.type, other.type) &&
+                   Objects.equals(this.isGlobal, other.isGlobal) &&
+                   Objects.equals(this.elementId, other.elementId) &&
+                   Objects.equals(this.portNumber, other.portNumber) &&
+                   Objects.equals(this.parentPoint, other.parentPoint);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return toStringHelper(this)
+                .add("elementId", elementId)
+                .add("portNumber", portNumber)
+                .add("parentPoint", parentPoint)
+                .add("type", type)
+                .add("id", id)
+                .add("isGlobal", isGlobal)
+                .toString();
+    }
+
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/DefaultTunnel.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/DefaultTunnel.java
new file mode 100644
index 0000000..62a5dcb
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/DefaultTunnel.java
@@ -0,0 +1,171 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+import java.util.Objects;
+
+import org.onosproject.core.DefaultGroupId;
+import org.onosproject.net.AbstractModel;
+import org.onosproject.net.Annotations;
+import org.onosproject.net.NetworkResource;
+import org.onosproject.net.provider.ProviderId;
+
+/**
+ * The default implementation of an network tunnel. supports for creating a
+ * tunnel by connect point ,IP address, MAC address, device and so on.
+ */
+public final class DefaultTunnel extends AbstractModel implements Tunnel {
+
+    private final TunnelEndPoint src; // a source point of tunnel.
+    private final TunnelEndPoint dst; // a destination point of tunnel.
+    private final State state;
+    private final Type type; // tunnel type
+    private final DefaultGroupId groupId; // represent for a group flow table
+    // which a tunnel match up
+    // tunnel producer
+    private final TunnelId tunnelId; // tunnel identify generated by
+                                     // ONOS as primary key
+    private final TunnelName tunnelName; // name of a tunnel
+
+    /**
+     * Creates an active infrastructure tunnel using the supplied information.
+     *
+     * @param producerName provider identity
+     * @param src tunnel source
+     * @param dst tunnel destination
+     * @param type tunnel type
+     * @param groupId groupId
+     * @param tunnelId tunnelId
+     * @param tunnelName tunnel name
+     * @param annotations optional key/value annotations
+     */
+    public DefaultTunnel(ProviderId producerName, TunnelEndPoint src,
+                         TunnelEndPoint dst, Type type, DefaultGroupId groupId,
+                         TunnelId tunnelId, TunnelName tunnelName,
+                         Annotations... annotations) {
+        this(producerName, src, dst, type, Tunnel.State.ACTIVE, groupId,
+             tunnelId, tunnelName, annotations);
+    }
+
+    /**
+     * Creates an tunnel using the supplied information.
+     *
+     * @param producerName provider identity
+     * @param src tunnel source
+     * @param dst tunnel destination
+     * @param type tunnel type
+     * @param state tunnel state
+     * @param groupId groupId
+     * @param tunnelId tunnelId
+     * @param tunnelName tunnel name
+     * @param annotations optional key/value annotations
+     */
+    public DefaultTunnel(ProviderId producerName, TunnelEndPoint src,
+                         TunnelEndPoint dst, Type type, State state,
+                         DefaultGroupId groupId, TunnelId tunnelId,
+                         TunnelName tunnelName, Annotations... annotations) {
+        super(producerName, annotations);
+        checkNotNull(producerName, "producerName cannot be null");
+        checkNotNull(src, "src cannot be null");
+        checkNotNull(dst, "dst cannot be null");
+        checkNotNull(type, "type cannot be null");
+        checkNotNull(state, "state cannot be null");
+        this.src = src;
+        this.dst = dst;
+        this.type = type;
+        this.state = state;
+        this.groupId = groupId;
+        this.tunnelId = tunnelId;
+        this.tunnelName = tunnelName;
+    }
+
+    @Override
+    public TunnelEndPoint src() {
+        return src;
+    }
+
+    @Override
+    public TunnelEndPoint dst() {
+        return dst;
+    }
+
+    @Override
+    public Type type() {
+        return type;
+    }
+
+    @Override
+    public State state() {
+        return state;
+    }
+
+    @Override
+    public NetworkResource resource() {
+        return null;
+    }
+
+    @Override
+    public TunnelId tunnelId() {
+        return tunnelId;
+    }
+
+    @Override
+    public DefaultGroupId groupId() {
+        return groupId;
+    }
+
+    @Override
+    public TunnelName tunnelName() {
+        return tunnelName;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(src, dst, type, groupId, tunnelId, tunnelName,
+                            state);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof DefaultTunnel) {
+            final DefaultTunnel other = (DefaultTunnel) obj;
+            return Objects.equals(this.src, other.src)
+                    && Objects.equals(this.dst, other.dst)
+                    && Objects.equals(this.type, other.type)
+                    && Objects.equals(this.groupId, other.groupId)
+                    && Objects.equals(this.tunnelId, other.tunnelId)
+                    && Objects.equals(this.tunnelName, other.tunnelName)
+                    && Objects.equals(this.state, other.state);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return toStringHelper(this).add("src", src).add("dst", dst)
+                .add("type", type).add("state", state).add("groupId", groupId)
+                .add("producerTunnelId", tunnelId)
+                .add("tunnelName", tunnelName).toString();
+    }
+
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/DefaultTunnelDescription.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/DefaultTunnelDescription.java
new file mode 100644
index 0000000..e4c4d89
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/DefaultTunnelDescription.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import org.onosproject.core.DefaultGroupId;
+import org.onosproject.net.AbstractDescription;
+import org.onosproject.net.SparseAnnotations;
+import org.onosproject.net.provider.ProviderId;
+
+import com.google.common.base.MoreObjects;
+
+/**
+ * Default implementation of immutable tunnel description entity.
+ */
+public class DefaultTunnelDescription extends AbstractDescription
+        implements TunnelDescription {
+
+    private final TunnelId tunnelId;
+    private final TunnelEndPoint src;
+    private final TunnelEndPoint dst;
+    private final Tunnel.Type type;
+    private final DefaultGroupId groupId; // represent for a group flow table
+    // which a tunnel match up
+    // tunnel producer
+    private final ProviderId producerName; // tunnel producer name
+    private final TunnelName tunnelName; // name of a tunnel
+
+    /**
+     * Creates a tunnel description using the supplied information.
+     *
+     * @param id TunnelId
+     * @param src TunnelPoint source
+     * @param dst TunnelPoint destination
+     * @param type tunnel type
+     * @param groupId groupId
+     * @param producerName tunnel producer
+     * @param tunnelName tunnel name
+     * @param annotations optional key/value annotations
+     */
+    public DefaultTunnelDescription(TunnelId id, TunnelEndPoint src,
+                                    TunnelEndPoint dst, Tunnel.Type type,
+                                    DefaultGroupId groupId,
+                                    ProviderId producerName,
+                                    TunnelName tunnelName,
+                                    SparseAnnotations... annotations) {
+        super(annotations);
+        checkNotNull(producerName, "producerName cannot be null");
+        checkNotNull(src, "src cannot be null");
+        checkNotNull(dst, "dst cannot be null");
+        checkNotNull(type, "type cannot be null");
+        this.tunnelId = id;
+        this.src = src;
+        this.dst = dst;
+        this.type = type;
+        this.groupId = groupId;
+        this.producerName = producerName;
+        this.tunnelName = tunnelName;
+    }
+
+    @Override
+    public TunnelId id() {
+        return tunnelId;
+    }
+
+    @Override
+    public TunnelEndPoint src() {
+        return src;
+    }
+
+    @Override
+    public TunnelEndPoint dst() {
+        return dst;
+    }
+
+    @Override
+    public Tunnel.Type type() {
+        return type;
+    }
+
+    @Override
+    public DefaultGroupId groupId() {
+        return groupId;
+    }
+
+    @Override
+    public ProviderId producerName() {
+        return producerName;
+    }
+
+    @Override
+    public TunnelName tunnelName() {
+        return tunnelName;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("tunnelId", id())
+                .add("src", src())
+                .add("dst", dst())
+                .add("type", type())
+                .add("tunnelName", tunnelName())
+                .add("producerName", producerName())
+                .add("groupId", groupId())
+                .toString();
+    }
+
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/IpTunnelEndPoint.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/IpTunnelEndPoint.java
new file mode 100644
index 0000000..a9278fc
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/IpTunnelEndPoint.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import java.util.Objects;
+
+import org.onlab.packet.IpAddress;
+
+import com.google.common.base.MoreObjects;
+/**
+ * Represent for a tunnel point using ip address.
+ */
+public final class IpTunnelEndPoint implements TunnelEndPoint {
+
+    private final IpAddress ip;
+
+    /**
+     * Public construction is prohibited.
+     * @param ip ip address
+     */
+    private IpTunnelEndPoint(IpAddress ip) {
+        this.ip = ip;
+    }
+
+    /**
+     * Create a IP tunnel end point.
+     * @param ip IP address
+     * @return IpTunnelEndPoint
+     */
+    public static IpTunnelEndPoint ipTunnelPoint(IpAddress ip) {
+        return new IpTunnelEndPoint(ip);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(ip);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof IpTunnelEndPoint) {
+            final IpTunnelEndPoint other = (IpTunnelEndPoint) obj;
+            return Objects.equals(this.ip, other.ip);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(getClass()).add("ip", ip).toString();
+    }
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/OpticalLogicId.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/OpticalLogicId.java
new file mode 100644
index 0000000..fee5542
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/OpticalLogicId.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import java.util.Objects;
+import com.google.common.primitives.UnsignedLongs;
+
+/**
+ * Representation of a label Id, a logical port identifier.
+ */
+public final class OpticalLogicId {
+        /**
+         * Represents a logical Id.
+        */
+        private final long logicId;
+
+        /**
+         * Constructor, public creation is prohibited.
+         */
+        private OpticalLogicId(long id) {
+            this.logicId = id;
+        }
+
+        /**
+         * Returns the LabelId representing the specified long value.
+         *
+         * @param id identifier as long value
+         * @return LabelId
+         */
+        public static OpticalLogicId logicId(long id) {
+            return new OpticalLogicId(id);
+        }
+
+        public static OpticalLogicId logicId(String string) {
+            return new OpticalLogicId(UnsignedLongs.decode(string));
+        }
+
+        public long toLong() {
+            return logicId;
+        }
+
+        @Override
+        public String toString() {
+            return UnsignedLongs.toString(logicId);
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(logicId);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj instanceof OpticalLogicId) {
+                final OpticalLogicId other = (OpticalLogicId) obj;
+                return this.logicId == other.logicId;
+            }
+            return false;
+        }
+
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/OpticalTunnelEndPoint.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/OpticalTunnelEndPoint.java
new file mode 100644
index 0000000..7f0ab4b
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/OpticalTunnelEndPoint.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import java.util.Optional;
+
+import org.onosproject.net.Annotated;
+import org.onosproject.net.ElementId;
+import org.onosproject.net.NetworkResource;
+import org.onosproject.net.PortNumber;
+import org.onosproject.net.Provided;
+
+/**
+ * Generic representation of a logical port entity in a consistent way,
+ * it is used to identify e.g., ODUk timeSlot, WDM lambda, etc.
+ * It supports nested case.
+ */
+public interface OpticalTunnelEndPoint extends TunnelEndPoint, Annotated, Provided, NetworkResource {
+
+    /** Represents coarse tunnel point type classification. */
+    public enum Type {
+        /**
+         * Signifies optical data unit-based tunnel point.
+         */
+        TIMESLOT,
+
+        /**
+         * Signifies optical wavelength-based tunnel point.
+         */
+        LAMBDA
+    }
+
+    /**
+     * Returns the identifier.
+     *
+     * @return identifier
+     */
+    OpticalLogicId id();
+
+    /**
+     * Returns the parent network element to which this tunnel point belongs.
+     *
+     * @return parent network element
+     */
+    Optional<ElementId> elementId();
+
+    /**
+     * Returns the parent network port to which this tunnel point belongs, can not be be null.
+     *
+     * @return port number
+     */
+    Optional<PortNumber> portNumber();
+
+    /**
+     * Returns the parent tunnel point to which this tunnel point belongs, optional.
+     *
+     * @return parent tunnel point, if it is null, the parent is a physical port
+     */
+    Optional<OpticalTunnelEndPoint> parentPoint();
+
+    /**
+     * Indicates whether or not the port is global significant.
+     *
+     * @return true if the port is global significant
+     */
+    boolean isGlobal();
+
+    /**
+     * Returns the tunnel point type.
+     *
+     * @return tunnel point type
+     */
+    Type type();
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/Tunnel.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/Tunnel.java
new file mode 100644
index 0000000..8b80b86
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/Tunnel.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import org.onosproject.core.DefaultGroupId;
+import org.onosproject.net.Annotated;
+import org.onosproject.net.NetworkResource;
+import org.onosproject.net.Provided;
+
+/**
+ * Abstraction of a generalized Tunnel entity (bandwidth pipe) for either L3/L2
+ * networks or L1/L0 networks, representation of e.g., VLAN, GRE tunnel, MPLS
+ * LSP, L1 ODUk connection, WDM OCH, etc.. Each Tunnel is associated with at
+ * least two tunnel end point objects that model the logical ports essentially.
+ * Note that it supports nested case.
+ */
+public interface Tunnel extends Annotated, Provided, NetworkResource {
+
+    /**
+     * Tunnel technology type.
+     */
+    enum Type {
+        /**
+         * Signifies that this is a MPLS tunnel.
+         */
+        MPLS,
+        /**
+         * Signifies that this is a L2 tunnel.
+         */
+        VLAN,
+        /**
+         * Signifies that this is a DC L2 extension tunnel.
+         */
+        VXLAN,
+        /**
+         * Signifies that this is a L3 tunnel.
+         */
+        GRE,
+        /**
+         * Signifies that this is a L1 OTN tunnel.
+         */
+        ODUK,
+        /**
+         * Signifies that this is a L0 OCH tunnel.
+         */
+        OCH
+    }
+
+    /**
+     * Representation of the tunnel state.
+     */
+    public enum State {
+        /**
+         * Signifies that a tunnel is currently in a initialized state.
+         */
+        INIT,
+        /**
+         * Signifies that a tunnel is currently established but no traffic.
+         */
+        ESTABLISHED,
+        /**
+         * Signifies that a tunnel is currently active. This state means that
+         * this tunnel is available. It can be borrowed by consumer.
+         */
+        ACTIVE,
+        /**
+         * Signifies that a tunnel is currently out of service.
+         */
+        FAILED,
+        /**
+         * Signifies that a tunnel is currently inactive. This state means that
+         * this tunnel can not be borrowed by consumer.
+         */
+        INACTIVE
+    }
+
+    /**
+     * Returns the tunnel state.
+     *
+     * @return tunnel state
+     */
+    State state();
+
+    /**
+     * the origin of a tunnel.
+     *
+     * @return the origin of a tunnel
+     */
+    TunnelEndPoint src();
+
+    /**
+     * the terminal of a tunnel.
+     *
+     * @return the terminal of a tunnel
+     */
+    TunnelEndPoint dst();
+
+    /**
+     * Returns the tunnel type.
+     *
+     * @return tunnel type
+     */
+    Type type();
+
+    /**
+     * Returns group flow table id which a tunnel match up.
+     *
+     * @return OpenFlowGroupId
+     */
+    DefaultGroupId groupId();
+
+    /**
+     * Returns tunnel identify generated by ONOS as primary key.
+     *
+     * @return TunnelId
+     */
+    TunnelId tunnelId();
+
+    /**
+     * Return the name of a tunnel.
+     *
+     * @return Tunnel Name
+     */
+    TunnelName tunnelName();
+
+    /**
+     * Network resource backing the tunnel, e.g. lambda, VLAN id, MPLS tag.
+     *
+     * @return backing resource
+     */
+    NetworkResource resource();
+
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelAdminService.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelAdminService.java
new file mode 100644
index 0000000..3c6cf3f
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelAdminService.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import org.onosproject.net.Path;
+import org.onosproject.net.provider.ProviderId;
+
+/**
+ * Service for administering the inventory of provisioned tunnels.
+ */
+public interface TunnelAdminService {
+
+    /**
+     * Removes the provisioned tunnel.
+     *
+     * @param tunnelId tunnel ID
+     */
+    void removeTunnel(TunnelId tunnelId);
+
+    /**
+     * Removes the provisioned tunnel leading to and from the
+     * specified labels.
+     *
+     * @param src source label
+     * @param dst destination label
+     * @param producerName producer name
+     */
+    void removeTunnels(TunnelEndPoint src, TunnelEndPoint dst, ProviderId producerName);
+
+    /**
+     * Removes all provisioned tunnels leading to and from the
+     * specified connection point.
+     *
+     * @param src source connection point
+     * @param dst destination connection point
+     * @param type tunnel type
+     * @param producerName producer name
+     */
+    void removeTunnels(TunnelEndPoint src, TunnelEndPoint dst, Tunnel.Type type, ProviderId producerName);
+
+    /**
+     * Invokes the core to update a tunnel based on specified tunnel parameters.
+     *
+     * @param tunnel Tunnel
+     * @param path explicit route (path changed) or null (path not changed) for the tunnel
+     */
+    void updateTunnel(Tunnel tunnel, Path path);
+
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelDescription.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelDescription.java
new file mode 100644
index 0000000..eca8fdd
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelDescription.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import org.onosproject.core.DefaultGroupId;
+import org.onosproject.net.Annotated;
+import org.onosproject.net.Description;
+import org.onosproject.net.provider.ProviderId;
+import org.onosproject.incubator.net.tunnel.Tunnel.Type;
+
+/**
+ * Describes a tunnel.
+ */
+public interface TunnelDescription extends Description, Annotated {
+
+    /**
+     * Returns the tunnel id.
+     *
+     * @return tunnelId
+     */
+    TunnelId id();
+
+    /**
+     * Returns the connection point source.
+     *
+     * @return tunnel source ConnectionPoint
+     */
+    TunnelEndPoint src();
+
+    /**
+     * Returns the connection point destination.
+     *
+     * @return tunnel destination
+     */
+    TunnelEndPoint dst();
+
+    /**
+     * Returns the tunnel type.
+     *
+     * @return tunnel type
+     */
+    Type type();
+
+    /**
+     * Returns group flow table id which a tunnel match up.
+     *
+     * @return OpenFlowGroupId
+     */
+    DefaultGroupId groupId();
+
+    /**
+     * Returns tunnel producer name.
+     *
+     * @return producer name
+     */
+    ProviderId producerName();
+
+    /**
+     * Return the name of a tunnel.
+     *
+     * @return Tunnel Name
+     */
+    TunnelName tunnelName();
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelEndPoint.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelEndPoint.java
new file mode 100644
index 0000000..3265a4e
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelEndPoint.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+/**
+ * Represents for source end point or destination end point of a tunnel. Maybe a tunnel
+ * based on ConnectPoint, IpAddress, MacAddress and so on is built.
+ */
+public interface TunnelEndPoint {
+
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelEvent.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelEvent.java
new file mode 100644
index 0000000..16c5ec3
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelEvent.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import org.onosproject.event.AbstractEvent;
+
+/**
+ * Describes tunnel events.
+ */
+public final class TunnelEvent extends AbstractEvent<TunnelEvent.Type, Tunnel> {
+
+    /**
+     * Type of tunnel events.
+     */
+    public enum Type {
+        /**
+         * Signifies that a new tunnel has been added.
+         */
+        TUNNEL_ADDED,
+
+        /**
+         * Signifies that a tunnel has been updated or changed state.
+         */
+        TUNNEL_UPDATED,
+
+        /**
+         * Signifies that a tunnel has been removed.
+         */
+        TUNNEL_REMOVED
+    }
+
+    /**
+     * Creates an event of a given type and for the specified tunnel.
+     *
+     * @param type tunnel event type
+     * @param tunnel event tunnel subject
+     */
+    public TunnelEvent(Type type, Tunnel tunnel) {
+        super(type, tunnel);
+    }
+
+    /**
+     * Creates an event of a given type and for the specified link and
+     * the current time.
+     *
+     * @param type tunnel event type
+     * @param tunnel event tunnel subject
+     * @param time occurrence time
+     */
+    public TunnelEvent(Type type, Tunnel tunnel, long time) {
+        super(type, tunnel, time);
+    }
+
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelId.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelId.java
new file mode 100644
index 0000000..b596700
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelId.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import static com.google.common.base.Preconditions.checkArgument;
+
+/**
+ * Representation of a Tunnel Id.
+ */
+public final class TunnelId {
+    private final long value;
+
+    /**
+     * Creates an tunnel identifier from the specified tunnel.
+     *
+     * @param value long value
+     * @return tunnel identifier
+     */
+    public static TunnelId valueOf(long value) {
+        return new TunnelId(value);
+    }
+
+    public static TunnelId valueOf(String value) {
+        checkArgument(value.startsWith("0x"));
+         return new TunnelId(Long.parseLong(value.substring("0x".length()), 16));
+    }
+
+    /**
+     * Constructor for serializer.
+     */
+    TunnelId() {
+        this.value = 0;
+    }
+
+    /**
+     * Constructs the ID corresponding to a given long value.
+     *
+     * @param value the underlying value of this ID
+     */
+    TunnelId(long value) {
+        this.value = value;
+    }
+
+    /**
+     * Returns the backing value.
+     *
+     * @return the value
+     */
+    public long id() {
+        return value;
+    }
+
+    @Override
+    public int hashCode() {
+        return Long.hashCode(value);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        }
+        if (!(obj instanceof TunnelId)) {
+            return false;
+        }
+        TunnelId that = (TunnelId) obj;
+        return this.value == that.value;
+    }
+
+    @Override
+    public String toString() {
+        return "0x" + Long.toHexString(value);
+    }
+
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelListener.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelListener.java
new file mode 100644
index 0000000..41011be
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelListener.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import org.onosproject.event.EventListener;
+
+/**
+ * Entity capable of receiving tunnel related events.
+ */
+public interface TunnelListener extends EventListener<TunnelEvent> {
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelName.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelName.java
new file mode 100644
index 0000000..7e32137
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelName.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import java.util.Objects;
+
+/**
+ * Represents for a unique tunnel name. TunnelId is generated by ONOS while
+ * TunnelName is given by producer. The consumer can borrow tunnels with
+ * TunnelId or TunnelName.
+ */
+public final class TunnelName {
+    private final String str;
+
+    // Default constructor for serialization
+    private TunnelName(String tunnelName) {
+        this.str = tunnelName;
+    }
+
+
+    /**
+     * Creates a tunnel name using the supplied URI string.
+     *
+     * @param tunnelName tunnel name string
+     * @return tunnel name object
+     */
+    public static TunnelName tunnelName(String tunnelName) {
+        return new TunnelName(tunnelName);
+    }
+
+    /**
+     * The string of tunnel name.
+     *
+     * @return the string of tunnel name
+     */
+    public String value() {
+        return str;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(str);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof TunnelName) {
+            final TunnelName that = (TunnelName) obj;
+            return this.getClass() == that.getClass()
+                    && Objects.equals(this.str, that.str);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return str;
+    }
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelProvider.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelProvider.java
new file mode 100644
index 0000000..f01bb61
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelProvider.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import org.onosproject.net.ElementId;
+import org.onosproject.net.Path;
+import org.onosproject.net.provider.Provider;
+
+/**
+ * Abstraction of an entity providing tunnel setup/release services to the core.
+ */
+public interface TunnelProvider extends Provider {
+
+    /**
+     * Instructs the provider to setup a tunnel. It's used by consumers.
+     *
+     * @param tunnel Tunnel
+     * @param path explicit route or null for the tunnel
+     */
+    void setupTunnel(Tunnel tunnel, Path path);
+
+    /**
+     * Instructs the provider to setup a tunnel given the respective device.
+     * It's used by consumers.
+     *
+     * @param srcElement device
+     * @param tunnel Tunnel
+     * @param path explicit route (not null) for the tunnel
+     */
+    void setupTunnel(ElementId srcElement, Tunnel tunnel, Path path);
+
+    /**
+     * Instructs the provider to release a tunnel. It's used by consumers.
+     *
+     * @param tunnel Tunnel
+     */
+    void releaseTunnel(Tunnel tunnel);
+
+    /**
+     * Instructs the provider to release a tunnel given the respective device.
+     * It's used by consumers.
+     *
+     * @param srcElement device
+     * @param tunnel Tunnel
+     */
+    void releaseTunnel(ElementId srcElement, Tunnel tunnel);
+
+    /**
+     * Instructs the provider to update a tunnel. It's used by consumers. Maybe
+     * some consumers enable to update a tunnel.
+     *
+     * @param tunnel Tunnel
+     * @param path explicit route (path changed) or null (path not changed) for
+     *            the tunnel
+     */
+    void updateTunnel(Tunnel tunnel, Path path);
+
+    /**
+     * Instructs the provider to update a tunnel given the respective device.
+     * It's used by consumers. Maybe some consumers enable to update a tunnel.
+     *
+     * @param srcElement device
+     * @param tunnel Tunnel
+     * @param path explicit route (path changed) or null (path not changed) for
+     *            the tunnel
+     */
+    void updateTunnel(ElementId srcElement, Tunnel tunnel, Path path);
+
+    /**
+     * Signals that the provider has added a tunnel. It's used by producers.
+     *
+     * @param tunnel tunnel information
+     * @return tunnel identity
+     */
+    TunnelId tunnelAdded(TunnelDescription tunnel);
+
+    /**
+     * Signals that the provider has removed a tunnel. It's used by producers.
+     *
+     * @param tunnel tunnel information
+     */
+    void tunnelRemoved(TunnelDescription tunnel);
+
+    /**
+     * Signals that the a tunnel was changed (e.g., sensing changes of
+     * tunnel).It's used by producers.
+     *
+     * @param tunnel tunnel information
+     */
+    void tunnelUpdated(TunnelDescription tunnel);
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelProviderRegistry.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelProviderRegistry.java
new file mode 100644
index 0000000..33ff21c
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelProviderRegistry.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import org.onosproject.net.provider.ProviderRegistry;
+
+/**
+ * Abstraction of an tunnel provider registry.
+ */
+public interface TunnelProviderRegistry
+        extends ProviderRegistry<TunnelProvider, TunnelProviderService> {
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelProviderService.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelProviderService.java
new file mode 100644
index 0000000..9049299
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelProviderService.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import org.onosproject.net.provider.ProviderService;
+
+/**
+ * APIs for tunnel provider to notify the tunnel subSystem.
+ */
+public interface TunnelProviderService extends ProviderService<TunnelProvider> {
+
+    /**
+     * Signals that the provider has added a tunnel.
+     *
+     * @param tunnel tunnel information
+     * @return tunnel identity
+     */
+    TunnelId tunnelAdded(TunnelDescription tunnel);
+
+    /**
+     * Signals that the provider has removed a tunnel.
+     *
+     * @param tunnel tunnel information
+     */
+    void tunnelRemoved(TunnelDescription tunnel);
+
+    /**
+     * Signals that the a tunnel was changed (e.g., sensing changes of tunnel).
+     *
+     * @param tunnel tunnel information
+     */
+    void tunnelUpdated(TunnelDescription tunnel);
+
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelService.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelService.java
new file mode 100644
index 0000000..f2611fa
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelService.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import java.util.Collection;
+
+import org.onosproject.core.ApplicationId;
+import org.onosproject.net.Annotations;
+
+/**
+ * Service for interacting with the inventory of tunnels.
+ */
+public interface TunnelService {
+
+    /**
+     * Borrows a specific tunnel. Annotations parameter is reserved.If there
+     * is no tunnel in the store, returns a "null" object, and record the tunnel subscription.
+     * Where tunnel is created, ONOS notifies this consumer actively.
+     *
+     * @param consumerId a tunnel consumer
+     * @param tunnelId tunnel identify generated by onos
+     * @param annotations Annotations
+     * @return Tunnel subscribed tunnel
+     */
+    Tunnel borrowTunnel(ApplicationId consumerId, TunnelId tunnelId,
+                           Annotations... annotations);
+
+    /**
+     * Borrows a specific tunnel by tunnelName. Annotations parameter is reserved.If there
+     * is no tunnel in the store, return a "null" object, and record the tunnel subscription.
+     * Where tunnel is created, ONOS notifies this consumer actively.
+     *
+     * @param consumerId a tunnel consumer
+     * @param tunnelName tunnel name
+     * @param annotations Annotations
+     * @return collection of subscribed Tunnels
+     */
+    Collection<Tunnel> borrowTunnel(ApplicationId consumerId, TunnelName tunnelName,
+                           Annotations... annotations);
+
+    /**
+     * Borrows all tunnels between source and destination. Annotations
+     * parameter is reserved.If there is no any tunnel in the store, return a
+     * empty collection,and record the tunnel subscription. Where tunnel is created, ONOS
+     * notifies this consumer actively. Otherwise ONOS core returns all the
+     * tunnels, consumer determined which one to use.
+     *
+     * @param consumerId a tunnel consumer
+     * @param src a source point of tunnel.
+     * @param dst a destination point of tunnel
+     * @param annotations Annotations
+     * @return collection of subscribed Tunnels
+     */
+    Collection<Tunnel> borrowTunnel(ApplicationId consumerId, TunnelEndPoint src,
+                                       TunnelEndPoint dst, Annotations... annotations);
+
+    /**
+     * Borrows all specified type tunnels between source and destination.
+     * Annotations parameter is reserved.If there is no any tunnel in the store,
+     * return a empty collection, and record the tunnel subscription. Where tunnel is
+     * created, ONOS notifies this consumer actively. Otherwise,ONOS core returns
+     * all available tunnels, consumer determined which one to use.
+     *
+     * @param consumerId a tunnel consumer
+     * @param src a source point of tunnel.
+     * @param dst a destination point of tunnel
+     * @param type tunnel type
+     * @param annotations Annotations
+     * @return collection of available Tunnels
+     */
+    Collection<Tunnel> borrowTunnel(ApplicationId consumerId, TunnelEndPoint src,
+                                       TunnelEndPoint dst, Tunnel.Type type,
+                                       Annotations... annotations);
+
+    /**
+     * Returns back a specific tunnel to store.
+     *
+     * @param consumerId a tunnel consumer
+     * @param tunnelId tunnel identify generated by ONOS
+     * @param annotations Annotations
+     * @return success or fail
+     */
+    boolean returnTunnel(ApplicationId consumerId, TunnelId tunnelId,
+                              Annotations... annotations);
+
+    /**
+     * Returns all specific name tunnel back store. Annotations parameter is reserved.if there
+     * is no tunnel in the store, return a "null" object, and record the tunnel subscription.
+     * Where tunnel is created, ONOS notifies this consumer actively.
+     *
+     * @param consumerId a tunnel consumer
+     * @param tunnelName tunnel name
+     * @param annotations Annotations
+     * @return boolean
+     */
+    boolean returnTunnel(ApplicationId consumerId, TunnelName tunnelName,
+                           Annotations... annotations);
+
+    /**
+     * Returns all specific type tunnels between source and destination back
+     * store. Annotations parameter is reserved.
+     *
+     * @param consumerId a tunnel consumer
+     * @param src a source point of tunnel.
+     * @param dst a destination point of tunnel
+     * @param type tunnel type
+     * @param annotations Annotations
+     * @return success or fail
+     */
+    boolean returnTunnel(ApplicationId consumerId, TunnelEndPoint src,
+                              TunnelEndPoint dst, Tunnel.Type type,
+                              Annotations... annotations);
+
+    /**
+     * Returns all tunnels between source and destination back the store.
+     * Annotations parameter is reserved.
+     *
+     * @param consumerId a tunnel consumer
+     * @param src a source point of tunnel.
+     * @param dst a destination point of tunnel.
+     * @param annotations Annotations
+     * @return success or fail
+     */
+    boolean returnTunnel(ApplicationId consumerId, TunnelEndPoint src,
+                              TunnelEndPoint dst, Annotations... annotations);
+
+    /**
+     * Returns a tunnel by a specific tunnel identity.
+     *
+     * @param tunnelId tunnel identify generated by tunnel producer
+     * @return Tunnel
+     */
+    Tunnel queryTunnel(TunnelId tunnelId);
+
+    /**
+     * Returns all tunnel subscription record by consumer.
+     *
+     * @param consumerId consumer identity
+     * @return Collection of TunnelSubscription
+     */
+    Collection<TunnelSubscription> queryTunnelSubscription(ApplicationId consumerId);
+
+    /**
+     * Returns all specified type tunnels.
+     *
+     * @param type tunnel type
+     * @return Collection of tunnels
+     */
+    Collection<Tunnel> queryTunnel(Tunnel.Type type);
+
+    /**
+     * Returns all tunnels between source point and destination point.
+     *
+     * @param src a source point of tunnel.
+     * @param dst a destination point of tunnel.
+     * @return Collection of tunnels
+     */
+    Collection<Tunnel> queryTunnel(TunnelEndPoint src, TunnelEndPoint dst);
+
+    /**
+     * Returns all tunnels.
+     *
+     * @return all tunnels
+     */
+    int tunnelCount();
+
+    /**
+     * Adds the specified tunnel listener.
+     *
+     * @param listener tunnel listener
+     */
+    void addListener(TunnelListener listener);
+
+    /**
+     * Removes the specified tunnel listener.
+     *
+     * @param listener tunnel listener
+     */
+    void removeListener(TunnelListener listener);
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelStore.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelStore.java
new file mode 100644
index 0000000..3286ef2
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelStore.java
@@ -0,0 +1,221 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import java.util.Collection;
+
+import org.onosproject.core.ApplicationId;
+import org.onosproject.net.Annotations;
+import org.onosproject.net.provider.ProviderId;
+import org.onosproject.incubator.net.tunnel.Tunnel.Type;
+import org.onosproject.store.Store;
+
+/**
+ * Manages inventory of tunnel; not intended for direct use.
+ */
+public interface TunnelStore extends Store<TunnelEvent, TunnelStoreDelegate> {
+    /**
+     * Creates or updates a tunnel.
+     *
+     * @param tunnel tunnel
+     * @return tunnel identity
+     */
+    TunnelId createOrUpdateTunnel(Tunnel tunnel);
+
+    /**
+     * Deletes a tunnel by a specific tunnel identifier.
+     *
+     * @param tunnelId tunnel unique identifier generated by ONOS
+     */
+    void deleteTunnel(TunnelId tunnelId);
+
+    /**
+     * Deletes all tunnels between source point and destination point.
+     *
+     * @param src a source point of tunnel.
+     * @param dst a destination point of tunnel.
+     * @param producerName producerName
+     */
+    void deleteTunnel(TunnelEndPoint src, TunnelEndPoint dst,
+                                  ProviderId producerName);
+
+    /**
+     * Deletes all specific type tunnels between source point and destination
+     * point.
+     *
+     * @param src a source point of tunnel.
+     * @param dst a destination point of tunnel.
+     * @param type tunnel type
+     * @param producerName producerName
+     */
+    void deleteTunnel(TunnelEndPoint src, TunnelEndPoint dst,
+                                  Tunnel.Type type, ProviderId producerName);
+
+    /**
+     * Returns a specific tunnel. Annotations parameter is reserved. If there
+     * is no tunnel in the store, return a "null" object, and record the tunnel subscription.
+     * Where tunnel is created, ONOS notifies this consumer actively.
+     *
+     * @param consumerId a tunnel consumer
+     * @param tunnelId tunnel identify generated by onos
+     * @param annotations parameter
+     * @return Tunnel subscribed tunnel
+     */
+    Tunnel borrowTunnel(ApplicationId consumerId, TunnelId tunnelId,
+                           Annotations... annotations);
+
+    /**
+     * Returns a specific tunnel by tunnelName. Annotations parameter is
+     * reserved. If there is no tunnel in the store, return a "null" object,and
+     * record the tunnel subscription. Where tunnel is created, ONOS notifies this consumer
+     * actively.
+     *
+     * @param consumerId a tunnel consumer
+     * @param tunnelName tunnel name
+     * @param annotations parameter
+     * @return collection of subscribed Tunnels
+     */
+    Collection<Tunnel> borrowTunnel(ApplicationId consumerId,
+                                       TunnelName tunnelName,
+                                       Annotations... annotations);
+
+    /**
+     * Returns all tunnels between source and destination. Annotations
+     * parameter is reserved. If there is no any tunnel in the store, return a
+     * empty collection, and record the tunnel subscription. Where tunnel is created, ONOS
+     * notifies this consumer actively. Otherwise ONOS core returns all the
+     * tunnels, consumer determined which one to use.
+     *
+     * @param consumerId a tunnel consumer
+     * @param src a source point of tunnel.
+     * @param dst a destination point of tunnel
+     * @param annotations parameter
+     * @return collection of subscribed Tunnels
+     */
+    Collection<Tunnel> borrowTunnel(ApplicationId consumerId, TunnelEndPoint src,
+                                       TunnelEndPoint dst, Annotations... annotations);
+
+    /**
+     * Returns all specified type tunnels between source and destination.
+     * Annotations parameter is reserved. If there is no any tunnel in the store,
+     * return a empty collection, and record the tunnel subscription. Where tunnel is
+     * created, ONOS notifies this consumer actively. Otherwise,ONOS core returns
+     * all available tunnels, consumer determined which one to use.
+     *
+     * @param consumerId a tunnel consumer
+     * @param src a source point of tunnel.
+     * @param dst a destination point of tunnel
+     * @param type tunnel type
+     * @param annotations Annotations
+     * @return collection of available Tunnels
+     */
+    Collection<Tunnel> borrowTunnel(ApplicationId consumerId, TunnelEndPoint src,
+                                       TunnelEndPoint dst, Type type,
+                                       Annotations... annotations);
+
+    /**
+     * Returns back a specific tunnel to store.
+     *
+     * @param consumerId a tunnel consumer
+     * @param tunnelId tunnel identify generated by ONOS
+     * @param annotations Annotations
+     * @return success or fail
+     */
+    boolean returnTunnel(ApplicationId consumerId, TunnelId tunnelId,
+                              Annotations... annotations);
+
+    /**
+     * Returns all specific name tunnel back store. Annotations parameter is
+     * reserved.If there is no tunnel in the store, return a "null" object,and
+     * record the tunnel subscription. Where tunnel is created, ONOS notifies this consumer
+     * actively.
+     *
+     * @param consumerId a tunnel consumer
+     * @param tunnelName tunnel name
+     * @param annotations Annotations
+     * @return boolean
+     */
+    boolean returnTunnel(ApplicationId consumerId, TunnelName tunnelName,
+                              Annotations... annotations);
+
+    /**
+     * Returns all specific type tunnels between source and destination back
+     * store. Annotations parameter is reserved.
+     *
+     * @param consumerId a tunnel consumer
+     * @param src a source point of tunnel.
+     * @param dst a destination point of tunnel
+     * @param type tunnel type
+     * @param annotations Annotations
+     * @return success or fail
+     */
+    boolean returnTunnel(ApplicationId consumerId, TunnelEndPoint src,
+                              TunnelEndPoint dst, Type type,
+                              Annotations... annotations);
+
+    /**
+     * Returns all tunnels between source and destination back the store.
+     * Annotations parameter is reserved.
+     *
+     * @param consumerId a tunnel consumer
+     * @param src a source point of tunnel.
+     * @param dst a destination point of tunnel.
+     * @param annotations Annotations
+     * @return success or fail
+     */
+    boolean returnTunnel(ApplicationId consumerId, TunnelEndPoint src,
+                              TunnelEndPoint dst, Annotations... annotations);
+
+    /**
+     * Returns a tunnel by a specific tunnel identity.
+     *
+     * @param tunnelId tunnel identify generated by tunnel producer
+     * @return Tunnel
+     */
+    Tunnel queryTunnel(TunnelId tunnelId);
+
+    /**
+     * Returns all tunnel subscription record by consumer.
+     *
+     * @param consumerId consumer identity
+     * @return Collection of TunnelSubscription
+     */
+    Collection<TunnelSubscription> queryTunnelSubscription(ApplicationId consumerId);
+
+    /**
+     * Returns all specified type tunnels.
+     *
+     * @param type tunnel type
+     * @return Collection of tunnels
+     */
+    Collection<Tunnel> queryTunnel(Type type);
+
+    /**
+     * Returns all tunnels between source point and destination point.
+     *
+     * @param src a source point of tunnel.
+     * @param dst a destination point of tunnel.
+     * @return Collection of tunnels
+     */
+    Collection<Tunnel> queryTunnel(TunnelEndPoint src, TunnelEndPoint dst);
+
+    /**
+     * Returns all tunnels.
+     * @return all tunnels
+     */
+    int tunnelCount();
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelStoreDelegate.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelStoreDelegate.java
new file mode 100644
index 0000000..cf8a998
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelStoreDelegate.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import org.onosproject.store.StoreDelegate;
+
+/**
+ * Tunnel store delegate abstraction.
+ */
+public interface TunnelStoreDelegate extends StoreDelegate<TunnelEvent> {
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelSubscription.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelSubscription.java
new file mode 100644
index 0000000..9dd8e62
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelSubscription.java
@@ -0,0 +1,154 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.Objects;
+
+import org.onosproject.core.ApplicationId;
+import org.onosproject.net.AbstractAnnotated;
+import org.onosproject.net.Annotations;
+import org.onosproject.incubator.net.tunnel.Tunnel.Type;
+
+import com.google.common.base.MoreObjects;
+
+/**
+ * Represents for a order that consumer subscribe tunnel. ONOS maintains request
+ * information, it means ONOS knows how much resource echo consumer uses in the
+ * ONOS. Although there is no a tunnel that consumer want to use, when producer
+ * creates a new tunnel, ONOS will notify the consumers that want to use it.
+ */
+public final class TunnelSubscription extends AbstractAnnotated {
+    private final ApplicationId consumerId;
+    private final TunnelEndPoint src;
+    private final TunnelEndPoint dst;
+    private final Type type;
+    private final TunnelId tunnelId;
+    private final TunnelName tunnelName;
+
+    /**
+     * Creates a TunnelSubscription.
+     *
+     * @param consumerId consumer identity
+     * @param src source tunnel end point of tunnel
+     * @param dst destination tunnel end point of tunnel
+     * @param tunnelId tunnel identity
+     * @param type tunnel type
+     * @param tunnelName the name of a tunnel
+     * @param annotations parameter
+     */
+    public TunnelSubscription(ApplicationId consumerId, TunnelEndPoint src,
+                 TunnelEndPoint dst, TunnelId tunnelId, Type type,
+                 TunnelName tunnelName, Annotations... annotations) {
+        super(annotations);
+        checkNotNull(consumerId, "consumerId cannot be null");
+        this.consumerId = consumerId;
+        this.src = src;
+        this.dst = dst;
+        this.type = type;
+        this.tunnelId = tunnelId;
+        this.tunnelName = tunnelName;
+    }
+
+    /**
+     * Returns consumer identity.
+     *
+     * @return consumerId consumer id
+     */
+    public ApplicationId consumerId() {
+        return consumerId;
+    }
+
+    /**
+     * Returns source point of tunnel.
+     *
+     * @return source point
+     */
+    public TunnelEndPoint src() {
+        return src;
+    }
+
+    /**
+     * Returns destination point of tunnel.
+     *
+     * @return destination point
+     */
+    public TunnelEndPoint dst() {
+        return dst;
+    }
+
+    /**
+     * Returns tunnel type.
+     *
+     * @return tunnel type
+     */
+    public Type type() {
+        return type;
+    }
+
+    /**
+     * Returns tunnel identity.
+     *
+     * @return tunnel id
+     */
+    public TunnelId tunnelId() {
+        return tunnelId;
+    }
+
+    /**
+     * Returns tunnel name.
+     *
+     * @return tunnel name
+     */
+    public TunnelName tunnelName() {
+        return tunnelName;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(consumerId, src, dst, type, tunnelId, tunnelName);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof TunnelSubscription) {
+            final TunnelSubscription other = (TunnelSubscription) obj;
+            return Objects.equals(this.src, other.src)
+                    && Objects.equals(this.dst, other.dst)
+                    && Objects.equals(this.consumerId, other.consumerId)
+                    && Objects.equals(this.type, other.type)
+                    && Objects.equals(this.tunnelId, other.tunnelId)
+                    && Objects.equals(this.tunnelName, other.tunnelName);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(getClass())
+                .add("src", src)
+                .add("dst", dst)
+                .add("consumerId", consumerId)
+                .add("type", type)
+                .add("tunnelId", tunnelId)
+                .add("tunnelName", tunnelName).toString();
+    }
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/package-info.java b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/package-info.java
new file mode 100644
index 0000000..d31aab5
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Tunnel model related services and providers API definitions.
+ */
+package org.onosproject.incubator.net.tunnel;
diff --git a/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/DefaultTunnelTest.java b/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/DefaultTunnelTest.java
new file mode 100644
index 0000000..bab9ff0
--- /dev/null
+++ b/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/DefaultTunnelTest.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
+
+import org.junit.Test;
+import org.onlab.packet.IpAddress;
+import org.onosproject.core.DefaultGroupId;
+import org.onosproject.net.provider.ProviderId;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test of the default tunnel model entity.
+ */
+public class DefaultTunnelTest {
+    /**
+     * Checks that the Order class is immutable.
+     */
+    @Test
+    public void testImmutability() {
+        assertThatClassIsImmutable(DefaultTunnel.class);
+    }
+
+    @Test
+    public void testEquality() {
+        TunnelEndPoint src = IpTunnelEndPoint.ipTunnelPoint(IpAddress
+                .valueOf(23423));
+        TunnelEndPoint dst = IpTunnelEndPoint.ipTunnelPoint(IpAddress
+                .valueOf(32421));
+        DefaultGroupId groupId = new DefaultGroupId(92034);
+        TunnelName tunnelName = TunnelName.tunnelName("TunnelName");
+        TunnelId tunnelId = TunnelId.valueOf(41654654);
+        ProviderId producerName1 = new ProviderId("producer1", "13");
+        ProviderId producerName2 = new ProviderId("producer2", "13");
+        Tunnel p1 = new DefaultTunnel(producerName1, src, dst, Tunnel.Type.VXLAN,
+                                      Tunnel.State.ACTIVE, groupId, tunnelId,
+                                      tunnelName);
+        Tunnel p2 = new DefaultTunnel(producerName1, src, dst, Tunnel.Type.VXLAN,
+                                      Tunnel.State.ACTIVE, groupId, tunnelId,
+                                      tunnelName);
+        Tunnel p3 = new DefaultTunnel(producerName2, src, dst, Tunnel.Type.OCH,
+                                      Tunnel.State.ACTIVE, groupId, tunnelId,
+                                      tunnelName);
+        new EqualsTester().addEqualityGroup(p1, p2).addEqualityGroup(p3)
+                .testEquals();
+    }
+}
diff --git a/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/TunnelEventTest.java b/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/TunnelEventTest.java
new file mode 100644
index 0000000..6f330a7
--- /dev/null
+++ b/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/TunnelEventTest.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
+
+import org.junit.Test;
+import org.onlab.packet.IpAddress;
+import org.onosproject.core.DefaultGroupId;
+import org.onosproject.net.provider.ProviderId;
+
+/**
+ * Test of a tunnel event.
+ */
+public class TunnelEventTest {
+    /**
+     * Checks that the Order class is immutable.
+     */
+    @Test
+    public void testImmutability() {
+        assertThatClassIsImmutable(TunnelEvent.class);
+    }
+
+    /**
+     * Checks the operation of equals(), hashCode() and toString() methods.
+     */
+    @Test
+    public void testConstructor() {
+        TunnelEndPoint src = IpTunnelEndPoint.ipTunnelPoint(IpAddress
+                .valueOf(23423));
+        TunnelEndPoint dst = IpTunnelEndPoint.ipTunnelPoint(IpAddress
+                .valueOf(32421));
+        DefaultGroupId groupId = new DefaultGroupId(92034);
+        TunnelName tunnelName = TunnelName.tunnelName("TunnelName");
+        TunnelId tunnelId = TunnelId.valueOf(41654654);
+        ProviderId producerName1 = new ProviderId("producer1", "13");
+        Tunnel p1 = new DefaultTunnel(producerName1, src, dst, Tunnel.Type.VXLAN,
+                                      Tunnel.State.ACTIVE, groupId, tunnelId,
+                                      tunnelName);
+        TunnelEvent e1 = new TunnelEvent(TunnelEvent.Type.TUNNEL_ADDED, p1);
+        assertThat(e1, is(notNullValue()));
+        assertThat(e1.type(), is(TunnelEvent.Type.TUNNEL_ADDED));
+        assertThat(e1.subject(), is(p1));
+    }
+}
diff --git a/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/TunnelIdTest.java b/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/TunnelIdTest.java
new file mode 100644
index 0000000..f4c109f
--- /dev/null
+++ b/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/TunnelIdTest.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
+
+import org.junit.Test;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for tunnel id class.
+ */
+public class TunnelIdTest {
+
+    final TunnelId tunnelId1 = TunnelId.valueOf(1);
+    final TunnelId sameAstunnelId1 = TunnelId.valueOf(1);
+    final TunnelId tunnelId2 = TunnelId.valueOf(2);
+
+    /**
+     * Checks that the TunnelId class is immutable.
+     */
+    @Test
+    public void testImmutability() {
+        assertThatClassIsImmutable(TunnelId.class);
+    }
+
+    /**
+     * Checks the operation of equals(), hashCode() and toString() methods.
+     */
+    @Test
+    public void testEquals() {
+        new EqualsTester()
+                .addEqualityGroup(tunnelId1, sameAstunnelId1)
+                .addEqualityGroup(tunnelId2)
+                .testEquals();
+    }
+
+    /**
+     * Checks the construction of a FlowId object.
+     */
+    @Test
+    public void testConstruction() {
+        final long tunnelIdValue = 7777L;
+        final TunnelId tunnelId = TunnelId.valueOf(tunnelIdValue);
+        assertThat(tunnelId, is(notNullValue()));
+        assertThat(tunnelId.id(), is(tunnelIdValue));
+    }
+}
diff --git a/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/TunnelNameTest.java b/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/TunnelNameTest.java
new file mode 100644
index 0000000..d0fc49c
--- /dev/null
+++ b/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/TunnelNameTest.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
+
+import org.junit.Test;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for tunnel name class.
+ */
+public class TunnelNameTest {
+    final TunnelName name1 = TunnelName.tunnelName("name1");
+    final TunnelName sameAsName1 = TunnelName.tunnelName("name1");
+    final TunnelName name2 = TunnelName.tunnelName("name2");
+
+    /**
+     * Checks that the TunnelName class is immutable.
+     */
+    @Test
+    public void testImmutability() {
+        assertThatClassIsImmutable(TunnelName.class);
+    }
+
+    /**
+     * Checks the operation of equals(), hashCode() and toString() methods.
+     */
+    @Test
+    public void testEquals() {
+        new EqualsTester().addEqualityGroup(name1, sameAsName1)
+                .addEqualityGroup(name2).testEquals();
+    }
+
+    /**
+     * Checks the construction of a OpenFlowGroupId object.
+     */
+    @Test
+    public void testConstruction() {
+        final String nameValue = "name3";
+        final TunnelName name = TunnelName.tunnelName(nameValue);
+        assertThat(name, is(notNullValue()));
+        assertThat(name.value(), is(nameValue));
+    }
+
+}
diff --git a/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/TunnelSubscriptionTest.java b/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/TunnelSubscriptionTest.java
new file mode 100644
index 0000000..46634c7
--- /dev/null
+++ b/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/TunnelSubscriptionTest.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.incubator.net.tunnel;
+
+import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
+
+import org.junit.Test;
+import org.onlab.packet.IpAddress;
+import org.onosproject.core.ApplicationId;
+import org.onosproject.core.DefaultApplicationId;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test of order model entity.
+ */
+public class TunnelSubscriptionTest {
+    /**
+     * Checks that the Order class is immutable.
+     */
+    @Test
+    public void testImmutability() {
+        assertThatClassIsImmutable(TunnelSubscription.class);
+    }
+
+    /**
+     * Checks the operation of equals(), hashCode() and toString() methods.
+     */
+    @Test
+    public void testEquality() {
+        TunnelEndPoint src = IpTunnelEndPoint.ipTunnelPoint(IpAddress.valueOf(23423));
+        TunnelEndPoint dst = IpTunnelEndPoint.ipTunnelPoint(IpAddress.valueOf(32421));
+        ApplicationId appId = new DefaultApplicationId(243, "test");
+        ApplicationId appId2 = new DefaultApplicationId(2431, "test1");
+        TunnelId tunnelId = TunnelId.valueOf(41654654);
+        TunnelSubscription p1 = new TunnelSubscription(appId, src, dst, tunnelId, Tunnel.Type.VXLAN,
+                             null);
+        TunnelSubscription p2 = new TunnelSubscription(appId, src, dst, tunnelId, Tunnel.Type.VXLAN,
+                             null);
+        TunnelSubscription p3 = new TunnelSubscription(appId2, src, dst, tunnelId, Tunnel.Type.VXLAN,
+                             null);
+        new EqualsTester().addEqualityGroup(p1, p2).addEqualityGroup(p3)
+                .testEquals();
+    }
+}
diff --git a/incubator/net/pom.xml b/incubator/net/pom.xml
index 65bde31..0869aa1 100644
--- a/incubator/net/pom.xml
+++ b/incubator/net/pom.xml
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
 <!--
   ~ Copyright 2015 Open Networking Laboratory
   ~
diff --git a/incubator/net/src/main/java/org/onosproject/incubator/net/tunnel/impl/TunnelManager.java b/incubator/net/src/main/java/org/onosproject/incubator/net/tunnel/impl/TunnelManager.java
new file mode 100644
index 0000000..c2c9975
--- /dev/null
+++ b/incubator/net/src/main/java/org/onosproject/incubator/net/tunnel/impl/TunnelManager.java
@@ -0,0 +1,358 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.net.tunnel.impl;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static org.slf4j.LoggerFactory.getLogger;
+
+import java.util.Collection;
+import java.util.Set;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.Service;
+import org.onosproject.core.ApplicationId;
+import org.onosproject.event.EventDeliveryService;
+import org.onosproject.event.ListenerRegistry;
+import org.onosproject.net.Annotations;
+import org.onosproject.net.Path;
+import org.onosproject.net.provider.AbstractProviderRegistry;
+import org.onosproject.net.provider.AbstractProviderService;
+import org.onosproject.net.provider.ProviderId;
+import org.onosproject.incubator.net.tunnel.DefaultTunnel;
+import org.onosproject.incubator.net.tunnel.Tunnel;
+import org.onosproject.incubator.net.tunnel.Tunnel.Type;
+import org.onosproject.incubator.net.tunnel.TunnelAdminService;
+import org.onosproject.incubator.net.tunnel.TunnelDescription;
+import org.onosproject.incubator.net.tunnel.TunnelEndPoint;
+import org.onosproject.incubator.net.tunnel.TunnelEvent;
+import org.onosproject.incubator.net.tunnel.TunnelId;
+import org.onosproject.incubator.net.tunnel.TunnelListener;
+import org.onosproject.incubator.net.tunnel.TunnelName;
+import org.onosproject.incubator.net.tunnel.TunnelProvider;
+import org.onosproject.incubator.net.tunnel.TunnelProviderRegistry;
+import org.onosproject.incubator.net.tunnel.TunnelProviderService;
+import org.onosproject.incubator.net.tunnel.TunnelService;
+import org.onosproject.incubator.net.tunnel.TunnelStore;
+import org.onosproject.incubator.net.tunnel.TunnelStoreDelegate;
+import org.onosproject.incubator.net.tunnel.TunnelSubscription;
+import org.slf4j.Logger;
+
+/**
+ * Provides implementation of the tunnel NB/SB APIs.
+ */
+@Component(immediate = true, enabled = true)
+@Service
+public class TunnelManager
+        extends AbstractProviderRegistry<TunnelProvider, TunnelProviderService>
+        implements TunnelService, TunnelAdminService, TunnelProviderRegistry {
+
+    private static final String TUNNNEL_ID_NULL = "Tunnel ID cannot be null";
+
+    private final Logger log = getLogger(getClass());
+
+    protected final ListenerRegistry<TunnelEvent, TunnelListener>
+            listenerRegistry = new ListenerRegistry<>();
+
+    private final TunnelStoreDelegate delegate = new InternalStoreDelegate();
+
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected TunnelStore store;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected EventDeliveryService eventDispatcher;
+
+    @Activate
+    public void activate() {
+        store.setDelegate(delegate);
+        eventDispatcher.addSink(TunnelEvent.class, listenerRegistry);
+        log.info("Started");
+    }
+
+    @Deactivate
+    public void deactivate() {
+        store.unsetDelegate(delegate);
+        eventDispatcher.removeSink(TunnelEvent.class);
+        log.info("Stopped");
+    }
+
+    @Override
+    public void removeTunnel(TunnelId tunnelId) {
+        checkNotNull(tunnelId, TUNNNEL_ID_NULL);
+        store.deleteTunnel(tunnelId);
+        Tunnel tunnel = store.queryTunnel(tunnelId);
+        if (tunnel.providerId() != null) {
+            TunnelProvider provider = getProvider(tunnel.providerId());
+            if (provider != null) {
+                provider.releaseTunnel(tunnel);
+            }
+        } else {
+            Set<ProviderId> ids = getProviders();
+            for (ProviderId providerId : ids) {
+                TunnelProvider provider = getProvider(providerId);
+                provider.releaseTunnel(tunnel);
+            }
+        }
+    }
+
+    @Override
+    public void updateTunnel(Tunnel tunnel, Path path) {
+        store.createOrUpdateTunnel(tunnel);
+        if (tunnel.providerId() != null) {
+            TunnelProvider provider = getProvider(tunnel.providerId());
+            if (provider != null) {
+                provider.updateTunnel(tunnel, path);
+            }
+        } else {
+            Set<ProviderId> ids = getProviders();
+            for (ProviderId providerId : ids) {
+                TunnelProvider provider = getProvider(providerId);
+                provider.updateTunnel(tunnel, path);
+            }
+        }
+    }
+
+    @Override
+    public void removeTunnels(TunnelEndPoint src, TunnelEndPoint dst,
+                              ProviderId producerName) {
+        store.deleteTunnel(src, dst, producerName);
+        Collection<Tunnel> setTunnels = store.queryTunnel(src, dst);
+        for (Tunnel tunnel : setTunnels) {
+            if (producerName != null
+                    && !tunnel.providerId().equals(producerName)) {
+                continue;
+            }
+            if (tunnel.providerId() != null) {
+                TunnelProvider provider = getProvider(tunnel.providerId());
+                if (provider != null) {
+                    provider.releaseTunnel(tunnel);
+                }
+            } else {
+                Set<ProviderId> ids = getProviders();
+                for (ProviderId providerId : ids) {
+                    TunnelProvider provider = getProvider(providerId);
+                    provider.releaseTunnel(tunnel);
+                }
+            }
+        }
+    }
+
+    @Override
+    public void removeTunnels(TunnelEndPoint src, TunnelEndPoint dst, Type type,
+                              ProviderId producerName) {
+        store.deleteTunnel(src, dst, type, producerName);
+        Collection<Tunnel> setTunnels = store.queryTunnel(src, dst);
+        for (Tunnel tunnel : setTunnels) {
+            if (producerName != null
+                    && !tunnel.providerId().equals(producerName)
+                    || !type.equals(tunnel.type())) {
+                continue;
+            }
+            if (tunnel.providerId() != null) {
+                TunnelProvider provider = getProvider(tunnel.providerId());
+                if (provider != null) {
+                    provider.releaseTunnel(tunnel);
+                }
+            } else {
+                Set<ProviderId> ids = getProviders();
+                for (ProviderId providerId : ids) {
+                    TunnelProvider provider = getProvider(providerId);
+                    provider.releaseTunnel(tunnel);
+                }
+            }
+        }
+    }
+
+    @Override
+    public Tunnel borrowTunnel(ApplicationId consumerId, TunnelId tunnelId,
+                                  Annotations... annotations) {
+        return store.borrowTunnel(consumerId, tunnelId, annotations);
+    }
+
+    @Override
+    public Collection<Tunnel> borrowTunnel(ApplicationId consumerId,
+                                              TunnelName tunnelName,
+                                              Annotations... annotations) {
+        return store.borrowTunnel(consumerId, tunnelName, annotations);
+    }
+
+    @Override
+    public Collection<Tunnel> borrowTunnel(ApplicationId consumerId,
+                                              TunnelEndPoint src, TunnelEndPoint dst,
+                                              Annotations... annotations) {
+        Collection<Tunnel> tunnels = store.borrowTunnel(consumerId, src,
+                                                           dst, annotations);
+        if (tunnels == null || tunnels.size() == 0) {
+            Tunnel tunnel = new DefaultTunnel(null, src, dst, null, null, null,
+                                              null, null, annotations);
+            Set<ProviderId> ids = getProviders();
+            for (ProviderId providerId : ids) {
+                TunnelProvider provider = getProvider(providerId);
+                provider.setupTunnel(tunnel, null);
+            }
+        }
+        return tunnels;
+    }
+
+    @Override
+    public Collection<Tunnel> borrowTunnel(ApplicationId consumerId,
+                                              TunnelEndPoint src, TunnelEndPoint dst,
+                                              Type type, Annotations... annotations) {
+        Collection<Tunnel> tunnels = store.borrowTunnel(consumerId, src,
+                                                           dst, type,
+                                                           annotations);
+        if (tunnels == null || tunnels.size() == 0) {
+            Tunnel tunnel = new DefaultTunnel(null, src, dst, type, null, null,
+                                              null, null, annotations);
+            Set<ProviderId> ids = getProviders();
+            for (ProviderId providerId : ids) {
+                TunnelProvider provider = getProvider(providerId);
+                provider.setupTunnel(tunnel, null);
+            }
+        }
+        return tunnels;
+    }
+
+    @Override
+    public boolean returnTunnel(ApplicationId consumerId,
+                                     TunnelId tunnelId, Annotations... annotations) {
+        return store.returnTunnel(consumerId, tunnelId, annotations);
+    }
+
+    @Override
+    public boolean returnTunnel(ApplicationId consumerId,
+                                     TunnelName tunnelName,
+                                     Annotations... annotations) {
+        return store.returnTunnel(consumerId, tunnelName, annotations);
+    }
+
+    @Override
+    public boolean returnTunnel(ApplicationId consumerId, TunnelEndPoint src,
+                                     TunnelEndPoint dst, Type type,
+                                     Annotations... annotations) {
+        return store.returnTunnel(consumerId, src, dst, type, annotations);
+    }
+
+    @Override
+    public boolean returnTunnel(ApplicationId consumerId, TunnelEndPoint src,
+                                     TunnelEndPoint dst, Annotations... annotations) {
+        return store.returnTunnel(consumerId, src, dst, annotations);
+    }
+
+    @Override
+    public Tunnel queryTunnel(TunnelId tunnelId) {
+        return store.queryTunnel(tunnelId);
+    }
+
+    @Override
+    public Collection<TunnelSubscription> queryTunnelSubscription(ApplicationId consumerId) {
+        return store.queryTunnelSubscription(consumerId);
+    }
+
+    @Override
+    public Collection<Tunnel> queryTunnel(Type type) {
+        return store.queryTunnel(type);
+    }
+
+    @Override
+    public Collection<Tunnel> queryTunnel(TunnelEndPoint src, TunnelEndPoint dst) {
+        return store.queryTunnel(src, dst);
+    }
+
+    @Override
+    public int tunnelCount() {
+        return store.tunnelCount();
+    }
+
+    @Override
+    protected TunnelProviderService createProviderService(TunnelProvider provider) {
+        return new InternalTunnelProviderService(provider);
+    }
+
+    @Override
+    public void addListener(TunnelListener listener) {
+        listenerRegistry.addListener(listener);
+    }
+
+    @Override
+    public void removeListener(TunnelListener listener) {
+        listenerRegistry.removeListener(listener);
+    }
+
+    private class InternalTunnelProviderService
+            extends AbstractProviderService<TunnelProvider>
+            implements TunnelProviderService {
+        protected InternalTunnelProviderService(TunnelProvider provider) {
+            super(provider);
+        }
+
+
+        @Override
+        public TunnelId tunnelAdded(TunnelDescription tunnel) {
+            Tunnel storedTunnel = new DefaultTunnel(provider().id(),
+                                                    tunnel.src(), tunnel.dst(),
+                                                    tunnel.type(),
+                                                    tunnel.groupId(),
+                                                    tunnel.id(),
+                                                    tunnel.tunnelName(),
+                                                    tunnel.annotations());
+            return store.createOrUpdateTunnel(storedTunnel);
+        }
+
+        @Override
+        public void tunnelUpdated(TunnelDescription tunnel) {
+            Tunnel storedTunnel = new DefaultTunnel(provider().id(),
+                                                    tunnel.src(), tunnel.dst(),
+                                                    tunnel.type(),
+                                                    tunnel.groupId(),
+                                                    tunnel.id(),
+                                                    tunnel.tunnelName(),
+                                                    tunnel.annotations());
+            store.createOrUpdateTunnel(storedTunnel);
+        }
+
+        @Override
+        public void tunnelRemoved(TunnelDescription tunnel) {
+            if (tunnel.id() != null) {
+                store.deleteTunnel(tunnel.id());
+            }
+            if (tunnel.src() != null && tunnel.dst() != null
+                    && tunnel.type() != null) {
+                store.deleteTunnel(tunnel.src(), tunnel.dst(), tunnel.type(),
+                                   provider().id());
+            }
+            if (tunnel.src() != null && tunnel.dst() != null
+                    && tunnel.type() == null) {
+                store.deleteTunnel(tunnel.src(), tunnel.dst(), provider().id());
+            }
+        }
+
+    }
+
+    private class InternalStoreDelegate implements TunnelStoreDelegate {
+        @Override
+        public void notify(TunnelEvent event) {
+            if (event != null) {
+                eventDispatcher.post(event);
+            }
+        }
+    }
+}
diff --git a/incubator/net/src/main/java/org/onosproject/incubator/net/tunnel/impl/package-info.java b/incubator/net/src/main/java/org/onosproject/incubator/net/tunnel/impl/package-info.java
new file mode 100644
index 0000000..6e0de55
--- /dev/null
+++ b/incubator/net/src/main/java/org/onosproject/incubator/net/tunnel/impl/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Core subsystem for tracking global inventory of tunnels.
+ */
+package org.onosproject.incubator.net.tunnel.impl;
diff --git a/incubator/pom.xml b/incubator/pom.xml
index 235bff9..0eb6e89 100644
--- a/incubator/pom.xml
+++ b/incubator/pom.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-  ~ Copyright 2014 Open Networking Laboratory
+  ~ Copyright 2015 Open Networking Laboratory
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
diff --git a/incubator/store/pom.xml b/incubator/store/pom.xml
index b7439ef..67ff427 100644
--- a/incubator/store/pom.xml
+++ b/incubator/store/pom.xml
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
 <!--
   ~ Copyright 2015 Open Networking Laboratory
   ~
@@ -68,6 +69,21 @@
             <classifier>tests</classifier>
             <scope>test</scope>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
     </dependencies>
 
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-scr-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>
diff --git a/incubator/store/src/main/java/org/onosproject/incubator/store/tunnel/impl/DistributedTunnelStore.java b/incubator/store/src/main/java/org/onosproject/incubator/store/tunnel/impl/DistributedTunnelStore.java
new file mode 100644
index 0000000..b49743c
--- /dev/null
+++ b/incubator/store/src/main/java/org/onosproject/incubator/store/tunnel/impl/DistributedTunnelStore.java
@@ -0,0 +1,519 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.incubator.store.tunnel.impl;
+
+import static org.slf4j.LoggerFactory.getLogger;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Objects;
+import java.util.Set;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.Service;
+import org.onlab.util.KryoNamespace;
+import org.onosproject.cluster.ClusterService;
+import org.onosproject.core.ApplicationId;
+import org.onosproject.core.CoreService;
+import org.onosproject.core.IdGenerator;
+import org.onosproject.net.Annotations;
+import org.onosproject.net.provider.ProviderId;
+import org.onosproject.incubator.net.tunnel.DefaultTunnel;
+import org.onosproject.incubator.net.tunnel.Tunnel;
+import org.onosproject.incubator.net.tunnel.Tunnel.Type;
+import org.onosproject.incubator.net.tunnel.TunnelEndPoint;
+import org.onosproject.incubator.net.tunnel.TunnelEvent;
+import org.onosproject.incubator.net.tunnel.TunnelId;
+import org.onosproject.incubator.net.tunnel.TunnelName;
+import org.onosproject.incubator.net.tunnel.TunnelStore;
+import org.onosproject.incubator.net.tunnel.TunnelStoreDelegate;
+import org.onosproject.incubator.net.tunnel.TunnelSubscription;
+import org.onosproject.store.AbstractStore;
+import org.onosproject.store.app.GossipApplicationStore.InternalState;
+import org.onosproject.store.cluster.messaging.ClusterCommunicationService;
+import org.onosproject.store.serializers.KryoNamespaces;
+import org.onosproject.store.service.EventuallyConsistentMap;
+import org.onosproject.store.service.MultiValuedTimestamp;
+import org.onosproject.store.service.StorageService;
+import org.onosproject.store.service.WallclockClockManager;
+import org.slf4j.Logger;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Manages inventory of tunnel in distributed data store that uses optimistic
+ * replication and gossip based techniques.
+ */
+@Component(immediate = true)
+@Service
+public class DistributedTunnelStore
+        extends AbstractStore<TunnelEvent, TunnelStoreDelegate>
+        implements TunnelStore {
+
+    private final Logger log = getLogger(getClass());
+
+    /**
+     * The topic used for obtaining globally unique ids.
+     */
+    private String runnelOpTopoic = "tunnel-ops-ids";
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected ClusterCommunicationService clusterCommunicator;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected ClusterService clusterService;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected CoreService coreService;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected StorageService storageService;
+
+    // tunnel identity as map key in the store.
+    private EventuallyConsistentMap<TunnelId, Tunnel> tunnelIdAsKeyStore;
+    // tunnel name as map key in the store.
+    private EventuallyConsistentMap<TunnelName, Set<TunnelId>> tunnelNameAsKeyStore;
+    // maintains all the tunnels between source and destination.
+    private EventuallyConsistentMap<TunnelKey, Set<TunnelId>> srcAndDstKeyStore;
+    // maintains all the tunnels by tunnel type.
+    private EventuallyConsistentMap<Tunnel.Type, Set<TunnelId>> typeKeyStore;
+    // maintains records that app subscribes tunnel.
+    private EventuallyConsistentMap<ApplicationId, Set<TunnelSubscription>> orderRelationship;
+
+    private IdGenerator idGenerator;
+
+    @Activate
+    public void activate() {
+        KryoNamespace.Builder serializer = KryoNamespace.newBuilder()
+                .register(KryoNamespaces.API)
+                .register(MultiValuedTimestamp.class)
+                .register(InternalState.class);
+        tunnelIdAsKeyStore = storageService
+                .<TunnelId, Tunnel>eventuallyConsistentMapBuilder()
+                .withName("all_tunnel").withSerializer(serializer)
+                .withClockService(new WallclockClockManager<>()).build();
+        tunnelNameAsKeyStore = storageService
+                .<TunnelName, Set<TunnelId>>eventuallyConsistentMapBuilder()
+                .withName("tunnel_name_tunnel").withSerializer(serializer)
+                .withClockService(new WallclockClockManager<>()).build();
+        srcAndDstKeyStore = storageService
+                .<TunnelKey, Set<TunnelId>>eventuallyConsistentMapBuilder()
+                .withName("src_dst_tunnel").withSerializer(serializer)
+                .withClockService(new WallclockClockManager<>()).build();
+        typeKeyStore = storageService
+                .<Tunnel.Type, Set<TunnelId>>eventuallyConsistentMapBuilder()
+                .withName("type_tunnel").withSerializer(serializer)
+                .withClockService(new WallclockClockManager<>()).build();
+        idGenerator = coreService.getIdGenerator(runnelOpTopoic);
+        log.info("Started");
+    }
+
+    @Deactivate
+    public void deactivate() {
+        tunnelIdAsKeyStore.destroy();
+        srcAndDstKeyStore.destroy();
+        typeKeyStore.destroy();
+        tunnelNameAsKeyStore.destroy();
+        log.info("Stopped");
+    }
+
+    @Override
+    public TunnelId createOrUpdateTunnel(Tunnel tunnel) {
+        // tunnelIdAsKeyStore.
+        if (tunnel.tunnelId() != null && !"".equals(tunnel.tunnelId())) {
+            Tunnel old = tunnelIdAsKeyStore.get(tunnel.tunnelId());
+            if (old == null) {
+                log.info("This tunnel[" + tunnel.tunnelId() + "] is not available.");
+                return tunnel.tunnelId();
+            }
+            Tunnel newT = new DefaultTunnel(tunnel.providerId(), tunnel.src(),
+                                            tunnel.dst(), tunnel.type(),
+                                            tunnel.state(), tunnel.groupId(),
+                                            old.tunnelId(),
+                                            tunnel.tunnelName(),
+                                            tunnel.annotations());
+            tunnelIdAsKeyStore.remove(tunnel.tunnelId());
+            tunnelIdAsKeyStore.put(tunnel.tunnelId(), newT);
+            TunnelEvent event = new TunnelEvent(
+                                                TunnelEvent.Type.TUNNEL_UPDATED,
+                                                tunnel);
+            notifyDelegate(event);
+            return tunnel.tunnelId();
+        } else {
+            TunnelId tunnelId = TunnelId.valueOf(idGenerator.getNewId());
+            Tunnel newT = new DefaultTunnel(tunnel.providerId(), tunnel.src(),
+                                            tunnel.dst(), tunnel.type(),
+                                            tunnel.state(), tunnel.groupId(),
+                                            tunnelId,
+                                            tunnel.tunnelName(),
+                                            tunnel.annotations());
+            TunnelKey key = TunnelKey.tunnelKey(tunnel.src(), tunnel.dst());
+            tunnelIdAsKeyStore.put(tunnelId, newT);
+            Set<TunnelId> tunnelnameSet = tunnelNameAsKeyStore.get(tunnel
+                    .tunnelName());
+            if (tunnelnameSet == null) {
+                tunnelnameSet = new HashSet<TunnelId>();
+            }
+            tunnelnameSet.add(tunnelId);
+            tunnelNameAsKeyStore.put(tunnel
+                    .tunnelName(), tunnelnameSet);
+            Set<TunnelId> srcAndDstKeySet = srcAndDstKeyStore.get(key);
+            if (srcAndDstKeySet == null) {
+                srcAndDstKeySet = new HashSet<TunnelId>();
+            }
+            srcAndDstKeySet.add(tunnelId);
+            srcAndDstKeyStore.put(key, srcAndDstKeySet);
+            Set<TunnelId> typeKeySet = typeKeyStore.get(tunnel.type());
+            if (typeKeySet == null) {
+                typeKeySet = new HashSet<TunnelId>();
+            }
+            typeKeySet.add(tunnelId);
+            typeKeyStore.put(tunnel.type(), typeKeySet);
+            TunnelEvent event = new TunnelEvent(TunnelEvent.Type.TUNNEL_ADDED,
+                                                tunnel);
+            notifyDelegate(event);
+            return tunnelId;
+        }
+    }
+
+    @Override
+    public void deleteTunnel(TunnelId tunnelId) {
+        Tunnel deletedTunnel = tunnelIdAsKeyStore.get(tunnelId);
+        if (deletedTunnel == null) {
+            return;
+        }
+        tunnelNameAsKeyStore.get(deletedTunnel.tunnelName()).remove(tunnelId);
+        tunnelIdAsKeyStore.remove(tunnelId);
+        TunnelKey key = new TunnelKey(deletedTunnel.src(), deletedTunnel.dst());
+        srcAndDstKeyStore.get(key).remove(tunnelId);
+        typeKeyStore.get(deletedTunnel.type()).remove(tunnelId);
+        TunnelEvent event = new TunnelEvent(TunnelEvent.Type.TUNNEL_REMOVED,
+                                            deletedTunnel);
+        notifyDelegate(event);
+    }
+
+    @Override
+    public void deleteTunnel(TunnelEndPoint src, TunnelEndPoint dst,
+                             ProviderId producerName) {
+        TunnelKey key = TunnelKey.tunnelKey(src, dst);
+        Set<TunnelId> idSet = srcAndDstKeyStore.get(key);
+        if (idSet == null) {
+            return;
+        }
+        Tunnel deletedTunnel = null;
+        TunnelEvent event = null;
+        List<TunnelEvent> ls = new ArrayList<TunnelEvent>();
+        for (TunnelId id : idSet) {
+            deletedTunnel = tunnelIdAsKeyStore.get(id);
+            event = new TunnelEvent(TunnelEvent.Type.TUNNEL_REMOVED,
+                                    deletedTunnel);
+            ls.add(event);
+            if (producerName.equals(deletedTunnel.providerId())) {
+                tunnelIdAsKeyStore.remove(deletedTunnel.tunnelId());
+                tunnelNameAsKeyStore.get(deletedTunnel.tunnelName())
+                        .remove(deletedTunnel.tunnelId());
+                srcAndDstKeyStore.get(key).remove(deletedTunnel.tunnelId());
+                typeKeyStore.get(deletedTunnel.type())
+                        .remove(deletedTunnel.tunnelId());
+            }
+        }
+        notifyDelegate(ls);
+    }
+
+    @Override
+    public void deleteTunnel(TunnelEndPoint src, TunnelEndPoint dst, Type type,
+                             ProviderId producerName) {
+        TunnelKey key = TunnelKey.tunnelKey(src, dst);
+        Set<TunnelId> idSet = srcAndDstKeyStore.get(key);
+        if (idSet == null) {
+            return;
+        }
+        Tunnel deletedTunnel = null;
+        TunnelEvent event = null;
+        List<TunnelEvent> ls = new ArrayList<TunnelEvent>();
+        for (TunnelId id : idSet) {
+            deletedTunnel = tunnelIdAsKeyStore.get(id);
+            event = new TunnelEvent(TunnelEvent.Type.TUNNEL_REMOVED,
+                                    deletedTunnel);
+            ls.add(event);
+            if (producerName.equals(deletedTunnel.providerId())
+                    && type.equals(deletedTunnel.type())) {
+                tunnelIdAsKeyStore.remove(deletedTunnel.tunnelId());
+                tunnelNameAsKeyStore.get(deletedTunnel.tunnelName())
+                        .remove(deletedTunnel.tunnelId());
+                srcAndDstKeyStore.get(key).remove(deletedTunnel.tunnelId());
+                typeKeyStore.get(deletedTunnel.type())
+                        .remove(deletedTunnel.tunnelId());
+            }
+        }
+        notifyDelegate(ls);
+    }
+
+    @Override
+    public Tunnel borrowTunnel(ApplicationId appId, TunnelId tunnelId,
+                               Annotations... annotations) {
+        Set<TunnelSubscription> orderSet = orderRelationship.get(appId);
+        if (orderSet == null) {
+            orderSet = new HashSet<TunnelSubscription>();
+        }
+        TunnelSubscription order = new TunnelSubscription(appId, null, null, tunnelId, null, null,
+                                annotations);
+        Tunnel result = tunnelIdAsKeyStore.get(tunnelId);
+        if (result != null || Tunnel.State.INACTIVE.equals(result.state())) {
+            return null;
+        }
+        orderSet.add(order);
+        orderRelationship.put(appId, orderSet);
+        return result;
+    }
+
+    @Override
+    public Collection<Tunnel> borrowTunnel(ApplicationId appId,
+                                           TunnelEndPoint src,
+                                           TunnelEndPoint dst,
+                                           Annotations... annotations) {
+        Set<TunnelSubscription> orderSet = orderRelationship.get(appId);
+        if (orderSet == null) {
+            orderSet = new HashSet<TunnelSubscription>();
+        }
+        TunnelSubscription order = new TunnelSubscription(appId, src, dst, null, null, null, annotations);
+        boolean isExist = orderSet.contains(order);
+        if (!isExist) {
+            orderSet.add(order);
+        }
+        orderRelationship.put(appId, orderSet);
+        TunnelKey key = TunnelKey.tunnelKey(src, dst);
+        Set<TunnelId> idSet = srcAndDstKeyStore.get(key);
+        if (idSet == null || idSet.size() == 0) {
+            return Collections.emptySet();
+        }
+        Collection<Tunnel> tunnelSet = new HashSet<Tunnel>();
+        for (TunnelId tunnelId : idSet) {
+            Tunnel result = tunnelIdAsKeyStore.get(tunnelId);
+            if (Tunnel.State.ACTIVE.equals(result.state())) {
+                tunnelSet.add(result);
+            }
+        }
+        return tunnelSet;
+    }
+
+    @Override
+    public Collection<Tunnel> borrowTunnel(ApplicationId appId,
+                                           TunnelEndPoint src,
+                                           TunnelEndPoint dst, Type type,
+                                           Annotations... annotations) {
+        Set<TunnelSubscription> orderSet = orderRelationship.get(appId);
+        if (orderSet == null) {
+            orderSet = new HashSet<TunnelSubscription>();
+        }
+        TunnelSubscription order = new TunnelSubscription(appId, src, dst, null, type, null, annotations);
+        boolean isExist = orderSet.contains(order);
+        if (!isExist) {
+            orderSet.add(order);
+        }
+        orderRelationship.put(appId, orderSet);
+        TunnelKey key = TunnelKey.tunnelKey(src, dst);
+        Set<TunnelId> idSet = srcAndDstKeyStore.get(key);
+        if (idSet == null || idSet.size() == 0) {
+            return Collections.emptySet();
+        }
+        Collection<Tunnel> tunnelSet = new HashSet<Tunnel>();
+        for (TunnelId tunnelId : idSet) {
+            Tunnel result = tunnelIdAsKeyStore.get(tunnelId);
+            if (type.equals(result.type())
+                    && Tunnel.State.ACTIVE.equals(result.state())) {
+                tunnelSet.add(result);
+            }
+        }
+        return tunnelSet;
+    }
+
+    @Override
+    public Collection<Tunnel> borrowTunnel(ApplicationId appId,
+                                           TunnelName tunnelName,
+                                           Annotations... annotations) {
+        Set<TunnelSubscription> orderSet = orderRelationship.get(appId);
+        if (orderSet == null) {
+            orderSet = new HashSet<TunnelSubscription>();
+        }
+        TunnelSubscription order = new TunnelSubscription(appId, null, null, null, null, tunnelName,
+                                annotations);
+        boolean isExist = orderSet.contains(order);
+        if (!isExist) {
+            orderSet.add(order);
+        }
+        orderRelationship.put(appId, orderSet);
+        Set<TunnelId> idSet = tunnelNameAsKeyStore.get(tunnelName);
+        if (idSet == null || idSet.size() == 0) {
+            return Collections.emptySet();
+        }
+        Collection<Tunnel> tunnelSet = new HashSet<Tunnel>();
+        for (TunnelId tunnelId : idSet) {
+            Tunnel result = tunnelIdAsKeyStore.get(tunnelId);
+            if (Tunnel.State.ACTIVE.equals(result.state())) {
+                tunnelSet.add(result);
+            }
+        }
+        return tunnelSet;
+    }
+
+    @Override
+    public boolean returnTunnel(ApplicationId appId, TunnelName tunnelName,
+                                Annotations... annotations) {
+        TunnelSubscription order = new TunnelSubscription(appId, null, null, null, null, tunnelName,
+                                annotations);
+        return deleteOrder(order);
+    }
+
+    @Override
+    public boolean returnTunnel(ApplicationId appId, TunnelId tunnelId,
+                                Annotations... annotations) {
+        TunnelSubscription order = new TunnelSubscription(appId, null, null, tunnelId, null, null,
+                                annotations);
+        return deleteOrder(order);
+    }
+
+    @Override
+    public boolean returnTunnel(ApplicationId appId, TunnelEndPoint src,
+                                TunnelEndPoint dst, Type type,
+                                Annotations... annotations) {
+        TunnelSubscription order = new TunnelSubscription(appId, src, dst, null, type, null, annotations);
+        return deleteOrder(order);
+    }
+
+    @Override
+    public boolean returnTunnel(ApplicationId appId, TunnelEndPoint src,
+                                TunnelEndPoint dst, Annotations... annotations) {
+        TunnelSubscription order = new TunnelSubscription(appId, src, dst, null, null, null, annotations);
+        return deleteOrder(order);
+    }
+
+    private boolean deleteOrder(TunnelSubscription order) {
+        Set<TunnelSubscription> orderSet = orderRelationship.get(order.consumerId());
+        if (orderSet == null) {
+            return true;
+        }
+        if (orderSet.contains(order)) {
+            orderSet.remove(order);
+            return true;
+        }
+        return false;
+    }
+
+    @Override
+    public Tunnel queryTunnel(TunnelId tunnelId) {
+        return tunnelIdAsKeyStore.get(tunnelId);
+    }
+
+    @Override
+    public Collection<TunnelSubscription> queryTunnelSubscription(ApplicationId appId) {
+        return orderRelationship.get(appId) != null ? ImmutableSet.copyOf(orderRelationship
+                .get(appId)) : Collections.emptySet();
+    }
+
+    @Override
+    public Collection<Tunnel> queryTunnel(Type type) {
+        Collection<Tunnel> result = new HashSet<Tunnel>();
+        Set<TunnelId> tunnelIds = typeKeyStore.get(type);
+        if (tunnelIds == null) {
+            return Collections.emptySet();
+        }
+        for (TunnelId id : tunnelIds) {
+            result.add(tunnelIdAsKeyStore.get(id));
+        }
+        return result.size() == 0 ? Collections.emptySet() : ImmutableSet
+                .copyOf(result);
+    }
+
+    @Override
+    public Collection<Tunnel> queryTunnel(TunnelEndPoint src, TunnelEndPoint dst) {
+        Collection<Tunnel> result = new HashSet<Tunnel>();
+        TunnelKey key = TunnelKey.tunnelKey(src, dst);
+        Set<TunnelId> tunnelIds = srcAndDstKeyStore.get(key);
+        if (tunnelIds == null) {
+            return Collections.emptySet();
+        }
+        for (TunnelId id : tunnelIds) {
+            result.add(tunnelIdAsKeyStore.get(id));
+        }
+        return result.size() == 0 ? Collections.emptySet() : ImmutableSet
+                .copyOf(result);
+    }
+
+    @Override
+    public int tunnelCount() {
+        return tunnelIdAsKeyStore.size();
+    }
+
+    /**
+     * Uses source TunnelPoint and destination TunnelPoint as map key.
+     */
+    private static final class TunnelKey {
+        private final TunnelEndPoint src;
+        private final TunnelEndPoint dst;
+
+        private TunnelKey(TunnelEndPoint src, TunnelEndPoint dst) {
+            this.src = src;
+            this.dst = dst;
+
+        }
+
+        /**
+         * create a map key.
+         *
+         * @param src
+         * @param dst
+         * @return a key using source ip and destination ip
+         */
+        static TunnelKey tunnelKey(TunnelEndPoint src, TunnelEndPoint dst) {
+            return new TunnelKey(src, dst);
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(src, dst);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj instanceof TunnelKey) {
+                final TunnelKey other = (TunnelKey) obj;
+                return Objects.equals(this.src, other.src)
+                        && Objects.equals(this.dst, other.dst);
+            }
+            return false;
+        }
+
+        @Override
+        public String toString() {
+            return MoreObjects.toStringHelper(getClass()).add("src", src)
+                    .add("dst", dst).toString();
+        }
+    }
+
+}
diff --git a/incubator/store/src/main/java/org/onosproject/incubator/store/tunnel/impl/package-info.java b/incubator/store/src/main/java/org/onosproject/incubator/store/tunnel/impl/package-info.java
new file mode 100644
index 0000000..f0c06f7
--- /dev/null
+++ b/incubator/store/src/main/java/org/onosproject/incubator/store/tunnel/impl/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Implementation of distributed tunnel store using p2p synchronization protocol.
+ */
+package org.onosproject.incubator.store.tunnel.impl;