diff --git a/drivers/pom.xml b/drivers/pom.xml
index fa8d72c..d208fb6 100644
--- a/drivers/pom.xml
+++ b/drivers/pom.xml
@@ -36,6 +36,7 @@
         <module>fujitsu</module>
         <module>cisco</module>
         <module>netconf</module>
+        <module>server</module>
         <module>ovsdb</module>
         <module>utilities</module>
         <module>lumentum</module>
diff --git a/drivers/server/BUCK b/drivers/server/BUCK
new file mode 100644
index 0000000..9be0e49
--- /dev/null
+++ b/drivers/server/BUCK
@@ -0,0 +1,39 @@
+COMPILE_DEPS = [
+    '//lib:CORE_DEPS',
+    '//lib:JACKSON',
+    '//lib:javax.ws.rs-api',
+    '//incubator/api:onos-incubator-api',
+    '//utils/rest:onlab-rest',
+    '//protocols/rest/api:onos-protocols-rest-api',
+]
+
+TEST_DEPS = [
+    '//lib:TEST_ADAPTERS',
+    '//core/api:onos-api-tests',
+]
+
+BUNDLES = [
+    ':onos-drivers-server',
+]
+
+REQUIRED_APPS = [
+    'org.onosproject.restsb',
+]
+
+osgi_jar_with_tests (
+    deps = COMPILE_DEPS,
+    test_deps = TEST_DEPS,
+    resources_root = 'src/main/resources',
+    resources = glob(['src/main/resources/**']),
+)
+
+onos_app (
+    app_name = 'org.onosproject.drivers.server',
+    title = 'Server Device Drivers',
+    category = 'Drivers',
+    origin = 'KTH Royal Institute of Technology &amp; RISE SICS',
+    url = 'https://github.com/gkatsikas/onos/tree/metron-driver',
+    description = 'ONOS southbound drivers for commodity servers',
+    included_bundles = BUNDLES,
+    required_apps = REQUIRED_APPS,
+)
diff --git a/drivers/server/features.xml b/drivers/server/features.xml
new file mode 100644
index 0000000..ba45275
--- /dev/null
+++ b/drivers/server/features.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+  ~ Copyright 2017-present Open Networking Foundation
+  ~
+  ~ 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>
+        <bundle>mvn:${project.groupId}/onos-restsb-api/${project.version}</bundle>
+    </feature>
+</features>
diff --git a/drivers/server/pom.xml b/drivers/server/pom.xml
new file mode 100644
index 0000000..8f81931
--- /dev/null
+++ b/drivers/server/pom.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2017-present Open Networking Foundation
+  ~
+  ~ 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">
+    <parent>
+        <artifactId>onos-drivers-general</artifactId>
+        <groupId>org.onosproject</groupId>
+        <version>1.13.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>onos-drivers-server</artifactId>
+    <packaging>bundle</packaging>
+
+    <description>ONOS southbound drivers for commodity servers</description>
+
+    <properties>
+        <onos.app.name>org.onosproject.drivers.server</onos.app.name>
+        <onos.app.origin>KTH Royal Institute of Technology &amp; RISE SICS</onos.app.origin>
+        <onos.app.category>Drivers</onos.app.category>
+        <onos.app.title>Server Device Drivers</onos.app.title>
+        <onos.app.url>https://github.com/gkatsikas/onos/tree/metron-driver</onos.app.url>
+        <onos.app.readme>
+            Allows ONOS to manage CPU and network interface cards' (NICs)
+            resources on commodity servers.
+        </onos.app.readme>
+        <onos.app.requires>
+            org.onosproject.restsb
+        </onos.app.requires>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-restsb-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>javax.ws.rs-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.glassfish.jersey.containers</groupId>
+            <artifactId>jersey-container-servlet</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-annotations</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/BasicServerDriver.java b/drivers/server/src/main/java/org/onosproject/drivers/server/BasicServerDriver.java
new file mode 100644
index 0000000..e270b43
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/BasicServerDriver.java
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * 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.drivers.server;
+
+import org.onosproject.net.driver.AbstractHandlerBehaviour;
+import org.onosproject.net.driver.DriverHandler;
+import org.onosproject.protocol.rest.RestSBController;
+
+import org.onlab.osgi.ServiceNotFoundException;
+
+import org.slf4j.Logger;
+import com.fasterxml.jackson.databind.JsonNode;
+
+import java.util.EnumSet;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import static org.slf4j.LoggerFactory.getLogger;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * The basic functionality of the server driver.
+ */
+public class BasicServerDriver extends AbstractHandlerBehaviour {
+
+    private final Logger log = getLogger(getClass());
+
+    /**
+     * Resource endpoints of the server agent (REST server-side).
+     */
+    public    static final MediaType  JSON = MediaType.valueOf(MediaType.APPLICATION_JSON);
+    protected static final String ROOT_URL = "";
+    public    static final String BASE_URL = ROOT_URL + "/metron";
+
+    /**
+     * Successful HTTP status codes.
+     */
+    private static final int STATUS_OK = Response.Status.OK.getStatusCode();
+    private static final int STATUS_CREATED = Response.Status.CREATED.getStatusCode();
+    private static final int STATUS_ACCEPTED = Response.Status.ACCEPTED.getStatusCode();
+
+    /**
+     * Messages for error handlers.
+     */
+    protected static final String MASTERSHIP_NULL = "Mastership service is null";
+    protected static final String CONTROLLER_NULL = "RestSB controller is null";
+    protected static final String DEVICE_ID_NULL  = "Device ID cannot be null";
+    protected static final String HANDLER_NULL    = "Handler cannot be null";
+    protected static final String DEVICE_NULL     = "Device cannot be null";
+
+    /**
+     * A unique controller that handles the REST-based communication.
+     */
+    protected static RestSBController controller = null;
+    protected static DriverHandler       handler = null;
+
+    public BasicServerDriver() {};
+
+    /**
+     * Initialize the REST SB controller (if not already).
+     * Creates a handler and a controller only once, and
+     * then re-uses these objects.
+     *
+     * @throws ServiceNotFoundException when either the handler
+     *         or the controller cannot be retrieved.
+     */
+    private void init() {
+        // Already done
+        if ((handler != null) && (controller != null)) {
+            return;
+        }
+
+        try {
+            handler = handler();
+            checkNotNull(handler, HANDLER_NULL);
+            controller = handler.get(RestSBController.class);
+            checkNotNull(controller, CONTROLLER_NULL);
+        } catch (ServiceNotFoundException e) {
+            throw e;
+        }
+    }
+
+    /**
+     * Retrieve an instance of the REST SB controller.
+     * Method init will only be called the first time
+     * this method (or getHandler) is invoked.
+     *
+     * @return RestSBController instance
+     */
+    protected RestSBController getController() {
+        if (controller == null) {
+            init();
+        }
+
+        return controller;
+    }
+
+    /**
+     * Retrieve an instance of the driver handler.
+     * Method init will only be called the first time
+     * this method (or getController) is invoked.
+     *
+     * @return DriverHandler instance
+     */
+    protected DriverHandler getHandler() {
+        if (handler == null) {
+            init();
+        }
+
+        return handler;
+    }
+
+    /**
+     * Return all the enumeration's types in a space-separated string.
+     *
+     * @param <E> the expected class of the enum
+     * @param enumType the enum class to get its types
+     * @return String with all enumeration types
+     */
+    public static <E extends Enum<E>> String enumTypesToString(
+            Class<E> enumType) {
+        String allTypes = "";
+        for (E en : EnumSet.allOf(enumType)) {
+            allTypes += en.toString() + " ";
+        }
+
+        return allTypes.trim();
+    }
+
+    /**
+     * Return a string value after reading the input
+     * attribute from the input JSON node.
+     *
+     * @param jsonNode JSON node to read from
+     * @param attribute to lookup in the JSON node
+     * @return string value mapped to the attribute
+     */
+    public static String get(JsonNode jsonNode, String attribute) {
+        if (jsonNode == null || (attribute == null || attribute.isEmpty())) {
+            return null;
+        }
+
+        String result = "";
+
+        try {
+            result = jsonNode.get(attribute).asText();
+        } catch (Exception ex) {
+            throw new RuntimeException(
+                "Failed to read JSON attribute: " + attribute
+            );
+        }
+
+        return result;
+    }
+
+    /**
+     * Assess a given HTTP status code.
+     *
+     * @param statusCode the HTTP status code to check
+     * @return boolean status (success or failure)
+     */
+    public static boolean checkStatusCode(int statusCode) {
+        if (statusCode == STATUS_OK || statusCode == STATUS_CREATED || statusCode == STATUS_ACCEPTED) {
+            return true;
+        }
+
+        return false;
+    }
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/ServerControllerConfig.java b/drivers/server/src/main/java/org/onosproject/drivers/server/ServerControllerConfig.java
new file mode 100644
index 0000000..e26d4be
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/ServerControllerConfig.java
@@ -0,0 +1,249 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * 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.drivers.server;
+
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.behaviour.ControllerConfig;
+import org.onosproject.net.behaviour.ControllerInfo;
+import org.onosproject.mastership.MastershipService;
+
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.TpPort;
+import org.slf4j.Logger;
+
+import com.google.common.collect.Lists;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+import javax.ws.rs.ProcessingException;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static org.slf4j.LoggerFactory.getLogger;
+
+/**
+ * Sets, gets, and removes controller configuration
+ * from a commodity server (i.e., a REST device).
+ */
+public class ServerControllerConfig extends BasicServerDriver
+        implements ControllerConfig {
+
+    private final Logger log = getLogger(getClass());
+
+    /**
+     * Resource endpoints of the server agent (REST server-side).
+     */
+    private static final String CONTROLLERS_CONF_URL = BASE_URL + "/controllers";
+
+    /**
+     * Parameters to be exchanged with the server's agent.
+     */
+    private static final String PARAM_CTRL      = "controllers";
+    private static final String PARAM_CTRL_IP   = "ip";
+    private static final String PARAM_CTRL_PORT = "port";
+    private static final String PARAM_CTRL_TYPE = "type";
+
+    /**
+     * Constructs controller configuration for server.
+     */
+    public ServerControllerConfig() {
+        super();
+        log.debug("Started");
+    }
+
+    @Override
+    public List<ControllerInfo> getControllers() {
+        List<ControllerInfo> controllers = Lists.newArrayList();
+
+        DeviceId deviceId = getHandler().data().deviceId();
+        checkNotNull(deviceId, DEVICE_ID_NULL);
+
+        MastershipService mastershipService = getHandler().get(MastershipService.class);
+        checkNotNull(deviceId, MASTERSHIP_NULL);
+
+        if (!mastershipService.isLocalMaster(deviceId)) {
+            log.warn(
+                "I am not master for {}. " +
+                "Please use master {} to get controllers for this device",
+                deviceId,
+                mastershipService.getMasterFor(deviceId)
+            );
+            return controllers;
+        }
+
+        // Hit the path that provides the server's controllers
+        InputStream response = null;
+        try {
+            response = getController().get(
+                deviceId,
+                CONTROLLERS_CONF_URL,
+                JSON
+            );
+        } catch (ProcessingException pEx) {
+            log.error("Failed to get controllers of device: {}", deviceId);
+            return controllers;
+        }
+
+        // Load the JSON into objects
+        ObjectMapper mapper = new ObjectMapper();
+        Map<String, Object> jsonMap = null;
+        JsonNode jsonNode = null;
+        ObjectNode objNode = null;
+        try {
+            jsonMap  = mapper.readValue(response, Map.class);
+            jsonNode = mapper.convertValue(jsonMap, JsonNode.class);
+            objNode = (ObjectNode) jsonNode;
+        } catch (IOException ioEx) {
+            log.error("Failed to get controllers of device: {}", deviceId);
+            return controllers;
+        }
+
+        if (jsonMap == null) {
+            log.error("Failed to get controllers of device: {}", deviceId);
+            return controllers;
+        }
+
+        JsonNode ctrlNode = objNode.path(PARAM_CTRL);
+
+        // Fetch controller objects
+        for (JsonNode cn : ctrlNode) {
+            ObjectNode ctrlObjNode = (ObjectNode) cn;
+
+            // Get the attributes of a controller
+            String ctrlIpStr = get(cn, PARAM_CTRL_IP);
+            int    ctrlPort  = ctrlObjNode.path(PARAM_CTRL_PORT).asInt();
+            String ctrlType  = get(cn, PARAM_CTRL_TYPE);
+
+            // Check data format and range
+            IpAddress ctrlIp = null;
+            try {
+                ctrlIp = IpAddress.valueOf(ctrlIpStr);
+            } catch (IllegalArgumentException e) {
+                throw new IllegalArgumentException(e);
+            }
+
+            if ((ctrlPort < 0) || (ctrlPort > TpPort.MAX_PORT)) {
+                final String msg = "Invalid controller port: " + ctrlPort;
+                throw new IllegalArgumentException(msg);
+            }
+
+            controllers.add(
+                new ControllerInfo(ctrlIp, ctrlPort, ctrlType)
+            );
+        }
+
+        return controllers;
+    }
+
+    @Override
+    public void setControllers(List<ControllerInfo> controllers) {
+        DeviceId deviceId = getHandler().data().deviceId();
+        checkNotNull(deviceId, DEVICE_ID_NULL);
+
+        MastershipService mastershipService = getHandler().get(MastershipService.class);
+        checkNotNull(deviceId, MASTERSHIP_NULL);
+
+        if (!mastershipService.isLocalMaster(deviceId)) {
+            log.warn(
+                "I am not master for {}. " +
+                "Please use master {} to set controllers for this device",
+                deviceId,
+                mastershipService.getMasterFor(deviceId)
+            );
+            return;
+        }
+
+        ObjectMapper mapper = new ObjectMapper();
+
+        // Create the object node to host the data
+        ObjectNode sendObjNode = mapper.createObjectNode();
+
+        // Insert header
+        ArrayNode ctrlsArrayNode = sendObjNode.putArray(PARAM_CTRL);
+
+        // Add each controller's information object
+        for (ControllerInfo ctrl : controllers) {
+            ObjectNode ctrlObjNode = mapper.createObjectNode();
+            ctrlObjNode.put(PARAM_CTRL_IP,   ctrl.ip().toString());
+            ctrlObjNode.put(PARAM_CTRL_PORT, ctrl.port());
+            ctrlObjNode.put(PARAM_CTRL_TYPE, ctrl.type());
+            ctrlsArrayNode.add(ctrlObjNode);
+        }
+
+        // Post the controllers to the device
+        int response = getController().post(
+            deviceId,
+            CONTROLLERS_CONF_URL,
+            new ByteArrayInputStream(sendObjNode.toString().getBytes()),
+            JSON
+        );
+
+        if (!checkStatusCode(response)) {
+            log.error("Failed to set controllers on device {}", deviceId);
+        }
+
+        return;
+    }
+
+    @Override
+    public void removeControllers(List<ControllerInfo> controllers) {
+        DeviceId deviceId = getHandler().data().deviceId();
+        checkNotNull(deviceId, DEVICE_ID_NULL);
+
+        MastershipService mastershipService = getHandler().get(MastershipService.class);
+        checkNotNull(deviceId, MASTERSHIP_NULL);
+
+        if (!mastershipService.isLocalMaster(deviceId)) {
+            log.warn(
+                "I am not master for {}. " +
+                "Please use master {} to remove controllers from this device",
+                deviceId,
+                mastershipService.getMasterFor(deviceId)
+            );
+            return;
+        }
+
+        /**
+         * TODO: Explicit removal of the requested controllers.
+         */
+
+        /**
+         * List of controllers is ignored for now.
+         * We just tell the server to remove its
+         * current controller information.
+         */
+        int response = getController().delete(
+            deviceId,
+            CONTROLLERS_CONF_URL,
+            null,
+            JSON
+        );
+
+        if (!checkStatusCode(response)) {
+            log.error("Failed to remove controllers from device {}", deviceId);
+        }
+
+        return;
+    }
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/ServerDevicesDiscovery.java b/drivers/server/src/main/java/org/onosproject/drivers/server/ServerDevicesDiscovery.java
new file mode 100644
index 0000000..c5934f5
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/ServerDevicesDiscovery.java
@@ -0,0 +1,926 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server;
+
+import org.onosproject.drivers.server.behavior.CpuStatisticsDiscovery;
+import org.onosproject.drivers.server.behavior.MonitoringStatisticsDiscovery;
+import org.onosproject.drivers.server.devices.CpuDevice;
+import org.onosproject.drivers.server.devices.CpuVendor;
+import org.onosproject.drivers.server.devices.NicDevice;
+import org.onosproject.drivers.server.devices.NicRxFilter;
+import org.onosproject.drivers.server.devices.NicRxFilter.RxFilter;
+import org.onosproject.drivers.server.devices.ServerDeviceDescription;
+import org.onosproject.drivers.server.devices.RestServerSBDevice;
+import org.onosproject.drivers.server.stats.CpuStatistics;
+import org.onosproject.drivers.server.stats.MonitoringStatistics;
+import org.onosproject.drivers.server.stats.TimingStatistics;
+
+import org.onosproject.drivers.server.impl.devices.DefaultCpuDevice;
+import org.onosproject.drivers.server.impl.devices.DefaultNicDevice;
+import org.onosproject.drivers.server.impl.devices.DefaultRestServerSBDevice;
+import org.onosproject.drivers.server.impl.devices.DefaultServerDeviceDescription;
+import org.onosproject.drivers.server.impl.stats.DefaultCpuStatistics;
+import org.onosproject.drivers.server.impl.stats.DefaultMonitoringStatistics;
+import org.onosproject.drivers.server.impl.stats.DefaultTimingStatistics;
+
+import org.onlab.packet.ChassisId;
+import org.onosproject.net.AnnotationKeys;
+import org.onosproject.net.Device;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.DefaultAnnotations;
+import org.onosproject.net.behaviour.DevicesDiscovery;
+import org.onosproject.net.device.DeviceDescription;
+import org.onosproject.net.device.DeviceDescriptionDiscovery;
+import org.onosproject.net.device.DefaultPortStatistics;
+import org.onosproject.net.device.DefaultPortDescription;
+import org.onosproject.net.device.PortDescription;
+import org.onosproject.net.device.PortStatistics;
+import org.onosproject.net.device.PortStatisticsDiscovery;
+import org.onosproject.net.Port;
+import org.onosproject.net.PortNumber;
+import org.onosproject.protocol.rest.RestSBDevice;
+import org.onosproject.protocol.rest.RestSBDevice.AuthenticationScheme;
+
+import org.slf4j.Logger;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.ImmutableList;
+
+import javax.ws.rs.ProcessingException;
+import java.io.InputStream;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static org.slf4j.LoggerFactory.getLogger;
+
+/**
+ * Discovers the device details of
+ * REST-based commodity server devices.
+ */
+public class ServerDevicesDiscovery extends BasicServerDriver
+        implements  DevicesDiscovery, DeviceDescriptionDiscovery,
+                    PortStatisticsDiscovery, CpuStatisticsDiscovery,
+                    MonitoringStatisticsDiscovery {
+
+    private final Logger log = getLogger(getClass());
+
+    /**
+     * Resource endpoints of the server agent (REST server-side).
+     */
+    private static final String RESOURCE_DISCOVERY_URL   = BASE_URL + "/resources";
+    private static final String GLOBAL_STATS_URL         = BASE_URL + "/stats";
+    private static final String SERVICE_CHAINS_STATS_URL = BASE_URL + "/chains_stats";  // + /ID
+
+    /**
+     * Parameters to be exchanged with the server's agent.
+     */
+    private static final String PARAM_ID               = "id";
+    private static final String PARAM_CPUS             = "cpus";
+    private static final String PARAM_MANUFACTURER     = "manufacturer";
+    private static final String PARAM_HW_VENDOR        = "hwVersion";
+    private static final String PARAM_SW_VENDOR        = "swVersion";
+    private static final String PARAM_SERIAL           = "serial";
+    private static final String PARAM_NICS             = "nics";
+    private static final String PARAM_TIMING_STATS     = "timing_stats";
+    private static final String PARAM_TIMING_AUTOSCALE = "autoscale_timing_stats";
+
+    private static final String NIC_PARAM_ID               = "id";
+    private static final String NIC_PARAM_PORT_TYPE        = "portType";
+    private static final String NIC_PARAM_PORT_TYPE_FIBER  = "fiber";
+    private static final String NIC_PARAM_PORT_TYPE_COPPER = "copper";
+    private static final String NIC_PARAM_SPEED            = "speed";
+    private static final String NIC_PARAM_STATUS           = "status";
+    private static final String NIC_PARAM_HW_ADDR          = "hwAddr";
+    private static final String NIC_PARAM_RX_FILTER        = "rxFilter";
+    private static final String NIC_PARAM_RX_METHOD        = "method";
+    private static final String NIC_PARAM_RX_METHOD_VALUES = "values";
+
+    /**
+     * NIC statistics.
+     */
+    private static final String NIC_STATS_TX_COUNT  = "txCount";
+    private static final String NIC_STATS_TX_BYTES  = "txBytes";
+    private static final String NIC_STATS_TX_DROPS  = "txDropped";
+    private static final String NIC_STATS_TX_ERRORS = "txErrors";
+    private static final String NIC_STATS_RX_COUNT  = "rxCount";
+    private static final String NIC_STATS_RX_BYTES  = "rxBytes";
+    private static final String NIC_STATS_RX_DROPS  = "rxDropped";
+    private static final String NIC_STATS_RX_ERRORS = "rxErrors";
+
+    /**
+     * CPU statistics.
+     */
+    private static final String CPU_PARAM_ID        = "id";
+    private static final String CPU_PARAM_VENDOR    = "vendor";
+    private static final String CPU_PARAM_FREQUENCY = "frequency";
+    private static final String CPU_PARAM_LOAD      = "load";
+    private static final String CPU_PARAM_STATUS    = "busy";
+    private static final String CPU_STATS_BUSY_CPUS = "busyCpus";
+    private static final String CPU_STATS_FREE_CPUS = "freeCpus";
+
+    /**
+     * Timing statistics.
+     */
+    private static final String TIMING_PARAM_PARSE     = "parse";
+    private static final String TIMING_PARAM_LAUNCH    = "launch";
+    private static final String TIMING_PARAM_AUTOSCALE = "autoscale";
+
+    /**
+     * Auxiliary constants.
+     */
+    private static final short  DISCOVERY_RETRIES  = 3;
+    private static final String CPU_VENDOR_NULL    = "Unsupported CPU vendor" +
+        " Choose one in: " + BasicServerDriver.enumTypesToString(CpuVendor.class);
+    private static final String NIC_RX_FILTER_NULL = "Unsupported NIC Rx filter" +
+        " Choose one in: " + BasicServerDriver.enumTypesToString(RxFilter.class);
+
+    /**
+     * Port types that usually appear in commodity servers.
+     */
+    public static final Map<String, Port.Type> PORT_TYPE_MAP =
+        Collections.unmodifiableMap(
+            new HashMap<String, Port.Type>() {
+                {
+                    put(NIC_PARAM_PORT_TYPE_FIBER,  Port.Type.FIBER);
+                    put(NIC_PARAM_PORT_TYPE_COPPER, Port.Type.COPPER);
+                }
+            }
+        );
+
+    /**
+     * Constructs server device discovery.
+     */
+    public ServerDevicesDiscovery() {
+        super();
+        log.debug("Started");
+    }
+
+    @Override
+    public Set<DeviceId> deviceIds() {
+        // Set of devices to return
+        Set<DeviceId> devices = new HashSet<DeviceId>();
+
+        DeviceId deviceId = getHandler().data().deviceId();
+        checkNotNull(deviceId, DEVICE_ID_NULL);
+        devices.add(deviceId);
+
+        return devices;
+    }
+
+    @Override
+    public DeviceDescription deviceDetails(DeviceId deviceId) {
+        return getDeviceDetails(deviceId);
+    }
+
+    @Override
+    public DeviceDescription discoverDeviceDetails() {
+        return getDeviceDetails(null);
+    }
+
+    /**
+     * Query a server to retrieve its features.
+     *
+     * @param deviceId the device ID to be queried
+     * @return a DeviceDescription with the device's features
+     */
+    private DeviceDescription getDeviceDetails(DeviceId deviceId) {
+        // Create a description for this server device
+        ServerDeviceDescription desc = null;
+
+        // Retrieve the device ID, if null given
+        if (deviceId == null) {
+            deviceId = getHandler().data().deviceId();
+            checkNotNull(deviceId, DEVICE_ID_NULL);
+        }
+
+        // Get the device
+        RestSBDevice device = getController().getDevice(deviceId);
+        checkNotNull(device, DEVICE_NULL);
+
+        // Hit the path that provides the server's resources
+        InputStream response = null;
+        try {
+            response = getController().get(
+                deviceId,
+                RESOURCE_DISCOVERY_URL,
+                JSON
+            );
+        } catch (ProcessingException pEx) {
+            log.error("Failed to discover the device details of: {}", deviceId);
+            return desc;
+        }
+
+        // Load the JSON into objects
+        ObjectMapper mapper = new ObjectMapper();
+        Map<String, Object> jsonMap = null;
+        JsonNode jsonNode = null;
+        ObjectNode objNode = null;
+        try {
+            jsonMap  = mapper.readValue(response, Map.class);
+            jsonNode = mapper.convertValue(jsonMap, JsonNode.class);
+            objNode = (ObjectNode) jsonNode;
+        } catch (IOException ioEx) {
+            log.error("Failed to discover the device details of: {}", deviceId);
+            return desc;
+        }
+
+        if (jsonMap == null) {
+            log.error("Failed to discover the device details of: {}", deviceId);
+            return desc;
+        }
+
+        // Get all the attributes
+        String id     = get(jsonNode, PARAM_ID);
+        String vendor = get(jsonNode, PARAM_MANUFACTURER);
+        String hw     = get(jsonNode, PARAM_HW_VENDOR);
+        String sw     = get(jsonNode, PARAM_SW_VENDOR);
+        String serial = get(jsonNode, PARAM_SERIAL);
+
+        // CPUs are composite attributes
+        Set<CpuDevice> cpuSet = new HashSet<CpuDevice>();
+        JsonNode cpuNode = objNode.path(PARAM_CPUS);
+
+        // Construct CPU objects
+        for (JsonNode cn : cpuNode) {
+            ObjectNode cpuObjNode = (ObjectNode) cn;
+
+            // All the CPU attributes
+            int           cpuId = cpuObjNode.path(CPU_PARAM_ID).asInt();
+            String cpuVendorStr = get(cn, CPU_PARAM_VENDOR);
+            long   cpuFrequency = cpuObjNode.path(CPU_PARAM_FREQUENCY).asLong();
+
+            // Verify that this is a valid vendor
+            CpuVendor cpuVendor = CpuVendor.getByName(cpuVendorStr);
+            checkNotNull(cpuVendor, CPU_VENDOR_NULL);
+
+            // Construct a CPU device
+            CpuDevice cpu = new DefaultCpuDevice(cpuId, cpuVendor, cpuFrequency);
+
+            // Add it to the set
+            cpuSet.add(cpu);
+        }
+
+        // NICs are composite attributes too
+        Set<NicDevice> nicSet = new HashSet<NicDevice>();
+        JsonNode nicNode = objNode.path(PARAM_NICS);
+
+        // Construct NIC objects
+        for (JsonNode nn : nicNode) {
+            ObjectNode nicObjNode = (ObjectNode) nn;
+
+            // All the NIC attributes
+            String nicId       = get(nn, NIC_PARAM_ID);
+            int port           = Integer.parseInt(nicId.replaceAll("\\D+", ""));
+            long speed         = nicObjNode.path(NIC_PARAM_SPEED).asLong();
+            String portTypeStr = get(nn, NIC_PARAM_PORT_TYPE);
+            Port.Type portType = PORT_TYPE_MAP.get(portTypeStr);
+            if (portType == null) {
+                throw new RuntimeException(
+                    portTypeStr + " is not a valid port type for NIC " + nicId
+                );
+            }
+            boolean status     = nicObjNode.path(NIC_PARAM_STATUS).asInt() > 0;
+            String hwAddr      = get(nn, NIC_PARAM_HW_ADDR);
+            JsonNode tagNode   = nicObjNode.path(NIC_PARAM_RX_FILTER);
+            if (tagNode == null) {
+                throw new RuntimeException(
+                    "The Rx filters of NIC " + nicId + " are not reported"
+                );
+            }
+
+            // Convert the JSON list into an array of strings
+            List<String> rxFilters = null;
+            try {
+                rxFilters = mapper.readValue(
+                    tagNode.traverse(),
+                    new TypeReference<ArrayList<String>>() { }
+                );
+            } catch (IOException ioEx) {
+                continue;
+            }
+
+            // Parse the array of strings and create an RxFilter object
+            NicRxFilter rxFilterMechanism = new NicRxFilter();
+            for (String s : rxFilters) {
+                // Verify that this is a valid Rx filter
+                RxFilter rf = RxFilter.getByName(s);
+                checkNotNull(rf, NIC_RX_FILTER_NULL);
+
+                rxFilterMechanism.addRxFilter(rf);
+            }
+
+            // Construct a NIC device for this server
+            NicDevice nic = new DefaultNicDevice(
+                nicId, port, portType, speed, status, hwAddr, rxFilterMechanism
+            );
+
+            // Add it to the set
+            nicSet.add(nic);
+        }
+
+        /**
+         * Construct a complete server device object.
+         * Lists of NICs and CPUs extend the information
+         * already in RestSBDevice (parent class).
+         */
+        RestServerSBDevice dev = new DefaultRestServerSBDevice(
+            device.ip(), device.port(), device.username(),
+            device.password(), device.protocol(), device.url(),
+            device.isActive(), device.testUrl().toString(),
+            vendor, hw, sw, AuthenticationScheme.BASIC, "",
+            cpuSet, nicSet
+        );
+        checkNotNull(dev, DEVICE_NULL);
+
+        // Updates the controller with the complete device information
+        getController().removeDevice(deviceId);
+        getController().addDevice((RestSBDevice) dev);
+
+        /**
+         * TODO: Create a new Device type
+         * Device.Type.COMMODITY_SERVER
+         * and add a new icon in the GUI.
+         */
+        try {
+            desc = new DefaultServerDeviceDescription(
+                new URI(id), Device.Type.OTHER, vendor,
+                hw, sw, serial, new ChassisId(),
+                cpuSet, nicSet, DefaultAnnotations.EMPTY
+            );
+        } catch (URISyntaxException uEx) {
+            log.error(
+                "Failed to create a server device description for: {}", deviceId
+            );
+            return null;
+        }
+
+        log.info("Device's {} details sent to the controller", deviceId);
+
+        return desc;
+    }
+
+    @Override
+    public List<PortDescription> discoverPortDetails() {
+        // List of port descriptions to return
+        List<PortDescription> portDescriptions = Lists.newArrayList();
+
+        // Retrieve the device ID
+        DeviceId deviceId = getHandler().data().deviceId();
+        checkNotNull(deviceId, DEVICE_ID_NULL);
+        // .. and object
+        RestServerSBDevice device = null;
+
+        /*
+         * In case this method is called before discoverDeviceDetails,
+         * there is missing information to be gathered.
+         */
+        short i = 0;
+        while ((device == null) && (i < DISCOVERY_RETRIES)) {
+            i++;
+
+            try {
+                device = (RestServerSBDevice) getController().getDevice(deviceId);
+            } catch (ClassCastException ccEx) {
+                try {
+                    Thread.sleep(1);
+                } catch (InterruptedException intEx) {
+                    // Just retry
+                } finally {
+                    continue;
+                }
+            }
+
+            // No device
+            if (device == null) {
+                // This method will add the device to the RestSBController
+                this.getDeviceDetails(deviceId);
+            }
+        }
+
+        if ((device == null) || (device.nics() == null)) {
+            log.error("No ports available on {}", deviceId);
+            return ImmutableList.copyOf(portDescriptions);
+        }
+
+        // Sorted list of NIC ports
+        Set<NicDevice> nics = new TreeSet(device.nics());
+
+        // Iterate through the NICs of this device to populate the list
+        long portCounter = 0;
+        for (NicDevice nic : nics) {
+            // The port number of this NIC
+            PortNumber portNumber = PortNumber.portNumber(++portCounter);
+
+            // Include the name of this device as an annotation
+            DefaultAnnotations.Builder annotations = DefaultAnnotations.builder()
+                                .set(AnnotationKeys.PORT_NAME, nic.id());
+
+            // Create a port description and add it to the list
+            portDescriptions.add(
+                new DefaultPortDescription(
+                    portNumber, nic.status(),
+                    nic.portType(), nic.speed(),
+                    annotations.build()
+                )
+            );
+
+            log.info(
+                "Port discovery on device {}: NIC {} is {} at {} Mbps",
+                deviceId, nic.port(), nic.status() ? "up" : "down",
+                nic.speed()
+            );
+        }
+
+        return ImmutableList.copyOf(portDescriptions);
+    }
+
+    @Override
+    public Collection<PortStatistics> discoverPortStatistics() {
+        // Retrieve the device ID
+        DeviceId deviceId = getHandler().data().deviceId();
+        checkNotNull(deviceId, DEVICE_ID_NULL);
+
+        // Get port statistics for this device
+        return getPortStatistics(deviceId);
+    }
+
+    /**
+     * Query a server to retrieve its port statistics.
+     *
+     * @param deviceId the device ID to be queried
+     * @return list of (per port) PortStatistics
+     */
+    private Collection<PortStatistics> getPortStatistics(DeviceId deviceId) {
+        // List of port statistics to return
+        Collection<PortStatistics> portStats = null;
+
+        // Get global monitoring statistics
+        MonitoringStatistics monStats = getGlobalMonitoringStatistics(deviceId);
+        if (monStats == null) {
+            return portStats;
+        }
+
+        // Filter out the NIC statistics
+        portStats = monStats.nicStatisticsAll();
+        if (portStats == null) {
+            return portStats;
+        }
+
+        log.debug("Port statistics: {}", portStats.toString());
+
+        return portStats;
+    }
+
+    @Override
+    public Collection<CpuStatistics> discoverCpuStatistics() {
+        // Retrieve the device ID
+        DeviceId deviceId = getHandler().data().deviceId();
+        checkNotNull(deviceId, DEVICE_ID_NULL);
+
+        // Get CPU statistics for this device
+        return getCpuStatistics(deviceId);
+    }
+
+    /**
+     * Query a server to retrieve its CPU statistics.
+     *
+     * @param deviceId the device ID to be queried
+     * @return list of (per core) CpuStatistics
+     */
+     private Collection<CpuStatistics> getCpuStatistics(DeviceId deviceId) {
+        // List of port statistics to return
+        Collection<CpuStatistics> cpuStats = null;
+
+        // Get global monitoring statistics
+        MonitoringStatistics monStats = getGlobalMonitoringStatistics(deviceId);
+        if (monStats == null) {
+            return cpuStats;
+        }
+
+        // Filter out the CPU statistics
+        cpuStats = monStats.cpuStatisticsAll();
+        if (cpuStats == null) {
+            return cpuStats;
+        }
+
+        log.debug("CPU statistics: {}", cpuStats.toString());
+
+        return cpuStats;
+    }
+
+    @Override
+    public MonitoringStatistics discoverGlobalMonitoringStatistics() {
+        // Retrieve the device ID
+        DeviceId deviceId = getHandler().data().deviceId();
+        checkNotNull(deviceId, DEVICE_ID_NULL);
+
+        // Get global monitoring statistics for this device
+        return getGlobalMonitoringStatistics(deviceId);
+    }
+
+    /**
+     * Query a server to retrieve its global monitoring statistics.
+     *
+     * @param deviceId the device ID to be queried
+     * @return global monitoring statistics
+     */
+     private MonitoringStatistics getGlobalMonitoringStatistics(DeviceId deviceId) {
+        // Monitoring statistics to return
+        MonitoringStatistics monStats = null;
+
+        RestServerSBDevice device = null;
+        try {
+            device = (RestServerSBDevice) getController().getDevice(deviceId);
+        } catch (ClassCastException ccEx) {
+            log.error(
+                "Failed to retrieve global monitoring statistics from device {}",
+                deviceId
+            );
+            return monStats;
+        }
+        checkNotNull(device, DEVICE_NULL);
+
+        // Hit the path that provides the server's global resources
+        InputStream response = null;
+        try {
+            response = getController().get(
+                deviceId,
+                GLOBAL_STATS_URL,
+                JSON
+            );
+        } catch (ProcessingException pEx) {
+            log.error(
+                "Failed to retrieve global monitoring statistics from device {}",
+                deviceId
+            );
+            return monStats;
+        }
+
+        // Load the JSON into objects
+        ObjectMapper mapper = new ObjectMapper();
+        Map<String, Object> jsonMap = null;
+        JsonNode jsonNode  = null;
+        ObjectNode objNode = null;
+        try {
+            jsonMap  = mapper.readValue(response, Map.class);
+            jsonNode = mapper.convertValue(jsonMap, JsonNode.class);
+            objNode = (ObjectNode) jsonNode;
+        } catch (IOException ioEx) {
+            log.error(
+                "Failed to retrieve global monitoring statistics from device {}",
+                deviceId
+            );
+            return monStats;
+        }
+
+        if (jsonMap == null) {
+            log.error(
+                "Failed to retrieve global monitoring statistics from device {}",
+                deviceId
+            );
+            return monStats;
+        }
+
+        // Get high-level CPU statistics
+        int busyCpus = objNode.path(CPU_STATS_BUSY_CPUS).asInt();
+        int freeCpus = objNode.path(CPU_STATS_FREE_CPUS).asInt();
+
+        // Get a list of CPU statistics per core
+        Collection<CpuStatistics> cpuStats = parseCpuStatistics(deviceId, objNode);
+
+        // Get a list of port statistics
+        Collection<PortStatistics> nicStats = parseNicStatistics(deviceId, objNode);
+
+        // Get zero timing statistics
+        TimingStatistics timinsgStats = getZeroTimingStatistics();
+
+        // Ready to construct the grand object
+        DefaultMonitoringStatistics.Builder statsBuilder =
+            DefaultMonitoringStatistics.builder();
+
+        statsBuilder.setDeviceId(deviceId)
+                .setTimingStatistics(timinsgStats)
+                .setCpuStatistics(cpuStats)
+                .setNicStatistics(nicStats)
+                .build();
+
+        monStats = statsBuilder.build();
+
+        log.debug("Global monitoring statistics: {}", monStats.toString());
+
+        return monStats;
+    }
+
+    @Override
+    public MonitoringStatistics discoverMonitoringStatistics(URI tcId) {
+        // Retrieve the device ID
+        DeviceId deviceId = getHandler().data().deviceId();
+        checkNotNull(deviceId, DEVICE_ID_NULL);
+
+        // Get resource-specific monitoring statistics for this device
+        return getMonitoringStatistics(deviceId, tcId);
+    }
+
+    /**
+     * Query a server to retrieve monitoring statistics for a
+     * specific resource (i.e., traffic class).
+     *
+     * @param deviceId the device ID to be queried
+     * @param tcId the ID of the traffic class to be monitored
+     * @return resource-specific monitoring statistics
+     */
+     private MonitoringStatistics getMonitoringStatistics(DeviceId deviceId, URI tcId) {
+        // Monitoring statistics to return
+        MonitoringStatistics monStats = null;
+
+        RestServerSBDevice device = null;
+        try {
+            device = (RestServerSBDevice) getController().getDevice(deviceId);
+        } catch (ClassCastException ccEx) {
+            log.error(
+                "Failed to retrieve monitoring statistics from device {}",
+                deviceId
+            );
+            return monStats;
+        }
+        checkNotNull(device, DEVICE_NULL);
+
+        // Create a resource-specific URL
+        String scUrl = SERVICE_CHAINS_STATS_URL + "/" + tcId.toString();
+
+        // Hit the path that provides the server's specific resources
+        InputStream response = null;
+        try {
+            response = getController().get(
+                deviceId,
+                scUrl,
+                JSON
+            );
+        } catch (ProcessingException pEx) {
+            log.error(
+                "Failed to retrieve monitoring statistics from device {}",
+                deviceId
+            );
+            return monStats;
+        }
+
+        // Load the JSON into objects
+        ObjectMapper mapper = new ObjectMapper();
+        Map<String, Object> jsonMap = null;
+        JsonNode jsonNode  = null;
+        ObjectNode objNode = null;
+        try {
+            jsonMap  = mapper.readValue(response, Map.class);
+            jsonNode = mapper.convertValue(jsonMap, JsonNode.class);
+            objNode = (ObjectNode) jsonNode;
+        } catch (IOException ioEx) {
+            log.error(
+                "Failed to retrieve monitoring statistics from device {}",
+                deviceId
+            );
+            return monStats;
+        }
+
+        if (jsonMap == null) {
+            log.error(
+                "Failed to retrieve monitoring statistics from device {}",
+                deviceId
+            );
+            return monStats;
+        }
+
+        // Get the ID of the traffic class
+        String id = get(jsonNode, PARAM_ID);
+
+        // And verify that this is the traffic class we want to monitor
+        if (!id.equals(tcId.toString())) {
+            throw new RuntimeException(
+                "Failed to retrieve monitoring data for traffic class " + tcId +
+                ". Traffic class ID does not agree."
+            );
+        }
+
+        // Get a list of CPU statistics per core
+        Collection<CpuStatistics> cpuStats = parseCpuStatistics(deviceId, objNode);
+
+        // Get a list of port statistics
+        Collection<PortStatistics> nicStats = parseNicStatistics(deviceId, objNode);
+
+        // Get timing statistics
+        TimingStatistics timinsgStats = parseTimingStatistics(objNode);
+
+        // Ready to construct the grand object
+        DefaultMonitoringStatistics.Builder statsBuilder =
+            DefaultMonitoringStatistics.builder();
+
+        statsBuilder.setDeviceId(deviceId)
+                .setTimingStatistics(timinsgStats)
+                .setCpuStatistics(cpuStats)
+                .setNicStatistics(nicStats)
+                .build();
+
+        monStats = statsBuilder.build();
+
+        log.debug("Monitoring statistics: {}", monStats.toString());
+
+        return monStats;
+    }
+
+    /**
+     * Parse the input JSON object, looking for CPU-related
+     * statistics. Upon success, construct and return a list
+     * of CPU statistics objects.
+     *
+     * @param deviceId the device ID that sent the JSON object
+     * @param objNode input JSON node with CPU statistics information
+     * @return list of (per core) CpuStatistics
+     */
+    private Collection<CpuStatistics> parseCpuStatistics(
+            DeviceId deviceId, JsonNode objNode) {
+        Collection<CpuStatistics> cpuStats = Lists.newArrayList();
+
+        if (objNode == null) {
+            return cpuStats;
+        }
+
+        JsonNode cpuNode = objNode.path(PARAM_CPUS);
+
+        for (JsonNode cn : cpuNode) {
+            ObjectNode cpuObjNode = (ObjectNode) cn;
+
+            // CPU ID with its load and status
+            int   cpuId    = cpuObjNode.path(CPU_PARAM_ID).asInt();
+            float cpuLoad  = cpuObjNode.path(CPU_PARAM_LOAD).floatValue();
+            boolean isBusy = cpuObjNode.path(CPU_PARAM_STATUS).booleanValue();
+
+            // Incorporate these statistics into an object
+            DefaultCpuStatistics.Builder cpuBuilder =
+                DefaultCpuStatistics.builder();
+
+            cpuBuilder.setDeviceId(deviceId)
+                    .setId(cpuId)
+                    .setLoad(cpuLoad)
+                    .setIsBusy(isBusy)
+                    .build();
+
+            // We have statistics for this CPU core
+            cpuStats.add(cpuBuilder.build());
+        }
+
+        return cpuStats;
+    }
+
+    /**
+     * Parse the input JSON object, looking for NIC-related
+     * statistics. Upon success, construct and return a list
+     * of NIC statistics objects.
+     *
+     * @param deviceId the device ID that sent the JSON object
+     * @param objNode input JSON node with NIC statistics information
+     * @return list of (per port) PortStatistics
+     */
+    private Collection<PortStatistics> parseNicStatistics(
+            DeviceId deviceId, JsonNode objNode) {
+        Collection<PortStatistics> nicStats = Lists.newArrayList();
+
+        if (objNode == null) {
+            return nicStats;
+        }
+
+        JsonNode nicNode = objNode.path(PARAM_NICS);
+
+        for (JsonNode nn : nicNode) {
+            ObjectNode nicObjNode = (ObjectNode) nn;
+
+            // All the NIC attributes
+            String nicId  = get(nn, NIC_PARAM_ID);
+            int port = Integer.parseInt(nicId.replaceAll("\\D+", ""));
+
+            long rxCount   = nicObjNode.path(NIC_STATS_RX_COUNT).asLong();
+            long rxBytes   = nicObjNode.path(NIC_STATS_RX_BYTES).asLong();
+            long rxDropped = nicObjNode.path(NIC_STATS_RX_DROPS).asLong();
+            long rxErrors  = nicObjNode.path(NIC_STATS_RX_ERRORS).asLong();
+            long txCount   = nicObjNode.path(NIC_STATS_TX_COUNT).asLong();
+            long txBytes   = nicObjNode.path(NIC_STATS_TX_BYTES).asLong();
+            long txDropped = nicObjNode.path(NIC_STATS_TX_DROPS).asLong();
+            long txErrors  = nicObjNode.path(NIC_STATS_TX_ERRORS).asLong();
+
+            // Incorporate these statistics into an object
+            DefaultPortStatistics.Builder nicBuilder =
+                DefaultPortStatistics.builder();
+
+            nicBuilder.setDeviceId(deviceId)
+                    .setPort(port)
+                    .setPacketsReceived(rxCount)
+                    .setPacketsSent(txCount)
+                    .setBytesReceived(rxBytes)
+                    .setBytesSent(txBytes)
+                    .setPacketsRxDropped(rxDropped)
+                    .setPacketsRxErrors(rxErrors)
+                    .setPacketsTxDropped(txDropped)
+                    .setPacketsTxErrors(txErrors)
+                    .build();
+
+            // We have statistics for this NIC
+            nicStats.add(nicBuilder.build());
+        }
+
+        return nicStats;
+    }
+
+    /**
+     * Parse the input JSON object, looking for timing-related
+     * statistics. Upon success, construct and return a
+     * timing statistics object.
+     *
+     * @param objNode input JSON node with timing statistics information
+     * @return TimingStatistics object or null
+     */
+    private TimingStatistics parseTimingStatistics(JsonNode objNode) {
+        TimingStatistics timinsgStats = null;
+
+        if (objNode == null) {
+            return timinsgStats;
+        }
+
+        // Get timing statistics
+        JsonNode timingNode = objNode.path(PARAM_TIMING_STATS);
+        ObjectNode timingObjNode = (ObjectNode) timingNode;
+
+        // Time (ns) to parse the controller's deployment instruction
+        long parsingTime = timingObjNode.path(TIMING_PARAM_PARSE).asLong();
+        // Time (ns) to do the deployment
+        long launchingTime = timingObjNode.path(TIMING_PARAM_LAUNCH).asLong();
+        // Total time (ns)
+        long totalTime = parsingTime + launchingTime;
+
+        // Get autoscale timing statistics
+        JsonNode autoscaleTimingNode = objNode.path(PARAM_TIMING_AUTOSCALE);
+        ObjectNode autoscaleTimingObjNode = (ObjectNode) autoscaleTimingNode;
+
+        // Time (ns) to autoscale a server's load
+        long autoscaleTime = autoscaleTimingObjNode.path(
+            TIMING_PARAM_AUTOSCALE
+        ).asLong();
+
+        DefaultTimingStatistics.Builder timingBuilder =
+            DefaultTimingStatistics.builder();
+
+        timingBuilder.setParsingTime(parsingTime)
+                    .setLaunchingTime(launchingTime)
+                    .setAutoscaleTime(autoscaleTime)
+                    .build();
+
+        return timingBuilder.build();
+    }
+
+    /**
+     * Return a timing statistics object with zero counters.
+     * This is useful when constructing MonitoringStatistics
+     * objects that do not require timers.
+     *
+     * @return TimingStatistics object
+     */
+    private TimingStatistics getZeroTimingStatistics() {
+        DefaultTimingStatistics.Builder zeroTimingBuilder =
+            DefaultTimingStatistics.builder();
+
+        zeroTimingBuilder.setParsingTime(0)
+                         .setLaunchingTime(0)
+                         .setAutoscaleTime(0)
+                         .build();
+
+        return zeroTimingBuilder.build();
+    }
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/ServerDriversLoader.java b/drivers/server/src/main/java/org/onosproject/drivers/server/ServerDriversLoader.java
new file mode 100644
index 0000000..cb5cc4f
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/ServerDriversLoader.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server;
+
+import org.apache.felix.scr.annotations.Component;
+import org.onosproject.net.driver.AbstractDriverLoader;
+
+/**
+ * Loader for server device drivers.
+ */
+@Component(immediate = true)
+public class ServerDriversLoader extends AbstractDriverLoader {
+    public ServerDriversLoader() {
+        super("/server-drivers.xml");
+    }
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/behavior/CpuStatisticsDiscovery.java b/drivers/server/src/main/java/org/onosproject/drivers/server/behavior/CpuStatisticsDiscovery.java
new file mode 100644
index 0000000..9d42f95
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/behavior/CpuStatisticsDiscovery.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.behavior;
+
+import org.onosproject.drivers.server.stats.CpuStatistics;
+
+import org.onosproject.net.driver.HandlerBehaviour;
+
+import java.util.Collection;
+
+/**
+ * Handler behaviour capable of collecting and updating CPU statistics.
+ */
+public interface CpuStatisticsDiscovery extends HandlerBehaviour {
+
+    /**
+     * Returns a list of CPU statistics.
+     *
+     * @return CPU statistics list
+     */
+    Collection<CpuStatistics> discoverCpuStatistics();
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/behavior/MonitoringStatisticsDiscovery.java b/drivers/server/src/main/java/org/onosproject/drivers/server/behavior/MonitoringStatisticsDiscovery.java
new file mode 100644
index 0000000..ba8ea2a
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/behavior/MonitoringStatisticsDiscovery.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.behavior;
+
+import org.onosproject.drivers.server.stats.MonitoringStatistics;
+
+import org.onosproject.net.driver.HandlerBehaviour;
+
+import java.net.URI;
+
+/**
+ * Handler behaviour capable of collecting and updating
+ * server monitoring statistics.
+ */
+public interface MonitoringStatisticsDiscovery extends HandlerBehaviour {
+
+    /**
+     * Returns global server monitoring statistics.
+     * These statistics include all of the traffic that
+     * goes through the NICs of the server.
+     *
+     * @return global monitoring statistics
+     */
+    MonitoringStatistics discoverGlobalMonitoringStatistics();
+
+    /**
+     * Returns monitoring statistics for a specific resource.
+     * This resource represents a specific portion of the traffic.
+     *
+     * @param tcId the ID of the traffic class to be monitored
+     * @return resource-specific monitoring statistics
+     */
+    MonitoringStatistics discoverMonitoringStatistics(URI tcId);
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/behavior/package-info.java b/drivers/server/src/main/java/org/onosproject/drivers/server/behavior/package-info.java
new file mode 100644
index 0000000..b6e40083
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/behavior/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.
+ */
+
+/**
+ * API for server's behavior.
+ */
+package org.onosproject.drivers.server.behavior;
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/devices/CpuDevice.java b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/CpuDevice.java
new file mode 100644
index 0000000..4ddd241
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/CpuDevice.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.devices;
+
+/**
+ * Represents an abstraction of a CPU core in ONOS.
+ */
+public interface CpuDevice {
+
+    /**
+     * Returns the ID of this CPU.
+     * Typically this is the order number (0...N-1)
+     * of this CPU core in the socket.
+     *
+     * @return CPU core ID
+     */
+    int id();
+
+    /**
+     * Returns the vendor of this CPU core.
+     *
+     * @return CPU core vendor
+     */
+    CpuVendor vendor();
+
+    /**
+     * Returns the frequency of this CPU core in MHz.
+     *
+     * @return CPU core frequency in MHz
+     */
+    long frequency();
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/devices/CpuVendor.java b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/CpuVendor.java
new file mode 100644
index 0000000..289b3c3
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/CpuVendor.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.devices;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * Representation of a CPU vendor.
+ */
+public enum CpuVendor {
+
+    INTEL("GenuineIntel"),
+    AMD("AMD");
+
+    private String vendor;
+
+    // Statically maps CPU vendor names to enum types
+    private static final Map<String, CpuVendor> MAP =
+        new HashMap<String, CpuVendor>();
+    static {
+        for (CpuVendor cv : CpuVendor.values()) {
+            MAP.put(cv.toString().toLowerCase(), cv);
+        }
+    }
+
+    private CpuVendor(String vendor) {
+        this.vendor = vendor;
+    }
+
+    public static CpuVendor getByName(String pr) {
+        pr = pr.toLowerCase();
+        return MAP.get(pr);
+    }
+
+    @Override
+    public String toString() {
+        return this.vendor;
+    }
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/devices/MacRxFilterValue.java b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/MacRxFilterValue.java
new file mode 100644
index 0000000..b5dfe12
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/MacRxFilterValue.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.devices;
+
+import org.onlab.packet.MacAddress;
+
+import java.util.Objects;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * A MAC Rx filter value.
+ */
+public class MacRxFilterValue extends RxFilterValue implements Comparable  {
+
+    private MacAddress mac;
+
+    public MacRxFilterValue() {
+        super();
+
+        this.mac = null;
+    }
+
+    public MacRxFilterValue(MacAddress mac) {
+        super();
+
+        checkNotNull(mac, "MAC address of Rx filter is NULL");
+
+        this.mac = mac;
+    }
+
+    public MacRxFilterValue(MacRxFilterValue other) {
+        super();
+
+        if (other.value() == null) {
+            return;
+        }
+
+        this.mac = other.value();
+    }
+
+    /**
+     * Returns the value of this Rx filter.
+     *
+     * @return MAC value
+     */
+    public MacAddress value() {
+        return this.mac;
+    }
+
+    /**
+     * Sets the value of this Rx filter.
+     *
+     * @param mac MAC value
+     */
+    public void setValue(MacAddress mac) {
+        checkNotNull(mac, "MAC address of Rx filter is NULL");
+
+        this.mac = mac;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(this.mac);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+
+        if ((obj == null) || (!(obj instanceof MacRxFilterValue))) {
+            return false;
+        }
+
+        MacRxFilterValue other = (MacRxFilterValue) obj;
+
+        return this.value().equals(other.value());
+    }
+
+    @Override
+    public int compareTo(Object other) {
+        if (this == other) {
+            return 0;
+        }
+
+        if (other == null) {
+            return -1;
+        }
+
+        if (other instanceof MacRxFilterValue) {
+            MacRxFilterValue otherRxVal = (MacRxFilterValue) other;
+
+            // Extract the digits out of the ID
+            String thisMac  = this.toString();
+            String otherMac = otherRxVal.toString();
+
+            return thisMac.compareToIgnoreCase(otherMac);
+        }
+
+        return -1;
+    }
+
+    @Override
+    public String toString() {
+        return  this.value().toString();
+    }
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/devices/MplsRxFilterValue.java b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/MplsRxFilterValue.java
new file mode 100644
index 0000000..21ea37d
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/MplsRxFilterValue.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.devices;
+
+import org.onlab.packet.MplsLabel;
+
+import java.util.Objects;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * An MPLS Rx filter value.
+ */
+public class MplsRxFilterValue extends RxFilterValue {
+
+    private MplsLabel mplsLabel;
+
+    public MplsRxFilterValue() {
+        super();
+
+        this.mplsLabel = null;
+    }
+
+    public MplsRxFilterValue(MplsLabel mplsLabel) {
+        super();
+
+        checkNotNull(mplsLabel, "MPLS label of Rx filter is NULL");
+
+        this.mplsLabel = mplsLabel;
+    }
+
+    public MplsRxFilterValue(MplsRxFilterValue other) {
+        super();
+
+        if (other.value() == null) {
+            return;
+        }
+
+        this.mplsLabel = other.value();
+    }
+
+    /**
+     * Returns the value of this Rx filter.
+     *
+     * @return MPLS label value
+     */
+    public MplsLabel value() {
+        return this.mplsLabel;
+    }
+
+    /**
+     * Sets the value of this Rx filter.
+     *
+     * @param mplsLabel MPLS label value
+     */
+    public void setValue(MplsLabel mplsLabel) {
+        checkNotNull(mplsLabel, "MPLS label of Rx filter is NULL");
+
+        this.mplsLabel = mplsLabel;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(this.mplsLabel);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+
+        if ((obj == null) || (!(obj instanceof MplsRxFilterValue))) {
+            return false;
+        }
+
+        MplsRxFilterValue other = (MplsRxFilterValue) obj;
+
+        return this.value().equals(other.value());
+    }
+
+    @Override
+    public String toString() {
+        return  this.value().toString();
+    }
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/devices/NicDevice.java b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/NicDevice.java
new file mode 100644
index 0000000..0416a6c
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/NicDevice.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.devices;
+
+import org.onlab.packet.MacAddress;
+
+import static org.onosproject.net.Port.Type;
+
+/**
+ * Represents an abstraction of a
+ * network interface card (NIC) device in ONOS.
+ */
+public interface NicDevice extends Comparable {
+
+    /**
+     * Returns the ID of this NIC.
+     *
+     * @return NIC ID
+     */
+    String id();
+
+    /**
+     * Returns the port number of this NIC.
+     *
+     * @return integer port number for the NIC
+     */
+    int port();
+
+    /**
+     * Returns the type of the port of this NIC.
+     *
+     * @return port type
+     */
+    Type portType();
+
+    /**
+     * Returns the speed of the NIC in Mbps.
+     *
+     * @return integer NIC speed in Mbps
+     */
+    long speed();
+
+    /**
+     * Returns the current status of the NIC.
+     *
+     * @return boolean NIC status (up=true, down=false)
+     */
+    boolean status();
+
+    /**
+     * Sets the current status of the NIC.
+     *
+     * @param status boolean NIC status (up=true, down=false)
+     */
+    void setStatus(boolean status);
+
+    /**
+     * Returns the MAC address of the NIC.
+     *
+     * @return MacAddress hardware address of the NIC
+     */
+    MacAddress macAddress();
+
+    /**
+     * Returns the Rx filter mechanisms supported by the NIC.
+     *
+     * @return Rx filter mechanisms
+     */
+    NicRxFilter rxFilterMechanisms();
+
+    /**
+     * Sets the Rx filter mechanisms supported by the NIC.
+     *
+     * @param rxFilterMechanisms Rx filter mechanisms
+     */
+    void setRxFilterMechanisms(NicRxFilter rxFilterMechanisms);
+
+    /**
+     * Adds a new Rx filter to the NIC.
+     *
+     * @param rxFilter an Rx filter to be added to the set
+     */
+    void addRxFilterMechanism(NicRxFilter.RxFilter rxFilter);
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/devices/NicRxFilter.java b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/NicRxFilter.java
new file mode 100644
index 0000000..ffddc9b
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/NicRxFilter.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.devices;
+
+import org.apache.commons.lang.ArrayUtils;
+import com.google.common.base.MoreObjects;
+
+import java.util.Set;
+import java.util.Map;
+import java.util.HashSet;
+import java.util.HashMap;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * Filtering mechanisms supported by a NIC device.
+ */
+public class NicRxFilter {
+
+    /**
+     * Supported Rx filters.
+     */
+    public enum RxFilter {
+        VLAN("vlan"),
+        MAC("mac"),
+        MPLS("mpls");
+
+        private String rxFilter;
+
+        // Statically maps primitives with enum types
+        private static final Map<String, RxFilter> MAP = new HashMap<String, RxFilter>();
+        static {
+            for (RxFilter rxFilter : RxFilter.values()) {
+                MAP.put(rxFilter.toString(), rxFilter);
+            }
+        }
+
+        public static RxFilter getByName(String rxFilter) {
+            return MAP.get(rxFilter.toLowerCase());
+        }
+
+        public static boolean isSupported(RxFilter rxFilter) {
+            return MAP.containsKey(rxFilter.toString());
+        }
+
+        private RxFilter(String rxFilter) {
+            this.rxFilter = rxFilter;
+        }
+
+        @Override
+        public String toString() {
+            return this.rxFilter;
+        }
+    }
+
+    private Set<RxFilter> rxFilters;
+
+    public NicRxFilter() {
+        this.rxFilters = new HashSet<RxFilter>();
+    }
+
+    public NicRxFilter(RxFilter rxFilter) {
+        checkNotNull(rxFilter, "NIC Rx filter is NULL");
+
+        if (!ArrayUtils.contains(RxFilter.values(), rxFilter)) {
+            throw new IllegalArgumentException(String.valueOf(rxFilter));
+        }
+
+        this.rxFilters = new HashSet<RxFilter>();
+        rxFilters.add(rxFilter);
+    }
+
+    public NicRxFilter(NicRxFilter other) {
+        checkNotNull(other, "NIC Rx filter mechanism is NULL");
+        this.rxFilters = new HashSet<RxFilter>(other.rxFilters);
+    }
+
+    /**
+     * Returns the set of Rx filters supported by this NIC.
+     *
+     * @return set of supported Rx filters
+     */
+    public Set<RxFilter> rxFilters() {
+        return this.rxFilters;
+    }
+
+    /**
+     * Adds a new Rx filter to this NIC.
+     *
+     * @param rxFilter an Rx filter to be added
+     */
+    public void addRxFilter(RxFilter rxFilter) {
+        checkNotNull(rxFilter, "NIC Rx filter is NULL");
+        this.rxFilters.add(rxFilter);
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .omitNullValues()
+                .add("rxFilters", rxFilters)
+                .toString();
+    }
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/devices/RestServerSBDevice.java b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/RestServerSBDevice.java
new file mode 100644
index 0000000..a1172f8
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/RestServerSBDevice.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.devices;
+
+import org.onosproject.protocol.rest.RestSBDevice;
+
+import java.util.Collection;
+
+/**
+ * Represents an abstraction of a REST server device in ONOS.
+ */
+public interface RestServerSBDevice extends RestSBDevice {
+    /**
+     * Returns the set of CPUs of the server.
+     *
+     * @return set of CPUs
+     */
+    Collection<CpuDevice> cpus();
+
+    /**
+     * Returns the number of CPUs of the server.
+     *
+     * @return number of CPUs
+     */
+    int numberOfCpus();
+
+    /**
+     * Returns the set of NICs of the server.
+     *
+     * @return set of NICs
+     */
+    Collection<NicDevice> nics();
+
+    /**
+     * Returns the number of NICs of the server.
+     *
+     * @return number of NICs
+     */
+    int numberOfNics();
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/devices/RxFilterValue.java b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/RxFilterValue.java
new file mode 100644
index 0000000..29d2c99
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/RxFilterValue.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.devices;
+
+/**
+ * The base class that holds the value of a NIC's Rx filter.
+ */
+public abstract class RxFilterValue {
+
+    public RxFilterValue() {
+    }
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/devices/ServerDeviceDescription.java b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/ServerDeviceDescription.java
new file mode 100644
index 0000000..dced9cd
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/ServerDeviceDescription.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.devices;
+
+import org.onosproject.net.device.DeviceDescription;
+
+import java.util.Collection;
+
+/**
+ * Carrier of immutable information about a server device.
+ */
+public interface ServerDeviceDescription extends DeviceDescription {
+
+    /**
+     * The set of CPUs of the server device.
+     *
+     * @return set of CPUs of the server device
+     */
+    Collection<CpuDevice> cpus();
+
+    /**
+     * The set of NICs of the server device.
+     *
+     * @return set of NICs of the server device
+     */
+    Collection<NicDevice> nics();
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/devices/VlanRxFilterValue.java b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/VlanRxFilterValue.java
new file mode 100644
index 0000000..a984810
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/VlanRxFilterValue.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.devices;
+
+import org.onlab.packet.VlanId;
+
+import java.util.Objects;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * A VLAN Rx filter value.
+ */
+public class VlanRxFilterValue extends RxFilterValue {
+
+    private VlanId vlanId;
+
+    public VlanRxFilterValue() {
+        super();
+
+        this.vlanId = null;
+    }
+
+    public VlanRxFilterValue(VlanId vlanId) {
+        super();
+
+        checkNotNull(vlanId, "VLAN ID of Rx filter is NULL");
+
+        this.vlanId = vlanId;
+    }
+
+    public VlanRxFilterValue(VlanRxFilterValue other) {
+        super();
+
+        if (other.value() == null) {
+            return;
+        }
+
+        this.vlanId = other.value();
+    }
+
+    /**
+     * Returns the value of this Rx filter.
+     *
+     * @return VLAN ID value
+     */
+    public VlanId value() {
+        return this.vlanId;
+    }
+
+    /**
+     * Sets the value of this Rx filter.
+     *
+     * @param vlanId VLAN ID value
+     */
+    public void setValue(VlanId vlanId) {
+        checkNotNull(vlanId, "VLAN ID of Rx filter is NULL");
+
+        this.vlanId = vlanId;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(this.vlanId);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+
+        if ((obj == null) || (!(obj instanceof VlanRxFilterValue))) {
+            return false;
+        }
+
+        VlanRxFilterValue other = (VlanRxFilterValue) obj;
+
+        return this.value().equals(other.value());
+    }
+
+    @Override
+    public String toString() {
+        return  this.value().toString();
+    }
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/devices/package-info.java b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/package-info.java
new file mode 100644
index 0000000..0828e6b
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/devices/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.
+ */
+
+/**
+ * API for server devices.
+ */
+package org.onosproject.drivers.server.devices;
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/impl/devices/DefaultCpuDevice.java b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/devices/DefaultCpuDevice.java
new file mode 100644
index 0000000..79712fc
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/devices/DefaultCpuDevice.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.impl.devices;
+
+import org.onosproject.drivers.server.devices.CpuDevice;
+import org.onosproject.drivers.server.devices.CpuVendor;
+
+import org.onosproject.drivers.server.impl.stats.DefaultCpuStatistics;
+
+import com.google.common.base.MoreObjects;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkArgument;
+
+import java.util.Objects;
+
+/**
+ * Default implementation for CPU core devices.
+ */
+public class DefaultCpuDevice implements CpuDevice {
+
+    private final int       id;
+    private final CpuVendor vendor;
+    private final long      frequency;
+
+    // Maximum CPU core frequency in MHz
+    public static final long MAX_FREQUENCY_MHZ = 4500;
+
+    public DefaultCpuDevice(int id, CpuVendor vendor, long frequency) {
+        checkArgument(
+            (id >= 0) && (id < DefaultCpuStatistics.MAX_CPU_NB),
+            "CPU core ID must be in [0, " +
+            String.valueOf(DefaultCpuStatistics.MAX_CPU_NB - 1) + "]"
+        );
+        checkNotNull(
+            vendor,
+            "CPU core vendor cannot be null"
+        );
+        checkArgument(
+            (frequency > 0) && (frequency <= MAX_FREQUENCY_MHZ),
+            "CPU core frequency (MHz) must be positive and less or equal than " +
+            MAX_FREQUENCY_MHZ + " MHz"
+        );
+
+        this.id        = id;
+        this.vendor    = vendor;
+        this.frequency = frequency;
+    }
+
+    @Override
+    public int id() {
+        return this.id;
+    }
+
+    @Override
+    public CpuVendor vendor() {
+        return this.vendor;
+    }
+
+    @Override
+    public long frequency() {
+        return this.frequency;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .omitNullValues()
+                .add("id",        id())
+                .add("vendor",    vendor())
+                .add("frequency", frequency())
+                .toString();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        }
+        if (!(obj instanceof CpuDevice)) {
+            return false;
+        }
+        CpuDevice device = (CpuDevice) obj;
+        return  this.id() ==  device.id() &&
+                this.vendor() == device.vendor() &&
+                this.frequency() == device.frequency();
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, vendor, frequency);
+    }
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/impl/devices/DefaultNicDevice.java b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/devices/DefaultNicDevice.java
new file mode 100644
index 0000000..d69ff23
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/devices/DefaultNicDevice.java
@@ -0,0 +1,191 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.impl.devices;
+
+import org.onosproject.drivers.server.devices.NicDevice;
+import org.onosproject.drivers.server.devices.NicRxFilter;
+
+import org.onlab.packet.MacAddress;
+
+import com.google.common.base.MoreObjects;
+
+import java.util.Objects;
+
+import static org.onosproject.net.Port.Type;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkArgument;
+
+/**
+ * Default implementation for NIC devices.
+ */
+public class DefaultNicDevice implements NicDevice, Comparable {
+
+    private final String     id;
+    private final int        port;
+    private final long       speed;
+    private final Type       portType;
+    private boolean          status;
+    private final MacAddress macAddress;
+    private NicRxFilter      rxFilterMechanisms;
+
+    // 200 Gbps or 200.000 Mbps
+    public static final long MAX_SPEED = 200000;
+
+    public DefaultNicDevice(
+            String      id,
+            int         port,
+            Type        portType,
+            long        speed,
+            boolean     status,
+            String      macStr,
+            NicRxFilter rxFilterMechanisms) {
+        checkNotNull(id, "NIC ID cannot be null");
+        checkArgument(!id.isEmpty(), "NIC ID cannot be empty");
+        checkArgument(port >= 0, "NIC port number must be non-negative");
+        checkNotNull(portType, "NIC port type cannot be null");
+        checkArgument(
+            (speed >= 0) && (speed <= MAX_SPEED),
+            "NIC speed must be positive and less or equal than " + MAX_SPEED + " Mbps"
+        );
+        checkNotNull(macStr, "NIC MAC address cannot be null");
+        checkNotNull(rxFilterMechanisms, "NIC Rx filter mechanisms cannot be null");
+
+        // Implies a problem
+        if (speed == 0) {
+            status = false;
+        }
+
+        this.id         = id;
+        this.port       = port;
+        this.speed      = speed;
+        this.portType   = portType;
+        this.status     = status;
+        this.macAddress = MacAddress.valueOf(macStr);
+        this.rxFilterMechanisms  = rxFilterMechanisms;
+    }
+
+    @Override
+    public String id() {
+        return this.id;
+    }
+
+    @Override
+    public int port() {
+        return this.port;
+    }
+
+    @Override
+    public Type portType() {
+        return this.portType;
+    }
+
+    @Override
+    public long speed() {
+        return this.speed;
+    }
+
+    @Override
+    public boolean status() {
+        return this.status;
+    }
+
+    @Override
+    public void setStatus(boolean status) {
+        this.status = status;
+    }
+
+    @Override
+    public MacAddress macAddress() {
+        return this.macAddress;
+    }
+
+    @Override
+    public NicRxFilter rxFilterMechanisms() {
+        return this.rxFilterMechanisms;
+    }
+
+    @Override
+    public void setRxFilterMechanisms(NicRxFilter rxFilterMechanisms) {
+        checkNotNull(rxFilterMechanisms, "NIC Rx filter mechanisms cannot be null");
+        this.rxFilterMechanisms = rxFilterMechanisms;
+    }
+
+    @Override
+    public void addRxFilterMechanism(NicRxFilter.RxFilter rxFilter) {
+        this.rxFilterMechanisms.addRxFilter(rxFilter);
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .omitNullValues()
+                .add("id",        id())
+                .add("port",      port())
+                .add("mac",       macAddress.toString())
+                .add("portType",  portType())
+                .add("speed",     speed())
+                .add("status",    status ? "active" : "inactive")
+                .add("rxFilters", rxFilterMechanisms())
+                .toString();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        }
+        if (!(obj instanceof NicDevice)) {
+            return false;
+        }
+        NicDevice device = (NicDevice) obj;
+        return  this.id().equals(device.id()) &&
+                this.port() ==  device.port() &&
+                this.speed  == device.speed() &&
+                this.macAddress.equals(device.macAddress());
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, port, speed, macAddress);
+    }
+
+    @Override
+    public int compareTo(Object other) {
+        if (this == other) {
+            return 0;
+        }
+
+        if (other == null) {
+            return -1;
+        }
+
+        if (other instanceof NicDevice) {
+            NicDevice otherNic = (NicDevice) other;
+
+            if (this.port() == otherNic.port()) {
+                return 0;
+            } else if (this.port() > otherNic.port()) {
+                return 1;
+            } else {
+                return -1;
+            }
+        }
+
+        return -1;
+    }
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/impl/devices/DefaultRestServerSBDevice.java b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/devices/DefaultRestServerSBDevice.java
new file mode 100644
index 0000000..7232ed5
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/devices/DefaultRestServerSBDevice.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.impl.devices;
+
+import org.onosproject.drivers.server.devices.CpuDevice;
+import org.onosproject.drivers.server.devices.NicDevice;
+import org.onosproject.drivers.server.devices.RestServerSBDevice;
+
+import org.onosproject.protocol.rest.DefaultRestSBDevice;
+import org.onosproject.protocol.rest.RestSBDevice.AuthenticationScheme;
+import org.onlab.packet.IpAddress;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.collect.Lists;
+
+import java.util.Objects;
+import java.util.Collection;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * Default implementation for REST server devices.
+ */
+public class DefaultRestServerSBDevice
+        extends DefaultRestSBDevice implements RestServerSBDevice {
+
+    private Collection<CpuDevice> cpus = Lists.newArrayList();
+    private Collection<NicDevice> nics = Lists.newArrayList();
+
+    public DefaultRestServerSBDevice(
+            IpAddress ip, int port, String name, String password,
+            String protocol, String url, boolean isActive,
+            Collection<CpuDevice> cpus, Collection<NicDevice> nics) {
+        this(
+            ip, port, name, password, protocol, url, isActive,
+            "", "", "", "", AuthenticationScheme.BASIC, "", cpus, nics
+        );
+    }
+
+    public DefaultRestServerSBDevice(
+            IpAddress ip, int port, String name, String password,
+            String protocol, String url, boolean isActive, String testUrl,
+            String manufacturer, String hwVersion, String swVersion,
+            AuthenticationScheme authenticationScheme, String token,
+            Collection<CpuDevice> cpus, Collection<NicDevice> nics) {
+        super(
+            ip, port, name, password, protocol, url, isActive,
+            testUrl, manufacturer, hwVersion, swVersion,
+            authenticationScheme, token
+        );
+
+        checkNotNull(cpus, "Device's set of CPUs cannot be null");
+        checkNotNull(nics, "Device's set of NICs cannot be null");
+
+        this.cpus = cpus;
+        this.nics = nics;
+    }
+
+    @Override
+    public Collection<CpuDevice> cpus() {
+        return this.cpus;
+    }
+
+    @Override
+    public int numberOfCpus() {
+        return this.cpus.size();
+    }
+
+    @Override
+    public Collection<NicDevice> nics() {
+        return this.nics;
+    }
+
+    @Override
+    public int numberOfNics() {
+        return this.nics.size();
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .omitNullValues()
+                .add("url", url())
+                .add("testUrl", testUrl())
+                .add("protocol", protocol())
+                .add("username", username())
+                .add("port", port())
+                .add("ip", ip())
+                .add("manufacturer", manufacturer().orElse(null))
+                .add("hwVersion", hwVersion().orElse(null))
+                .add("swVersion", swVersion().orElse(null))
+                .add("cpus", cpus())
+                .add("nics", nics())
+                .toString();
+
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        }
+        if (!(obj instanceof RestServerSBDevice)) {
+            return false;
+        }
+        RestServerSBDevice device = (RestServerSBDevice) obj;
+
+        return  this.username().equals(device.username()) &&
+                this.ip().equals(device.ip()) &&
+                this.port() == device.port();
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(ip(), port(), cpus(), nics());
+    }
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/impl/devices/DefaultServerDeviceDescription.java b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/devices/DefaultServerDeviceDescription.java
new file mode 100644
index 0000000..50aeb02
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/devices/DefaultServerDeviceDescription.java
@@ -0,0 +1,208 @@
+/*
+ * Copyright 2014-present Open Networking Foundation
+ *
+ * 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.drivers.server.impl.devices;
+
+import org.onosproject.drivers.server.devices.CpuDevice;
+import org.onosproject.drivers.server.devices.NicDevice;
+import org.onosproject.drivers.server.devices.ServerDeviceDescription;
+
+import org.onosproject.net.device.DefaultDeviceDescription;
+import org.onosproject.net.SparseAnnotations;
+import org.onlab.packet.ChassisId;
+
+import com.google.common.base.Objects;
+
+import java.net.URI;
+import java.util.Collection;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static org.onosproject.net.Device.Type;
+
+/**
+ * Default implementation of immutable server device description entity.
+ */
+public class DefaultServerDeviceDescription extends DefaultDeviceDescription
+        implements ServerDeviceDescription {
+
+    private final Collection<CpuDevice> cpus;
+    private final Collection<NicDevice> nics;
+
+    /**
+     * Creates a server device description using the supplied information.
+     *
+     * @param uri          device URI
+     * @param type         device type
+     * @param manufacturer device manufacturer
+     * @param hwVersion    device HW version
+     * @param swVersion    device SW version
+     * @param serialNumber device serial number
+     * @param chassis      chassis id
+     * @param cpus         set of CPUs
+     * @param nics         set of network interface cards (NICs)
+     * @param annotations  optional key/value annotations map
+     */
+    public DefaultServerDeviceDescription(
+            URI uri, Type type, String manufacturer,
+            String hwVersion, String swVersion,
+            String serialNumber, ChassisId chassis,
+            Collection<CpuDevice> cpus, Collection<NicDevice> nics,
+            SparseAnnotations... annotations) {
+        this(uri, type, manufacturer, hwVersion, swVersion, serialNumber,
+             chassis, true, cpus, nics, annotations);
+    }
+
+    /**
+     * Creates a server device description using the supplied information.
+     *
+     * @param uri              device URI
+     * @param type             device type
+     * @param manufacturer     device manufacturer
+     * @param hwVersion        device HW version
+     * @param swVersion        device SW version
+     * @param serialNumber     device serial number
+     * @param chassis          chassis id
+     * @param cpus             set of CPUs
+     * @param nics             set of network interface cards (NICs)
+     * @param defaultAvailable optional whether device is by default available
+     * @param annotations      optional key/value annotations map
+     */
+    public DefaultServerDeviceDescription(
+            URI uri, Type type, String manufacturer,
+            String hwVersion, String swVersion,
+            String serialNumber, ChassisId chassis,
+            boolean defaultAvailable,
+            Collection<CpuDevice> cpus, Collection<NicDevice> nics,
+            SparseAnnotations... annotations) {
+        super(
+            uri, type, manufacturer, hwVersion, swVersion,
+            serialNumber, chassis, defaultAvailable, annotations
+        );
+
+        checkNotNull(cpus, "Device's set of CPUs cannot be null");
+        checkNotNull(nics, "Device's set of NICs cannot be null");
+
+        this.cpus = cpus;
+        this.nics = nics;
+    }
+
+    /**
+     * Creates a server device description using the supplied information.
+     * @param base ServerDeviceDescription to basic information
+     * @param annotations Annotations to use.
+     */
+    public DefaultServerDeviceDescription(ServerDeviceDescription base,
+                                    SparseAnnotations... annotations) {
+        this(base.deviceUri(), base.type(), base.manufacturer(),
+             base.hwVersion(), base.swVersion(), base.serialNumber(),
+             base.chassisId(), base.isDefaultAvailable(),
+             base.cpus(), base.nics(),
+             annotations);
+    }
+
+    /**
+     * Creates a device description using the supplied information.
+     * @param base ServerDeviceDescription to basic information (except for type)
+     * @param type device type
+     * @param annotations Annotations to use.
+     */
+    public DefaultServerDeviceDescription(
+            ServerDeviceDescription base, Type type,
+            SparseAnnotations... annotations) {
+        this(base.deviceUri(), type, base.manufacturer(),
+             base.hwVersion(), base.swVersion(), base.serialNumber(),
+             base.chassisId(), base.isDefaultAvailable(),
+             base.cpus(), base.nics(),
+             annotations);
+    }
+
+    /**
+     * Creates a device description using the supplied information.
+     *
+     * @param base ServerDeviceDescription to basic information (except for defaultAvailable)
+     * @param defaultAvailable whether device should be made available by default
+     * @param annotations Annotations to use.
+     */
+    public DefaultServerDeviceDescription(
+            ServerDeviceDescription base,
+            boolean defaultAvailable,
+            SparseAnnotations... annotations) {
+        this(base.deviceUri(), base.type(), base.manufacturer(),
+             base.hwVersion(), base.swVersion(), base.serialNumber(),
+             base.chassisId(), defaultAvailable,
+             base.cpus(), base.nics(),
+             annotations);
+    }
+
+    @Override
+    public Collection<CpuDevice> cpus() {
+        return this.cpus;
+    }
+
+    @Override
+    public Collection<NicDevice> nics() {
+        return this.nics;
+    }
+
+    @Override
+    public String toString() {
+        return toStringHelper(this)
+                .add("uri",          deviceUri())
+                .add("type",         type())
+                .add("manufacturer", manufacturer())
+                .add("hwVersion",    hwVersion())
+                .add("swVersion",    swVersion())
+                .add("serial",       serialNumber())
+                .add("cpus",         cpus)
+                .add("nics",         nics)
+                .add("annotations",  annotations())
+                .toString();
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(super.hashCode(), cpus, nics);
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        if (object instanceof DefaultServerDeviceDescription) {
+            if (!super.equals(object)) {
+                return false;
+            }
+            DefaultServerDeviceDescription that = (DefaultServerDeviceDescription) object;
+            return Objects.equal(this.deviceUri(),          that.deviceUri())
+                && Objects.equal(this.type(),               that.type())
+                && Objects.equal(this.manufacturer(),       that.manufacturer())
+                && Objects.equal(this.hwVersion(),          that.hwVersion())
+                && Objects.equal(this.swVersion(),          that.swVersion())
+                && Objects.equal(this.serialNumber(),       that.serialNumber())
+                && Objects.equal(this.chassisId(),          that.chassisId())
+                && Objects.equal(this.cpus(),               that.cpus())
+                && Objects.equal(this.nics(),               that.nics())
+                && Objects.equal(this.isDefaultAvailable(), that.isDefaultAvailable());
+        }
+        return false;
+    }
+
+    // Default constructor for serialization
+    DefaultServerDeviceDescription() {
+        super(null, null, null, null, null, null, null, (SparseAnnotations[]) null);
+        this.cpus = null;
+        this.nics = null;
+    }
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/impl/devices/package-info.java b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/devices/package-info.java
new file mode 100644
index 0000000..c0ba64b
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/devices/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Implementation of server devices.
+ */
+package org.onosproject.drivers.server.impl.devices;
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/impl/package-info.java b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/package-info.java
new file mode 100644
index 0000000..26be5bf
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Implementation of server device drivers.
+ */
+package org.onosproject.drivers.server.impl;
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/impl/stats/DefaultCpuStatistics.java b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/stats/DefaultCpuStatistics.java
new file mode 100644
index 0000000..43b7273
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/stats/DefaultCpuStatistics.java
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.impl.stats;
+
+import org.onosproject.drivers.server.stats.CpuStatistics;
+
+import org.onosproject.net.DeviceId;
+import com.google.common.base.MoreObjects;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkArgument;
+
+/**
+ * Default implementation for CPU statistics.
+ */
+public final class DefaultCpuStatistics implements CpuStatistics {
+
+    private static final float MIN_CPU_LOAD = (float) 0.0;
+    private static final float MAX_CPU_LOAD = (float) 1.0;
+
+    // Upper limit of CPU cores in one machine
+    public static final int MAX_CPU_NB = 512;
+
+    private final DeviceId deviceId;
+
+    private final int id;
+    private final float load;
+    private final boolean isBusy;
+
+    private DefaultCpuStatistics(
+            DeviceId deviceId,
+            int      id,
+            float    load,
+            boolean  isBusy) {
+        checkNotNull(deviceId, "Device ID is NULL");
+        checkArgument(
+            (id >= 0) && (id < MAX_CPU_NB),
+            "CPU core ID must be in [0, " + String.valueOf(MAX_CPU_NB - 1) + "]"
+        );
+        checkArgument(
+            (load >= MIN_CPU_LOAD) && (load <= MAX_CPU_LOAD),
+            "CPU load must be in [" + MIN_CPU_LOAD + ", " + MAX_CPU_LOAD + "]"
+        );
+
+        this.deviceId = deviceId;
+        this.id       = id;
+        this.load     = load;
+        this.isBusy   = isBusy;
+    }
+
+    // Constructor for serializer
+    private DefaultCpuStatistics() {
+        this.deviceId = null;
+        this.id       = 0;
+        this.load     = 0;
+        this.isBusy   = false;
+    }
+
+    /**
+     * Creates a builder for DefaultCpuStatistics object.
+     *
+     * @return builder object for DefaultCpuStatistics object
+     */
+    public static DefaultCpuStatistics.Builder builder() {
+        return new Builder();
+    }
+
+    @Override
+    public int id() {
+        return this.id;
+    }
+
+    @Override
+    public float load() {
+        return this.load;
+    }
+
+    @Override
+    public boolean busy() {
+        return this.isBusy;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .omitNullValues()
+                .add("device", deviceId)
+                .add("id",     id())
+                .add("load",   load())
+                .add("isBusy", busy())
+                .toString();
+    }
+
+    public static final class Builder {
+
+        DeviceId deviceId;
+        int      id;
+        float    load;
+        boolean  isBusy;
+
+        private Builder() {
+
+        }
+
+        /**
+         * Sets the device identifier.
+         *
+         * @param deviceId device identifier
+         * @return builder object
+         */
+        public Builder setDeviceId(DeviceId deviceId) {
+            this.deviceId = deviceId;
+
+            return this;
+        }
+
+        /**
+         * Sets the CPU ID.
+         *
+         * @param id the CPU ID
+         * @return builder object
+         */
+        public Builder setId(int id) {
+            this.id = id;
+
+            return this;
+        }
+
+        /**
+         * Sets the CPU load.
+         *
+         * @param load CPU load
+         * @return builder object
+         */
+        public Builder setLoad(float load) {
+            this.load = load;
+
+            return this;
+        }
+
+        /**
+         * Sets the CPU status (free or busy).
+         *
+         * @param isBusy CPU status
+         * @return builder object
+         */
+        public Builder setIsBusy(boolean isBusy) {
+            this.isBusy = isBusy;
+
+            return this;
+        }
+
+        /**
+         * Creates a DefaultCpuStatistics object.
+         *
+         * @return DefaultCpuStatistics object
+         */
+        public DefaultCpuStatistics build() {
+            return new DefaultCpuStatistics(
+                deviceId,
+                id,
+                load,
+                isBusy
+            );
+        }
+    }
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/impl/stats/DefaultMonitoringStatistics.java b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/stats/DefaultMonitoringStatistics.java
new file mode 100644
index 0000000..5c1ba99
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/stats/DefaultMonitoringStatistics.java
@@ -0,0 +1,214 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.impl.stats;
+
+import org.onosproject.drivers.server.stats.CpuStatistics;
+import org.onosproject.drivers.server.stats.MonitoringStatistics;
+import org.onosproject.drivers.server.stats.TimingStatistics;
+
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.device.PortStatistics;
+
+import com.google.common.base.MoreObjects;
+
+import java.util.Collection;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkArgument;
+
+/**
+ * Default monitoring statistics for server devices.
+ * Includes CPU, NIC, and timing statistics.
+ */
+public final class DefaultMonitoringStatistics implements MonitoringStatistics {
+
+    private final DeviceId deviceId;
+
+    private final TimingStatistics           timingStatistics;
+    private final Collection<CpuStatistics>  cpuStatistics;
+    private final Collection<PortStatistics> nicStatistics;
+
+    private DefaultMonitoringStatistics(
+            DeviceId                   deviceId,
+            TimingStatistics           timingStatistics,
+            Collection<CpuStatistics>  cpuStatistics,
+            Collection<PortStatistics> nicStatistics) {
+        checkNotNull(deviceId,         "Device ID is NULL");
+        checkNotNull(timingStatistics, "Timing statistics are NULL");
+        checkNotNull(cpuStatistics,    "CPU statistics are NULL");
+        checkNotNull(nicStatistics,    "NIC statistics are NULL");
+
+        this.deviceId         = deviceId;
+        this.timingStatistics = timingStatistics;
+        this.cpuStatistics    = cpuStatistics;
+        this.nicStatistics    = nicStatistics;
+    }
+
+    // Constructor for serializer
+    private DefaultMonitoringStatistics() {
+        this.deviceId         = null;
+        this.timingStatistics = null;
+        this.cpuStatistics    = null;
+        this.nicStatistics    = null;
+    }
+
+    /**
+     * Creates a builder for DefaultMonitoringStatistics object.
+     *
+     * @return builder object for DefaultMonitoringStatistics object
+     */
+    public static DefaultMonitoringStatistics.Builder builder() {
+        return new Builder();
+    }
+
+    @Override
+    public TimingStatistics timingStatistics() {
+        return this.timingStatistics;
+    }
+
+    @Override
+    public Collection<CpuStatistics> cpuStatisticsAll() {
+        return this.cpuStatistics;
+    }
+
+    @Override
+    public CpuStatistics cpuStatistics(int cpuId) {
+        checkArgument(
+            (cpuId >= 0) && (cpuId < DefaultCpuStatistics.MAX_CPU_NB),
+            "CPU core ID must be in [0, " +
+            String.valueOf(DefaultCpuStatistics.MAX_CPU_NB - 1) + "]"
+        );
+        for (CpuStatistics cs : this.cpuStatistics) {
+            if (cs.id() == cpuId) {
+                return cs;
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public Collection<PortStatistics> nicStatisticsAll() {
+        return this.nicStatistics;
+    }
+
+    @Override
+    public PortStatistics nicStatistics(int nicId) {
+        checkArgument(nicId >= 0, "NIC ID must be a non-negative integer");
+        for (PortStatistics ns : this.nicStatistics) {
+            if (ns.port() == nicId) {
+                return ns;
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public int numberOfNics() {
+        return this.nicStatistics.size();
+    }
+
+    @Override
+    public int numberOfCpus() {
+        return this.cpuStatistics.size();
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .omitNullValues()
+                .add("timingStatistics", timingStatistics())
+                .add("cpuStatistics",    cpuStatisticsAll())
+                .add("nicStatistics",    nicStatisticsAll())
+                .toString();
+    }
+
+    public static final class Builder {
+
+        DeviceId                   deviceId;
+        TimingStatistics           timingStatistics;
+        Collection<CpuStatistics>  cpuStatistics;
+        Collection<PortStatistics> nicStatistics;
+
+        private Builder() {
+
+        }
+
+        /**
+         * Sets the device identifier.
+         *
+         * @param deviceId device identifier
+         * @return builder object
+         */
+        public Builder setDeviceId(DeviceId deviceId) {
+            this.deviceId = deviceId;
+
+            return this;
+        }
+
+        /**
+         * Sets timing statistics.
+         *
+         * @param timingStatistics timing statistics
+         * @return builder object
+         */
+        public Builder setTimingStatistics(TimingStatistics timingStatistics) {
+            this.timingStatistics = timingStatistics;
+
+            return this;
+        }
+
+        /**
+         * Sets CPU statistics.
+         *
+         * @param cpuStatistics CPU statistics
+         * @return builder object
+         */
+        public Builder setCpuStatistics(Collection<CpuStatistics> cpuStatistics) {
+            this.cpuStatistics = cpuStatistics;
+
+            return this;
+        }
+
+        /**
+         * Sets NIC statistics.
+         *
+         * @param nicStatistics NIC statistics
+         * @return builder object
+         */
+        public Builder setNicStatistics(Collection<PortStatistics> nicStatistics) {
+            this.nicStatistics = nicStatistics;
+
+            return this;
+        }
+
+        /**
+         * Creates a MonitoringStatistics object.
+         *
+         * @return DefaultMonitoringStatistics object
+         */
+        public DefaultMonitoringStatistics build() {
+            return new DefaultMonitoringStatistics(
+                deviceId,
+                timingStatistics,
+                cpuStatistics,
+                nicStatistics
+            );
+        }
+
+    }
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/impl/stats/DefaultTimingStatistics.java b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/stats/DefaultTimingStatistics.java
new file mode 100644
index 0000000..8256c5f
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/stats/DefaultTimingStatistics.java
@@ -0,0 +1,154 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.impl.stats;
+
+import org.onosproject.drivers.server.stats.TimingStatistics;
+
+import com.google.common.base.MoreObjects;
+
+import static com.google.common.base.Preconditions.checkArgument;
+
+/**
+ * Default implementation for timing statistics.
+ */
+public final class DefaultTimingStatistics implements TimingStatistics {
+
+    private final long deployCommandParsingTime;
+    private final long deployCommandLaunchingTime;
+    private long autoscaleTime;
+
+    private DefaultTimingStatistics(
+            long parsingTime,
+            long launchingTime,
+            long autoscaleTime) {
+        checkArgument(parsingTime   >= 0, "Parsing time is negative");
+        checkArgument(launchingTime >= 0, "Launching time is negative");
+        checkArgument(autoscaleTime >= 0, "Autoscale time is negative");
+
+        this.deployCommandParsingTime   = parsingTime;
+        this.deployCommandLaunchingTime = launchingTime;
+        this.autoscaleTime = autoscaleTime;
+    }
+
+    // Constructor for serializer
+    private DefaultTimingStatistics() {
+        this.deployCommandParsingTime   = 0;
+        this.deployCommandLaunchingTime = 0;
+        this.autoscaleTime = 0;
+    }
+
+    /**
+     * Creates a builder for DefaultTimingStatistics object.
+     *
+     * @return builder object for DefaultTimingStatistics object
+     */
+    public static DefaultTimingStatistics.Builder builder() {
+        return new Builder();
+    }
+
+    @Override
+    public long deployCommandParsingTime() {
+        return this.deployCommandParsingTime;
+    }
+
+    @Override
+    public long deployCommandLaunchingTime() {
+        return this.deployCommandLaunchingTime;
+    }
+
+    @Override
+    public long totalDeploymentTime() {
+        return this.deployCommandParsingTime + this.deployCommandLaunchingTime;
+    }
+
+    @Override
+    public long autoscaleTime() {
+        return this.autoscaleTime;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .omitNullValues()
+                .add("parsing",   this.deployCommandParsingTime())
+                .add("launching", this.deployCommandLaunchingTime())
+                .add("total",     this.totalDeploymentTime())
+                .add("autoscale", this.autoscaleTime())
+                .toString();
+    }
+
+    public static final class Builder {
+
+        long deployCommandParsingTime;
+        long deployCommandLaunchingTime;
+        long autoscaleTime;
+
+        private Builder() {
+
+        }
+
+        /**
+         * Sets parsing time.
+         *
+         * @param parsingTime parsing time
+         * @return builder object
+         */
+        public Builder setParsingTime(long parsingTime) {
+            this.deployCommandParsingTime = parsingTime;
+
+            return this;
+        }
+
+        /**
+         * Sets launching time.
+         *
+         * @param launchingTime launching time
+         * @return builder object
+         */
+        public Builder setLaunchingTime(long launchingTime) {
+            this.deployCommandLaunchingTime = launchingTime;
+
+            return this;
+        }
+
+        /**
+         * Sets autoscale time.
+         *
+         * @param autoscaleTime time required to autoscale
+         * @return builder object
+         */
+        public Builder setAutoscaleTime(long autoscaleTime) {
+            this.autoscaleTime = autoscaleTime;
+
+            return this;
+        }
+
+        /**
+         * Creates a DefaultTimingStatistics object.
+         *
+         * @return DefaultTimingStatistics object
+         */
+        public DefaultTimingStatistics build() {
+            return new DefaultTimingStatistics(
+                deployCommandParsingTime,
+                deployCommandLaunchingTime,
+                autoscaleTime
+            );
+        }
+    }
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/impl/stats/package-info.java b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/stats/package-info.java
new file mode 100644
index 0000000..92c0e7d
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/impl/stats/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Implementation of server device statistics.
+ */
+package org.onosproject.drivers.server.impl.stats;
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/package-info.java b/drivers/server/src/main/java/org/onosproject/drivers/server/package-info.java
new file mode 100644
index 0000000..7b4fe77
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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 for server device drivers.
+ */
+package org.onosproject.drivers.server;
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/stats/CpuStatistics.java b/drivers/server/src/main/java/org/onosproject/drivers/server/stats/CpuStatistics.java
new file mode 100644
index 0000000..9ea22b3
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/stats/CpuStatistics.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.stats;
+
+/**
+ * CPU statistics API.
+ */
+public interface CpuStatistics {
+
+    /**
+     * Returns the ID of a CPU core.
+     *
+     * @return CPU core identifier
+     */
+    int id();
+
+    /**
+     * Returns the load of this CPU core.
+     * This is a value in [0, 1].
+     * Zero means no load, while one means fully loaded.
+     *
+     * @return load of a CPU core
+     */
+    float load();
+
+    /**
+     * Returns the status (true=busy, false=free) of a CPU core.
+     *
+     * @return boolean CPU core status
+     */
+    boolean busy();
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/stats/MonitoringStatistics.java b/drivers/server/src/main/java/org/onosproject/drivers/server/stats/MonitoringStatistics.java
new file mode 100644
index 0000000..c713d01
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/stats/MonitoringStatistics.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.stats;
+
+import org.onosproject.net.device.PortStatistics;
+
+import java.util.Collection;
+
+/**
+ * Server statistics API.
+ */
+public interface MonitoringStatistics {
+
+    /**
+     * Returns timing statistics related to
+     * tasks requested by the controller.
+     *
+     * @return timing statistics
+     */
+    TimingStatistics timingStatistics();
+
+    /**
+     * Returns the CPU statistics of a server device.
+     * Includes the statistics of all CPUs.
+     *
+     * @return CPU statistics
+     */
+    Collection<CpuStatistics> cpuStatisticsAll();
+
+    /**
+     * Returns the statistics of a particular CPU
+     * of a server device.
+     *
+     * @param cpuId ID of the CPU
+     * @return CpuStatistics object for this CPU
+     */
+    CpuStatistics cpuStatistics(int cpuId);
+
+    /**
+     * Returns the NIC statistics of a server device.
+     * Includes the statistics of all NICs.
+     *
+     * @return set of PortStatistics
+     */
+    Collection<PortStatistics> nicStatisticsAll();
+
+    /**
+     * Returns the statistics of a particular NIC
+     * of a server device.
+     *
+     * @param nicId ID of the NIC
+     * @return PortStatistics object for this NIC
+     */
+    PortStatistics nicStatistics(int nicId);
+
+    /**
+     * Returns the number of CPUs being monitored.
+     *
+     * @return number of CPUs
+     */
+    int numberOfCpus();
+
+    /**
+     * Returns the number of NICs being monitored.
+     *
+     * @return number of NICs
+     */
+    int numberOfNics();
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/stats/TimingStatistics.java b/drivers/server/src/main/java/org/onosproject/drivers/server/stats/TimingStatistics.java
new file mode 100644
index 0000000..102b186
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/stats/TimingStatistics.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server.stats;
+
+/**
+ * Timing statistics API.
+ */
+public interface TimingStatistics {
+
+    /**
+     * Time (ns) to parse the controller's deployment instruction.
+     *
+     * @return time in nanoseconds to parse a 'deploy' command
+     */
+    long deployCommandParsingTime();
+
+    /**
+     * Time (ns) to launch a slave process in the dataplane.
+     *
+     * @return time in nanoseconds to launch a 'deploy' command
+     */
+    long deployCommandLaunchingTime();
+
+    /**
+     * Time (ns) to parse + launch the controller's deployment instruction.
+     * This is the sum of the above two timers.
+     *
+     * @return time in nanoseconds to parse + launch a 'deploy' command
+     */
+    long totalDeploymentTime();
+
+    /**
+     * Time (ns) to perform a local reconfiguration.
+     * (i.e., the agent autoscales the number of CPUs).
+     *
+     * @return time in nanoseconds to autoscale
+     */
+    long autoscaleTime();
+
+}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/stats/package-info.java b/drivers/server/src/main/java/org/onosproject/drivers/server/stats/package-info.java
new file mode 100644
index 0000000..b50f763
--- /dev/null
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/stats/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.
+ */
+
+/**
+ * API for server device statistics.
+ */
+package org.onosproject.drivers.server.stats;
diff --git a/drivers/server/src/main/resources/server-drivers.xml b/drivers/server/src/main/resources/server-drivers.xml
new file mode 100644
index 0000000..3c97a9d
--- /dev/null
+++ b/drivers/server/src/main/resources/server-drivers.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2017-present Open Networking Foundation
+  ~
+  ~ 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.
+  -->
+<drivers>
+    <driver name="restServer" extends="default" manufacturer="GenuineIntel" hwVersion="Intel(R) Xeon(R) CPU E5-2667 v3 @ 3.20GHz" swVersion="Click 2.1">
+        <behaviour api="org.onosproject.net.behaviour.DevicesDiscovery"
+                   impl="org.onosproject.drivers.server.ServerDevicesDiscovery"/>
+
+        <behaviour api="org.onosproject.net.device.DeviceDescriptionDiscovery"
+                   impl="org.onosproject.drivers.server.ServerDevicesDiscovery"/>
+
+        <behaviour api="org.onosproject.net.behaviour.ControllerConfig"
+                   impl="org.onosproject.drivers.server.ServerControllerConfig"/>
+
+        <behaviour api="org.onosproject.net.device.PortStatisticsDiscovery"
+                   impl="org.onosproject.drivers.server.ServerDevicesDiscovery"/>
+
+        <behaviour api="org.onosproject.drivers.server.behavior.CpuStatisticsDiscovery"
+                   impl="org.onosproject.drivers.server.ServerDevicesDiscovery"/>
+
+        <behaviour api="org.onosproject.drivers.server.behavior.MonitoringStatisticsDiscovery"
+                   impl="org.onosproject.drivers.server.ServerDevicesDiscovery"/>
+    </driver>
+</drivers>
+
+
diff --git a/drivers/server/src/test/java/org/onosproject/drivers/server/RestSBControllerMock.java b/drivers/server/src/test/java/org/onosproject/drivers/server/RestSBControllerMock.java
new file mode 100644
index 0000000..915c1bb
--- /dev/null
+++ b/drivers/server/src/test/java/org/onosproject/drivers/server/RestSBControllerMock.java
@@ -0,0 +1,175 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * 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.drivers.server;
+
+import org.onlab.packet.IpAddress;
+
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.behaviour.ControllerInfo;
+import org.onosproject.protocol.rest.RestSBController;
+import org.onosproject.protocol.rest.RestSBDevice;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Set;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import static org.hamcrest.Matchers.notNullValue;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test class for REST SB controller.
+ */
+public class RestSBControllerMock implements RestSBController {
+    /**
+     * Local memory of devices.
+     */
+    private Map<DeviceId, RestSBDevice> deviceMap = new ConcurrentHashMap<>();
+
+    /**
+     * Objects to populate our memory.
+     */
+    private DeviceId restDeviceId1;
+    private RestSBDevice restDevice1;
+    private static List<ControllerInfo> controllers;
+
+    /**
+     * Parameters to be exchanged with the server's agent.
+     */
+    private static final String PARAM_CTRL      = "controllers";
+    private static final String PARAM_CTRL_IP   = "ip";
+    private static final String PARAM_CTRL_PORT = "port";
+    private static final String PARAM_CTRL_TYPE = "type";
+
+    public RestSBControllerMock() {
+        restDeviceId1 = TestConfig.REST_DEV_ID1;
+        assertThat(restDeviceId1, notNullValue());
+
+        restDevice1 = TestConfig.REST_DEV1;
+        assertThat(restDevice1, notNullValue());
+
+        controllers = TestConfig.CONTROLLERS;
+        assertThat(controllers, notNullValue());
+
+        deviceMap.put(restDeviceId1, restDevice1);
+    }
+
+    @Override
+    public void addProxiedDevice(DeviceId deviceId, RestSBDevice proxy) {
+        return;
+    }
+
+    @Override
+    public void removeProxiedDevice(DeviceId deviceId) {
+        return;
+    }
+
+    @Override
+    public Set<DeviceId> getProxiedDevices(DeviceId proxyId) {
+        return null;
+    }
+
+    @Override
+    public RestSBDevice getProxySBDevice(DeviceId deviceId) {
+        return null;
+    }
+
+    @Override
+    public Map<DeviceId, RestSBDevice> getDevices() {
+        return null;
+    }
+
+    @Override
+    public RestSBDevice getDevice(DeviceId deviceInfo) {
+        return null;
+    }
+
+    @Override
+    public RestSBDevice getDevice(IpAddress ip, int port) {
+        return null;
+    }
+
+    @Override
+    public void addDevice(RestSBDevice device) {
+        return;
+    }
+
+    @Override
+    public void removeDevice(DeviceId deviceId) {
+        return;
+    }
+
+    @Override
+    public InputStream get(DeviceId device, String request, MediaType mediaType) {
+        /**
+         * We fake the HTTP get in order to
+         * emulate the expected response.
+         */
+        ObjectMapper mapper = new ObjectMapper();
+
+        // Create the object node to host the data
+        ObjectNode sendObjNode = mapper.createObjectNode();
+
+        // Insert header
+        ArrayNode ctrlsArrayNode = sendObjNode.putArray(PARAM_CTRL);
+
+        // Add each controller's information object
+        for (ControllerInfo ctrl : controllers) {
+            ObjectNode ctrlObjNode = mapper.createObjectNode();
+            ctrlObjNode.put(PARAM_CTRL_IP,   ctrl.ip().toString());
+            ctrlObjNode.put(PARAM_CTRL_PORT, ctrl.port());
+            ctrlObjNode.put(PARAM_CTRL_TYPE, ctrl.type());
+            ctrlsArrayNode.add(ctrlObjNode);
+        }
+
+        return new ByteArrayInputStream(sendObjNode.toString().getBytes());
+    }
+
+    @Override
+    public int post(DeviceId device, String request, InputStream payload, MediaType mediaType) {
+        return Response.Status.OK.getStatusCode();
+    }
+
+    @Override
+    public int put(DeviceId device, String request, InputStream payload, MediaType mediaType) {
+        return Response.Status.OK.getStatusCode();
+    }
+
+    @Override
+    public int patch(DeviceId device, String request, InputStream payload, MediaType mediaType) {
+        return Response.Status.OK.getStatusCode();
+    }
+
+    @Override
+    public int delete(DeviceId device, String request, InputStream payload, MediaType mediaType) {
+        return Response.Status.OK.getStatusCode();
+    }
+
+    @Override
+     public <T> T post(DeviceId device, String request, InputStream payload,
+            MediaType mediaType, Class<T> responseClass) {
+        return null;
+     }
+}
\ No newline at end of file
diff --git a/drivers/server/src/test/java/org/onosproject/drivers/server/ServerControllerConfigTest.java b/drivers/server/src/test/java/org/onosproject/drivers/server/ServerControllerConfigTest.java
new file mode 100644
index 0000000..add6e03
--- /dev/null
+++ b/drivers/server/src/test/java/org/onosproject/drivers/server/ServerControllerConfigTest.java
@@ -0,0 +1,206 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * 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.drivers.server;
+
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.behaviour.ControllerConfig;
+import org.onosproject.net.behaviour.ControllerInfo;
+import org.onosproject.net.driver.Behaviour;
+import org.onosproject.net.driver.DefaultDriverData;
+import org.onosproject.net.driver.Driver;
+import org.onosproject.net.driver.DriverData;
+import org.onosproject.net.driver.DriverHandler;
+import org.onosproject.net.driver.DriverService;
+import org.onosproject.net.driver.DriverServiceAdapter;
+import org.onosproject.mastership.MastershipServiceAdapter;
+import org.onosproject.mastership.MastershipService;
+import org.onosproject.protocol.rest.RestSBController;
+import org.onosproject.protocol.rest.RestSBDevice;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.List;
+
+import static org.hamcrest.Matchers.notNullValue;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Unit tests for methods of ServerControllerConfig.
+ */
+public class ServerControllerConfigTest {
+
+    // Device information used during the tests
+    private static final String REST_SCHEME = "rest";
+    private static final String REST_DEV_TEST_IP_1 = "10.0.0.1";
+    private static final int    REST_TEST_PORT = 80;
+
+    // Controller information used during the tests
+    private static final String REST_CTRL_TEST_IP_1 = "10.0.0.253";
+    private static final String REST_CTRL_TEST_IP_2 = "10.0.0.254";
+    private static final String REST_CTRL_TEST_TYPE = "tcp";
+    private static List<ControllerInfo> controllers;
+
+    // Device used during the tests
+    private DeviceId restDeviceId1;
+    private RestSBDevice restDevice1;
+
+    // Test Driver service used during the tests
+    private DriverService driverService;
+
+    // Test mastership service used during the tests
+    private MastershipService mastershipService;
+
+    // Test Rest SB controller used during the tests
+    private RestSBController controller;
+
+    @Before
+    public void setUp() throws Exception {
+        restDeviceId1 = TestConfig.REST_DEV_ID1;
+        assertThat(restDeviceId1, notNullValue());
+
+        restDevice1 = TestConfig.REST_DEV1;
+        assertThat(restDevice1, notNullValue());
+
+        controllers = TestConfig.CONTROLLERS;
+        assertThat(controllers, notNullValue());
+
+        driverService = new TestDriverService();
+        mastershipService = new TestMastershipService();
+        controller = new RestSBControllerMock();
+    }
+
+    /**
+     * Test of setControllers().
+     */
+    @Test
+    public void testSetControllers() {
+        // Get device handler
+        DriverHandler driverHandler = null;
+        try {
+            driverHandler = driverService.createHandler(restDeviceId1);
+        } catch (Exception e) {
+            throw e;
+        }
+        assertThat(driverHandler, notNullValue());
+
+        // TODO: Fix this test
+    }
+
+    /**
+     * Test of getControllers().
+     */
+    @Test
+    public void testGetControllers() {
+        // Get device handler
+        DriverHandler driverHandler = null;
+        try {
+            driverHandler = driverService.createHandler(restDeviceId1);
+        } catch (Exception e) {
+            throw e;
+        }
+        assertThat(driverHandler, notNullValue());
+
+        // Ask for the controllers of this device
+        List<ControllerInfo> receivedControllers = null;
+
+        // TODO: Fix this test
+    }
+
+    /**
+     * Test class for driver handler.
+     */
+    private class TestDriverHandler implements DriverHandler {
+
+        private final DeviceId deviceId;
+
+        TestDriverHandler(DeviceId deviceId) {
+            this.deviceId = deviceId;
+        }
+
+        @Override
+        public Driver driver() {
+            return null;
+        }
+
+        @Override
+        public DriverData data() {
+            // Just create a fake driver data
+            return new DefaultDriverData(null, deviceId);
+        }
+
+        @Override
+        @SuppressWarnings("unchecked")
+        public <T extends Behaviour> T behaviour(Class<T> behaviourClass) {
+            // Let's create the behavior
+            ControllerConfig controllerConfing = null;
+            try {
+                controllerConfing = new ServerControllerConfig();
+            } catch (Exception e) {
+                // Do nothing
+            }
+
+            if (controllerConfing == null) {
+                return null;
+            }
+
+            // Set the handler
+            controllerConfing.setHandler(this);
+
+            // Done, return the behavior
+            return (T) controllerConfing;
+        }
+
+        @Override
+        @SuppressWarnings("unchecked")
+        public <T> T get(Class<T> serviceClass) {
+            if (serviceClass == MastershipService.class) {
+                return (T) mastershipService;
+            } else if (serviceClass == RestSBController.class) {
+                return (T) controller;
+            }
+            return null;
+        }
+
+        @Override
+        public boolean hasBehaviour(Class<? extends Behaviour> behaviourClass) {
+            return true;
+        }
+    }
+
+    /**
+     * Test class for driver service.
+     */
+    private class TestDriverService extends DriverServiceAdapter {
+        @Override
+        public DriverHandler createHandler(DeviceId deviceId, String... credentials) {
+            return new TestDriverHandler(deviceId);
+        }
+
+    }
+
+    /**
+     * Test class for mastership service.
+     */
+    private final class TestMastershipService extends MastershipServiceAdapter {
+        @Override
+        public boolean isLocalMaster(DeviceId deviceId) {
+            return true;
+        }
+    }
+
+}
diff --git a/drivers/server/src/test/java/org/onosproject/drivers/server/ServerDriversLoaderTest.java b/drivers/server/src/test/java/org/onosproject/drivers/server/ServerDriversLoaderTest.java
new file mode 100644
index 0000000..0ca21f3
--- /dev/null
+++ b/drivers/server/src/test/java/org/onosproject/drivers/server/ServerDriversLoaderTest.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.drivers.server;
+
+import org.junit.Before;
+import org.onosproject.net.driver.AbstractDriverLoaderTest;
+
+/**
+ * Commodity server drivers loader test.
+ */
+public class ServerDriversLoaderTest extends AbstractDriverLoaderTest {
+
+    @Before
+    public void setUp() {
+        loader = new ServerDriversLoader();
+    }
+}
diff --git a/drivers/server/src/test/java/org/onosproject/drivers/server/TestConfig.java b/drivers/server/src/test/java/org/onosproject/drivers/server/TestConfig.java
new file mode 100644
index 0000000..4a7ecbf
--- /dev/null
+++ b/drivers/server/src/test/java/org/onosproject/drivers/server/TestConfig.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * 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.drivers.server;
+
+import org.onlab.packet.IpAddress;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.behaviour.ControllerInfo;
+import org.onosproject.protocol.rest.DefaultRestSBDevice;
+import org.onosproject.protocol.rest.RestSBDevice;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Common configuration for testing.
+ */
+public class TestConfig {
+
+    /**
+     * No need for a constructor, methods are static.
+     */
+    protected TestConfig() {}
+
+    /**
+     * Device information used during the tests.
+     */
+    public static final String REST_SCHEME = "rest";
+    public static final String REST_DEV_TEST_IP_1 = "10.0.0.1";
+    public static final int    REST_TEST_PORT = 80;
+
+    public static final DeviceId REST_DEV_ID1 = DeviceId.deviceId(
+        REST_SCHEME + ":" + REST_DEV_TEST_IP_1 + ":" + REST_TEST_PORT
+    );
+    public static final RestSBDevice REST_DEV1 = new DefaultRestSBDevice(
+        IpAddress.valueOf(REST_DEV_TEST_IP_1),
+        REST_TEST_PORT,
+        "foo", "bar", "http", null, true
+    );
+
+    /**
+     * Controller information used during the tests.
+     */
+    public static final String REST_CTRL_TEST_IP_1 = "10.0.0.253";
+    public static final String REST_CTRL_TEST_IP_2 = "10.0.0.254";
+    public static final String REST_CTRL_TEST_TYPE = "tcp";
+
+    public static final List<ControllerInfo> CONTROLLERS = Arrays.asList(
+        new ControllerInfo(
+            IpAddress.valueOf(REST_CTRL_TEST_IP_1),
+            REST_TEST_PORT,
+            REST_CTRL_TEST_TYPE
+        ),
+        new ControllerInfo(
+            IpAddress.valueOf(REST_CTRL_TEST_IP_2),
+            REST_TEST_PORT,
+            REST_CTRL_TEST_TYPE
+        )
+    );
+
+}
diff --git a/modules.defs b/modules.defs
index b090666..fcea956 100644
--- a/modules.defs
+++ b/modules.defs
@@ -96,6 +96,7 @@
     '//drivers/fujitsu:onos-drivers-fujitsu-oar',
     '//drivers/lumentum:onos-drivers-lumentum-oar',
     '//drivers/netconf:onos-drivers-netconf-oar',
+    '//drivers/server:onos-drivers-server-oar',
     '//drivers/optical:onos-drivers-optical-oar',
     '//drivers/ovsdb:onos-drivers-ovsdb-oar',
     '//drivers/juniper:onos-drivers-juniper-oar',
