diff --git a/apps/pom.xml b/apps/pom.xml
index 375f7cd..c1175e3 100644
--- a/apps/pom.xml
+++ b/apps/pom.xml
@@ -76,6 +76,7 @@
         <module>scalablegateway</module>
         <module>bmv2-demo</module>
         <module>yms</module>
+        <module>tetopology</module>
         <module>rabbitmq</module>
         <module>learning-switch</module>
     </modules>
diff --git a/apps/tetopology/BUCK b/apps/tetopology/BUCK
new file mode 100644
index 0000000..8a74315
--- /dev/null
+++ b/apps/tetopology/BUCK
@@ -0,0 +1,14 @@
+COMPILE_DEPS = [
+    '//lib:CORE_DEPS',
+]
+
+osgi_jar_with_tests (
+    deps = COMPILE_DEPS,
+)
+
+onos_app (
+    title = 'TE Topology Core App',
+    category = 'Traffic Steering',
+    url = 'http://onosproject.org',
+    description = 'Application to create and manage hierarchical TE topologies.',
+)
diff --git a/apps/tetopology/app.xml b/apps/tetopology/app.xml
new file mode 100644
index 0000000..e675d4c
--- /dev/null
+++ b/apps/tetopology/app.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<app name="org.onosproject.tetopology" origin="HUAWEI" version="${project.version}"
+     featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
+     features="${project.artifactId}">
+    <description>${project.description}</description>
+    <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
+</app>
+
diff --git a/apps/tetopology/features.xml b/apps/tetopology/features.xml
new file mode 100644
index 0000000..5b08d80
--- /dev/null
+++ b/apps/tetopology/features.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+  ~ 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.
+  -->
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${project.version}">
+    <feature name="${project.artifactId}" version="${project.version}"
+             description="${project.description}">
+        <feature>onos-api</feature>
+        <bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle>
+    </feature>
+</features>
diff --git a/apps/tetopology/pom.xml b/apps/tetopology/pom.xml
new file mode 100644
index 0000000..75ae24d
--- /dev/null
+++ b/apps/tetopology/pom.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2016-present 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.
+  -->
+<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/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-apps</artifactId>
+        <version>1.8.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>onos-app-tetopology</artifactId>
+    <version>1.8.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+
+    <description>IETF TE Management</description>
+
+    <properties>
+        <onos.app.name>org.onosproject.tetopology</onos.app.name>
+        <onos.app.category>Application</onos.app.category>
+        <onos.app.url>http://onosproject.org</onos.app.url>
+        <onos.app.readme>IETF TE Management.</onos.app.readme>
+        <!--  onos.app.requires>com.huawei.tsdn.yang</onos.app.requires -->
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onlab-junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-core-serializers</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava-testlib</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.easymock</groupId>
+            <artifactId>easymock</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onlab-osgi</artifactId>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-api</artifactId>
+            <scope>test</scope>
+            <classifier>tests</classifier>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-incubator-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onlab-misc</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-core-common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-core-common</artifactId>
+            <version>${project.version}</version>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>
+      
+    </dependencies>
+</project>
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/DefaultNetwork.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/DefaultNetwork.java
new file mode 100644
index 0000000..e2d600f
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/DefaultNetwork.java
@@ -0,0 +1,227 @@
+/*
+ * Copyright 2016 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.tetopology.management.api;
+
+import java.util.List;
+
+import org.onosproject.tetopology.management.api.link.NetworkLink;
+import org.onosproject.tetopology.management.api.node.NetworkNode;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * Default Network implementation.
+ * <p>
+ * The Set/Get methods below are defined to accept and pass references because
+ * the object class is treated as a "composite" object class that holds
+ * references to various member objects and their relationships, forming a
+ * data tree. Internal routines of the TE topology manager may use the
+ * following example methods to construct and manipulate any piece of data in
+ * the data tree:
+ * <pre>
+ * newNode.getTe().setAdminStatus(), or
+ * newNode.getSupportingNodeIds().add(nodeId), etc.
+ * </pre>
+ * Same for constructors where, for example, a child list may be constructed
+ * first and passed in by reference to its parent object constructor.
+ */
+public class DefaultNetwork implements Network {
+    private KeyId networkId;
+    private List<KeyId> supportingNetworkIds;
+    private List<NetworkNode> nodes;
+    private List<NetworkLink> links;
+    private TeTopologyId teTopologyId;
+    private boolean serverProvided;
+
+    /**
+     * Constructor with all fields.
+     *
+     * @param networkId network identifier
+     * @param supportingNetworkIds supporting network identifier
+     * @param nodes list of nodes within the network
+     * @param links list of links within the network
+     * @param teTopologyId TE topology identifier
+     * @param serverProvided whether the network is received from server
+     */
+    public DefaultNetwork(KeyId networkId, List<KeyId> supportingNetworkIds,
+            List<NetworkNode> nodes, List<NetworkLink> links, TeTopologyId teTopologyId,
+            boolean serverProvided) {
+        this.networkId = networkId;
+        this.supportingNetworkIds = supportingNetworkIds;
+        this.nodes = nodes;
+        this.links = links;
+        this.teTopologyId = teTopologyId;
+        this.serverProvided = serverProvided;
+    }
+
+    /**
+     * Constructor with key only.
+     *
+     * @param networkId network identifier
+     */
+    public DefaultNetwork(KeyId networkId) {
+        this.networkId = networkId;
+    }
+
+    /**
+     * Creates an instance of DefaultNetwork from an existing Network object.
+     *
+     * @param network network identifier
+     */
+    public DefaultNetwork(Network network) {
+        this.networkId = network.networkId();
+        this.supportingNetworkIds = network.getSupportingNetworkIds();
+        this.nodes = network.getNodes();
+        this.links = network.getLinks();
+        this.teTopologyId =  network.getTeTopologyId();
+        this.serverProvided =  network.isServerProvided();
+    }
+
+    @Override
+    public KeyId networkId() {
+        return networkId;
+    }
+
+    @Override
+    public List<KeyId> getSupportingNetworkIds() {
+        return supportingNetworkIds;
+    }
+
+    @Override
+    public List<NetworkNode> getNodes() {
+        return nodes;
+    }
+
+    @Override
+    public NetworkNode getNode(KeyId nodeId) {
+
+        for (NetworkNode node : nodes) {
+           if (node.nodeId().equals(nodeId)) {
+               return node;
+           }
+        }
+        return null;
+    }
+
+    @Override
+    public List<NetworkLink> getLinks() {
+        return links;
+    }
+
+    @Override
+    public NetworkLink getLink(KeyId linkId) {
+
+       for (NetworkLink link : links) {
+           if (link.linkId().equals(linkId)) {
+               return link;
+           }
+       }
+       return null;
+    }
+
+    @Override
+    public boolean isServerProvided() {
+        return serverProvided;
+    }
+
+    @Override
+    public TeTopologyId getTeTopologyId() {
+        return teTopologyId;
+    }
+
+
+    /**
+     * Sets the supporting network keys.
+     *
+     * @param supportingNetworkIds the supportingNetworkIds to set
+     */
+    public void setSupportingNetworkIds(List<KeyId> supportingNetworkIds) {
+        this.supportingNetworkIds = supportingNetworkIds;
+    }
+
+    /**
+     * Sets the list of nodes .
+     *
+     * @param nodes the nodes to set
+     */
+    public void setNodes(List<NetworkNode> nodes) {
+        this.nodes = nodes;
+    }
+
+    /**
+     * Sets the links.
+     *
+     * @param links the links to set
+     */
+    public void setLinks(List<NetworkLink> links) {
+        this.links = links;
+    }
+
+    /**
+     * Sets the attribute serverProvided.
+     *
+     * @param serverProvided the attribute to set
+     */
+    public void setServerProvided(boolean serverProvided) {
+        this.serverProvided = serverProvided;
+    }
+
+    /**
+     * Sets the TE Topology Id.
+     *
+     * @param teTopologyId the teTopologyId to set
+     */
+    public void setTeTopologyId(TeTopologyId teTopologyId) {
+        this.teTopologyId = teTopologyId;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(networkId, supportingNetworkIds,
+                nodes, links, serverProvided, teTopologyId);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object instanceof DefaultNetwork) {
+            DefaultNetwork that = (DefaultNetwork) object;
+            return Objects.equal(this.networkId, that.networkId) &&
+                    Objects.equal(this.supportingNetworkIds, that.supportingNetworkIds) &&
+                    Objects.equal(this.nodes, that.nodes) &&
+                    Objects.equal(this.links, that.links) &&
+                    Objects.equal(this.serverProvided, that.serverProvided) &&
+                    Objects.equal(this.teTopologyId, that.teTopologyId);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("networkId", networkId)
+                .add("supportingNetworkIds", supportingNetworkIds)
+                .add("nodes", nodes)
+                .add("links", links)
+                .add("serverProvided", serverProvided)
+                .add("teTopologyId", teTopologyId)
+                .toString();
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/DefaultNetworks.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/DefaultNetworks.java
new file mode 100644
index 0000000..51515e0
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/DefaultNetworks.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2016 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.tetopology.management.api;
+
+import java.util.List;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * Default Networks implementation.
+ * <p>
+ * The Set/Get methods below are defined to accept and pass references because
+ * the object class is treated as a "composite" object class that holds
+ * references to various member objects and their relationships, forming a
+ * data tree. Internal routines of the TE topology manager may use the
+ * following example methods to construct and manipulate any piece of data in
+ * the data tree:
+ * <pre>
+ * newNode.getTe().setAdminStatus(), or
+ * newNode.getSupportingNodeIds().add(nodeId), etc.
+ * </pre>
+ * Same for constructors where, for example, a child list may be constructed
+ * first and passed in by reference to its parent object constructor.
+ */
+public class DefaultNetworks implements Networks, TeTopologyEventSubject {
+    private List<Network> networks;
+
+    /**
+     * Creates an instance of DefaultNetworks.
+     */
+    public DefaultNetworks() {
+    }
+
+    /**
+     * Constructor with all fields.
+     *
+     * @param networks list of networks
+     */
+    public DefaultNetworks(List<Network> networks) {
+        this.networks = networks;
+    }
+
+    @Override
+    public List<Network> networks() {
+        return networks;
+    }
+
+    /**
+     * Sets the networks.
+     *
+     * @param networks the networks to set
+     */
+    public void setNetworks(List<Network> networks) {
+        this.networks = networks;
+    }
+
+    @Override
+    public int hashCode() {
+       return Objects.hashCode(networks);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object instanceof DefaultNetworks) {
+            DefaultNetworks that = (DefaultNetworks) object;
+            return Objects.equal(this.networks, that.networks);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("networks", networks)
+                .toString();
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/InternalTeNetwork.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/InternalTeNetwork.java
new file mode 100644
index 0000000..294d7d7
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/InternalTeNetwork.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2016 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.tetopology.management.api;
+
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * Internal TE Network implementation.
+ */
+public class InternalTeNetwork extends DefaultNetwork {
+    private TeTopologyType teTopologyType;
+
+    /**
+     * Constructor with all fields.
+     *
+     * @param teTopologyType TE topology type
+     * @param network network object
+     */
+    public InternalTeNetwork(TeTopologyType teTopologyType, Network network) {
+        super(network);
+        this.teTopologyType = teTopologyType;
+    }
+
+    /**
+     * Returns the TE topoology type.
+     *
+     * @return TE topology type
+     */
+    public TeTopologyType getTeTopologyType() {
+        return this.teTopologyType;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(super.hashCode(), teTopologyType);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object instanceof InternalTeNetwork) {
+
+            if (!super.equals(object)) {
+                return false;
+            }
+
+            InternalTeNetwork that = (InternalTeNetwork) object;
+            return Objects.equal(this.teTopologyType, that.teTopologyType);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("teTopologyType", teTopologyType)
+                .add("DefaultNetwork", super.toString())
+                .toString();
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/KeyId.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/KeyId.java
new file mode 100644
index 0000000..6e73a5b
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/KeyId.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2016-present 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.tetopology.management.api;
+
+import java.net.URI;
+import java.util.Objects;
+
+/**
+ * Representation of an key identifier in URI.
+ *
+ */
+public class KeyId {
+    /**
+     * Represents either no uri, or an unspecified uri.
+     */
+    public static final KeyId NONE = keyId("none:none");
+
+    private final URI uri;
+    private final String str;
+
+    // Public construction is prohibited
+    private KeyId(URI uri) {
+        this.uri = uri;
+        //this.str = uri.toString().toLowerCase();
+        this.str = uri.toString();
+    }
+
+
+    /**
+     * Default constructor for serialization of KeyId.
+     */
+    protected KeyId() {
+        this.uri = null;
+        this.str = null;
+    }
+
+    /**
+     * Returns the backing URI.
+     *
+     * @return backing URI
+     */
+    public URI uri() {
+        return uri;
+    }
+
+    @Override
+    public int hashCode() {
+        return str.hashCode();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof KeyId) {
+            KeyId that = (KeyId) obj;
+            return this.getClass() == that.getClass() &&
+                    Objects.equals(this.str, that.str);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return str;
+    }
+
+    /**
+     * Creates a uri id using the supplied URI.
+     *
+     * @param uri URI
+     * @return UriId
+     */
+    public static KeyId keyId(URI uri) {
+        return new KeyId(uri);
+    }
+
+    /**
+     * Creates a uri id using the supplied URI string.
+     *
+     * @param string URI string
+     * @return UriId
+     */
+    public static KeyId keyId(String string) {
+        return keyId(URI.create(string));
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/Network.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/Network.java
new file mode 100644
index 0000000..2f2014a
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/Network.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2016-present 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.tetopology.management.api;
+
+import java.util.List;
+
+import org.onosproject.tetopology.management.api.link.NetworkLink;
+import org.onosproject.tetopology.management.api.node.NetworkNode;
+
+/**
+ * Abstraction of a network element.
+ */
+public interface Network extends TeTopologyEventSubject {
+
+    /**
+     * Returns the network identifier / key of this element.
+     *
+     * @return network identifier
+     */
+    KeyId networkId();
+
+    /**
+     * Returns the attribute of supporting Network.
+     *
+     * @return list of the ids of the supporting networks
+     */
+    List<KeyId> getSupportingNetworkIds();
+
+    /**
+     * Returns a collection of nodes in the network identified by the specified
+     * network id.
+     *
+     * @return a collection of currently known nodes
+     */
+    List<NetworkNode> getNodes();
+
+    /**
+     * Returns the node.
+     *
+     * @param  nodeId node id URI format
+     * @return value of node
+     */
+    NetworkNode getNode(KeyId nodeId);
+
+    /**
+     * Returns a collection of links in the network identified by the specified
+     * network id.
+     *
+     * @return a collection of currently known links
+     */
+    List<NetworkLink> getLinks();
+
+    /**
+     * Returns the link.
+     *
+     * @param  linkId link id in URI format
+     * @return value of link
+     */
+    NetworkLink getLink(KeyId linkId);
+
+    /**
+     * Returns if the network is provided by a server or is configured by a
+     * client.
+     *
+     * @return true if the network is provided by a server; false otherwise
+     */
+    boolean isServerProvided();
+
+    /**
+     * Returns the TE topology Id.
+     *
+     * @return TE topology id for this network
+     */
+    TeTopologyId getTeTopologyId();
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/Networks.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/Networks.java
new file mode 100644
index 0000000..b8696a9
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/Networks.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2016 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.tetopology.management.api;
+
+import java.util.List;
+
+/**
+ * Abstraction of an entity which represents the functionality of networks.
+ */
+public interface Networks {
+
+    /**
+     * Returns the list of networks.
+     *
+     * @return list of networks
+     */
+    List<Network> networks();
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyEvent.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyEvent.java
new file mode 100644
index 0000000..556294f
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyEvent.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2016 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.tetopology.management.api;
+
+import org.onosproject.event.AbstractEvent;
+
+/**
+ * TE network topology event.
+ */
+public class TeTopologyEvent
+         extends AbstractEvent<TeTopologyEvent.Type, TeTopologyEventSubject> {
+
+    /**
+     * Type of TE topology events.
+     */
+    public enum Type {
+
+        /** Designates addition of a network. */
+        NETWORK_ADDED,
+
+        /** Designates update of a network. */
+        NETWORK_UPDATED,
+
+        /** Designates removal of a network. */
+        NETWORK_REMOVED,
+
+        /** Designates addition of a node. */
+        NODE_ADDED,
+
+        /** Designates update of a node. */
+        NODE_UPDATED,
+
+        /** Designates removal of a node. */
+        NODE_REMOVED,
+
+        /** Designates addition of a termination point. */
+        TP_ADDED,
+
+        /** Designates update of a termination point. */
+        TP_UPDATED,
+
+        /** Designates removal of a termination point. */
+        TP_REMOVED,
+
+        /** Designates addition of a link. */
+        LINK_ADDED,
+
+        /** Designates update of a link. */
+        LINK_UPDATED,
+
+        /** Designates removal of a link. */
+        LINK_REMOVED;
+    }
+
+    /**
+     * Constructor for TeTopologyEvent.
+     *
+     * @param type type of topology event
+     * @param subject event subject interface
+     */
+    public TeTopologyEvent(Type type, TeTopologyEventSubject subject) {
+        super(type, subject);
+    }
+
+    /**
+     * Constructor for TeTopologyEvent.
+     *
+     * @param type type of topology event
+     * @param subject event subject interface
+     * @param time event time
+     */
+    public TeTopologyEvent(Type type, TeTopologyEventSubject subject, long time) {
+        super(type, subject, time);
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyEventSubject.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyEventSubject.java
new file mode 100644
index 0000000..4241af4
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyEventSubject.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2016 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.tetopology.management.api;
+
+/**
+ * Abstraction of TE network topology event subject.
+ */
+public interface TeTopologyEventSubject {
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyId.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyId.java
new file mode 100644
index 0000000..d96ed74
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyId.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2016 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.tetopology.management.api;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * TE Topology identifiers.
+ */
+public class TeTopologyId {
+    private final long providerId;
+    private final long clientId;
+    private final String topologyId;
+
+    /**
+     * Creates an instance of TE topology identifier.
+     *
+     * @param providerId value of provider identifier
+     * @param clientId   value of client identifier
+     * @param topologyId value of topology identifier
+     */
+    public TeTopologyId(long providerId, long clientId, String topologyId) {
+        this.providerId = providerId;
+        this.clientId = clientId;
+        this.topologyId = topologyId;
+    }
+
+    /**
+     * Returns the provider identifier.
+     *
+     * @return provider identifier
+     */
+    public long providerId() {
+        return providerId;
+    }
+
+    /**
+     * Returns the client identifier.
+     *
+     * @return client identifier
+     */
+    public long clientId() {
+        return clientId;
+    }
+
+    /**
+     * Returns the topology identifier.
+     *
+     * @return topology identifier
+     */
+    public String topologyId() {
+        return topologyId;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(providerId, clientId, topologyId);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object instanceof TeTopologyId) {
+            TeTopologyId that = (TeTopologyId) object;
+            return Objects.equal(this.providerId, that.providerId) &&
+                    Objects.equal(this.clientId, that.clientId) &&
+                    Objects.equal(this.topologyId, that.topologyId);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("providerId", providerId)
+                .add("clientId", clientId)
+                .add("topologyId", topologyId)
+                .toString();
+    }
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyListener.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyListener.java
new file mode 100644
index 0000000..001c79f
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyListener.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2016 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.tetopology.management.api;
+
+import org.onosproject.event.EventListener;
+
+/**
+ * Entity capable of receiving TE network Topology related events.
+ */
+public interface TeTopologyListener extends EventListener<TeTopologyEvent> {
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyProvider.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyProvider.java
new file mode 100644
index 0000000..f52c4a3
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyProvider.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2016 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.tetopology.management.api;
+
+import org.onosproject.net.provider.Provider;
+
+/**
+ * Abstraction of an IETF network provider.
+ * APIs for Manager to signal Provider.
+ */
+public interface TeTopologyProvider extends Provider {
+
+    /**
+     * TODO:
+     *
+     * Signals provider that abstract networks/network/link/node has been created/updated/deleted.
+     * It's used by producers.
+     *
+     */
+
+    // TODO: Need to look at the following functions are required for TE Nodes
+
+    // TODO: consider how dirty the triggerProbe gets; if it costs too much, let's drop it
+
+    /**
+     * Triggers an asynchronous probe of the specified device, intended to
+     * determine whether the device is present or not. An indirect result of this
+     * should be invocation of
+     * {@link org.onosproject.net.device.DeviceProviderService#deviceConnected} )} or
+     * {@link org.onosproject.net.device.DeviceProviderService#deviceDisconnected}
+     * at some later point in time.
+     *
+     * @param deviceId ID of device to be probed
+     */
+    //void triggerProbe(DeviceId deviceId);
+
+    /**
+     * Notifies the provider of a mastership role change for the specified
+     * device as decided by the core.
+     *
+     * @param deviceId  device identifier
+     * @param newRole newly determined mastership role
+     */
+    //void roleChanged(DeviceId deviceId, MastershipRole newRole);
+
+    /**
+     * Checks the reachability (connectivity) of a device from this provider.
+     *
+     * @param deviceId  device identifier
+     * @return true if reachable, false otherwise
+     */
+    //boolean isReachable(DeviceId deviceId);
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyProviderRegistry.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyProviderRegistry.java
new file mode 100644
index 0000000..84fc030
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyProviderRegistry.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2016 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.tetopology.management.api;
+
+import org.onosproject.net.provider.ProviderRegistry;
+
+/**
+ *  Abstraction of IETF networks topology provider registry.
+ */
+public interface TeTopologyProviderRegistry
+         extends ProviderRegistry<TeTopologyProvider, TeTopologyProviderService> {
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyProviderService.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyProviderService.java
new file mode 100644
index 0000000..1374999
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyProviderService.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2016 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.tetopology.management.api;
+
+import org.onosproject.net.provider.ProviderService;
+import org.onosproject.tetopology.management.api.link.NetworkLink;
+import org.onosproject.tetopology.management.api.link.NetworkLinkKey;
+import org.onosproject.tetopology.management.api.node.NetworkNode;
+import org.onosproject.tetopology.management.api.node.NetworkNodeKey;
+import org.onosproject.tetopology.management.api.node.TerminationPoint;
+import org.onosproject.tetopology.management.api.node.TerminationPointKey;
+
+/**
+ * APIs for Provider to notify Manager about the network topology updates.
+ */
+public interface TeTopologyProviderService
+           extends ProviderService<TeTopologyProvider> {
+
+    /**
+     * Signals that a Network has been created/updated.
+     *
+     * @param network value of the network to be updated
+     */
+    void networkUpdated(Network network);
+
+    /**
+     * Signals that a Network has been removed.
+     *
+     * @param networkId network id in URI format
+     */
+    void networkRemoved(KeyId networkId);
+
+    /**
+     * Signals that a Link has been created/updated.
+     *
+     * @param linkKey link id
+     * @param link link object to be updated
+    */
+    void linkUpdated(NetworkLinkKey linkKey, NetworkLink link);
+
+    /**
+     * Signals that a Network has been removed.
+     *
+     * @param linkKey link id
+     */
+    void linkRemoved(NetworkLinkKey linkKey);
+
+    /**
+     * Signals that a Node has been created/updated.
+     *
+     * @param nodeKey node id
+     * @param node node object to be updated
+     */
+    void nodeUpdated(NetworkNodeKey nodeKey, NetworkNode node);
+
+    /**
+     * Signals that a Node has been removed.
+     *
+     * @param nodeKey node id
+     */
+    void nodeRemoved(NetworkNodeKey nodeKey);
+
+    /**
+     * Signals that a TerminationPoint has been created/updated.
+     *
+     * @param terminationPointKey termination point id
+     * @param terminationPoint termination point object to be updated
+     */
+    void terminationPointUpdated(TerminationPointKey terminationPointKey,
+                                TerminationPoint terminationPoint);
+
+    /**
+     * Signals that a TerminationPoint has been removed.
+     *
+     * @param terminationPointKey termination point id
+     */
+    void terminationPointRemoved(TerminationPointKey terminationPointKey);
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyService.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyService.java
new file mode 100644
index 0000000..fc4981f
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyService.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2016 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.tetopology.management.api;
+
+import org.onosproject.event.ListenerService;
+
+/**
+ * TE Topology Service API.
+ */
+public interface TeTopologyService
+    extends ListenerService<TeTopologyEvent, TeTopologyListener> {
+
+    /**
+     * Returns a collection of currently known networks.
+     *
+     * @return a collection of networks
+     */
+    Networks getNetworks();
+
+    /**
+     * Returns the network identified by its network id.
+     *
+     * @param  networkId network id in URI format
+     * @return value of network
+     */
+    Network getNetwork(KeyId networkId);
+
+    /**
+     * Updates the network.
+     *
+     * @param network network to be updated
+     */
+    void updateNetwork(Network network);
+
+    /**
+     * Removes the network.
+     *
+     * @param  networkId network id in URI format
+     */
+    void removeNetwork(KeyId networkId);
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyStore.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyStore.java
new file mode 100644
index 0000000..0433496
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyStore.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2016 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.tetopology.management.api;
+
+import java.util.List;
+
+import org.onosproject.store.Store;
+
+/**
+ * Inventory of TE network topology.
+ */
+public interface TeTopologyStore
+        extends Store<TeTopologyEvent, TeTopologyStoreDelegate> {
+
+    /**
+     * Returns a collection of currently known networks.
+     *
+     * @param  type TE topology type
+     * @return a collection of stored internal TE networks
+     */
+    List<InternalTeNetwork> getNetworks(TeTopologyType type);
+
+    /**
+     * Returns the network.
+     *
+     * @param  networkId network id in URI format
+     * @return value of internal TE network
+     */
+    InternalTeNetwork getNetwork(KeyId networkId);
+
+    /**
+     * Updates the network.
+     *
+     * @param network value of the network to be updated
+     */
+    void updateNetwork(InternalTeNetwork network);
+
+    /**
+     * Removes the network.
+     *
+     * @param  networkId network id in URI format
+     */
+    void removeNetwork(KeyId networkId);
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyStoreDelegate.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyStoreDelegate.java
new file mode 100644
index 0000000..7f6c929
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyStoreDelegate.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2016 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.tetopology.management.api;
+
+import org.onosproject.store.StoreDelegate;
+
+/**
+ * Abstraction of TE networks store delegate.
+ */
+public interface TeTopologyStoreDelegate extends StoreDelegate<TeTopologyEvent> {
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyType.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyType.java
new file mode 100644
index 0000000..e9cfb43
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/TeTopologyType.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2016-present 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.tetopology.management.api;
+
+/**
+ * TE Topology type enumeration.
+ */
+public enum TeTopologyType {
+
+    /**
+     * Native topology.
+     */
+    NATIVE(0),
+
+    /**
+     * Customized topology.
+     */
+    CUSTOMIZED(1),
+
+    /**
+     * Subordinate TE topology received from SB.
+     */
+    SUBORDINATE(2),
+
+    /**
+     * Configured TE topology received from NB.
+     */
+    CONFIGURED(3),
+
+    /**
+     * ANY - default value, used for topology filtering based on topology type.
+     */
+    ANY(4);
+
+    private int teTopologyType;
+
+    /**
+     * Creates an instance of teTopologyType.
+     *
+     * @param value value of teTopologyType
+     */
+    TeTopologyType(int value) {
+        teTopologyType = value;
+    }
+
+    /**
+     * Returns the attribute teTopologyType.
+     *
+     * @return value of teTopologyType
+     */
+    public int teTopologyType() {
+        return teTopologyType;
+    }
+
+    /**
+     * Returns the object of teTopologyType from input String. Returns null
+     * when string conversion fails or value is not recognized.
+     *
+     * @param valInString input String
+     * @return Object of teTopologyType
+     */
+    public static TeTopologyType of(String valInString) {
+        try {
+            int tmpVal = Integer.parseInt(valInString);
+            return of(tmpVal);
+        } catch (Exception e) {
+        }
+        return null;
+    }
+
+    /**
+     * Returns the object of teTopologyType from input integer. Returns null
+     * when the integer value is not recognized.
+     *
+     * @param value value of teTopologyType
+     * @return Object of corresponding TE topology type
+     */
+    public static TeTopologyType of(int value) {
+        switch (value) {
+            case 0:
+                return TeTopologyType.NATIVE;
+            case 1:
+                return TeTopologyType.CUSTOMIZED;
+            case 2:
+                return TeTopologyType.SUBORDINATE;
+            case 3:
+                return TeTopologyType.CONFIGURED;
+            case 4:
+                return TeTopologyType.ANY;
+            default :
+                return null;
+        }
+    }
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/AsNumber.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/AsNumber.java
new file mode 100644
index 0000000..8e46d22
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/AsNumber.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.link;
+
+import java.util.Objects;
+
+import com.google.common.base.MoreObjects;
+
+/**
+ * Implementation of Automous System (AS) number as an ElementType.
+ */
+public class AsNumber implements ElementType {
+    private final int asNumber;
+
+    /**
+     * Creates an instance of AsNumber.
+     *
+     * @param asNumber value of autonomous system number
+     */
+    public AsNumber(int asNumber) {
+        this.asNumber = asNumber;
+    }
+
+    /**
+     * Returns the asNumber.
+     *
+     * @return value of the autonomous system number
+     */
+    public int getAsNumber() {
+        return asNumber;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(asNumber);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof AsNumber) {
+            AsNumber other = (AsNumber) obj;
+            return Objects.equals(asNumber, other.asNumber);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(getClass())
+            .add("asNumber", asNumber)
+            .toString();
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/DefaultNetworkLink.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/DefaultNetworkLink.java
new file mode 100644
index 0000000..9aa4cd2
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/DefaultNetworkLink.java
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.link;
+
+import java.util.List;
+
+import org.onosproject.tetopology.management.api.KeyId;
+import org.onosproject.tetopology.management.api.node.TerminationPointKey;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * NetworkLink implementation.
+ * <p>
+ * The Set/Get methods below are defined to accept and pass references because
+ * the object class is treated as a "composite" object class that holds
+ * references to various member objects and their relationships, forming a
+ * data tree. Internal routines of the TE topology manager may use the
+ * following example methods to construct and manipulate any piece of data in
+ * the data tree:
+ *<pre>
+ * newNode.getTe().setAdminStatus(), or
+ * newNode.getSupportingNodeIds().add(nodeId), etc.
+ *</pre>
+ * Same for constructors where, for example, a child list may be constructed
+ * first and passed in by reference to its parent object constructor.
+ */
+public class DefaultNetworkLink implements NetworkLink {
+    private final KeyId linkId;
+    private TerminationPointKey source;
+    private TerminationPointKey destination;
+    private List<NetworkLinkKey> supportingLinkIds;
+    private TeLink te;
+
+    /**
+     * Creates an instance of DefaultNetworkLink.
+     *
+     * @param linkId link identifier
+     */
+    public DefaultNetworkLink(KeyId linkId) {
+        this.linkId = linkId;
+    }
+
+    /**
+     * Sets the link source point.
+     *
+     * @param source the source to set
+     */
+    public void setSource(TerminationPointKey source) {
+        this.source = source;
+    }
+
+    /**
+     * Sets the link destination point.
+     *
+     * @param destination the destination to set
+     */
+    public void setDestination(TerminationPointKey destination) {
+        this.destination = destination;
+    }
+
+    /**
+     * Sets the supporting link Ids.
+     *
+     * @param supportingLinkIds the supportingLinkIds to set
+     */
+    public void setSupportingLinkIds(List<NetworkLinkKey> supportingLinkIds) {
+        this.supportingLinkIds = supportingLinkIds;
+    }
+
+    /**
+     * Sets the te extension.
+     *
+     * @param te the te to set
+     */
+    public void setTe(TeLink te) {
+        this.te = te;
+    }
+
+    @Override
+    public KeyId linkId() {
+        return linkId;
+    }
+
+    @Override
+    public TerminationPointKey getSource() {
+        return source;
+    }
+
+    @Override
+    public TerminationPointKey getDestination() {
+        return destination;
+    }
+    @Override
+    public List<NetworkLinkKey> getSupportingLinkIds() {
+        return supportingLinkIds;
+    }
+
+    @Override
+    public TeLink getTe() {
+        return te;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(linkId, source, destination, supportingLinkIds, te);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object instanceof DefaultNetworkLink) {
+            DefaultNetworkLink that = (DefaultNetworkLink) object;
+            return Objects.equal(this.linkId, that.linkId) &&
+                    Objects.equal(this.source, that.source) &&
+                    Objects.equal(this.destination, that.destination) &&
+                    Objects.equal(this.supportingLinkIds, that.supportingLinkIds) &&
+                    Objects.equal(this.te, that.te);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("linkId", linkId)
+                .add("source", source)
+                .add("destination", destination)
+                .add("supportingLinkIds", supportingLinkIds)
+                .add("te", te)
+                .toString();
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/ElementType.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/ElementType.java
new file mode 100644
index 0000000..dfe6110
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/ElementType.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.link;
+
+/**
+ * Abstraction of a path element type.
+ */
+public interface ElementType {
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/ExternalDomain.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/ExternalDomain.java
new file mode 100644
index 0000000..e847da4
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/ExternalDomain.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.link;
+
+import org.onosproject.tetopology.management.api.KeyId;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * Representation of an external domain link.
+ */
+public class ExternalDomain {
+    private final KeyId remoteTeNodeId;
+    private final KeyId remoteTeLinkTpId;
+    private final long plugId;
+
+    /**
+     * Creates an instance of ExternalDomain.
+     *
+     * @param remoteTeNodeId remote TE node identifier
+     * @param remoteTeLinkTpId remote TE link termination point identifier
+     * @param plugId global plug id
+     */
+    public ExternalDomain(KeyId remoteTeNodeId, KeyId remoteTeLinkTpId, long plugId) {
+        this.remoteTeNodeId = remoteTeNodeId;
+        this.remoteTeLinkTpId = remoteTeLinkTpId;
+        this.plugId = plugId;
+    }
+
+    /**
+     * Creates an instance of ExternalDomain with remote TE node and tp.
+     *
+     * @param remoteTeNodeId remote TE node identifier
+     * @param remoteTeLinkTpId remote TE link termination point identifier
+     */
+    public ExternalDomain(KeyId remoteTeNodeId, KeyId remoteTeLinkTpId) {
+        this.remoteTeNodeId = remoteTeNodeId;
+        this.remoteTeLinkTpId = remoteTeLinkTpId;
+        this.plugId = 0L;
+    }
+
+    /**
+     * Creates an instance of ExternalDomain with plugId.
+     *
+     * @param plugId global plug id
+     */
+    public ExternalDomain(long plugId) {
+        this.remoteTeNodeId = null;
+        this.remoteTeLinkTpId = null;
+        this.plugId = plugId;
+    }
+
+    /**
+     * Returns the remote TeNode Id.
+     *
+     * @return value of the remote TE node identifier
+     */
+    public KeyId remoteTeNodeId() {
+        return remoteTeNodeId;
+    }
+
+    /**
+     * Returns the remote TeLink TpId.
+     *
+     * @return value of the remote TE link identifier
+     */
+    public KeyId remoteTeLinkTpId() {
+        return remoteTeLinkTpId;
+    }
+
+    /**
+     * Returns the plugId.
+     *
+     * @return value of the global plug id
+     */
+    public long plugId() {
+        return plugId;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(remoteTeNodeId, remoteTeLinkTpId, remoteTeLinkTpId);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object instanceof ExternalDomain) {
+            ExternalDomain that = (ExternalDomain) object;
+            return Objects.equal(this.remoteTeNodeId, that.remoteTeNodeId) &&
+                    Objects.equal(this.remoteTeLinkTpId, that.remoteTeLinkTpId) &&
+                    Objects.equal(this.remoteTeLinkTpId, that.remoteTeLinkTpId);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("remoteTeNodeId", remoteTeNodeId)
+                .add("remoteTeLinkTpId", remoteTeLinkTpId)
+                .add("remoteTeLinkTpId", remoteTeLinkTpId)
+                .toString();
+    }
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/Label.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/Label.java
new file mode 100644
index 0000000..558fc5a
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/Label.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.link;
+
+import java.util.Objects;
+
+import com.google.common.base.MoreObjects;
+
+/**
+ * Implementation of Label as an ElementType.
+ */
+public class Label implements ElementType {
+    private final long value;
+
+    /**
+     * Creates an instance of Label.
+     *
+     * @param label label value
+     */
+    public Label(long label) {
+        this.value = label;
+    }
+
+    /**
+     * Returns the label.
+     *
+     * @return value of the label
+     */
+    public long label() {
+        return value;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(value);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof Label) {
+            Label other = (Label) obj;
+            return
+                 Objects.equals(value, other.value);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(getClass())
+            .add("value", value)
+            .toString();
+    }
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/LinkProtectionType.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/LinkProtectionType.java
new file mode 100644
index 0000000..bcbdf0c
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/LinkProtectionType.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2016-present 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.tetopology.management.api.link;
+
+/**
+ * Represents ENUM data of linkProtectionType.
+ */
+public enum LinkProtectionType {
+
+    /**
+     * Represents unprotected.
+     */
+    UNPROTECTED(0),
+
+    /**
+     * Represents extraTraffic.
+     */
+    EXTRA_TRAFFIC(1),
+
+    /**
+     * Represents shared.
+     */
+    SHARED(2),
+
+    /**
+     * Represents yangAutoPrefix1For1.
+     */
+    YANGAUTOPREFIX1_FOR_1(3),
+
+    /**
+     * Represents yangAutoPrefix1Plus1.
+     */
+    YANGAUTOPREFIX1_PLUS_1(4),
+
+    /**
+     * Represents enhanced.
+     */
+    ENHANCED(5);
+
+    private int linkProtectionType;
+
+    LinkProtectionType(int value) {
+        linkProtectionType = value;
+    }
+
+    /**
+     * Returns the attribute linkProtectionType.
+     *
+     * @return value of linkProtectionType
+     */
+    public int linkProtectionType() {
+        return linkProtectionType;
+    }
+
+    /**
+     * Returns the object of linkProtectionType from input String. Returns null
+     * when string conversion fails or converted integer value is not recognized.
+     *
+     * @param valInString input String
+     * @return Object of linkProtectionType
+     */
+    public static LinkProtectionType of(String valInString) {
+        try {
+            int tmpVal = Integer.parseInt(valInString);
+            return of(tmpVal);
+        } catch (NumberFormatException e) {
+        }
+        return null;
+    }
+
+    /**
+     * Returns the object of linkProtectionType from input integer. Returns null
+     * when the integer value is not recognized.
+     *
+     * @param value value of linkProtectionTypeForTypeInt
+     * @return Object of linkProtectionTypeForTypeInt
+     */
+    public static LinkProtectionType of(int value) {
+        switch (value) {
+            case 0:
+                return LinkProtectionType.UNPROTECTED;
+            case 1:
+                return LinkProtectionType.EXTRA_TRAFFIC;
+            case 2:
+                return LinkProtectionType.SHARED;
+            case 3:
+                return LinkProtectionType.YANGAUTOPREFIX1_FOR_1;
+            case 4:
+                return LinkProtectionType.YANGAUTOPREFIX1_PLUS_1;
+            case 5:
+                return LinkProtectionType.ENHANCED;
+            default :
+                return null;
+        }
+    }
+
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/NetworkLink.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/NetworkLink.java
new file mode 100644
index 0000000..09cb010
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/NetworkLink.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.link;
+
+import java.util.List;
+
+import org.onosproject.tetopology.management.api.KeyId;
+import org.onosproject.tetopology.management.api.TeTopologyEventSubject;
+import org.onosproject.tetopology.management.api.node.TerminationPointKey;
+
+/**
+ * Abstraction of a base network link.
+ */
+public interface NetworkLink extends TeTopologyEventSubject {
+
+    /**
+     * Returns the link id.
+     *
+     * @return link identifier
+     */
+    KeyId linkId();
+
+    /**
+     * Returns the link source termination point.
+     *
+     * @return source link termination point id
+     */
+    TerminationPointKey getSource();
+
+    /**
+     * Returns the link destination termination point.
+     *
+     * @return destination link termination point id
+     */
+    TerminationPointKey getDestination();
+
+    /**
+     * Returns the supporting link ids.
+     *
+     * @return list of the ids of the supporting links
+     */
+    List<NetworkLinkKey> getSupportingLinkIds();
+
+    /**
+     * Returns the link te extension.
+     *
+     * @return TE link attributes
+     */
+    TeLink getTe();
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/NetworkLinkKey.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/NetworkLinkKey.java
new file mode 100644
index 0000000..aa5d5e1
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/NetworkLinkKey.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.link;
+
+import org.onosproject.tetopology.management.api.KeyId;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * Representation of a link key or link reference.
+ */
+public class NetworkLinkKey {
+    private final KeyId networkId;
+    private final KeyId linkId;
+
+    /**
+     * Creates an instance of NetworkLinkKey.
+     *
+     * @param networkId network identifier
+     * @param linkId link identifier
+     */
+    public NetworkLinkKey(KeyId networkId, KeyId linkId) {
+        this.networkId = networkId;
+        this.linkId = linkId;
+    }
+
+    /**
+     * Returns the network identifier.
+     *
+     * @return network identifier
+     */
+    public KeyId networkId() {
+        return networkId;
+    }
+
+    /**
+     * Returns the link identifier.
+     *
+     * @return link identifier
+     */
+    public KeyId linkId() {
+        return linkId;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(networkId, linkId);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object instanceof NetworkLinkKey) {
+            NetworkLinkKey that = (NetworkLinkKey) object;
+            return Objects.equal(this.networkId, that.networkId) &&
+                    Objects.equal(this.linkId, that.linkId);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("networkId", networkId)
+                .add("linkId", linkId)
+                .toString();
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/PathElement.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/PathElement.java
new file mode 100644
index 0000000..646c772
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/PathElement.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.link;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * Represent a path element.
+ */
+public class PathElement {
+    private final long pathElementId;
+    private final ElementType type;
+
+    /**
+     * Creates an instance of PathElement.
+     *
+     * @param pathElementId path element identifier
+     * @param type path element type
+     */
+    public PathElement(long pathElementId, ElementType type) {
+        this.pathElementId = pathElementId;
+        this.type = type;
+    }
+
+    /**
+     * Returns the path element identifier.
+     *
+     * @return path element id
+     */
+    public long pathElementId() {
+        return pathElementId;
+    }
+
+    /**
+     * Returns the path element type.
+     *
+     * @return path element type
+     */
+    public ElementType type() {
+        return type;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(pathElementId, type);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object instanceof PathElement) {
+            PathElement that = (PathElement) object;
+            return Objects.equal(this.pathElementId, that.pathElementId) &&
+                    Objects.equal(this.type, that.type);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("pathElementId", pathElementId)
+                .add("type", type)
+                .toString();
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/TeIpv4.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/TeIpv4.java
new file mode 100644
index 0000000..fdef295
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/TeIpv4.java
@@ -0,0 +1,120 @@
+/**
+ * Copyright 2016 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.tetopology.management.api.link;
+
+import java.util.Objects;
+
+import org.onlab.packet.Ip4Address;
+
+import com.google.common.base.MoreObjects;
+
+/**
+ * Implementation of IPv4 address as an ElementType.
+ */
+public class TeIpv4 implements ElementType {
+    private Ip4Address v4Address;
+    private short v4PrefixLength;
+    private boolean v4Loose;
+
+    /**
+     * Creates an instance of TeIpv4.
+     */
+    public TeIpv4() {
+    }
+
+    /**
+     * Sets the v4 address.
+     *
+     * @param v4Address the v4Address to set
+     */
+    public void setV4Address(Ip4Address v4Address) {
+        this.v4Address = v4Address;
+    }
+
+    /**
+     * Sets the prefix length.
+     *
+     * @param v4PrefixLength the v4PrefixLength to set
+     */
+    public void setV4PrefixLength(short v4PrefixLength) {
+        this.v4PrefixLength = v4PrefixLength;
+    }
+
+    /**
+     * Sets the loose flag.
+     *
+     * @param v4Loose the v4Loose to set
+     */
+    public void setV4Loose(boolean v4Loose) {
+        this.v4Loose = v4Loose;
+    }
+
+    /**
+     * Returns the v4Address.
+     *
+     * @return IPv4 address
+     */
+    public Ip4Address v4Address() {
+        return v4Address;
+    }
+
+    /**
+     * Returns the v4PrefixLength.
+     *
+     * @return IPv4 address prefix length
+     */
+    public short v4PrefixLength() {
+        return v4PrefixLength;
+    }
+
+    /**
+     * Returns the v4Loose.
+     *
+     * @return true if the address specifies a loose hop; false otherwise
+     */
+    public boolean v4Loose() {
+        return v4Loose;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(v4Address, v4PrefixLength, v4Loose);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof TeIpv4) {
+            TeIpv4 other = (TeIpv4) obj;
+            return Objects.equals(v4Address, other.v4Address) &&
+                 Objects.equals(v4PrefixLength, other.v4PrefixLength) &&
+                 Objects.equals(v4Loose, other.v4Loose);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(getClass())
+            .add("v4Address", v4Address)
+            .add("v4PrefixLength", v4PrefixLength)
+            .add("v4Loose", v4Loose)
+            .toString();
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/TeIpv6.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/TeIpv6.java
new file mode 100644
index 0000000..074a866
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/TeIpv6.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.link;
+
+import java.util.Objects;
+
+import org.onlab.packet.Ip6Address;
+
+import com.google.common.base.MoreObjects;
+
+/**
+ * Implementation of IPv6 address as an ElementType.
+ */
+public class TeIpv6 implements ElementType {
+    private Ip6Address v6Address;
+    private short v6PrefixLength;
+    private boolean v6Loose;
+
+    /**
+     * Creates an instance of TeIpv6.
+     */
+    public TeIpv6() {
+    }
+
+    /**
+     * Sets the v6 address.
+     *
+     * @param v6Address the v6Address to set
+     */
+    public void setV6Address(Ip6Address v6Address) {
+        this.v6Address = v6Address;
+    }
+
+    /**
+     * Sets the prefix length.
+     *
+     * @param v6PrefixLength the v6PrefixLength to set
+     */
+    public void setV6PrefixLength(short v6PrefixLength) {
+        this.v6PrefixLength = v6PrefixLength;
+    }
+
+    /**
+     * Sets the loose flag.
+     *
+     * @param v6Loose the v6Loose to set
+     */
+    public void setv6Loose(boolean v6Loose) {
+        this.v6Loose = v6Loose;
+    }
+
+    /**
+     * Returns the v6Address.
+     *
+     * @return IPv6 address
+     */
+    public Ip6Address v6Address() {
+        return v6Address;
+    }
+
+    /**
+     * Returns the v6PrefixLength.
+     *
+     * @return IPv6 address prefix length
+     */
+    public short v6PrefixLength() {
+        return v6PrefixLength;
+    }
+
+    /**
+     * Returns the v6Loose.
+     *
+     * @return true if the address specifies a loose hop; false otherwise
+     */
+    public boolean v6Loose() {
+        return v6Loose;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(v6Address, v6PrefixLength, v6Loose);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof TeIpv6) {
+            TeIpv6 other = (TeIpv6) obj;
+            return Objects.equals(v6Address, other.v6Address) &&
+                 Objects.equals(v6PrefixLength, other.v6PrefixLength) &&
+                 Objects.equals(v6Loose, other.v6Loose);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(getClass())
+            .add("v6Address", v6Address)
+            .add("v6PrefixLength", v6PrefixLength)
+            .add("v6Loose", v6Loose)
+            .toString();
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/TeLink.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/TeLink.java
new file mode 100644
index 0000000..181f710
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/TeLink.java
@@ -0,0 +1,368 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.link;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.List;
+
+import org.onosproject.tetopology.management.api.node.TeStatus;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * Link TE extension.
+ * <p>
+ * The Set/Get methods below are defined to accept and pass references because
+ * the object class is treated as a "composite" object class that holds
+ * references to various member objects and their relationships, forming a
+ * data tree. Internal routines of the TE topology manager may use the
+ * following example methods to construct and manipulate any piece of data in
+ * the data tree:
+ *<pre>
+ * newNode.getTe().setAdminStatus(), or
+ * newNode.getSupportingNodeIds().add(nodeId), etc.
+ *</pre>
+ * Same for constructors where, for example, a child list may be constructed
+ * first and passed in by reference to its parent object constructor.
+ */
+public class TeLink {
+    // See org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.
+    // topology.rev20160708.ietftetopology
+    // .augmentedntlink.te.config.DefaultTeLinkAttributes for reference
+    private BigInteger linkIndex;
+    private String name;
+    private TeStatus adminStatus;
+    private TeStatus opStatus;
+    private TeLinkAccessType accessType;
+    //private administrativeGroup
+    private LinkProtectionType linkProtectionType;
+    private BigDecimal maxLinkBandwidth;
+    private BigDecimal maxResvLinkBandwidth;
+    private List<UnreservedBandwidth> unreservedBandwidths;
+    private long teDefaultMetric;
+    private ExternalDomain externalDomain;
+    private List<Long> teSrlgs;
+    private boolean isAbstract;
+    private UnderlayPath underlayPath;
+
+    /**
+     * Creates an instance of TeLink.
+     *
+     * @param linkIndex TE link index
+     */
+    public TeLink(BigInteger linkIndex) {
+        this.linkIndex = linkIndex;
+    }
+
+    /**
+     * Sets the name.
+     *
+     * @param name the name to set
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * Sets the administrative status.
+     *
+     * @param adminStatus the adminStatus to set
+     */
+    public void setAdminStatus(TeStatus adminStatus) {
+        this.adminStatus = adminStatus;
+    }
+
+    /**
+     * Sets the operational status.
+     *
+     * @param opStatus the opStatus to set
+     */
+    public void setOpStatus(TeStatus opStatus) {
+        this.opStatus = opStatus;
+    }
+
+    /**
+     * Sets the access type.
+     *
+     * @param accessType the accessType to set
+     */
+    public void setAccessType(TeLinkAccessType accessType) {
+        this.accessType = accessType;
+    }
+
+    /**
+     * Sets the protection type.
+     *
+     * @param type the linkProtectionType to set
+     */
+    public void setLinkProtectionType(LinkProtectionType type) {
+        this.linkProtectionType = type;
+    }
+
+    /**
+     * Sets the link maximum bandwidth.
+     *
+     * @param bw the maxLinkBandwidth to set
+     */
+    public void setMaxLinkBandwidth(BigDecimal bw) {
+        this.maxLinkBandwidth = bw;
+    }
+
+    /**
+     * Sets the link maximum reservable bandwidth.
+     *
+     * @param bw the maxResvLinkBandwidth to set
+     */
+    public void setMaxResvLinkBandwidth(BigDecimal bw) {
+        this.maxResvLinkBandwidth = bw;
+    }
+
+    /**
+     * Sets the list of link unreserved bandwidths.
+     *
+     * @param bwList the unreservedBandwidths to set
+     */
+    public void setUnreservedBandwidths(List<UnreservedBandwidth> bwList) {
+        this.unreservedBandwidths = bwList;
+    }
+
+    /**
+     * Sets the default metric.
+     *
+     * @param metric the teDefaultMetric to set
+     */
+    public void setTeDefaultMetric(long metric) {
+        this.teDefaultMetric = metric;
+    }
+
+    /**
+     * Sets the external domain link.
+     *
+     * @param extDomain the externalDomain to set
+     */
+    public void setExternalDomain(ExternalDomain extDomain) {
+        this.externalDomain = extDomain;
+    }
+
+    /**
+     * Sets the list of SRLGs.
+     *
+     * @param teSrlgs the teSrlgs to set
+     */
+    public void setTeSrlgs(List<Long> teSrlgs) {
+        this.teSrlgs = teSrlgs;
+    }
+
+    /**
+     * Sets the isAbstract flag.
+     *
+     * @param isAbstract the isAbstract to set
+     */
+    public void setIsAbstract(boolean isAbstract) {
+        this.isAbstract = isAbstract;
+    }
+
+    /**
+     * Sets the link underlay path.
+     *
+     * @param underlayPath the underlay path to set
+     */
+    public void setUnderlayPath(UnderlayPath underlayPath) {
+        this.underlayPath = underlayPath;
+    }
+
+    /**
+     * Returns the link index.
+     *
+     * @return link index
+     */
+    public BigInteger linkIndex() {
+        return linkIndex;
+    }
+
+    /**
+     * Returns the name.
+     *
+     * @return name of the TE link
+     */
+    public String name() {
+        return name;
+    }
+
+    /**
+     * Returns the administrative status.
+     *
+     * @return link admin status
+     */
+    public TeStatus adminStatus() {
+        return adminStatus;
+    }
+
+    /**
+     * Returns the operational status.
+     *
+     * @return link operational status
+     */
+    public TeStatus opStatus() {
+        return opStatus;
+    }
+
+    /**
+     * Returns the access type.
+     *
+     * @return link access type
+     */
+    public TeLinkAccessType accessType() {
+        return accessType;
+    }
+
+    /**
+     * Returns the link protection type.
+     *
+     * @return link protection type
+     */
+    public LinkProtectionType linkProtectionType() {
+        return linkProtectionType;
+    }
+
+    /**
+     * Returns the link maximum bandwidth.
+     *
+     * @return link maximum bandwidth
+     */
+    public BigDecimal maxLinkBandwidth() {
+        return maxLinkBandwidth;
+    }
+
+    /**
+     * Returns the maximum reservable bandwidth.
+     *
+     * @return link maximum reservable bandwidth
+     */
+    public BigDecimal maxResvLinkBandwidth() {
+        return maxResvLinkBandwidth;
+    }
+
+    /**
+     * Returns the  list of link unreserved bandwidths.
+     *
+     * @return link unreserved bandwidth
+     */
+    public List<UnreservedBandwidth> unreservedBandwidths() {
+        return unreservedBandwidths;
+    }
+
+    /**
+     * Returns the te default metric.
+     *
+     * @return link TE metric
+     */
+    public long teDefaultMetric() {
+        return teDefaultMetric;
+    }
+
+    /**
+     * Returns the external domain link.
+     *
+     * @return external domain
+     */
+    public ExternalDomain externalDomain() {
+        return externalDomain;
+    }
+
+    /**
+     * Returns the list of SRLGs.
+     *
+     * @return link SRLG
+     */
+    public List<Long> teSrlgs() {
+        return teSrlgs;
+    }
+
+    /**
+     * Returns the flag isAbstract.
+     *
+     * @return true or false if link is abstract
+     */
+    public boolean isAbstract() {
+        return isAbstract;
+    }
+
+    /**
+     * Returns the underlay path data.
+     *
+     * @return link underlay TE path
+     */
+    public UnderlayPath underlayPath() {
+        return underlayPath;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(linkIndex, name, adminStatus, opStatus, accessType,
+                linkProtectionType, maxLinkBandwidth, maxResvLinkBandwidth, unreservedBandwidths,
+                teDefaultMetric, externalDomain, teSrlgs, isAbstract, underlayPath);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object instanceof TeLink) {
+            TeLink that = (TeLink) object;
+            return Objects.equal(this.linkIndex, that.linkIndex) &&
+                    Objects.equal(this.name, that.name) &&
+                    Objects.equal(this.adminStatus, that.adminStatus) &&
+                    Objects.equal(this.opStatus, that.opStatus) &&
+                    Objects.equal(this.accessType, that.accessType) &&
+                    Objects.equal(this.linkProtectionType, that.linkProtectionType) &&
+                    Objects.equal(this.maxLinkBandwidth, that.maxLinkBandwidth) &&
+                    Objects.equal(this.maxResvLinkBandwidth, that.maxResvLinkBandwidth) &&
+                    Objects.equal(this.unreservedBandwidths, that.unreservedBandwidths) &&
+                    Objects.equal(this.teDefaultMetric, that.teDefaultMetric) &&
+                    Objects.equal(this.externalDomain, that.externalDomain) &&
+                    Objects.equal(this.teSrlgs, that.teSrlgs) &&
+                    Objects.equal(this.isAbstract, that.isAbstract) &&
+                    Objects.equal(this.underlayPath, that.underlayPath);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("linkIndex", linkIndex)
+                .add("name", name)
+                .add("adminStatus", adminStatus)
+                .add("opStatus", opStatus)
+                .add("accessType", accessType)
+                .add("linkProtectionType", linkProtectionType)
+                .add("maxLinkBandwidth", maxLinkBandwidth)
+                .add("maxResvLinkBandwidth", maxResvLinkBandwidth)
+                .add("unreservedBandwidths", unreservedBandwidths)
+                .add("teDefaultMetric", teDefaultMetric)
+                .add("externalDomain", externalDomain)
+                .add("teSrlgs", teSrlgs)
+                .add("isAbstract", isAbstract)
+                .add("underlayPath", underlayPath)
+                .toString();
+    }
+
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/TeLinkAccessType.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/TeLinkAccessType.java
new file mode 100644
index 0000000..6fd34f5
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/TeLinkAccessType.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.link;
+
+/**
+ * Represents ENUM data of teLinkAccessType.
+ */
+public enum TeLinkAccessType {
+    /**
+     * Represents pointToPoint.
+     */
+    POINT_TO_POINT(0),
+
+    /**
+     * Represents multiAccess.
+     */
+    MULTI_ACCESS(1);
+
+    private int teLinkAccessType;
+
+    TeLinkAccessType(int value) {
+        teLinkAccessType = value;
+    }
+
+    /**
+     * Returns the attribute teLinkAccessType.
+     *
+     * @return value of teLinkAccessType
+     */
+    public int teLinkAccessType() {
+        return teLinkAccessType;
+    }
+
+    /**
+     * Returns the object of teLinkAccessType from input String. Returns null
+     * when string conversion fails or converted integer value is not recognized.
+     *
+     * @param valInString input String
+     * @return Object of teLinkAccessType
+     */
+    public static TeLinkAccessType of(String valInString) {
+        try {
+            int tmpVal = Integer.parseInt(valInString);
+            return of(tmpVal);
+        } catch (NumberFormatException e) {
+        }
+        return null;
+    }
+
+    /**
+     * Returns the object of teLinkAccessTypeForTypeInt. Returns null
+     * when the integer value is not recognized.
+     *
+     * @param value value of teLinkAccessTypeForTypeInt
+     * @return Object of teLinkAccessTypeForTypeInt
+     */
+    public static TeLinkAccessType of(int value) {
+        switch (value) {
+            case 0:
+                return TeLinkAccessType.POINT_TO_POINT;
+            case 1:
+                return TeLinkAccessType.MULTI_ACCESS;
+            default :
+                return null;
+        }
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/UnderlayAbstractPath.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/UnderlayAbstractPath.java
new file mode 100644
index 0000000..f57a75f
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/UnderlayAbstractPath.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.link;
+
+import java.util.List;
+import java.util.Objects;
+
+import org.onosproject.tetopology.management.api.node.TeNetworkTopologyId;
+
+import com.google.common.base.MoreObjects;
+
+/**
+ *  Represents the common defintion of an underlay path that supports a TE link.
+ */
+public class UnderlayAbstractPath {
+    private TeNetworkTopologyId ref;
+    private List<PathElement> pathElements;
+
+    /**
+     * Creates an instance of UnderlayAbstractPath.
+     */
+    public UnderlayAbstractPath() {
+    }
+
+    /**
+     * Sets the TE Topology reference.
+     *
+     * @param ref the ref to set
+     */
+    public void setRef(TeNetworkTopologyId ref) {
+        this.ref = ref;
+    }
+
+    /**
+     * Sets the list of path elements.
+     *
+     * @param pathElements the pathElement to set
+     */
+    public void setPathElement(List<PathElement> pathElements) {
+        this.pathElements = pathElements;
+    }
+
+    /**
+     * Returns the TE Topology reference.
+     *
+     * @return value of TE network topology identifier
+     */
+    public TeNetworkTopologyId ref() {
+        return ref;
+    }
+
+    /**
+     * Returns the list of path elements.
+     *
+     * @return list of path elements
+     */
+    public List<PathElement> pathElements() {
+        return pathElements;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(ref, pathElements);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof UnderlayAbstractPath) {
+            UnderlayAbstractPath other = (UnderlayAbstractPath) obj;
+            return Objects.equals(ref, other.ref) &&
+                 Objects.equals(pathElements, other.pathElements);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(getClass())
+            .add("ref", ref)
+            .add("pathElements", pathElements)
+            .toString();
+    }
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/UnderlayBackupPath.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/UnderlayBackupPath.java
new file mode 100644
index 0000000..385fed8
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/UnderlayBackupPath.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.link;
+
+import java.util.Objects;
+import com.google.common.base.MoreObjects;
+
+/**
+ * Represents a list of backup service paths on the underlay topology that
+ * protect the underlay primary path.
+ */
+public class UnderlayBackupPath extends UnderlayAbstractPath {
+    private long index;
+
+    /**
+     * Sets the index.
+     *
+     * @param index the index to set
+     */
+    public void setIndex(long index) {
+        this.index = index;
+    }
+
+    /**
+     * Returns the index.
+     *
+     * @return path index
+     */
+    public long index() {
+        return index;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(super.hashCode(), index);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof UnderlayBackupPath) {
+            if (!super.equals(obj)) {
+                return false;
+            }
+            UnderlayBackupPath that = (UnderlayBackupPath) obj;
+            return this.index == that.index;
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(getClass())
+            .add("index", index)
+            .add("ref", ref())
+            .add("pathElements", pathElements())
+            .toString();
+    }
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/UnderlayPath.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/UnderlayPath.java
new file mode 100644
index 0000000..9d0886b
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/UnderlayPath.java
@@ -0,0 +1,164 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.link;
+
+import java.util.List;
+
+import org.onosproject.tetopology.management.api.node.TerminationPointKey;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * Represents the TE link underlay path data.
+ */
+public class UnderlayPath {
+    private int protectionType;
+    private UnderlayPrimaryPath primaryPath;
+    private List<UnderlayBackupPath> backupPaths;
+    private TerminationPointKey trailSrc;
+    private TerminationPointKey trailDes;
+
+    /**
+     * Creates an instance of Underlay.
+     */
+    public UnderlayPath() {
+    }
+
+    /**
+     * Sets the protection type.
+     *
+     * @param protectionType the protectionType to set
+     */
+    public void setProtectionType(int protectionType) {
+        this.protectionType = protectionType;
+    }
+
+    /**
+     * Sets the primary path.
+     *
+     * @param primaryPath the primaryPath to set
+     */
+    public void setPrimaryPath(UnderlayPrimaryPath primaryPath) {
+        this.primaryPath = primaryPath;
+    }
+
+    /**
+     * Sets the link of backup paths.
+     *
+     * @param backupPaths the backupPath to set
+     */
+    public void setBackupPath(List<UnderlayBackupPath> backupPaths) {
+        this.backupPaths = backupPaths;
+    }
+
+    /**
+     * Sets the trail source.
+     *
+     * @param trailSrc the trailSrc to set
+     */
+    public void setTrailSrc(TerminationPointKey trailSrc) {
+        this.trailSrc = trailSrc;
+    }
+
+    /**
+     * Sets the trail destination.
+     *
+     * @param trailDes the trailDes to set
+     */
+    public void setTrailDes(TerminationPointKey trailDes) {
+        this.trailDes = trailDes;
+    }
+
+    /**
+     * Returns the protection type.
+     *
+     * @return path protection type
+     */
+    public int protectionType() {
+        return protectionType;
+    }
+
+    /**
+     * Returns the primary path.
+     *
+     * @return underlay primary path
+     */
+    public UnderlayPrimaryPath primaryPath() {
+        return primaryPath;
+    }
+
+    /**
+     * Returns the backup paths.
+     *
+     * @return list of underlay backup paths
+     */
+    public List<UnderlayBackupPath> backupPaths() {
+        return backupPaths;
+    }
+
+    /**
+     * Returns the trail source.
+     *
+     * @return trail source
+     */
+    public TerminationPointKey trailSrc() {
+        return trailSrc;
+    }
+
+    /**
+     * Returns the trail destination.
+     *
+     * @return trail destination
+     */
+    public TerminationPointKey trailDes() {
+        return trailDes;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(protectionType, primaryPath,
+                                            backupPaths, trailSrc, trailDes);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object instanceof UnderlayPath) {
+            UnderlayPath that = (UnderlayPath) object;
+            return Objects.equal(this.protectionType, that.protectionType) &&
+                    Objects.equal(this.primaryPath, that.primaryPath) &&
+                    Objects.equal(this.backupPaths, that.backupPaths) &&
+                    Objects.equal(this.trailSrc, that.trailSrc) &&
+                    Objects.equal(this.trailDes, that.trailDes);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("protectionType", protectionType)
+                .add("primaryPath", primaryPath)
+                .add("backupPaths", backupPaths)
+                .add("trailSrc", trailSrc)
+                .add("trailDes", trailDes)
+                .toString();
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/UnderlayPrimaryPath.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/UnderlayPrimaryPath.java
new file mode 100644
index 0000000..004b3ed
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/UnderlayPrimaryPath.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.link;
+
+/**
+ *  Represents the underlay primary path that supports a TE link.
+ */
+public class UnderlayPrimaryPath extends UnderlayAbstractPath {
+/*
+  * Underlay primary path currently has the same data structure defined in
+  * the underlay abstract path. It may be extended per standard definitions.
+  */
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/UnnumberedLink.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/UnnumberedLink.java
new file mode 100644
index 0000000..1b47cf9
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/UnnumberedLink.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.link;
+
+import java.util.Objects;
+
+import org.onlab.packet.IpAddress;
+
+import com.google.common.base.MoreObjects;
+
+/**
+ * Implementation of unnumbered link as an ElementType.
+ */
+public class UnnumberedLink implements ElementType {
+    private IpAddress routerId;
+    private long interfaceId;
+
+    /**
+     * Creates an instance of UnnumberedLink.
+     */
+    public UnnumberedLink() {
+    }
+
+    /**
+     * Sets the router Id.
+     *
+     * @param routerId the routerId to set
+     */
+    public void setRouterId(IpAddress routerId) {
+        this.routerId = routerId;
+    }
+
+    /**
+     * Sets the interface Id.
+     *
+     * @param interfaceId the interfaceId to set
+     */
+    public void setInterfaceId(long interfaceId) {
+        this.interfaceId = interfaceId;
+    }
+
+    /**
+     * Returns the router Id.
+     *
+     * @return router identifier
+     */
+    public IpAddress routerId() {
+        return routerId;
+    }
+
+    /**
+     * Returns the interface Id.
+     *
+     * @return interface identifier
+     */
+    public long interfaceId() {
+        return interfaceId;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(routerId, interfaceId);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof UnnumberedLink) {
+            UnnumberedLink other = (UnnumberedLink) obj;
+            return
+                 Objects.equals(routerId, other.routerId) &&
+                 Objects.equals(interfaceId, other.interfaceId);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(getClass())
+            .add("routerId", routerId)
+            .add("interfaceId", interfaceId)
+            .toString();
+    }
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/UnreservedBandwidth.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/UnreservedBandwidth.java
new file mode 100644
index 0000000..4225345
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/UnreservedBandwidth.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.link;
+
+import java.math.BigDecimal;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * Representation of a link's unreserved bandwidth.
+ */
+public class UnreservedBandwidth {
+    private final short priority;
+    private final BigDecimal bandwidth;
+
+    /**
+     * Create an instance of UnreservedBandwidth.
+     *
+     * @param priority allocatable priority of unreserved bandwidth
+     * @param bandwidth bandwidth
+     */
+    public UnreservedBandwidth(short priority, BigDecimal bandwidth) {
+        this.priority = priority;
+        this.bandwidth = bandwidth;
+    }
+
+    /**
+     * Returns the priority.
+     *
+     * @return the priority
+     */
+    public short priority() {
+        return priority;
+    }
+
+    /**
+     * Returns the bandwidth.
+     *
+     * @return the bandwidth
+     */
+    public BigDecimal bandwidth() {
+        return bandwidth;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(priority, bandwidth);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object instanceof UnreservedBandwidth) {
+            UnreservedBandwidth that = (UnreservedBandwidth) object;
+            return Objects.equal(this.priority, that.priority) &&
+                    Objects.equal(this.bandwidth, that.bandwidth);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("priority", priority)
+                .add("bandwidth", bandwidth)
+                .toString();
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/package-info.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/package-info.java
new file mode 100644
index 0000000..3b4c1cb
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/link/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2016 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.
+ */
+/**
+ * TE link API.
+ */
+package org.onosproject.tetopology.management.api.link;
\ No newline at end of file
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/ConnectivityMatrix.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/ConnectivityMatrix.java
new file mode 100644
index 0000000..ba298a8
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/ConnectivityMatrix.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.node;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ *  Represents node's switching limitations.
+ */
+public class ConnectivityMatrix {
+    private final long id;
+    private TerminationPointKey from;
+    private TerminationPointKey to;
+    private boolean isAllowed;
+
+    /**
+     * Creates an instance of ConnectivityMatrix.
+     *
+     * @param id connectivity matrix identifier
+     * @param from from termination point key
+     * @param to to termination point key
+     * @param isAllowed indicate whether this connectivity matrix is useable
+     */
+    public ConnectivityMatrix(long id, TerminationPointKey from,
+                            TerminationPointKey to, boolean isAllowed) {
+        this.id = id;
+        this.from = from;
+        this.to = to;
+        this.isAllowed = isAllowed;
+    }
+
+    /**
+     * Constructor with id only.
+     *
+     * @param id connectivity matrix id
+     */
+    public ConnectivityMatrix(long id) {
+        this.id = id;
+    }
+
+    /**
+     * Returns the id.
+     *
+     * @return connectivity matrix id
+     */
+    public long id() {
+        return id;
+    }
+
+    /**
+     * Returns the "from" of a connectivity matrix.
+     *
+     * @return the "from" of a connectivity matrix
+     */
+    public TerminationPointKey from() {
+        return from;
+    }
+
+    /**
+     * Returns the "to" of a connectivity matrix.
+     *
+     * @return the "to" of a connectivity matrix
+     */
+    public TerminationPointKey to() {
+        return to;
+    }
+
+    /**
+     * Returns true if the connectivity matrix is allowed; false otherwise.
+     *
+     * @return true if the connectivity matrix is allowed; false otherwise
+     */
+    public boolean isAllowed() {
+        return isAllowed;
+    }
+
+    /**
+     * Sets the from termination point.
+     *
+     * @param from the from to set
+     */
+    public void setFrom(TerminationPointKey from) {
+        this.from = from;
+    }
+
+    /**
+     * Sets the to termination point.
+     *
+     * @param to the to to set
+     */
+    public void setTo(TerminationPointKey to) {
+        this.to = to;
+    }
+
+    /**
+     * Sets isAllowed.
+     *
+     * @param isAllowed the isAllowed to set
+     */
+    public void setIsAllowed(boolean isAllowed) {
+        this.isAllowed = isAllowed;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(id, from, to, isAllowed);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object instanceof ConnectivityMatrix) {
+            ConnectivityMatrix that = (ConnectivityMatrix) object;
+            return Objects.equal(this.id, that.id) &&
+                    Objects.equal(this.from, that.from) &&
+                    Objects.equal(this.to, that.to) &&
+                    Objects.equal(this.isAllowed, that.isAllowed);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("id", id)
+                .add("from", from)
+                .add("to", to)
+                .add("isAllowed", isAllowed)
+               .toString();
+    }
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/DefaultNetworkNode.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/DefaultNetworkNode.java
new file mode 100644
index 0000000..62c65b5
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/DefaultNetworkNode.java
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.node;
+
+import java.util.List;
+
+import org.onosproject.tetopology.management.api.KeyId;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * NetworkNode implementation.
+ * <p>
+ * The Set/Get methods below are defined to accept and pass references because
+ * the object class is treated as a "composite" object class that holds
+ * references to various member objects and their relationships, forming a
+ * data tree. Internal routines of the TE topology manager may use the
+ * following example methods to construct and manipulate any piece of data in
+ * the data tree:
+ *<pre>
+ * newNode.getTe().setAdminStatus(), or
+ * newNode.getSupportingNodeIds().add(nodeId), etc.
+ *</pre>
+ * Same for constructors where, for example, a child list may be constructed
+ * first and passed in by reference to its parent object constructor.
+ */
+public class DefaultNetworkNode implements NetworkNode {
+    private final KeyId id;
+    private List<NetworkNodeKey> supportingNodeIds;
+    private TeNode te;
+    private List<TerminationPoint> tps;
+
+    /**
+     * Creates an instance of DefaultNetworkNode using Id.
+     *
+     * @param id network node identifier
+     */
+    public DefaultNetworkNode(KeyId id) {
+        this.id = id;
+    }
+
+    /**
+     * Creates an instance of DefaultNetworkNode.
+     *
+     * @param id network node identifier
+     * @param nodeIds support node identifiers
+     * @param te te parameter of the node
+     */
+    public DefaultNetworkNode(KeyId id, List<NetworkNodeKey> nodeIds, TeNode te) {
+        this.id = id;
+        this.supportingNodeIds = nodeIds;
+        this.te = te;
+    }
+
+    /**
+     * Sets the list of supporting node ids.
+     *
+     * @param ids the supporting node ids to set
+     */
+    public void setSupportingNodeIds(List<NetworkNodeKey> ids) {
+        this.supportingNodeIds = ids;
+    }
+
+    /**
+     * Sets the te attribute.
+     *
+     * @param te the te to set
+     */
+    public void setTe(TeNode te) {
+        this.te = te;
+    }
+
+    /**
+     * Sets the TerminationPoints.
+     *
+     * @param tps the tps to set
+     */
+    public void setTerminationPoints(List<TerminationPoint> tps) {
+        this.tps = tps;
+    }
+
+    /**
+     * Returns the node identifier.
+     *
+     * @return node identifier
+     */
+    @Override
+    public KeyId nodeId() {
+        return id;
+    }
+
+    /**
+     * Returns the supportingNodeIds.
+     *
+     * @return list of supporting node identifiers for this node
+     */
+    @Override
+    public List<NetworkNodeKey> getSupportingNodeIds() {
+        return supportingNodeIds;
+    }
+
+    /**
+     * Returns the te attribute value.
+     *
+     * @return TE attributes of this node
+     */
+    @Override
+    public TeNode getTe() {
+        return te;
+    }
+
+    /**
+     * Returns the list of termination points.
+     *
+     * @return a list of termination points associated with this node
+     */
+    @Override
+    public List<TerminationPoint> getTerminationPoints() {
+        return tps;
+    }
+
+    /**
+     * Returns the termination point.
+     *
+     * @return the termination point
+     */
+    @Override
+    public TerminationPoint getTerminationPoint(KeyId tpId) {
+
+        for (TerminationPoint tp : tps) {
+           if (tp.id().equals(tpId)) {
+               return tp;
+           }
+        }
+
+        return null;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(id, supportingNodeIds, te, tps);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object instanceof DefaultNetworkNode) {
+            DefaultNetworkNode that = (DefaultNetworkNode) object;
+            return Objects.equal(this.id, that.id) &&
+                    Objects.equal(this.supportingNodeIds, that.supportingNodeIds) &&
+                    Objects.equal(this.te, that.te) &&
+                    Objects.equal(this.tps, that.tps);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("id", id)
+                .add("supportingNodeIds", supportingNodeIds)
+                .add("te", te)
+                .add("tps", tps)
+                .toString();
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/DefaultTerminationPoint.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/DefaultTerminationPoint.java
new file mode 100644
index 0000000..057cd4c
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/DefaultTerminationPoint.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.node;
+
+import java.util.List;
+
+import org.onosproject.tetopology.management.api.KeyId;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * Represent a termination point.
+ * <p>
+ * The Set/Get methods below are defined to accept and pass references because
+ * the object class is treated as a "composite" object class that holds
+ * references to various member objects and their relationships, forming a
+ * data tree. Internal routines of the TE topology manager may use the
+ * following example methods to construct and manipulate any piece of data in
+ * the data tree:
+ *<pre>
+ * newNode.getTe().setAdminStatus(), or
+ * newNode.getSupportingNodeIds().add(nodeId), etc.
+ *</pre>
+ * Same for constructors where, for example, a child list may be constructed
+ * first and passed in by reference to its parent object constructor.
+ */
+public class DefaultTerminationPoint implements TerminationPoint {
+    private KeyId id;
+    private List<TerminationPointKey> supportingTpIds;
+    private TeTerminationPoint te;
+
+    /**
+     * Creates an instance of DefaultTerminationPoint.
+     *
+     * @param id termination point identifier
+     * @param tps support termination point identifier
+     * @param te te parameters of the terminiation point
+     */
+    public DefaultTerminationPoint(KeyId id, List<TerminationPointKey> tps,
+                                              TeTerminationPoint te) {
+        this.id = id;
+        this.supportingTpIds = tps;
+        this.te = te;
+    }
+
+    /**
+     * Creates an instance of DefaultTerminationPoint with teTpId only.
+     *
+     * @param id termination point identifier
+     */
+    public DefaultTerminationPoint(KeyId id) {
+        this.id = id;
+    }
+
+    @Override
+    public KeyId id() {
+        return id;
+    }
+
+    @Override
+    public List<TerminationPointKey> getSupportingTpIds() {
+        return supportingTpIds;
+    }
+
+    @Override
+    public TeTerminationPoint getTe() {
+        return te;
+    }
+
+    /**
+     * Sets the Id.
+     *
+     * @param id the id to set
+     */
+    public void setId(KeyId id) {
+        this.id = id;
+    }
+
+    /**
+     * Sets the supportingTpIds.
+     *
+     * @param tps the supportingTpIds to set
+     */
+    public void setSupportingTpIds(List<TerminationPointKey> tps) {
+        this.supportingTpIds = tps;
+    }
+
+    /**
+     * Sets the te extension.
+     *
+     * @param te the te to set
+     */
+    public void setTe(TeTerminationPoint te) {
+        this.te = te;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(id, supportingTpIds, te);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object instanceof DefaultTerminationPoint) {
+            DefaultTerminationPoint that = (DefaultTerminationPoint) object;
+            return Objects.equal(this.id, that.id) &&
+                    Objects.equal(this.supportingTpIds, that.supportingTpIds) &&
+                    Objects.equal(this.te, that.te);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("id", id)
+                .add("supportingTpIds", supportingTpIds)
+                .add("te", te)
+                .toString();
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/InterfaceSwitchingCapability.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/InterfaceSwitchingCapability.java
new file mode 100644
index 0000000..99e06de
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/InterfaceSwitchingCapability.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.node;
+
+/**
+ * Interface switching capability representation.
+ */
+public class InterfaceSwitchingCapability {
+    // Should include switching capability, lsp encoding, max_lsp-bandwidth
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/NetworkNode.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/NetworkNode.java
new file mode 100644
index 0000000..23ae28a
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/NetworkNode.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.node;
+
+import java.util.List;
+
+import org.onosproject.tetopology.management.api.KeyId;
+import org.onosproject.tetopology.management.api.TeTopologyEventSubject;
+
+/**
+ * Abstraction of a network node.
+ */
+public interface NetworkNode extends TeTopologyEventSubject {
+
+    /**
+     * Returns the node id.
+     *
+     * @return node identifier
+     */
+    KeyId nodeId();
+
+    /**
+     * Returns the supporting node ids.
+     *
+     * @return list of the ids of the supporting nodes
+     */
+    List<NetworkNodeKey> getSupportingNodeIds();
+
+    /**
+     * Returns the node TE extension attributes.
+     *
+     * @return node TE extension attributes
+     */
+    TeNode getTe();
+
+    /**
+     * Returns a collection of currently known termination points.
+     *
+     * @return a collection of termination points associated with this node
+     */
+    List<TerminationPoint> getTerminationPoints();
+
+    /**
+     * Returns the termination point.
+     *
+     * @param  tpId termination point id
+     * @return value of termination point
+     */
+    TerminationPoint getTerminationPoint(KeyId tpId);
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/NetworkNodeKey.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/NetworkNodeKey.java
new file mode 100644
index 0000000..cdb6913
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/NetworkNodeKey.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.node;
+
+import org.onosproject.tetopology.management.api.KeyId;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * Representation of a node key or node reference.
+ */
+public class NetworkNodeKey {
+    private final KeyId networkId;
+    private final KeyId nodeId;
+
+    /**
+     * Creates an instance of NetworkNodeKey.
+     *
+     * @param networkId network identifier
+     * @param nodeId node identifier
+     */
+    public NetworkNodeKey(KeyId networkId, KeyId nodeId) {
+        this.networkId = networkId;
+        this.nodeId = nodeId;
+    }
+
+    /**
+     * Returns the network identifier.
+     *
+     * @return network identifier
+     */
+    public KeyId networkId() {
+        return networkId;
+    }
+
+    /**
+     * Returns the node identifier.
+     *
+     * @return node identifier
+     */
+    public KeyId nodeId() {
+        return nodeId;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(networkId, nodeId);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object instanceof NetworkNodeKey) {
+            NetworkNodeKey that = (NetworkNodeKey) object;
+            return Objects.equal(this.networkId, that.networkId) &&
+                    Objects.equal(this.nodeId, that.nodeId);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("networkId", networkId)
+                .add("nodeId", nodeId)
+                .toString();
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TeNetworkTopologyId.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TeNetworkTopologyId.java
new file mode 100644
index 0000000..4c3bbe9
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TeNetworkTopologyId.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.node;
+
+import org.onosproject.tetopology.management.api.KeyId;
+import org.onosproject.tetopology.management.api.TeTopologyId;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * TE Network Topology identifiers.
+ */
+public class TeNetworkTopologyId {
+    private final KeyId networkId;
+    private final TeTopologyId topologyId;
+
+    /**
+     * Creates an instance of TeNetworkTopologyId.
+     *
+     * @param networkId network identifier
+     * @param topologyId topology identifier
+     */
+    public TeNetworkTopologyId(KeyId networkId, TeTopologyId topologyId) {
+        this.networkId = networkId;
+        this.topologyId = topologyId;
+    }
+
+    /**
+     * Creates TeNetworkTopologyId with networkId.
+     *
+     * @param networkId network identifier
+     */
+    public TeNetworkTopologyId(KeyId networkId) {
+        this.networkId = networkId;
+        this.topologyId = null;
+    }
+
+    /**
+     * Creates TeNetworkTopologyId with topologyId.
+     *
+     * @param topologyId topology identifier
+     */
+    public TeNetworkTopologyId(TeTopologyId topologyId) {
+        this.networkId = null;
+        this.topologyId = topologyId;
+    }
+
+    /**
+     * Returns the network identifier.
+     *
+     * @return network id
+     */
+    public KeyId getNetworkId() {
+        return networkId;
+    }
+
+    /**
+     * Returns the topology identifier.
+     *
+     * @return TE topology id
+     */
+    public TeTopologyId getTopologyId() {
+        return topologyId;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(networkId, topologyId);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object instanceof TeNetworkTopologyId) {
+            TeNetworkTopologyId that = (TeNetworkTopologyId) object;
+            return Objects.equal(this.networkId, that.networkId) &&
+                    Objects.equal(this.topologyId, that.topologyId);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("networkId", networkId)
+                .add("topologyId", topologyId)
+                .toString();
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TeNode.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TeNode.java
new file mode 100644
index 0000000..0eef01c
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TeNode.java
@@ -0,0 +1,235 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.node;
+
+import java.util.List;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * TE Node representation.
+ * <p>
+ * The Set/Get methods below are defined to accept and pass references because
+ * the object class is treated as a "composite" object class that holds
+ * references to various member objects and their relationships, forming a
+ * data tree. Internal routines of the TE topology manager may use the
+ * following example methods to construct and manipulate any piece of data in
+ * the data tree:
+ * <pre>
+ * newNode.getTe().setAdminStatus(), or
+ * newNode.getSupportingNodeIds().add(nodeId), etc.
+ * </pre>
+ * Same for constructors where, for example, a child list may be constructed
+ * first and passed in by reference to its parent object constructor.
+ */
+public class TeNode {
+    // See org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.
+    // topology.rev20160708.ietftetopology
+    // .augmentednwnode.te.config.DefaultTeNodeAttributes for reference
+    private String teNodeId;
+    private String name;
+    private TeStatus adminStatus;
+    private TeStatus opStatus;
+    private boolean isAbstract;
+    private List<ConnectivityMatrix> connMatrices;
+    private TeNetworkTopologyId underlayTopology;
+    private List<TunnelTerminationPoint> tunnelTerminationPoints;
+
+    /**
+     * Creates an instance of TeNode.
+     *
+     * @param teNodeId TE node identifier
+     */
+    public TeNode(String teNodeId) {
+        this.teNodeId = teNodeId;
+    }
+
+    /**
+     * Sets the node name.
+     *
+     * @param name the name to set
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * Sets the node administrative status.
+     *
+     * @param adminStatus the adminStatus to set
+     */
+    public void setAdminStatus(TeStatus adminStatus) {
+        this.adminStatus = adminStatus;
+    }
+
+    /**
+     * Sets the node operational status.
+     *
+     * @param opStatus the opStatus to set
+     */
+    public void setOpStatus(TeStatus opStatus) {
+        this.opStatus = opStatus;
+    }
+
+    /**
+     * Sets the node is an abstract node or not.
+     *
+     * @param isAbstract the isAbstract to set
+     */
+    public void setAbstract(boolean isAbstract) {
+        this.isAbstract = isAbstract;
+    }
+
+    /**
+     * Set connectivity matrix table.
+     *
+     * @param connMatrices connectivity matrix table
+     */
+    public void setConnectivityMatrices(List<ConnectivityMatrix> connMatrices) {
+          this.connMatrices = connMatrices;
+    }
+
+    /**
+     * Sets the node underlay TE topology.
+     *
+     * @param topo the underlayTopology to set
+     */
+    public void setUnderlayTopology(TeNetworkTopologyId topo) {
+        this.underlayTopology = topo;
+    }
+
+    /**
+     * Sets the list of tunnel termination points.
+     *
+     * @param ttps the tunnelTerminationPoints to set
+     */
+    public void setTunnelTerminationPoints(List<TunnelTerminationPoint> ttps) {
+        this.tunnelTerminationPoints = ttps;
+    }
+
+    /**
+     * Returns the teNodeId.
+     *
+     * @return TE node id
+     */
+    public String teNodeId() {
+        return teNodeId;
+    }
+
+    /**
+     * Returns the name.
+     *
+     * @return TE node name
+     */
+    public String name() {
+        return name;
+    }
+
+    /**
+     * Returns the adminStatus.
+     *
+     * @return TE node admin status
+     */
+    public TeStatus adminStatus() {
+        return adminStatus;
+    }
+
+    /**
+     * Returns the opStatus.
+     *
+     * @return TE node operational status
+     */
+    public TeStatus opStatus() {
+        return opStatus;
+    }
+
+    /**
+     * Returns the isAbstract.
+     *
+     * @return true or false if the TE node is abstract
+     */
+    public boolean isAbstract() {
+        return isAbstract;
+    }
+
+    /**
+     * Returns the connectivity matrix table.
+     *
+     * @return node connectivity matrix table
+     */
+    public List<ConnectivityMatrix> connectivityMatrices() {
+        return connMatrices;
+    }
+
+    /**
+     * Returns the underlay topology.
+     *
+     * @return node underlay topology
+     */
+    public TeNetworkTopologyId underlayTopology() {
+        return underlayTopology;
+    }
+
+    /**
+     * Returns the tunnelTerminationPoints.
+     *
+     * @return list of tunnel terminational points
+     */
+    public List<TunnelTerminationPoint> tunnelTerminationPoints() {
+        return tunnelTerminationPoints;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(teNodeId, name, adminStatus, opStatus, isAbstract,
+                connMatrices, underlayTopology, tunnelTerminationPoints);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object instanceof TeNode) {
+            TeNode that = (TeNode) object;
+            return Objects.equal(this.teNodeId, that.teNodeId) &&
+                    Objects.equal(this.name, that.name) &&
+                    Objects.equal(this.adminStatus, that.adminStatus) &&
+                    Objects.equal(this.opStatus, that.opStatus) &&
+                    Objects.equal(this.isAbstract, that.isAbstract) &&
+                    Objects.equal(this.connMatrices, that.connMatrices) &&
+                    Objects.equal(this.underlayTopology, that.underlayTopology) &&
+                    Objects.equal(this.tunnelTerminationPoints, that.tunnelTerminationPoints);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("teNodeId", teNodeId)
+                .add("name", name)
+                .add("adminStatus", adminStatus)
+                .add("opStatus", opStatus)
+                .add("isAbstract", isAbstract)
+                .add("connMatrices", connMatrices)
+                .add("underlayTopology", underlayTopology)
+                .add("tunnelTerminationPoints", tunnelTerminationPoints)
+                .toString();
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TeStatus.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TeStatus.java
new file mode 100644
index 0000000..59296bc
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TeStatus.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2016-present 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.tetopology.management.api.node;
+
+/**
+ * Represents ENUM data of teStatus.
+ */
+public enum TeStatus {
+
+    /**
+     * Represents up.
+     */
+    UP(0),
+
+    /**
+     * Represents down.
+     */
+    DOWN(1),
+
+    /**
+     * Represents testing.
+     */
+    TESTING(2),
+
+    /**
+     * Represents preparingMaintenance.
+     */
+    PREPARING_MAINTENANCE(3),
+
+    /**
+     * Represents maintenance.
+     */
+    MAINTENANCE(4),
+
+    /**
+     * Status cannot be determined for some reason.
+     */
+    UNKNOWN(5);
+
+    private int teStatus;
+
+    /**
+     * Creates an instance of teStatus.
+     *
+     * @param value value of teStatus
+     */
+    TeStatus(int value) {
+        teStatus = value;
+    }
+
+    /**
+     * Returns the attribute teStatus.
+     *
+     * @return value of teStatus
+     */
+    public int teStatus() {
+        return teStatus;
+    }
+
+    /**
+     * Returns the object of teStatus fromString input String. Returns null
+     * when the integer value is not recognized.
+     *
+     * @param valInString input String
+     * @return Object of teStatus
+     */
+    public static TeStatus of(String valInString) {
+        try {
+            int tmpVal = Integer.parseInt(valInString);
+            return of(tmpVal);
+        } catch (NumberFormatException e) {
+        }
+        return null;
+    }
+
+    /**
+     * Returns the object of teAdminStatusEnumForTypeInt.Returns null
+     * when string conversion fails or converted integer value is not
+     * recognized.
+     *
+     * @param value value of teAdminStatusEnumForTypeInt
+     * @return Object of teAdminStatusEnumForTypeInt
+     */
+    public static TeStatus of(int value) {
+        switch (value) {
+            case 0:
+                return TeStatus.UP;
+            case 1:
+                return TeStatus.DOWN;
+            case 2:
+                return TeStatus.TESTING;
+            case 3:
+                return TeStatus.PREPARING_MAINTENANCE;
+            case 4:
+                return TeStatus.MAINTENANCE;
+            case 5:
+                return TeStatus.UNKNOWN;
+            default :
+                return null;
+        }
+    }
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TeTerminationPoint.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TeTerminationPoint.java
new file mode 100644
index 0000000..bc18a8c
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TeTerminationPoint.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.node;
+
+import java.util.List;
+
+import org.onosproject.tetopology.management.api.KeyId;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * TE termination point representation.
+ */
+public class TeTerminationPoint {
+    private KeyId teTpId;
+    private List<InterfaceSwitchingCapability> capabilities;
+    private long interLayerLockId;
+
+    /**
+     * Creates an instance of TeTerminationPoint.
+     *
+     * @param teTpId TE termination point identifier
+     * @param capabilities capability descriptor for termination point
+     * @param interLayerLockId inter-layer lock identifier
+     */
+    public TeTerminationPoint(KeyId teTpId,
+      List<InterfaceSwitchingCapability> capabilities, long interLayerLockId) {
+        this.teTpId = teTpId;
+        this.capabilities = capabilities;
+        this.interLayerLockId = interLayerLockId;
+    }
+
+    /**
+     * Creates an instance of TeTerminationPoint with teTpId only.
+     *
+     * @param teTpId TE termination point id
+     */
+    public TeTerminationPoint(KeyId teTpId) {
+        this.teTpId = teTpId;
+    }
+
+    /**
+     * Returns the TE termination point id.
+     *
+     * @return value of teTpId
+     */
+    public KeyId teTpId() {
+        return teTpId;
+    }
+
+    /**
+     * Returns the interface switching capabilities.
+     *
+     * @return interface switching capabilities
+     */
+    public List<InterfaceSwitchingCapability> interfaceSwitchingCapabilities() {
+        return capabilities;
+    }
+
+    /**
+     * Returns the interLayerLockId.
+     *
+     * @return interlayer lock id
+     */
+    public long getInterLayerLockId() {
+        return interLayerLockId;
+    }
+
+    /**
+     * Sets the te tp Id.
+     *
+     * @param teTpId the teTpId to set
+     */
+    public void setTeTpId(KeyId teTpId) {
+        this.teTpId = teTpId;
+    }
+
+    /**
+     * Sets the interface switching capabilities.
+     *
+     * @param capabilities the capabilities to set
+     */
+    public void setInterfaceSwitchingCapabilities(List<InterfaceSwitchingCapability> capabilities) {
+        this.capabilities = capabilities;
+    }
+
+    /**
+     * Sets the inter layer lockId.
+     *
+     * @param interLayerLockId the interLayerLockId to set
+     */
+    public void setInterLayerLockId(long interLayerLockId) {
+        this.interLayerLockId = interLayerLockId;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(teTpId, capabilities, interLayerLockId);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object instanceof TeTerminationPoint) {
+            TeTerminationPoint that = (TeTerminationPoint) object;
+            return Objects.equal(this.teTpId, that.teTpId) &&
+                    Objects.equal(this.capabilities, that.capabilities) &&
+                    Objects.equal(this.interLayerLockId, that.interLayerLockId);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("teTpId", teTpId)
+                .add("capabilities", capabilities)
+                .add("interLayerLockId", interLayerLockId)
+                .toString();
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TerminationCapability.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TerminationCapability.java
new file mode 100644
index 0000000..dedb53a
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TerminationCapability.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.node;
+
+/**
+ * The termination capabilities between tunnel-termination-point
+ * and link termination-point.
+ */
+public class TerminationCapability {
+    // See reference - org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang
+   // .ietf.te.topology.rev20160708.ietftetopology.augmentednwnode.te
+    //.tunnelterminationpoint.config.DefaultTerminationCapability
+    private TerminationPointKey linkTpId;
+    //List<MaxLspBandwidth> maxLspBandwidth
+    // TODO - to be extended per future standard definitions
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TerminationPoint.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TerminationPoint.java
new file mode 100644
index 0000000..f27cafe
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TerminationPoint.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.node;
+
+import java.util.List;
+
+import org.onosproject.tetopology.management.api.KeyId;
+import org.onosproject.tetopology.management.api.TeTopologyEventSubject;
+
+/**
+ * Abstraction of a termination point.
+ */
+public interface TerminationPoint extends TeTopologyEventSubject {
+
+    /**
+     * Returns the termination point id.
+     *
+     * @return termination point id
+     */
+    KeyId id();
+
+    /**
+     * Returns list of supporting termination point ids.
+     *
+     * @return the supportingTpIds
+     */
+    List<TerminationPointKey> getSupportingTpIds();
+
+    /**
+     * Returns TE attributes for this termination point.
+     *
+     * @return the te attribute
+     */
+    TeTerminationPoint getTe();
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TerminationPointKey.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TerminationPointKey.java
new file mode 100644
index 0000000..f4a57f4
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TerminationPointKey.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.node;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+import org.onosproject.tetopology.management.api.KeyId;
+
+import com.google.common.base.Objects;
+
+/**
+ * Representation of a termination point key or reference.
+ */
+public class TerminationPointKey extends NetworkNodeKey {
+    private final KeyId tpId;
+
+    /**
+     * Creates an instance of TerminationPointKey.
+     *
+     * @param networkId network identifier
+     * @param nodeId node identifier
+     * @param tpId termination point identifier
+     */
+    public TerminationPointKey(KeyId networkId, KeyId nodeId, KeyId tpId) {
+        super(networkId, nodeId);
+        this.tpId = tpId;
+    }
+
+    /**
+     * Returns the termination point Id.
+     *
+     * @return termination point identifier
+     */
+    public KeyId tpId() {
+        return tpId;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(super.hashCode(), tpId);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (object instanceof TerminationPointKey) {
+            if (!super.equals(object)) {
+                return false;
+            }
+            TerminationPointKey that = (TerminationPointKey) object;
+            return Objects.equal(this.tpId, that.tpId);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return toStringHelper(this)
+                .add("networkId", networkId())
+                .add("nodeId", nodeId())
+                .add("tpId", tpId)
+                .toString();
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TunnelTerminationPoint.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TunnelTerminationPoint.java
new file mode 100644
index 0000000..df81a09
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/TunnelTerminationPoint.java
@@ -0,0 +1,140 @@
+/*
+ * Copyright 2016 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.tetopology.management.api.node;
+
+import java.util.List;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * Representation of a tunnel termination point.
+ */
+public class TunnelTerminationPoint {
+    //See org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te
+    //.topology.rev20160708.ietftetopology
+    //.augmentednwnode.te.DefaultTunnelTerminationPoint
+    //org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology
+    //.rev20160708.ietftetopology
+    //.augmentednwnode.te.tunnelterminationpoint.DefaultConfig
+    private byte[] tunnelTpId;
+    private List<InterfaceSwitchingCapability> switchingCapabilities;
+    private long interLayerLockId;
+    private List<TerminationCapability> terminationCapability;
+
+    /**
+     * Create an instance of TunnelTerminationPoint.
+     *
+     * @param tunnelTpId tunnel termination point id
+     */
+    public TunnelTerminationPoint(byte[] tunnelTpId) {
+        this.tunnelTpId = tunnelTpId;
+    }
+
+    /**
+     * Sets the switching capabilities.
+     *
+     * @param swcaps the switching capabilities to set
+     */
+    public void setSwitchingCapabilities(List<InterfaceSwitchingCapability> swcaps) {
+        this.switchingCapabilities = swcaps;
+    }
+
+    /**
+     * Sets the interLayerLockId.
+     *
+     * @param id the interLayerLockId to set
+     */
+    public void setInterLayerLockId(long id) {
+        this.interLayerLockId = id;
+    }
+
+    /**
+     * Sets the termination capability.
+     *
+     * @param terminationCapability the terminationCapability to set
+     */
+    public void setTerminationCapabilities(List<TerminationCapability> terminationCapability) {
+        this.terminationCapability = terminationCapability;
+    }
+
+    /**
+     * Returns the tunnelTpId.
+     *
+     * @return tunnel termination point id
+     */
+    public byte[] getTunnelTpId() {
+        return tunnelTpId;
+    }
+
+    /**
+     * Returns the switching capabilities.
+     *
+     * @return switching capabilities
+     */
+    public List<InterfaceSwitchingCapability> getSwitchingCapabilities() {
+        return switchingCapabilities;
+    }
+
+    /**
+     * Returns the interLayerLockId.
+     *
+     * @return inter layer lock identifier
+    */
+    public long getInterLayerLockId() {
+        return interLayerLockId;
+    }
+
+    /**
+     * Returns the termination capability list.
+     *
+     * @return termination capabilities
+     */
+    public List<TerminationCapability> getTerminationCapabilities() {
+        return terminationCapability;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(tunnelTpId, switchingCapabilities, interLayerLockId, terminationCapability);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object instanceof TunnelTerminationPoint) {
+            TunnelTerminationPoint that = (TunnelTerminationPoint) object;
+            return Objects.equal(this.tunnelTpId, that.tunnelTpId) &&
+                    Objects.equal(this.switchingCapabilities, that.switchingCapabilities) &&
+                    Objects.equal(this.terminationCapability, that.terminationCapability) &&
+                    Objects.equal(this.interLayerLockId, that.interLayerLockId);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("tunnelTpId", tunnelTpId)
+                .add("switchingCapabilities", switchingCapabilities)
+                .add("interLayerLockId", interLayerLockId)
+                .add("terminationCapability", terminationCapability)
+                .toString();
+    }
+
+}
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/package-info.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/package-info.java
new file mode 100644
index 0000000..ec1a8de
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/node/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2016 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.
+ */
+/**
+ * TE node API.
+ */
+package org.onosproject.tetopology.management.api.node;
\ No newline at end of file
diff --git a/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/package-info.java b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/package-info.java
new file mode 100644
index 0000000..39a178d
--- /dev/null
+++ b/apps/tetopology/src/main/java/org/onosproject/tetopology/management/api/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016-present 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.
+ */
+
+/**
+ * TE topology management API.
+ */
+package org.onosproject.tetopology.management.api;
\ No newline at end of file
