diff --git a/providers/ospf/BUCK b/providers/ospf/BUCK
new file mode 100644
index 0000000..829827e
--- /dev/null
+++ b/providers/ospf/BUCK
@@ -0,0 +1,16 @@
+BUNDLES = [
+    '//protocols/ospf/api:onos-protocols-ospf-api',
+    '//protocols/ospf/ctl:onos-protocols-ospf-ctl',
+    '//protocols/ospf/protocol:onos-protocols-ospf-protocol',
+    '//providers/ospf/cfg:onos-providers-ospf-cfg',
+    '//providers/ospf/topology:onos-providers-ospf-topology',
+]
+
+onos_app (
+    title = 'OSPF Provider',
+    category = 'Provider',
+    url = 'http://onosproject.org',
+    description = 'ONOS OSPF protocol adapters.',
+    included_bundles = BUNDLES,
+)
+
diff --git a/providers/ospf/app/app.xml b/providers/ospf/app/app.xml
new file mode 100644
index 0000000..b98afc2
--- /dev/null
+++ b/providers/ospf/app/app.xml
@@ -0,0 +1,27 @@
+<?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.
+  -->
+<app name="org.onosproject.ospf" origin="ON.Lab" version="${project.version}"
+     featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
+     features="${project.artifactId}">
+    <description>${project.description}</description>
+    <artifact>mvn:${project.groupId}/onos-ospf-api/${project.version}</artifact>
+    <artifact>mvn:${project.groupId}/onos-ospf-ctl/${project.version}</artifact>
+    <artifact>mvn:${project.groupId}/onos-ospf-protocol/${project.version}</artifact>
+    <artifact>mvn:${project.groupId}/onos-ospf-provider-topology/${project.version}</artifact>
+    <artifact>mvn:${project.groupId}/onos-ospf-provider-cfg/${project.version}</artifact>
+    <artifact>mvn:${project.groupId}/onos-ospf-provider-cli/${project.version}</artifact>
+</app>
diff --git a/providers/ospf/app/features.xml b/providers/ospf/app/features.xml
new file mode 100644
index 0000000..f04e131
--- /dev/null
+++ b/providers/ospf/app/features.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+  ~ 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.
+  -->
+<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}/onos-ospf-api/${project.version}</bundle>
+        <bundle>mvn:${project.groupId}/onos-ospf-ctl/${project.version}</bundle>
+        <bundle>mvn:${project.groupId}/onos-ospf-protocol/${project.version}</bundle>
+        <bundle>mvn:${project.groupId}/onos-ospf-provider-topology/${project.version}</bundle>
+        <bundle>mvn:${project.groupId}/onos-ospf-provider-cfg/${project.version}</bundle>
+        <bundle>mvn:${project.groupId}/onos-ospf-provider-cli/${project.version}</bundle>
+    </feature>
+</features>
diff --git a/providers/ospf/app/pom.xml b/providers/ospf/app/pom.xml
new file mode 100644
index 0000000..49e8ef3
--- /dev/null
+++ b/providers/ospf/app/pom.xml
@@ -0,0 +1,66 @@
+<?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:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns="http://maven.apache.org/POM/4.0.0"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-ospf-providers</artifactId>
+        <version>1.7.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>onos-ospf-app</artifactId>
+    <packaging>pom</packaging>
+    <description>OSPF protocol southbound providers</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-ospf-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-ospf-ctl</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-ospf-protocol</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-ospf-provider-topology</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-ospf-provider-cfg</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-ospf-provider-cli</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/providers/ospf/cfg/BUCK b/providers/ospf/cfg/BUCK
new file mode 100644
index 0000000..c884550
--- /dev/null
+++ b/providers/ospf/cfg/BUCK
@@ -0,0 +1,9 @@
+COMPILE_DEPS = [
+    '//lib:CORE_DEPS',
+    '//protocols/ospf/api:onos-protocols-ospf-api',
+]
+
+osgi_jar_with_tests (
+    deps = COMPILE_DEPS,
+)
+
diff --git a/providers/ospf/cfg/pom.xml b/providers/ospf/cfg/pom.xml
new file mode 100644
index 0000000..fce0cc4
--- /dev/null
+++ b/providers/ospf/cfg/pom.xml
@@ -0,0 +1,49 @@
+<?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/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-ospf-providers</artifactId>
+        <version>1.7.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>onos-ospf-provider-cfg</artifactId>
+    <packaging>bundle</packaging>
+    <description>ONOS OSPF Providers</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-ospf-ctl</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-ospf-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/providers/ospf/cfg/src/main/java/org/onosproject/provider/ospf/cfg/impl/OspfAppConfig.java b/providers/ospf/cfg/src/main/java/org/onosproject/provider/ospf/cfg/impl/OspfAppConfig.java
new file mode 100644
index 0000000..162ec30
--- /dev/null
+++ b/providers/ospf/cfg/src/main/java/org/onosproject/provider/ospf/cfg/impl/OspfAppConfig.java
@@ -0,0 +1,72 @@
+/*
+* 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.provider.ospf.cfg.impl;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.onlab.osgi.DefaultServiceDirectory;
+import org.onosproject.core.ApplicationId;
+import org.onosproject.net.config.Config;
+import org.onosproject.ospf.controller.OspfController;
+
+/**
+ * Configuration object for OSPF.
+ */
+public class OspfAppConfig extends Config<ApplicationId> {
+    public static final String METHOD = "method";
+    public static final String ATTRIBUTE = "attribute";
+    public static final String PROCESSES = "processes";
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    private OspfController ospfController;
+
+    /**
+     * Returns the configuration method, add, delete etc.
+     *
+     * @return the configuration method, add, delete etc
+     */
+    public String method() {
+        return get(METHOD, null);
+    }
+
+    /**
+     * Returns the configuration attribute, area, process etc.
+     *
+     * @return the configuration attribute, area, process etc
+     */
+    public String attribute() {
+        return get(ATTRIBUTE, null);
+    }
+
+    /**
+     * Returns the configured processes.
+     *
+     * @return the configured processes
+     */
+    public JsonNode processes() {
+        JsonNode jsonNodes = object.get(PROCESSES);
+
+        return jsonNodes;
+    }
+
+    @Override
+    public boolean isValid() {
+        this.ospfController = DefaultServiceDirectory.getService(OspfController.class);
+
+        return true;
+    }
+}
\ No newline at end of file
diff --git a/providers/ospf/cfg/src/main/java/org/onosproject/provider/ospf/cfg/impl/OspfCfgProvider.java b/providers/ospf/cfg/src/main/java/org/onosproject/provider/ospf/cfg/impl/OspfCfgProvider.java
new file mode 100644
index 0000000..7e91fbd
--- /dev/null
+++ b/providers/ospf/cfg/src/main/java/org/onosproject/provider/ospf/cfg/impl/OspfCfgProvider.java
@@ -0,0 +1,129 @@
+/*
+ * 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.provider.ospf.cfg.impl;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.onosproject.core.ApplicationId;
+import org.onosproject.core.CoreService;
+import org.onosproject.net.config.ConfigFactory;
+import org.onosproject.net.config.NetworkConfigEvent;
+import org.onosproject.net.config.NetworkConfigListener;
+import org.onosproject.net.config.NetworkConfigRegistry;
+import org.onosproject.net.config.NetworkConfigService;
+import org.onosproject.net.config.basics.SubjectFactories;
+import org.onosproject.net.provider.AbstractProvider;
+import org.onosproject.net.provider.ProviderId;
+import org.onosproject.ospf.controller.OspfController;
+import org.slf4j.Logger;
+
+import static org.slf4j.LoggerFactory.getLogger;
+
+/**
+ * Provider which advertises device descriptions to the core.
+ */
+@Component(immediate = true)
+@Service
+public class OspfCfgProvider extends AbstractProvider {
+
+    static final String PROVIDER_ID = "org.onosproject.provider.ospf.cfg";
+    private static final Logger log = getLogger(OspfCfgProvider.class);
+    private final ConfigFactory configFactory =
+            new ConfigFactory(SubjectFactories.APP_SUBJECT_FACTORY, OspfAppConfig.class, "ospfapp") {
+                @Override
+                public OspfAppConfig createConfig() {
+                    return new OspfAppConfig();
+                }
+            };
+    private final NetworkConfigListener configListener = new InternalConfigListener();
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected OspfController ospfController;
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected CoreService coreService;
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected NetworkConfigRegistry configRegistry;
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected NetworkConfigService configService;
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected OspfController controller;
+    private ApplicationId appId;
+
+    /**
+     * Creates an OSPF device provider.
+     */
+    public OspfCfgProvider() {
+        super(new ProviderId("ospf", PROVIDER_ID));
+    }
+
+    public void setOspfController(OspfController ospfController) {
+        this.ospfController = ospfController;
+    }
+
+    @Activate
+    public void activate() {
+        appId = coreService.registerApplication(PROVIDER_ID);
+        configService.addListener(configListener);
+        configRegistry.registerConfigFactory(configFactory);
+        log.info("activated...!!!");
+    }
+
+    @Deactivate
+    public void deactivate() {
+        configRegistry.unregisterConfigFactory(configFactory);
+        configService.removeListener(configListener);
+        log.info("deactivated...!!!");
+    }
+
+    private void updateConfig() {
+        OspfAppConfig ospfAppConfig = configRegistry.getConfig(appId, OspfAppConfig.class);
+        if ("ADD".equalsIgnoreCase(ospfAppConfig.method())) {
+            JsonNode jsonNode = ospfAppConfig.processes();
+            ospfController.updateConfig(jsonNode);
+        } else {
+            log.debug("Please signify prop1 and prop2");
+        }
+    }
+
+    /**
+     * OSPF config listener to populate the configuration.
+     */
+    private class InternalConfigListener implements NetworkConfigListener {
+        @Override
+        public void event(NetworkConfigEvent event) {
+            log.debug("InternalConfigListener:: event is getting called");
+            if (!event.configClass().equals(OspfAppConfig.class)) {
+                return;
+            }
+            switch (event.type()) {
+                case CONFIG_ADDED:
+                    updateConfig();
+                    break;
+                case CONFIG_UPDATED:
+                    updateConfig();
+                    break;
+                case CONFIG_REMOVED:
+                    break;
+                default:
+                    break;
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/providers/ospf/cfg/src/main/java/org/onosproject/provider/ospf/cfg/impl/package-info.java b/providers/ospf/cfg/src/main/java/org/onosproject/provider/ospf/cfg/impl/package-info.java
new file mode 100644
index 0000000..c2cd733
--- /dev/null
+++ b/providers/ospf/cfg/src/main/java/org/onosproject/provider/ospf/cfg/impl/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.
+ */
+
+/**
+ * Provider that uses OSPF capability request as a means of infrastructure device discovery.
+ */
+package org.onosproject.provider.ospf.cfg.impl;
diff --git a/providers/ospf/cli/pom.xml b/providers/ospf/cli/pom.xml
new file mode 100644
index 0000000..545f27f
--- /dev/null
+++ b/providers/ospf/cli/pom.xml
@@ -0,0 +1,69 @@
+<?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:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns="http://maven.apache.org/POM/4.0.0"
+         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-ospf-providers</artifactId>
+        <version>1.7.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>onos-ospf-provider-cli</artifactId>
+    <packaging>bundle</packaging>
+
+    <description>OSPF cli implementation</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-cli</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-ospf-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-ospf-ctl</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-ospf-protocol</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.karaf.shell</groupId>
+            <artifactId>org.apache.karaf.shell.console</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/providers/ospf/cli/src/main/java/org/onosproject/ospf/cli/ApplicationOspfCommand.java b/providers/ospf/cli/src/main/java/org/onosproject/ospf/cli/ApplicationOspfCommand.java
new file mode 100644
index 0000000..2027b74
--- /dev/null
+++ b/providers/ospf/cli/src/main/java/org/onosproject/ospf/cli/ApplicationOspfCommand.java
@@ -0,0 +1,401 @@
+/*
+* 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.ospf.cli;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.karaf.shell.commands.Argument;
+import org.apache.karaf.shell.commands.Command;
+import org.onosproject.cli.AbstractShellCommand;
+import org.onosproject.ospf.controller.OspfArea;
+import org.onosproject.ospf.controller.OspfController;
+import org.onosproject.ospf.controller.OspfInterface;
+import org.onosproject.ospf.controller.OspfLsaType;
+import org.onosproject.ospf.controller.OspfNbr;
+import org.onosproject.ospf.controller.OspfProcess;
+import org.onosproject.ospf.protocol.lsa.LsaHeader;
+import org.onosproject.ospf.protocol.lsa.types.RouterLsa;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Representation of OSPF cli commands.
+ */
+@Component(immediate = true)
+@Command(scope = "onos", name = "ospf", description = "list database")
+public class ApplicationOspfCommand extends AbstractShellCommand {
+
+    protected static final String FORMAT6 = "%-20s%-20s%-20s%-20s%-20s%-20s\n";
+    protected static final String FORMAT5 = "%-20s%-20s%-20s%-20s%-20s\n";
+    protected static final String NETWORK = "NETWORK";
+    protected static final String SUMMARY = "SUMMARY";
+    protected static final String ASBR = "ABSR";
+    protected static final String EXTERNAL = "EXTERNAL";
+    protected static final String LINKLOOPAQ = "LINKLOCALOPAQUE";
+    protected static final String AREALOCOPAQ = "AREALOCALOPAQUE";
+    protected static final String ASOPAQ = "ASOPAQUE";
+    protected static final String DR = "DR";
+    protected static final String BACKUP = "BACKUP";
+    protected static final String DROTHER = "DROther";
+    static final String DATABASE = "database";
+    static final String NEIGHBORLIST = "neighbors";
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected OspfController ospfController;
+    @Argument(index = 0, name = "name",
+            description = "database|neighborlist",
+            required = true, multiValued = false)
+    private String name = null;
+    @Argument(index = 1, name = "processid",
+            description = "processId",
+            required = true, multiValued = false)
+    private String process = null;
+    @Argument(index = 2, name = "areaid",
+            description = "areaId",
+            required = false, multiValued = false)
+    private String area = null;
+    private List<String> routerLsa = new ArrayList<>();
+    private List<String> networkLsa = new ArrayList<>();
+    private List<String> summaryLsa = new ArrayList<>();
+    private List<String> externalLsa = new ArrayList<>();
+    private List<String> asbrSumm = new ArrayList<>();
+    private List<String> areaLocalOpaqLsa = new ArrayList<>();
+    private List<String> linkLocalOpqLsa = new ArrayList<>();
+    private List<String> asOpqLsa = new ArrayList<>();
+    private List<String> undefinedLsa = new ArrayList<>();
+    private List<OspfArea> areaList = new ArrayList<>();
+
+
+    @Activate
+    public void activate() {
+        print("OSPF cli activated...!!!");
+        log.debug("OSPF cli activated...!!!");
+    }
+
+    @Deactivate
+    public void deactivate() {
+        log.debug("OSPF cli deactivated...!!!");
+    }
+
+    @Override
+    protected void execute() {
+        if (DATABASE.equals(name)) {
+            buildOspfDatabaseInformation();
+        } else if (NEIGHBORLIST.equals(name)) {
+            buildNeighborInformation();
+        } else {
+            print("Please check the command (database|neighbor)");
+        }
+    }
+
+    /**
+     * Clears all the lists.
+     */
+    private void clearLists() {
+        routerLsa.clear();
+        networkLsa.clear();
+        summaryLsa.clear();
+        externalLsa.clear();
+        asbrSumm.clear();
+        areaLocalOpaqLsa.clear();
+        linkLocalOpqLsa.clear();
+        asOpqLsa.clear();
+        undefinedLsa.clear();
+        areaList.clear();
+    }
+
+    /**
+     * Builds OSPF database information.
+     */
+    private void buildOspfDatabaseInformation() {
+        try {
+            //Builds LSA details
+            buildLsaLists();
+            for (OspfArea area : areaList) {
+                if (routerLsa.size() > 0) {
+                    printRouterFormat(area.areaId().toString(), area.routerId().toString(), process);
+                    for (String str : routerLsa) {
+                        String[] lsaVal = str.split("\\,");
+                        if (area.areaId().toString().equalsIgnoreCase(lsaVal[0])) {
+                            print(FORMAT6, lsaVal[2], lsaVal[3], lsaVal[4], lsaVal[5], lsaVal[6], lsaVal[7]);
+                        }
+                    }
+                }
+                if (networkLsa.size() > 0) {
+                    printNetworkFormat(area.areaId().toString(), NETWORK);
+                    printDetails(networkLsa, area.areaId().toString());
+                }
+                if (summaryLsa.size() > 0) {
+                    printNetworkFormat(area.areaId().toString(), SUMMARY);
+                    printDetails(summaryLsa, area.areaId().toString());
+                }
+                if (externalLsa.size() > 0) {
+                    printNetworkFormat(area.areaId().toString(), EXTERNAL);
+                    printDetails(externalLsa, area.areaId().toString());
+                }
+                if (asbrSumm.size() > 0) {
+                    printNetworkFormat(area.areaId().toString(), ASBR);
+                    printDetails(asbrSumm, area.areaId().toString());
+                }
+                if (areaLocalOpaqLsa.size() > 0) {
+                    printNetworkFormat(area.areaId().toString(), AREALOCOPAQ);
+                    printDetails(areaLocalOpaqLsa, area.areaId().toString());
+                }
+                if (linkLocalOpqLsa.size() > 0) {
+                    printNetworkFormat(area.areaId().toString(), LINKLOOPAQ);
+                    printDetails(linkLocalOpqLsa, area.areaId().toString());
+                }
+                if (asOpqLsa.size() > 0) {
+                    printNetworkFormat(area.areaId().toString(), ASOPAQ);
+                    printDetails(asOpqLsa, area.areaId().toString());
+                }
+                if (undefinedLsa.size() > 0) {
+                    printRouterFormat(area.areaId().toString(), area.routerId().toString(), process);
+                    printDetails(undefinedLsa, area.areaId().toString());
+                }
+            }
+            clearLists();
+        } catch (Exception ex) {
+            clearLists();
+            print("Error occured while Ospf controller getting called" + ex.getMessage());
+        }
+    }
+
+    /**
+     * Prints LSA details.
+     *
+     * @param lsaDetails LSA details
+     * @param areaId     area ID
+     */
+    private void printDetails(List<String> lsaDetails, String areaId) {
+        for (String str : lsaDetails) {
+            String[] lsaVal = str.split("\\,");
+            if (areaId.equalsIgnoreCase(lsaVal[0])) {
+                print(FORMAT5, lsaVal[2], lsaVal[3], lsaVal[4], lsaVal[5], lsaVal[6]);
+            }
+        }
+    }
+
+    /**
+     * Builds all LSA lists with LSA details.
+     */
+    private void buildLsaLists() {
+        this.ospfController = get(OspfController.class);
+        List<OspfProcess> listOfProcess = ospfController.getAllConfiguredProcesses();
+        Iterator<OspfProcess> itrProcess = listOfProcess.iterator();
+        while (itrProcess.hasNext()) {
+            OspfProcess ospfProcess = itrProcess.next();
+            if (process.equalsIgnoreCase(ospfProcess.processId())) {
+                List<OspfArea> listAreas = ospfProcess.areas();
+                Iterator<OspfArea> itrArea = listAreas.iterator();
+                while (itrArea.hasNext()) {
+                    OspfArea area = itrArea.next();
+                    List<LsaHeader> lsas = area.database()
+                            .getAllLsaHeaders(false, area.isOpaqueEnabled());
+                    List<LsaHeader> tmpLsaList = new ArrayList<>(lsas);
+                    log.debug("OSPFController::size of database::" + (lsas != null ? lsas.size() : null));
+                    Iterator<LsaHeader> itrLsaHeader = tmpLsaList.iterator();
+                    areaList.add(area);
+                    if (itrLsaHeader != null) {
+                        while (itrLsaHeader.hasNext()) {
+                            LsaHeader header = itrLsaHeader.next();
+                            populateLsaLists(header, area);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Populates the LSA lists based on the input.
+     *
+     * @param header LSA header instance
+     * @param area   OSPF area instance
+     */
+    private void populateLsaLists(LsaHeader header, OspfArea area) {
+        String seqNo = Long.toHexString(header.lsSequenceNo());
+        String checkSum = Long.toHexString(header.lsCheckSum());
+        if (seqNo.length() == 16) {
+            seqNo = seqNo.substring(8, seqNo.length());
+        }
+        if (checkSum.length() == 16) {
+            checkSum = checkSum.substring(8, checkSum.length());
+        }
+        StringBuffer strBuf = getBuffList(area.areaId().toString(), area.routerId().toString(),
+                                          header.linkStateId(),
+                                          header.advertisingRouter().toString(),
+                                          header.age(), seqNo, checkSum);
+        if (header.lsType() == OspfLsaType.ROUTER.value()) {
+            strBuf.append(",");
+            strBuf.append(((RouterLsa) header).noLink());
+            routerLsa.add(strBuf.toString());
+        } else if (header.lsType() == OspfLsaType.NETWORK.value()) {
+            strBuf.append(",");
+            strBuf.append("0");
+            networkLsa.add(strBuf.toString());
+        } else if (header.lsType() == OspfLsaType.SUMMARY.value()) {
+            strBuf.append(",");
+            strBuf.append("0");
+            summaryLsa.add(strBuf.toString());
+        } else if (header.lsType() == OspfLsaType.EXTERNAL_LSA.value()) {
+            strBuf.append(",");
+            strBuf.append("0");
+            externalLsa.add(strBuf.toString());
+        } else if (header.lsType() == OspfLsaType.ASBR_SUMMARY.value()) {
+            strBuf.append(",");
+            strBuf.append("0");
+            asbrSumm.add(strBuf.toString());
+        } else if (header.lsType() == OspfLsaType.AREA_LOCAL_OPAQUE_LSA.value()) {
+            strBuf.append(",");
+            strBuf.append("0");
+            areaLocalOpaqLsa.add(strBuf.toString());
+        } else if (header.lsType() == OspfLsaType.LINK_LOCAL_OPAQUE_LSA.value()) {
+            strBuf.append(",");
+            strBuf.append("0");
+            linkLocalOpqLsa.add(strBuf.toString());
+        } else if (header.lsType() == OspfLsaType.AS_OPAQUE_LSA.value()) {
+            strBuf.append(",");
+            strBuf.append("0");
+            asOpqLsa.add(strBuf.toString());
+        } else {
+            strBuf.append(",");
+            strBuf.append("0");
+            undefinedLsa.add(strBuf.toString());
+        }
+    }
+
+    /**
+     * Builds OSPF neighbor information.
+     */
+    private void buildNeighborInformation() {
+        try {
+            this.ospfController = get(OspfController.class);
+            List<OspfProcess> listOfProcess = ospfController.getAllConfiguredProcesses();
+            boolean flag = false;
+            printNeighborsFormat();
+            Iterator<OspfProcess> itrProcess = listOfProcess.iterator();
+            while (itrProcess.hasNext()) {
+                OspfProcess process = itrProcess.next();
+                List<OspfArea> listAreas = process.areas();
+                Iterator<OspfArea> itrArea = listAreas.iterator();
+                while (itrArea.hasNext()) {
+                    OspfArea area = itrArea.next();
+                    List<OspfInterface> itrefaceList = area.ospfInterfaceList();
+                    for (OspfInterface interfc : itrefaceList) {
+                        List<OspfNbr> nghbrList = new ArrayList<>(interfc.listOfNeighbors().values());
+                        for (OspfNbr neigbor : nghbrList) {
+                            print("%-20s%-20s%-20s%-20s%-20s\n", neigbor.neighborId(), neigbor.routerPriority(),
+                                  neigbor.getState() + "/" + checkDrBdrOther(neigbor.neighborIpAddr().toString(),
+                                                                             neigbor.neighborDr().toString(),
+                                                                             neigbor.neighborBdr().toString()),
+                                  neigbor.neighborIpAddr().toString(), interfc.ipAddress());
+                        }
+                    }
+                }
+            }
+        } catch (Exception ex) {
+            print("Error occured while Ospf controller getting called" + ex.getMessage());
+        }
+    }
+
+    /**
+     * Prints input after formatting.
+     *
+     * @param areaId    area ID
+     * @param routerId  router ID
+     * @param processId process ID
+     */
+    private void printRouterFormat(String areaId, String routerId, String processId) {
+        print("%s (%s) %s %s\n", "OSPF Router with ID", routerId, "Process Id", processId);
+        print("%s ( Area %s)\n", "Router Link States", areaId);
+        print("%-20s%-20s%-20s%-20s%-20s%-20s\n", "Link Id", "ADV Router", "Age", "Seq#",
+              "CkSum", "Link Count");
+    }
+
+    /**
+     * Prints input after formatting.
+     *
+     * @param areaId area ID
+     * @param type   network type
+     */
+    private void printNetworkFormat(String areaId, String type) {
+        print("%s %s ( Area %s)\n", type, "Link States", areaId);
+        print("%-20s%-20s%-20s%-20s%-20s\n", "Link Id", "ADV Router", "Age", "Seq#", "CkSum");
+    }
+
+    /**
+     * Prints input after formatting.
+     */
+    private void printNeighborsFormat() {
+        print("%-20s%-20s%-20s%-20s%-20s\n", "Neighbor Id", "Pri", "State",
+              "Address", "Interface");
+    }
+
+    /**
+     * Checks whether the neighbor is DR or BDR.
+     *
+     * @param ip    IP address to check
+     * @param drIP  DRs IP address
+     * @param bdrIp BDRs IP address
+     * @return 1- neighbor is DR, 2- neighbor is BDR, 3- DROTHER
+     */
+    public String checkDrBdrOther(String ip, String drIP, String bdrIp) {
+
+        if (ip.equalsIgnoreCase(drIP)) {
+            return DR;
+        } else if (ip.equalsIgnoreCase(bdrIp)) {
+            return BACKUP;
+        } else {
+            return DROTHER;
+        }
+    }
+
+    /**
+     * Returns inputs as formatted string.
+     *
+     * @param areaId            area id
+     * @param routerId          router id
+     * @param linkStateId       link state id
+     * @param advertisingRouter advertising router
+     * @param age               age
+     * @param seqNo             sequence number
+     * @param checkSum          checksum
+     * @return formatted string
+     */
+    private StringBuffer getBuffList(String areaId, String routerId, String linkStateId,
+                                     String advertisingRouter, int age, String seqNo, String checkSum) {
+        StringBuffer strBuf = new StringBuffer();
+        strBuf.append(areaId);
+        strBuf.append(",");
+        strBuf.append(routerId);
+        strBuf.append(",");
+        strBuf.append(linkStateId);
+        strBuf.append(",");
+        strBuf.append(advertisingRouter);
+        strBuf.append(",");
+        strBuf.append(age);
+        strBuf.append(",");
+        strBuf.append(seqNo);
+        strBuf.append(",");
+        strBuf.append(checkSum);
+        return strBuf;
+    }
+}
\ No newline at end of file
diff --git a/providers/ospf/cli/src/main/java/org/onosproject/ospf/cli/package-info.java b/providers/ospf/cli/src/main/java/org/onosproject/ospf/cli/package-info.java
new file mode 100644
index 0000000..d040733
--- /dev/null
+++ b/providers/ospf/cli/src/main/java/org/onosproject/ospf/cli/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.
+ */
+
+/**
+ * OSPF cli implementation.
+ */
+package org.onosproject.ospf.cli;
diff --git a/providers/ospf/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml b/providers/ospf/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml
new file mode 100644
index 0000000..d261dee
--- /dev/null
+++ b/providers/ospf/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml
@@ -0,0 +1,24 @@
+<!--
+  ~ 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.
+  -->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+
+    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
+        <command>
+            <action class="org.onosproject.ospf.cli.ApplicationOspfCommand"/>
+        </command>
+    </command-bundle>
+
+</blueprint>
diff --git a/providers/ospf/pom.xml b/providers/ospf/pom.xml
new file mode 100644
index 0000000..690598b
--- /dev/null
+++ b/providers/ospf/pom.xml
@@ -0,0 +1,60 @@
+<?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/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-providers</artifactId>
+        <version>1.7.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>onos-ospf-providers</artifactId>
+    <packaging>pom</packaging>
+
+    <description>ONOS OSPF protocol adapters</description>
+
+    <modules>
+        <module>app</module>
+        <module>cfg</module>
+        <module>cli</module>
+        <module>topology</module>
+    </modules>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-ospf-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-ospf-ctl</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-api</artifactId>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/providers/ospf/topology/BUCK b/providers/ospf/topology/BUCK
new file mode 100644
index 0000000..4197711
--- /dev/null
+++ b/providers/ospf/topology/BUCK
@@ -0,0 +1,15 @@
+COMPILE_DEPS = [
+    '//lib:CORE_DEPS',
+    '//protocols/ospf/api:onos-protocols-ospf-api',
+    '//protocols/ospf/ctl:onos-protocols-ospf-ctl',
+]
+
+TEST_DEPS = [
+    '//lib:TEST_ADAPTERS',
+]
+
+osgi_jar_with_tests (
+    deps = COMPILE_DEPS,
+    test_deps = TEST_DEPS,
+)
+
diff --git a/providers/ospf/topology/pom.xml b/providers/ospf/topology/pom.xml
new file mode 100644
index 0000000..370c7a5
--- /dev/null
+++ b/providers/ospf/topology/pom.xml
@@ -0,0 +1,39 @@
+<?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/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-ospf-providers</artifactId>
+        <version>1.7.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>onos-ospf-provider-topology</artifactId>
+    <packaging>bundle</packaging>
+
+    <description>ONOS OSPF Topology Providers</description>
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/providers/ospf/topology/src/main/java/org/onosproject/provider/ospf/topology/impl/OspfTopologyProvider.java b/providers/ospf/topology/src/main/java/org/onosproject/provider/ospf/topology/impl/OspfTopologyProvider.java
new file mode 100644
index 0000000..1b76de2
--- /dev/null
+++ b/providers/ospf/topology/src/main/java/org/onosproject/provider/ospf/topology/impl/OspfTopologyProvider.java
@@ -0,0 +1,246 @@
+/*
+ * 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.provider.ospf.topology.impl;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.onlab.packet.ChassisId;
+import org.onlab.packet.Ip4Address;
+import org.onosproject.net.AnnotationKeys;
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.DefaultAnnotations;
+import org.onosproject.net.Device;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.Link;
+import org.onosproject.net.MastershipRole;
+import org.onosproject.net.PortNumber;
+import org.onosproject.net.device.DefaultDeviceDescription;
+import org.onosproject.net.device.DefaultPortDescription;
+import org.onosproject.net.device.DeviceDescription;
+import org.onosproject.net.device.DeviceProvider;
+import org.onosproject.net.device.DeviceProviderRegistry;
+import org.onosproject.net.device.DeviceProviderService;
+import org.onosproject.net.device.PortDescription;
+import org.onosproject.net.link.DefaultLinkDescription;
+import org.onosproject.net.link.LinkDescription;
+import org.onosproject.net.link.LinkProvider;
+import org.onosproject.net.link.LinkProviderRegistry;
+import org.onosproject.net.link.LinkProviderService;
+import org.onosproject.net.link.LinkService;
+import org.onosproject.net.provider.AbstractProvider;
+import org.onosproject.net.provider.ProviderId;
+import org.onosproject.ospf.controller.OspfController;
+import org.onosproject.ospf.controller.OspfLinkTed;
+import org.onosproject.ospf.controller.OspfRouter;
+import org.onosproject.ospf.controller.OspfRouterId;
+import org.onosproject.ospf.controller.OspfRouterListener;
+import org.onosproject.ospf.controller.OspfLinkListener;
+import org.slf4j.Logger;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import static org.slf4j.LoggerFactory.getLogger;
+
+/**
+ * Provider which advertises device descriptions to the core.
+ */
+@Component(immediate = true)
+public class OspfTopologyProvider extends AbstractProvider implements DeviceProvider, LinkProvider {
+
+    public static final long PSEUDO_PORT = 0xffffffff;
+    private static final Logger log = getLogger(OspfTopologyProvider.class);
+    // Default values for tunable parameters
+    private static final String UNKNOWN = "unknown";
+    final InternalTopologyProvider listener = new InternalTopologyProvider();
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected DeviceProviderRegistry deviceProviderRegistry;
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected LinkProviderRegistry linkProviderRegistry;
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected LinkService linkService;
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected OspfController controller;
+    //This Interface that defines how this provider can interact with the core.
+    private LinkProviderService linkProviderService;
+    // The interface that defines how this Provider can interact with the core
+    private DeviceProviderService deviceProviderService;
+
+    /**
+     * Creates an OSPF device provider.
+     */
+    public OspfTopologyProvider() {
+        super(new ProviderId("l3", "org.onosproject.provider.ospf"));
+    }
+
+    @Activate
+    public void activate() {
+        deviceProviderService = deviceProviderRegistry.register(this);
+        linkProviderService = linkProviderRegistry.register(this);
+        controller.addRouterListener(listener);
+        controller.addLinkListener(listener);
+        log.debug("IsisDeviceProvider::activate...!!!!");
+    }
+
+    @Deactivate
+    public void deactivate() {
+        log.debug("IsisDeviceProvider::deactivate...!!!!");
+        deviceProviderRegistry.unregister(this);
+        deviceProviderService = null;
+        linkProviderRegistry.unregister(this);
+        linkProviderService = null;
+        controller.removeRouterListener(listener);
+        controller.removeLinkListener(listener);
+        log.info("deactivated...!!!");
+    }
+
+    @Override
+    public boolean isReachable(DeviceId deviceId) {
+        return true;
+    }
+
+    @Override
+    public void changePortState(DeviceId deviceId, PortNumber portNumber, boolean enable) {
+        log.info("changePortState on device {}", deviceId);
+    }
+
+    @Override
+    public void triggerProbe(DeviceId deviceId) {
+        log.info("Triggering probe on device {}", deviceId);
+    }
+
+    @Override
+    public void roleChanged(DeviceId deviceId, MastershipRole newRole) {
+        log.info("Accepting mastership role change for device {}", deviceId);
+    }
+
+    /**
+     * Builds link description.
+     *
+     * @param ospfRouter  OSPF router instance
+     * @param ospfLinkTed OSPF link TED instance
+     * @return link description instance
+     */
+    private LinkDescription buildLinkDes(OspfRouter ospfRouter, OspfLinkTed ospfLinkTed) {
+        long srcAddress = 0;
+        long dstAddress = 0;
+        boolean localPseduo = false;
+        //Changing of port numbers
+        srcAddress = Ip4Address.valueOf(ospfRouter.routerIp().toString()).toInt();
+        dstAddress = Ip4Address.valueOf(ospfRouter.neighborRouterId().toString()).toInt();
+        DeviceId srcId = DeviceId.deviceId(OspfRouterId.uri(ospfRouter.routerIp()));
+        DeviceId dstId = DeviceId.deviceId(OspfRouterId.uri(ospfRouter.neighborRouterId()));
+        if (ospfRouter.isDr()) {
+            localPseduo = true;
+        }
+        if (localPseduo && srcAddress == 0) {
+            srcAddress = PSEUDO_PORT;
+        }
+
+        ConnectPoint src = new ConnectPoint(srcId, PortNumber.portNumber(srcAddress));
+        ConnectPoint dst = new ConnectPoint(dstId, PortNumber.portNumber(dstAddress));
+
+        return new DefaultLinkDescription(src, dst, Link.Type.DIRECT, false);
+    }
+
+    /**
+     * Internal topology Provider implementation.
+     */
+    protected class InternalTopologyProvider implements OspfRouterListener, OspfLinkListener {
+
+        @Override
+        public void routerAdded(OspfRouter ospfRouter) {
+            String routerId = ospfRouter.routerIp().toString();
+            log.info("Added device {}", routerId);
+            DeviceId deviceId = DeviceId.deviceId(OspfRouterId.uri(ospfRouter.routerIp()));
+            Device.Type deviceType = Device.Type.ROUTER;
+            //If our routerType is Dr or Bdr type is PSEUDO
+            if (ospfRouter.isDr()) {
+                deviceType = Device.Type.ROUTER;
+            } else {
+                deviceType = Device.Type.VIRTUAL;
+            }
+            //deviceId = DeviceId.deviceId(routerDetails);
+            ChassisId cId = new ChassisId();
+            DefaultAnnotations.Builder newBuilder = DefaultAnnotations.builder();
+
+            newBuilder.set(AnnotationKeys.TYPE, "l3");
+            newBuilder.set("routerId", routerId);
+            DeviceDescription description =
+                    new DefaultDeviceDescription(OspfRouterId.uri(ospfRouter.routerIp()),
+                            deviceType, UNKNOWN, UNKNOWN, UNKNOWN,
+                            UNKNOWN, cId, newBuilder.build());
+            deviceProviderService.deviceConnected(deviceId, description);
+        }
+
+        @Override
+        public void routerRemoved(OspfRouter ospfRouter) {
+            String routerId = ospfRouter.routerIp().toString();
+            log.info("Delete device {}", routerId);
+            DeviceId deviceId = DeviceId.deviceId(OspfRouterId.uri(ospfRouter.routerIp()));
+            if (deviceProviderService == null) {
+                return;
+            }
+            deviceProviderService.deviceDisconnected(deviceId);
+            log.info("delete device {}", routerId);
+        }
+
+        @Override
+        public void addLink(OspfRouter ospfRouter, OspfLinkTed ospfLinkTed) {
+            log.debug("Addlink {}", ospfRouter.routerIp());
+            LinkDescription linkDes = buildLinkDes(ospfRouter, ospfLinkTed);
+            //If already link exists, return
+            if (linkService.getLink(linkDes.src(), linkDes.dst()) != null || linkProviderService == null) {
+                return;
+            }
+            //Updating ports of the link
+            List<PortDescription> srcPortDescriptions = new LinkedList<>();
+            srcPortDescriptions.add(new DefaultPortDescription(linkDes.src().port(), true));
+            deviceProviderService.updatePorts(linkDes.src().deviceId(), srcPortDescriptions);
+
+            List<PortDescription> dstPortDescriptions = new LinkedList<>();
+            dstPortDescriptions.add(new DefaultPortDescription(linkDes.dst().port(), true));
+            deviceProviderService.updatePorts(linkDes.dst().deviceId(), dstPortDescriptions);
+            linkProviderService.linkDetected(linkDes);
+        }
+
+        @Override
+        public void deleteLink(OspfRouter ospfRouter, OspfLinkTed ospfLinkTed) {
+            log.debug("Delete link {}", ospfRouter.routerIp().toString());
+            if (linkProviderService == null) {
+                return;
+            }
+            LinkDescription linkDes = buildLinkDes(ospfRouter, ospfLinkTed);
+            //Updating ports of the link
+            List<PortDescription> srcPortDescriptions = new LinkedList<>();
+            srcPortDescriptions.add(new DefaultPortDescription(linkDes.src().port(), true));
+            deviceProviderService.updatePorts(linkDes.src().deviceId(), srcPortDescriptions);
+
+            List<PortDescription> dstPortDescriptions = new LinkedList<>();
+            dstPortDescriptions.add(new DefaultPortDescription(linkDes.dst().port(), true));
+            deviceProviderService.updatePorts(linkDes.dst().deviceId(), dstPortDescriptions);
+            linkProviderService.linkVanished(linkDes);
+        }
+
+        @Override
+        public void routerChanged(OspfRouter ospfRouter) {
+            log.info("Router changed is not supported currently");
+        }
+    }
+}
\ No newline at end of file
diff --git a/providers/ospf/topology/src/main/java/org/onosproject/provider/ospf/topology/impl/package-info.java b/providers/ospf/topology/src/main/java/org/onosproject/provider/ospf/topology/impl/package-info.java
new file mode 100644
index 0000000..63f733e
--- /dev/null
+++ b/providers/ospf/topology/src/main/java/org/onosproject/provider/ospf/topology/impl/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.
+ */
+
+/**
+ * Provider that uses OSPF as a means of topology discovery.
+ */
+package org.onosproject.provider.ospf.topology.impl;
diff --git a/providers/ospf/topology/src/test/java/org/onosproject/provider/ospf/topology/impl/OspfTopologyProviderTest.java b/providers/ospf/topology/src/test/java/org/onosproject/provider/ospf/topology/impl/OspfTopologyProviderTest.java
new file mode 100644
index 0000000..a667a0e
--- /dev/null
+++ b/providers/ospf/topology/src/test/java/org/onosproject/provider/ospf/topology/impl/OspfTopologyProviderTest.java
@@ -0,0 +1,380 @@
+/*
+ * 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.provider.ospf.topology.impl;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onlab.packet.Ip4Address;
+import org.onlab.util.Bandwidth;
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.Device;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.Link;
+import org.onosproject.net.MastershipRole;
+import org.onosproject.net.PortNumber;
+import org.onosproject.net.device.DeviceDescription;
+import org.onosproject.net.device.DeviceListener;
+import org.onosproject.net.device.DeviceProvider;
+import org.onosproject.net.device.DeviceProviderRegistry;
+import org.onosproject.net.device.DeviceProviderService;
+import org.onosproject.net.device.DeviceServiceAdapter;
+import org.onosproject.net.device.PortDescription;
+import org.onosproject.net.device.PortStatistics;
+import org.onosproject.net.link.LinkDescription;
+import org.onosproject.net.link.LinkListener;
+import org.onosproject.net.link.LinkProvider;
+import org.onosproject.net.link.LinkProviderRegistry;
+import org.onosproject.net.link.LinkProviderService;
+import org.onosproject.net.link.LinkServiceAdapter;
+import org.onosproject.net.provider.ProviderId;
+import org.onosproject.ospf.controller.OspfController;
+import org.onosproject.ospf.controller.OspfDeviceTed;
+import org.onosproject.ospf.controller.OspfLinkListener;
+import org.onosproject.ospf.controller.OspfLinkTed;
+import org.onosproject.ospf.controller.OspfProcess;
+import org.onosproject.ospf.controller.OspfRouter;
+import org.onosproject.ospf.controller.OspfRouterListener;
+import org.onosproject.ospf.controller.impl.OspfDeviceTedImpl;
+import org.onosproject.ospf.controller.impl.OspfLinkTedImpl;
+import org.onosproject.ospf.controller.impl.OspfRouterImpl;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArraySet;
+
+import static org.junit.Assert.*;
+
+/**
+ * Test cases for OSPF topology provider.
+ */
+public class OspfTopologyProviderTest {
+
+    private final OspfTopologyProvider provider = new OspfTopologyProvider();
+    private final TestDeviceRegistry nodeRegistry = new TestDeviceRegistry();
+    private final TestLinkRegistry linkRegistry = new TestLinkRegistry();
+    private final TestController controller = new TestController();
+    private final TestLinkService linkService = new TestLinkService();
+
+    @Before
+    public void setUp() throws Exception {
+        provider.deviceProviderRegistry = nodeRegistry;
+        provider.linkProviderRegistry = linkRegistry;
+        provider.controller = controller;
+        provider.linkService = linkService;
+        provider.activate();
+        assertNotNull("provider should be registered", nodeRegistry.provider);
+        assertNotNull("listener should be registered", controller.nodeListener);
+
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        provider.deactivate();
+        assertNull("listener should be removed", controller.nodeListener);
+        provider.controller = null;
+        provider.deviceProviderRegistry = null;
+    }
+
+    @Test
+    public void triggerProbe() {
+        DeviceId deviceId = DeviceId.deviceId("2.2.2.2");
+        provider.triggerProbe(deviceId);
+    }
+
+    @Test
+    public void roleChanged() {
+        DeviceId deviceId = DeviceId.deviceId("2.2.2.2");
+        provider.roleChanged(deviceId, MastershipRole.MASTER);
+    }
+
+    @Test
+    public void changePortState() {
+        DeviceId deviceId = DeviceId.deviceId("2.2.2.2");
+        provider.changePortState(deviceId, PortNumber.portNumber(0), false);
+    }
+
+    @Test
+    public void isReachable() {
+        DeviceId deviceId = DeviceId.deviceId("1.1.1.1");
+        provider.isReachable(deviceId);
+    }
+
+    /* Validate node is added to the device validating URI, RIB should get updated properly */
+    @Test
+    public void ospfTopologyProviderTestAddDevice1() {
+        int deviceAddCount = 0;
+        OspfRouter ospfRouter = new OspfRouterImpl();
+        ospfRouter.setDr(false);
+        ospfRouter.setOpaque(false);
+        ospfRouter.setNeighborRouterId(Ip4Address.valueOf("2.2.2.2"));
+        ospfRouter.setInterfaceId(Ip4Address.valueOf("10.10.10.2"));
+        ospfRouter.setAreaIdOfInterface(Ip4Address.valueOf("5.5.5.5"));
+        ospfRouter.setRouterIp(Ip4Address.valueOf("1.1.1.1"));
+        OspfDeviceTed ospfDeviceTed = new OspfDeviceTedImpl();
+        ospfDeviceTed.setAbr(false);
+        ospfDeviceTed.setAsbr(false);
+        ospfRouter.setDeviceTed(ospfDeviceTed);
+        OspfLinkTed ospfLinkTed = new OspfLinkTedImpl();
+        ospfLinkTed.setMaximumLink(Bandwidth.bps(10));
+        ospfLinkTed.setMaxReserved(Bandwidth.bps(20));
+        ospfLinkTed.setTeMetric(10);
+        OspfRouter ospfRouter1 = new OspfRouterImpl();
+        ospfRouter1.setDr(true);
+        ospfRouter1.setOpaque(true);
+        ospfRouter1.setNeighborRouterId(Ip4Address.valueOf("2.2.2.2"));
+        ospfRouter1.setInterfaceId(Ip4Address.valueOf("10.10.10.2"));
+        ospfRouter1.setAreaIdOfInterface(Ip4Address.valueOf("5.5.5.5"));
+        ospfRouter1.setRouterIp(Ip4Address.valueOf("1.1.1.1"));
+        OspfDeviceTed ospfDeviceTed1 = new OspfDeviceTedImpl();
+        ospfDeviceTed1.setAbr(false);
+        ospfDeviceTed1.setAsbr(false);
+        ospfRouter.setDeviceTed(ospfDeviceTed);
+        OspfLinkTed ospfLinkTed1 = new OspfLinkTedImpl();
+        ospfLinkTed1.setMaximumLink(Bandwidth.bps(10));
+        ospfLinkTed1.setMaxReserved(Bandwidth.bps(20));
+        ospfLinkTed1.setTeMetric(10);
+        for (OspfRouterListener l : controller.nodeListener) {
+            l.routerAdded(ospfRouter);
+
+            deviceAddCount = nodeRegistry.connected.size();
+            assertTrue(deviceAddCount == 1);
+            l.routerRemoved(ospfRouter);
+            deviceAddCount = nodeRegistry.connected.size();
+            assertTrue(deviceAddCount == 0);
+        }
+        for (OspfLinkListener l : controller.linkListener) {
+            l.addLink(ospfRouter, ospfLinkTed);
+            l.deleteLink(ospfRouter, ospfLinkTed);
+
+        }
+    }
+
+    @Test
+    public void ospfTopologyProviderTestAddDevice2() {
+        int deviceAddCount = 0;
+        OspfRouter ospfRouter = new OspfRouterImpl();
+        ospfRouter.setDr(true);
+        ospfRouter.setOpaque(true);
+        ospfRouter.setNeighborRouterId(Ip4Address.valueOf("3.3.3.3"));
+        ospfRouter.setInterfaceId(Ip4Address.valueOf("10.10.10.3"));
+        ospfRouter.setAreaIdOfInterface(Ip4Address.valueOf("6.6.6.6"));
+        ospfRouter.setRouterIp(Ip4Address.valueOf("7.7.7.7"));
+        OspfDeviceTed ospfDeviceTed = new OspfDeviceTedImpl();
+        ospfDeviceTed.setAbr(true);
+        ospfDeviceTed.setAsbr(true);
+        ospfRouter.setDeviceTed(ospfDeviceTed);
+        OspfLinkTed ospfLinkTed = new OspfLinkTedImpl();
+        ospfLinkTed.setMaximumLink(Bandwidth.bps(30));
+        ospfLinkTed.setMaxReserved(Bandwidth.bps(40));
+        ospfLinkTed.setTeMetric(50);
+        for (OspfRouterListener l : controller.nodeListener) {
+            l.routerAdded(ospfRouter);
+            deviceAddCount = nodeRegistry.connected.size();
+            assertTrue(deviceAddCount == 1);
+            l.routerRemoved(ospfRouter);
+            deviceAddCount = nodeRegistry.connected.size();
+            assertTrue(deviceAddCount == 0);
+        }
+    }
+
+
+    /* Class implement device test registry */
+    private class TestDeviceRegistry implements DeviceProviderRegistry {
+        DeviceProvider provider;
+        Set<DeviceId> connected = new HashSet<>();
+
+        @Override
+        public DeviceProviderService register(DeviceProvider provider) {
+            this.provider = provider;
+            return new TestProviderService();
+        }
+
+        @Override
+        public void unregister(DeviceProvider provider) {
+        }
+
+        @Override
+        public Set<ProviderId> getProviders() {
+            return null;
+        }
+
+        private class TestProviderService implements DeviceProviderService {
+
+            @Override
+            public DeviceProvider provider() {
+                return null;
+            }
+
+            @Override
+            public void deviceConnected(DeviceId deviceId, DeviceDescription deviceDescription) {
+                connected.add(deviceId);
+            }
+
+            @Override
+            public void deviceDisconnected(DeviceId deviceId) {
+                connected.remove(deviceId);
+            }
+
+            @Override
+            public void updatePorts(DeviceId deviceId, List<PortDescription> portDescriptions) {
+                // TODO Auto-generated method stub
+            }
+
+            @Override
+            public void portStatusChanged(DeviceId deviceId, PortDescription portDescription) {
+                // TODO Auto-generated method stub
+            }
+
+            @Override
+            public void receivedRoleReply(DeviceId deviceId, MastershipRole requested, MastershipRole response) {
+                // TODO Auto-generated method stub
+            }
+
+            @Override
+            public void updatePortStatistics(DeviceId deviceId, Collection<PortStatistics> portStatistics) {
+                // TODO Auto-generated method stub
+            }
+        }
+    }
+
+    private class TestDeviceService extends DeviceServiceAdapter {
+        private DeviceListener listener;
+
+        @Override
+        public void addListener(DeviceListener listener) {
+            this.listener = listener;
+        }
+
+        @Override
+        public Iterable<Device> getDevices() {
+            return Collections.emptyList();
+        }
+    }
+
+    private class TestLinkService extends LinkServiceAdapter {
+        private LinkListener listener;
+
+        @Override
+        public void addListener(LinkListener listener) {
+            this.listener = listener;
+        }
+
+        @Override
+        public Iterable<Link> getLinks() {
+            return Collections.emptyList();
+        }
+    }
+
+    /* Class implement device test registry */
+    private class TestLinkRegistry implements LinkProviderRegistry {
+        LinkProvider provider;
+        Set<DeviceId> connected = new HashSet<>();
+
+        @Override
+        public LinkProviderService register(LinkProvider provider) {
+            this.provider = provider;
+            return new TestLinkProviderService();
+        }
+
+        @Override
+        public void unregister(LinkProvider provider) {
+        }
+
+        @Override
+        public Set<ProviderId> getProviders() {
+            return null;
+        }
+
+        private class TestLinkProviderService implements LinkProviderService {
+            @Override
+            public void linkDetected(LinkDescription linkDescription) {
+            }
+
+            @Override
+            public void linkVanished(LinkDescription linkDescription) {
+            }
+
+            @Override
+            public void linksVanished(ConnectPoint connectPoint) {
+            }
+
+            @Override
+            public void linksVanished(DeviceId deviceId) {
+            }
+
+            @Override
+            public LinkProvider provider() {
+                return null;
+            }
+        }
+    }
+
+    /* class implement test controller */
+    private class TestController implements OspfController {
+        protected Set<OspfRouterListener> nodeListener = new CopyOnWriteArraySet<>();
+        protected Set<OspfLinkListener> linkListener = new CopyOnWriteArraySet<>();
+
+        @Override
+        public void addRouterListener(OspfRouterListener nodeListener) {
+            this.nodeListener.add(nodeListener);
+        }
+
+        @Override
+        public void removeRouterListener(OspfRouterListener nodeListener) {
+            this.nodeListener = null;
+        }
+
+        @Override
+        public void addLinkListener(OspfLinkListener listener) {
+            this.linkListener.add(listener);
+        }
+
+        @Override
+        public void removeLinkListener(OspfLinkListener listener) {
+            this.nodeListener = null;
+        }
+
+        @Override
+        public void updateConfig(JsonNode processesNode) {
+        }
+
+
+        @Override
+        public void deleteConfig(List<OspfProcess> processes, String attribute) {
+        }
+
+        @Override
+        public Set<OspfRouterListener> listener() {
+            return null;
+        }
+
+        @Override
+        public Set<OspfLinkListener> linkListener() {
+            return null;
+        }
+
+        @Override
+        public List<OspfProcess> getAllConfiguredProcesses() {
+            return null;
+        }
+    }
+}
\ No newline at end of file
