diff --git a/drivers/polatis/netconf/BUILD b/drivers/polatis/netconf/BUILD
index faf52dc..39c39fa 100644
--- a/drivers/polatis/netconf/BUILD
+++ b/drivers/polatis/netconf/BUILD
@@ -1,4 +1,4 @@
-COMPILE_DEPS = CORE_DEPS + ONOS_YANG + [
+COMPILE_DEPS = CORE_DEPS + JACKSON + ONOS_YANG + [
     "//models/polatis:onos-models-polatis",
     "//drivers/utilities:onos-drivers-utilities",
     "//protocols/netconf/api:onos-protocols-netconf-api",
diff --git a/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisDeviceDescription.java b/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisDeviceDescription.java
index ad77648..916a029 100644
--- a/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisDeviceDescription.java
+++ b/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisDeviceDescription.java
@@ -18,12 +18,9 @@
 
 import org.apache.commons.configuration.HierarchicalConfiguration;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Lists;
-import org.onosproject.net.AnnotationKeys;
 import org.onosproject.net.DefaultAnnotations;
 import org.onosproject.net.Device;
 import org.onosproject.net.DeviceId;
-import org.onosproject.net.PortNumber;
 import org.onosproject.net.device.DefaultDeviceDescription;
 import org.onosproject.net.device.DeviceDescription;
 import org.onosproject.net.device.DeviceDescriptionDiscovery;
@@ -31,35 +28,32 @@
 import org.onosproject.net.device.PortDescription;
 import org.onosproject.net.driver.AbstractHandlerBehaviour;
 
-import static org.onosproject.net.optical.device.OmsPortHelper.omsPortDescription;
-
 import org.onlab.packet.ChassisId;
-import org.onlab.util.Frequency;
-import org.onlab.util.Spectrum;
 
 import org.slf4j.Logger;
 import static org.slf4j.LoggerFactory.getLogger;
 
 import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 import static org.onosproject.net.Device.Type.FIBER_SWITCH;
 
+import static org.onosproject.drivers.polatis.netconf.PolatisUtility.getPortsFilter;
+import static org.onosproject.drivers.polatis.netconf.PolatisUtility.getProdInfoFilter;
+import static org.onosproject.drivers.polatis.netconf.PolatisUtility.parsePorts;
+import static org.onosproject.drivers.polatis.netconf.PolatisUtility.KEY_MANUFACTURER;
+import static org.onosproject.drivers.polatis.netconf.PolatisUtility.KEY_HWVERSION;
+import static org.onosproject.drivers.polatis.netconf.PolatisUtility.KEY_SWVERSION;
+import static org.onosproject.drivers.polatis.netconf.PolatisUtility.KEY_SERIALNUMBER;
+import static org.onosproject.drivers.polatis.netconf.PolatisUtility.KEY_INPUTPORTS;
+import static org.onosproject.drivers.polatis.netconf.PolatisUtility.KEY_OUTPUTPORTS;
+
 import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.configAt;
-import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.configsAt;
 import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.netconfGet;
 import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.subscribe;
-import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.xmlOpen;
-import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.xmlClose;
-import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.xmlEmpty;
-import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PORT;
-import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PORTID;
-import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PORTCONFIG;
-import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PRODINF;
-import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PORTCONFIG_XMLNS;
-import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PRODINF_XMLNS;
 import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_DATA_PRODINF;
-import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_DATA_PORTCONFIG;
 
 /**
  * Representation of device information and ports via NETCONF for all Polatis
@@ -68,17 +62,6 @@
 public class PolatisDeviceDescription extends AbstractHandlerBehaviour
     implements DeviceDescriptionDiscovery {
 
-    public static final String DEFAULT_MANUFACTURER = "Polatis";
-    public static final String DEFAULT_DESCRIPTION_DATA = "Unknown";
-    public static final String KEY_MANUFACTURER = "manufacturer";
-    public static final String KEY_HWVERSION = "model-name";
-    public static final String KEY_SWVERSION = "software-version";
-    public static final String KEY_SERIALNUMBER = "serial-number";
-    public static final String KEY_PORTSTATUS = "status";
-    public static final String PORT_ENABLED = "ENABLED";
-    public static final String KEY_PORTLABEL = "label";
-    public static final int POLATIS_NUM_OF_WAVELENGTHS = 39;
-
     private final Logger log = getLogger(getClass());
 
     /**
@@ -89,32 +72,50 @@
      */
     @Override
     public DeviceDescription discoverDeviceDetails() {
+        log.debug("Discovering Polatis device detais...");
         return parseProductInformation();
     }
 
     private DeviceDescription parseProductInformation() {
         DeviceService devsvc = checkNotNull(handler().get(DeviceService.class));
-        DeviceId devid = handler().data().deviceId();
-        Device dev = devsvc.getDevice(devid);
-        if (dev == null) {
-            return new DefaultDeviceDescription(devid.uri(), FIBER_SWITCH,
-                    DEFAULT_MANUFACTURER, DEFAULT_DESCRIPTION_DATA,
-                    DEFAULT_DESCRIPTION_DATA, DEFAULT_DESCRIPTION_DATA,
-                    new ChassisId());
-        }
-        String reply = netconfGet(handler(), getProductInformationFilter());
+        DeviceId devID = handler().data().deviceId();
+        String reply = netconfGet(handler(), getProdInfoFilter());
         subscribe(handler());
         HierarchicalConfiguration cfg = configAt(reply, KEY_DATA_PRODINF);
-        return new DefaultDeviceDescription(dev.id().uri(), FIBER_SWITCH,
+        String hw = cfg.getString(KEY_HWVERSION);
+        String numInputPorts = "0";
+        String numOutputPorts = "0";
+        if (!hw.equals("")) {
+            Pattern patternSize = Pattern.compile("\\d+x[\\dC]+");
+            Matcher matcher = patternSize.matcher(hw);
+            if (matcher.find()) {
+                String switchSize = matcher.group();
+                log.debug("Got switch size: " + switchSize);
+                Pattern patternNumber = Pattern.compile("[\\dC]+");
+                matcher = patternNumber.matcher(switchSize);
+                if (matcher.find()) {
+                    numInputPorts = matcher.group();
+                    log.debug("numInputPorts=" + numInputPorts);
+                    if (matcher.find()) {
+                        if (!matcher.group().equals("CC")) {
+                            numOutputPorts = matcher.group();
+                        }
+                    }
+                log.debug("numOutputPorts=" + numOutputPorts);
+                }
+            }
+        } else {
+            log.warn("Unable to determine type of Polatis switch " + devID.toString());
+        }
+        DefaultAnnotations annotations = DefaultAnnotations.builder()
+                .set(KEY_INPUTPORTS, numInputPorts)
+                .set(KEY_OUTPUTPORTS, numOutputPorts)
+                .build();
+
+        return new DefaultDeviceDescription(devID.uri(), FIBER_SWITCH,
                 cfg.getString(KEY_MANUFACTURER), cfg.getString(KEY_HWVERSION),
                 cfg.getString(KEY_SWVERSION), cfg.getString(KEY_SERIALNUMBER),
-                dev.chassisId());
-    }
-
-    private String getProductInformationFilter() {
-        return new StringBuilder(xmlOpen(KEY_PRODINF_XMLNS))
-                .append(xmlClose(KEY_PRODINF))
-                .toString();
+                new ChassisId(cfg.getString(KEY_SERIALNUMBER)), true, annotations);
     }
 
     /**
@@ -124,41 +125,14 @@
      */
     @Override
     public List<PortDescription> discoverPortDetails() {
+        log.debug("Discovering ports on Polatis switch...");
+        DeviceService deviceService = handler().get(DeviceService.class);
+        DeviceId deviceID = handler().data().deviceId();
+        Device device = deviceService.getDevice(deviceID);
+        int numInputPorts = Integer.parseInt(device.annotations().value(KEY_INPUTPORTS));
+        int numOutputPorts = Integer.parseInt(device.annotations().value(KEY_OUTPUTPORTS));
         String reply = netconfGet(handler(), getPortsFilter());
-        List<PortDescription> descriptions = parsePorts(reply);
+        List<PortDescription> descriptions = parsePorts(reply, numInputPorts, numOutputPorts);
         return ImmutableList.copyOf(descriptions);
     }
-
-    private String getPortsFilter() {
-        return new StringBuilder(xmlOpen(KEY_PORTCONFIG_XMLNS))
-                .append(xmlOpen(KEY_PORT))
-                .append(xmlEmpty(KEY_PORTID))
-                .append(xmlEmpty(KEY_PORTSTATUS))
-                .append(xmlEmpty(KEY_PORTLABEL))
-                .append(xmlClose(KEY_PORT))
-                .append(xmlClose(KEY_PORTCONFIG))
-                .toString();
-    }
-
-    private List<PortDescription> parsePorts(String content) {
-        List<HierarchicalConfiguration> subtrees = configsAt(content, KEY_DATA_PORTCONFIG);
-        List<PortDescription> portDescriptions = Lists.newArrayList();
-        for (HierarchicalConfiguration portConfig : subtrees) {
-            portDescriptions.add(parsePort(portConfig));
-        }
-        return portDescriptions;
-    }
-
-    private PortDescription parsePort(HierarchicalConfiguration cfg) {
-        PortNumber portNumber = PortNumber.portNumber(cfg.getLong(KEY_PORTID));
-        DefaultAnnotations annotations = DefaultAnnotations.builder()
-                .set(AnnotationKeys.PORT_NAME, cfg.getString(KEY_PORTLABEL))
-                .build();
-        return omsPortDescription(portNumber,
-                cfg.getString(KEY_PORTSTATUS).equals(PORT_ENABLED),
-                Spectrum.O_BAND_MIN, Spectrum.L_BAND_MAX,
-                Frequency.ofGHz((Spectrum.O_BAND_MIN.asGHz() -
-                        Spectrum.L_BAND_MAX.asGHz()) /
-                    POLATIS_NUM_OF_WAVELENGTHS), annotations);
-    }
 }
diff --git a/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisFlowRuleProgrammable.java b/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisFlowRuleProgrammable.java
index 52b7940..6f37960 100644
--- a/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisFlowRuleProgrammable.java
+++ b/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisFlowRuleProgrammable.java
@@ -19,59 +19,44 @@
 import org.onosproject.yang.gen.v1.opticalswitch.rev20180322.opticalswitch.CrossConnects;
 import org.onosproject.yang.gen.v1.opticalswitch.rev20180322.opticalswitch.crossconnects.Pair;
 
-import com.google.common.collect.ImmutableList;
-
-import org.apache.commons.configuration.HierarchicalConfiguration;
-import org.onosproject.net.PortNumber;
 import org.onosproject.net.driver.AbstractHandlerBehaviour;
-import org.onosproject.net.flow.DefaultFlowEntry;
 import org.onosproject.net.flow.FlowEntry;
 import org.onosproject.net.flow.FlowRule;
 import org.onosproject.net.flow.FlowRuleProgrammable;
-import org.onosproject.netconf.NetconfException;
 import org.slf4j.Logger;
 
 import java.util.Collection;
-import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
 
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
+import static org.onosproject.drivers.polatis.netconf.PolatisUtility.parseKeyPairCompat;
+import static org.onosproject.drivers.polatis.netconf.PolatisUtility.parseConnections;
+import static org.onosproject.drivers.polatis.netconf.PolatisUtility.KEY_SRC;
+import static org.onosproject.drivers.polatis.netconf.PolatisUtility.KEY_DST;
 
-import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.netconfGet;
 import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.netconfEditConfig;
-import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.opticalRevision;
-import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.configsAt;
 import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.xmlOpen;
 import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.xmlClose;
 import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_CONNS;
 import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_CONNS_XMLNS;
-import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_DATA_CONNS;
 import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.CFG_MODE_MERGE;
 import static org.slf4j.LoggerFactory.getLogger;
 
 /**
- * Flow rule programmable behaviour for polatis optical netconf devices.
+ * Flow rule programmable behaviour for Polatis optical netconf devices.
  */
 public class PolatisFlowRuleProgrammable
     extends AbstractHandlerBehaviour implements FlowRuleProgrammable {
 
     public static final String KEY_CHID = "wavelength-id";
-    public static final String KEY_SRC = "ingress";
-    public static final String KEY_DST = "egress";
     public static final String KEY_SRC_CHID = String.format("%s.%s", KEY_SRC, KEY_CHID);
     public static final String CFG_MODE_DELETE = "delete";
-    public static final String KEY_PAIR = "pair";
-    public static final String KEY_PAIRS = "pairs";
-    public static final String KEY_PAIR_DELETE = String.format("%s %s", KEY_PAIR, CFG_MODE_DELETE);
-    public static final String PAIR_COMPAT_REVISION = "2017-08-04";
 
     private static final Logger log = getLogger(PolatisFlowRuleProgrammable.class);
 
     @Override
     public Collection<FlowEntry> getFlowEntries() {
-        return parseConnections();
+        return parseConnections(this);
     }
 
     @Override
@@ -84,30 +69,6 @@
         return removeConnections(rules);
     }
 
-    private String getConnectionsFilter() {
-        return new StringBuilder(xmlOpen(KEY_CONNS_XMLNS))
-                .append(xmlClose(KEY_CONNS))
-                .toString();
-    }
-
-    private Collection<FlowEntry> parseConnections() {
-        log.debug("Fetch connections...");
-        String reply = netconfGet(handler(), getConnectionsFilter());
-        final String keyPairMode = String.format("%s.%s", KEY_DATA_CONNS, parseKeyPairCompat());
-        List<HierarchicalConfiguration> subtrees = configsAt(reply, keyPairMode);
-        ImmutableList.Builder<FlowEntry> connectionsBuilder = ImmutableList.builder();
-        for (HierarchicalConfiguration connection : subtrees) {
-            connectionsBuilder.add(new DefaultFlowEntry(parseConnection(connection), FlowEntry.FlowEntryState.ADDED));
-        }
-        return connectionsBuilder.build();
-    }
-
-    private FlowRule parseConnection(HierarchicalConfiguration cfg) {
-        return PolatisOpticalUtility.toFlowRule(this,
-                PortNumber.portNumber(cfg.getInt(KEY_SRC)),
-                PortNumber.portNumber(cfg.getInt(KEY_DST)));
-    }
-
     private Collection<FlowRule> applyConnections(Collection<FlowRule> rules) {
         return rules.stream()
                 .filter(c -> editConnection(c, CFG_MODE_MERGE))
@@ -118,7 +79,7 @@
         CrossConnects crossConnects = PolatisOpticalUtility.fromFlowRule(this, rule);
         final StringBuilder cfg = new StringBuilder(xmlOpen(KEY_CONNS_XMLNS));
         List<Pair> pairs = crossConnects.pair();
-        final String keyPairCompat = parseKeyPairCompat();
+        final String keyPairCompat = parseKeyPairCompat(this);
         final String keyPairMode = String.format("%s operation=\"%s\"", keyPairCompat, mode);
         pairs.forEach(p -> {
                 cfg.append(xmlOpen(keyPairMode))
@@ -140,24 +101,4 @@
                 .collect(Collectors.toList());
     }
 
-    private String parseKeyPairCompat() {
-        String rev = opticalRevision(handler());
-        if (rev == null) {
-            throw new IllegalStateException(new NetconfException("Failed to obtain the revision."));
-        }
-        String keyPairCompat;
-        try {
-            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-            Date date = sdf.parse(PAIR_COMPAT_REVISION);
-
-            if (date.compareTo(sdf.parse(rev)) > 0) {
-                keyPairCompat = KEY_PAIRS;
-            } else {
-                keyPairCompat = KEY_PAIR;
-            }
-        } catch (ParseException e) {
-            throw new IllegalArgumentException(new NetconfException(String.format("Incorrect date format: %s", rev)));
-        }
-        return keyPairCompat;
-    }
 }
diff --git a/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisInternalConnectivity.java b/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisInternalConnectivity.java
new file mode 100644
index 0000000..42fd5bb
--- /dev/null
+++ b/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisInternalConnectivity.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2016-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.polatis.netconf;
+
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.Port;
+import org.onosproject.net.PortNumber;
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.behaviour.InternalConnectivity;
+import org.onosproject.net.device.DeviceService;
+import org.onosproject.net.driver.AbstractHandlerBehaviour;
+import org.onosproject.net.flow.FlowEntry;
+import org.onosproject.net.flow.criteria.Criterion;
+import org.onosproject.net.flow.criteria.PortCriterion;
+import org.onosproject.net.flow.instructions.Instructions.OutputInstruction;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Collection;
+import java.util.stream.Collectors;
+import org.slf4j.Logger;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static org.slf4j.LoggerFactory.getLogger;
+import static org.onosproject.drivers.polatis.netconf.PolatisUtility.*;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PORTDIR;
+
+
+/**
+ * Implements InternalConnectivity behaviour for Polatis optical switches.
+ */
+public class PolatisInternalConnectivity extends AbstractHandlerBehaviour
+        implements InternalConnectivity {
+
+    private final Logger log = getLogger(getClass());
+
+    private static final String JSON_PEERPORT_PEER_KEY = "peer";
+    private static final String JSON_PEERPORT_PEER_DEVICEID_KEY = "id";
+    private static final String JSON_PEERPORT_PEER_PORTID_KEY = "port";
+    private static final String SCHEME_NAME = "linkdiscovery";
+
+    /**
+     * Constructor just used to initiate logging when InternalConnectivity behaviour is invoked.
+     */
+    public PolatisInternalConnectivity() {
+        log.debug("Running PolatisInternalConnectivity handler");
+    }
+
+    /**
+     * Returns boolean in response to test of whether 2 ports on a given device can be internally connected.
+     * <p>
+     * This is a callback method required by the InternalConnectivity behaviour.
+     * @param  inputPortNum  Input port number on device
+     * @param  outputPortNum Output port number on device
+     * @return               Indication whether internal connection can be made
+     */
+    @Override
+    public boolean testConnectivity(PortNumber inputPortNum, PortNumber outputPortNum) {
+
+        // NOTE: this is implemented symmetrically reflecting the fact that reverse propagation
+        // is possible through a Polatis switch
+        if (inputPortNum.equals(outputPortNum)) {
+            log.debug("Input and output ports cannot be one and the same");
+            return false;
+        }
+        DeviceId deviceID = handler().data().deviceId();
+        DeviceService deviceService = checkNotNull(this.handler().get(DeviceService.class));
+        Port inputPort = deviceService.getPort(new ConnectPoint(deviceID, inputPortNum));
+        Port outputPort = deviceService.getPort(new ConnectPoint(deviceID, outputPortNum));
+        if (!inputPort.isEnabled()) {
+            log.debug("Input port is DISABLED");
+            return false;
+        }
+        if (!outputPort.isEnabled()) {
+            log.debug("Output port is DISABLED");
+            return false;
+        }
+        if (!inputPort.annotations().value(KEY_PORTDIR).equals(VALUE_CC)) {
+            if (inputPort.annotations().value(KEY_PORTDIR).equals(outputPort.annotations().value(KEY_PORTDIR))) {
+                log.debug("Dual sided switch and provided input & output ports on same side");
+                return false;
+            }
+        }
+        // Check if either port is used in an active cross-connect
+        Set<PortNumber> usedPorts = getUsedPorts();
+        if (usedPorts.contains(inputPortNum)) {
+            log.debug("Input port {} is used in an active cross-connect", inputPortNum);
+            return false;
+        }
+        if (usedPorts.contains(outputPortNum)) {
+            log.debug("Output port {} is used in an active cross-connect", outputPortNum);
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Returns a set of possible output PortNumbers to which a given input port can be internally connected
+     * on a given device.
+     * <p>
+     * This is a callback method required by the InternalConnectivity behaviour.
+     * @param inputPortNum Input port number on device
+     * @return             List of possible output ports
+     */
+    @Override
+    public Set<PortNumber> getOutputPorts(PortNumber inputPortNum) {
+
+        // NOTE: in this implementation, inputPortNum is the supplied port number and
+        // can be an "input" port OR an "output" port
+        // This reflects the fact that reverse propagation is possible through a Polatis switch
+        // (output port -> input port)
+
+        Set<PortNumber> ports = new HashSet<PortNumber>();
+        Set<PortNumber> enabledPorts = new HashSet<PortNumber>();
+        Collection<FlowEntry> flowEntries = parseConnections(this);
+        // Flow entries are very simple for an all-optical circuit switch which doesn't multicast
+        // e.g. one selector (IN_PORT) and one action (set output port)
+        if (flowEntries.stream().map(flow -> ((PortCriterion) flow.selector()
+                                             .getCriterion(Criterion.Type.IN_PORT)).port())
+                                .collect(Collectors.toSet())
+                                .contains(inputPortNum) ||
+            flowEntries.stream().map(flow -> ((OutputInstruction) flow.treatment()
+                                             .allInstructions().get(0)).port())
+                                .collect(Collectors.toSet())
+                                .contains(inputPortNum)) {
+            log.warn("Queried port {} is already used in a cross-connect", inputPortNum);
+            return ports;
+        } else {
+            DeviceId deviceID = handler().data().deviceId();
+            DeviceService deviceService = checkNotNull(this.handler().get(DeviceService.class));
+            Port inputPort = deviceService.getPort(new ConnectPoint(deviceID, inputPortNum));
+            if (inputPort.annotations().value(KEY_PORTDIR).equals(VALUE_CC)) {
+                ports = deviceService.getPorts(deviceID).stream()
+                        .filter(p -> !p.equals(inputPortNum))
+                        .map(p -> p.number())
+                        .collect(Collectors.toSet());
+            } else {
+                ports = deviceService.getPorts(deviceID).stream()
+                        .filter((p) -> {
+                            Port port = deviceService.getPort(new ConnectPoint(deviceID, p.number()));
+                            return !port.annotations().value(KEY_PORTDIR).equals(
+                                inputPort.annotations().value(KEY_PORTDIR));
+                         })
+                        .map(p -> p.number())
+                        .collect(Collectors.toSet());
+            }
+            // Remove disabled ports
+            enabledPorts = ports.stream()
+                .filter(p -> deviceService.getPort(new ConnectPoint(deviceID, p)).isEnabled())
+                .collect(Collectors.toSet());
+        }
+        log.debug("Ports before filtering out used and disabled ones: " + ports);
+        return filterUsedPorts(enabledPorts, flowEntries);
+    }
+
+    /**
+     * Returns a set of possible input PortNumbers to which a given output port can be internally connected
+     * on a given device.
+     * <p>
+     * This is a callback method required by the InternalConnectivity behaviour.
+     * This just calls the getOutputPorts method since reverse path optical transmission is possible through
+     * a Polatis switch.
+     * @param outputPortNum Input port number on device
+     * @return              List of possible input ports
+     */
+    @Override
+    public Set<PortNumber> getInputPorts(PortNumber outputPortNum) {
+
+        return getOutputPorts(outputPortNum);
+    }
+
+    private Set<PortNumber> filterUsedPorts(Set<PortNumber> ports, Collection<FlowEntry> flowEntries) {
+
+        if (ports.isEmpty() || flowEntries.isEmpty()) {
+            return ports;
+        }
+        for (FlowEntry flowEntry : flowEntries) {
+            PortNumber inputPort = ((PortCriterion) flowEntry.selector().getCriterion(Criterion.Type.IN_PORT)).port();
+            ports.remove(inputPort);
+            PortNumber outputPort = ((OutputInstruction) flowEntry.treatment().allInstructions().get(0)).port();
+            ports.remove(outputPort);
+            log.debug("Cross-connection {}-{} removed from output port list", inputPort, outputPort);
+        }
+        log.debug("Ports after filtering out used ones: " + ports);
+        return ports;
+    }
+
+    private Set<PortNumber> getUsedPorts() {
+        Set<PortNumber> usedPorts = new HashSet<PortNumber>();
+        Collection<FlowEntry> flowEntries = parseConnections(this);
+        for (FlowEntry flowEntry : flowEntries) {
+            usedPorts.add(((PortCriterion) flowEntry.selector().getCriterion(Criterion.Type.IN_PORT)).port());
+            usedPorts.add(((OutputInstruction) flowEntry.treatment().allInstructions().get(0)).port());
+        }
+        return usedPorts;
+    }
+}
diff --git a/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisLinkDiscovery.java b/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisLinkDiscovery.java
new file mode 100644
index 0000000..3640a2a
--- /dev/null
+++ b/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisLinkDiscovery.java
@@ -0,0 +1,247 @@
+/*
+ * Copyright 2016-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.polatis.netconf;
+
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.Device;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.Link;
+import org.onosproject.net.device.PortDescription;
+import org.onosproject.net.PortNumber;
+import org.onosproject.net.Port;
+import org.onosproject.net.DefaultAnnotations;
+import org.onosproject.net.behaviour.LinkDiscovery;
+import org.onosproject.net.device.DeviceService;
+import org.onosproject.net.driver.AbstractHandlerBehaviour;
+import org.onosproject.net.driver.DriverHandler;
+import org.onosproject.net.link.DefaultLinkDescription;
+import org.onosproject.net.link.LinkDescription;
+import org.onosproject.netconf.NetconfController;
+import org.onosproject.netconf.NetconfSession;
+import org.slf4j.Logger;
+
+import java.util.Set;
+import java.util.HashSet;
+import java.util.List;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.core.JsonProcessingException;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static org.slf4j.LoggerFactory.getLogger;
+
+import static org.onosproject.drivers.polatis.netconf.PolatisUtility.*;
+
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.netconfGet;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PORTPEER;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PORTDIR;
+
+
+/**
+ * Reads peer-port fields from a Polatis switch, parses them and returns a set of LinkDescriptions.
+ */
+public class PolatisLinkDiscovery extends AbstractHandlerBehaviour implements LinkDiscovery {
+
+    private final Logger log = getLogger(getClass());
+
+    private static final String JSON_PEERPORT_PEER_KEY = "peer";
+    private static final String JSON_PEERPORT_PEER_DEVICEID_KEY = "id";
+    private static final String JSON_PEERPORT_PEER_PORTID_KEY = "port";
+    private static final String SCHEME_NAME = "linkdiscovery";
+
+    /**
+     * Constructor just used to initiate logging when LinkDiscovery behaviour is invoked.
+     */
+    public PolatisLinkDiscovery() {
+        log.debug("Running PolatisLinkDiscovery handler");
+    }
+
+    /**
+     * Returns the set of LinkDescriptions originating from a Polatis switch.
+     * <p>
+     * This is the callback required by the LinkDiscovery behaviour.
+     * @return Set of outbound unidirectional links as LinkDescriptions
+     */
+    @Override
+    public Set<LinkDescription> getLinks() {
+        Set<LinkDescription> links = new HashSet<>();
+        DeviceId deviceID = handler().data().deviceId();
+        log.debug("*** Checking peer-port fields on device {}", deviceID.toString());
+        NetconfController controller = checkNotNull(handler().get(NetconfController.class));
+        if (controller == null || controller.getDevicesMap() == null
+                || controller.getDevicesMap().get(deviceID) == null) {
+            log.warn("NETCONF session to device {} not yet established, will try again...", deviceID);
+            return links;
+        }
+        DeviceService deviceService = checkNotNull(handler().get(DeviceService.class));
+        Device device = deviceService.getDevice(deviceID);
+        int numInputPorts = Integer.parseInt(device.annotations().value(KEY_INPUTPORTS));
+        int numOutputPorts = Integer.parseInt(device.annotations().value(KEY_OUTPUTPORTS));
+        log.trace("Talking to device " + handler().data().deviceId().toString());
+        String reply = netconfGet(handler(), getPortsFilter());
+        // Get port details from switch as PortDescription objects
+        List<PortDescription> ports = parsePorts(reply, numInputPorts, numOutputPorts);
+        int numPeerPortEntries = 0;
+        int numPortsScanned = 0;
+        ObjectMapper mapper = new ObjectMapper();
+        for (PortDescription port : ports) {
+            numPortsScanned++;
+            if (deviceService.getPort(new ConnectPoint(deviceID, port.portNumber())).isEnabled()) {
+                String peerPortData = port.annotations().value(KEY_PORTPEER);
+                if (!peerPortData.equals("")) {
+                    numPeerPortEntries++;
+                    if (peerPortData.charAt(0) == '{') {
+                        ConnectPoint nearEndCP = new ConnectPoint(deviceID, port.portNumber());
+                        ConnectPoint farEndCP = null;
+                        try {
+                            farEndCP = parsePeerportDataForCP(mapper.readTree(peerPortData));
+                        } catch (JsonProcessingException jpe) {
+                            log.debug("Error processing peer-port JSON: {}", jpe.toString());
+                        }
+                        if (farEndCP != null) {
+                            log.trace("Found ref on port {} to peer ConnectPoint: {}", port.portNumber(),
+                                      farEndCP.toString());
+                            if (checkPeer(nearEndCP, farEndCP, this.handler(), true)) {
+                                log.trace("Peer {} checks out", farEndCP.toString());
+                                // now add link to Set<LinkDescription>
+                                DefaultAnnotations annotations = DefaultAnnotations.builder()
+                                                                 .set(KEY_LINKBIDIR, VALUE_FALSE)
+                                                                 .set(KEY_LINKALLOWED, VALUE_TRUE)
+                                                                 .build();
+                                ConnectPoint aEndCP = nearEndCP;
+                                ConnectPoint bEndCP = farEndCP;
+                                // reverse direction of unidirectional link if near-end port is INPUT
+                                if (port.annotations().value(KEY_PORTDIR).equals(VALUE_INPUT)) {
+                                    aEndCP = farEndCP;
+                                    bEndCP = nearEndCP;
+                                }
+                                LinkDescription newLinkDesc = new DefaultLinkDescription(aEndCP, bEndCP,
+                                                                  Link.Type.OPTICAL, true, annotations);
+                                links.add(newLinkDesc);
+                                log.debug("Adding link {}", newLinkDesc);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        log.debug("Scanned {} ports, {} had peer-port entries, {} {} valid", numPortsScanned, numPeerPortEntries,
+                  links.size(), links.size() == 1 ? "is" : "are");
+        log.trace("Links found on this iteration: {}", links);
+        return links;
+    }
+
+    private ConnectPoint parsePeerportDataForCP(JsonNode peerData) {
+    DeviceId idTo = DeviceId.NONE;
+    PortNumber portNumTo = PortNumber.portNumber(0L);
+        JsonNode peer = peerData.get(JSON_PEERPORT_PEER_KEY);
+        if (peer != null) {
+            log.trace("Found peer element: {}", peer.toString());
+            JsonNode devIDNode = peer.get(JSON_PEERPORT_PEER_DEVICEID_KEY);
+            if (devIDNode != null) {
+                String devID = peer.get(JSON_PEERPORT_PEER_DEVICEID_KEY).asText();
+                log.trace("Found devID: {}", devID);
+                idTo = DeviceId.deviceId(devID);
+                JsonNode portNode = peer.get(JSON_PEERPORT_PEER_PORTID_KEY);
+                if (portNode != null) {
+                    portNumTo = PortNumber.portNumber(portNode.asInt());
+                        if (portNumTo.toLong() != 0) {
+                            log.trace("Found legal peer JSON element: {}={}, {}={}", JSON_PEERPORT_PEER_DEVICEID_KEY,
+                                      idTo.toString(), JSON_PEERPORT_PEER_PORTID_KEY, portNumTo.toString());
+                        } else {
+                            log.trace("Malformed peer-port JSON: non-numerical or zero port value");
+                        }
+                    } else {
+                        log.trace("Malformed peer-port JSON: unable to find \"{}\" key in {}",
+                                  JSON_PEERPORT_PEER_PORTID_KEY, peer.toString());
+                    }
+                } else {
+                    log.trace("Malformed peer-port JSON: unable to find \"{}\" key in {}",
+                              JSON_PEERPORT_PEER_DEVICEID_KEY, peer.toString());
+                }
+            } else {
+                log.trace("Malformed peer-port JSON: unable to find \"{}\" key in {}", JSON_PEERPORT_PEER_KEY,
+                          peerData.toString());
+            }
+        return (idTo.equals(DeviceId.NONE) || portNumTo.toLong() == 0) ? null : new ConnectPoint(idTo, portNumTo);
+    }
+
+    private boolean checkPeer(ConnectPoint nearEndCP, ConnectPoint peerCP, DriverHandler handler, boolean direct) {
+        // check peerCP exists and is available (either via device service or direct from device)
+        DeviceId peerDeviceID = peerCP.deviceId();
+        boolean result = false;
+        DeviceService deviceService = checkNotNull(handler.get(DeviceService.class));
+        if (deviceService.isAvailable(peerDeviceID)) {
+            log.trace("Peer device {} exists", peerDeviceID.toString());
+            Device device = deviceService.getDevice(peerDeviceID);
+            int numInputPorts = Integer.parseInt(device.annotations().value(KEY_INPUTPORTS));
+            int numOutputPorts = Integer.parseInt(device.annotations().value(KEY_OUTPUTPORTS));
+            List<Port> ports = deviceService.getPorts(peerDeviceID);
+            PortNumber farEndPortNum = peerCP.port();
+            Port port = deviceService.getPort(peerCP);
+            if (port != null) {
+                if (port.isEnabled()) {
+                    log.trace("Peer port {} exists", port.number().toLong());
+                    // check far end peer-port entry (use device service or retrieve direct from switch)
+                    Port peerPort = deviceService.getPort(peerDeviceID, farEndPortNum);
+                    String farEndPortPeerportData = peerPort.annotations().value(KEY_PORTPEER);
+                    if (direct) {
+                        log.trace("Checking device {} DIRECT", handler.data().deviceId());
+                        //A bit of a cludge it seems but temporarily open a new NETCONF session to far-end device
+                        NetconfController controller = checkNotNull(handler.get(NetconfController.class));
+                        NetconfSession farEndDeviceSession = controller.getDevicesMap().get(peerDeviceID).getSession();
+                        String reply = netconfGet(farEndDeviceSession, getPortFilter(farEndPortNum));
+                        PortDescription peerPortDescDirect = parsePorts(reply, numInputPorts, numOutputPorts).get(0);
+                        log.trace("peerPortDesc from device: " + peerPortDescDirect.toString());
+                        String farEndPortPeerportDataDirect = peerPortDescDirect.annotations().value(KEY_PORTPEER);
+                        farEndPortPeerportData = farEndPortPeerportDataDirect;
+                    }
+                    if (!farEndPortPeerportData.equals("")) {
+                        if (farEndPortPeerportData.charAt(0) == '{') {
+                            log.trace("Far-end peer-port value:" + farEndPortPeerportData);
+                            ObjectMapper mapper = new ObjectMapper();
+                            ConnectPoint checkNearEndCP = null;
+                            try {
+                                checkNearEndCP = parsePeerportDataForCP(mapper.readTree(farEndPortPeerportData));
+                            } catch (JsonProcessingException jpe) {
+                                log.trace("Error processing peer-port JSON: {}", jpe.toString());
+                            }
+                            if (nearEndCP.equals(checkNearEndCP)) {
+                                log.trace("Reciprocal peer port entries match: nearEnd={}, farEnd={}", nearEndCP,
+                                          checkNearEndCP);
+                                result = true;
+                            } else {
+                                log.trace("Peer-port entry for far-end port ({}) does not match near-end " +
+                                          "port number ({})", checkNearEndCP, nearEndCP);
+                            }
+                        }
+                    } else {
+                        log.trace("Null peer-port entry for far-end port ({})", peerCP);
+                    }
+                } else {
+                    log.trace("Peer port {} is DISABLED", port);
+                }
+            } else {
+                log.trace("Peer port {} does not exist", port);
+            }
+        } else {
+            log.trace("Far end device does not exist or is not available");
+        }
+        return result;
+    }
+}
diff --git a/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisNetconfUtility.java b/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisNetconfUtility.java
index ee1fe39..4f75923 100644
--- a/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisNetconfUtility.java
+++ b/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisNetconfUtility.java
@@ -43,16 +43,24 @@
     public static final String KEY_POLATIS_XMLNS = "xmlns=\"http://www.polatis.com/yang/polatis-switch\"";
     public static final String KEY_DATA = "data";
     public static final String KEY_PORT = "port";
+    public static final String KEY_PAIR = "pair";
+    public static final String KEY_PAIRS = "pairs";
     public static final String KEY_PORTID = "port-id";
+    public static final String KEY_PORTPEER = "portPeer";
+    public static final String KEY_PORTDIR = "portDir";
     public static final String KEY_PORTCONFIG = "port-config";
     public static final String KEY_SYSTEMALARMS = "system-alarms";
     public static final String KEY_ALARM = "alarm";
     public static final String KEY_CONNS = "cross-connects";
     public static final String KEY_PRODINF = "product-information";
+    public static final String KEY_PORTSETSTATE = "port-set-state";
+    public static final String KEY_RPCREPLY = "rpc-reply";
+    public static final String KEY_OK = "<ok/>";
     public static final String KEY_PORTCONFIG_XMLNS = String.format("%s %s", KEY_PORTCONFIG, KEY_XMLNS);
     public static final String KEY_SYSTEMALARMS_XMLNS = String.format("%s %s", KEY_SYSTEMALARMS, KEY_POLATIS_XMLNS);
     public static final String KEY_CONNS_XMLNS = String.format("%s %s", KEY_CONNS, KEY_XMLNS);
     public static final String KEY_PRODINF_XMLNS = String.format("%s %s", KEY_PRODINF, KEY_XMLNS);
+    public static final String KEY_PORTSETSTATE_XMLNS = String.format("%s %s", KEY_PORTSETSTATE, KEY_XMLNS);
     public static final String KEY_DATA_CONNS = String.format("%s.%s", KEY_DATA, KEY_CONNS);
     public static final String KEY_DATA_PRODINF = String.format("%s.%s", KEY_DATA, KEY_PRODINF);
     public static final String KEY_DATA_PORTCONFIG = String.format("%s.%s.%s", KEY_DATA, KEY_PORTCONFIG, KEY_PORT);
@@ -69,7 +77,7 @@
 
     public static final String CFG_MODE_MERGE = "merge";
 
-    private static final Logger log = getLogger(PolatisFlowRuleProgrammable.class);
+    private static final Logger log = getLogger(PolatisDeviceDescription.class);
 
     private PolatisNetconfUtility() {
     }
@@ -93,6 +101,23 @@
     }
 
     /**
+     * Retrieves session reply information for get operation.
+     *
+     * @param session explicit NETCONF session
+     * @param filter the filter string of xml content
+     * @return the reply string
+     */
+    public static String netconfGet(NetconfSession session, String filter) {
+        String reply;
+        try {
+            reply = session.get(filter, null);
+        } catch (NetconfException e) {
+            throw new IllegalStateException(new NetconfException("Failed to retrieve configuration.", e));
+        }
+        return reply;
+    }
+
+    /**
      * Retrieves session reply information for get config operation.
      *
      * @param handler parent driver handler
@@ -130,6 +155,24 @@
     }
 
     /**
+     * Makes a NETCONF RPC.
+     *
+     * @param handler parent driver handler
+     * @param body body of RPC
+     * @return the reply string
+     */
+    public static String netconfRpc(DriverHandler handler, String body) {
+        NetconfSession session = getNetconfSession(handler);
+        String reply;
+        try {
+            reply = session.doWrappedRpc(body);
+        } catch (NetconfException e) {
+            throw new IllegalStateException(new NetconfException("Failed to make RPC..", e));
+        }
+        return reply;
+    }
+
+    /**
      * Retrieves specified node hierarchical configuration from the xml information.
      *
      * @param content the xml information
@@ -139,7 +182,7 @@
     public static HierarchicalConfiguration configAt(String content, String key) {
         HierarchicalConfiguration info;
         try {
-            HierarchicalConfiguration cfg = XmlConfigParser.loadXmlString(content);
+            HierarchicalConfiguration cfg = XmlConfigParser.loadXmlString(content, false);
             info = cfg.configurationAt(key);
         } catch (IllegalArgumentException e) {
             // Accept null for information polling
@@ -158,8 +201,9 @@
     public static List<HierarchicalConfiguration> configsAt(String content, String key) {
         List<HierarchicalConfiguration> info;
         try {
-            HierarchicalConfiguration cfg = XmlConfigParser.loadXmlString(content);
+            HierarchicalConfiguration cfg = XmlConfigParser.loadXmlString(content, false);
             info = cfg.configurationsAt(key);
+
         } catch (IllegalArgumentException e) {
             // Accept empty for information polling
             return ImmutableList.of();
diff --git a/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisPortAdmin.java b/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisPortAdmin.java
new file mode 100644
index 0000000..55d88d2
--- /dev/null
+++ b/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisPortAdmin.java
@@ -0,0 +1,92 @@
+/*
+ * 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.polatis.netconf;
+
+import org.onosproject.net.PortNumber;
+import org.onosproject.net.behaviour.PortAdmin;
+import org.onosproject.net.driver.AbstractHandlerBehaviour;
+import org.slf4j.Logger;
+
+import java.util.concurrent.CompletableFuture;
+
+import static org.slf4j.LoggerFactory.getLogger;
+
+import static org.onosproject.drivers.polatis.netconf.PolatisUtility.*;
+
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.netconfGet;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.netconfRpc;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_OK;
+
+
+/**
+ * Handles port administration for Polatis switches using NETCONF.
+ */
+public class PolatisPortAdmin extends AbstractHandlerBehaviour implements PortAdmin {
+
+    public static final Logger log = getLogger(PolatisPortAdmin.class);
+
+
+    /**
+     * Sets the administrative state of the given port to the given value.
+     *
+     * @param portNumber Port number
+     * @param state      State, PC_ENABLED or PC_DISABLED
+     * @return           True if successfully set
+     */
+    private CompletableFuture<Boolean> setAdminState(PortNumber portNumber, String state) {
+
+        boolean result = false;
+        try {
+            log.debug("Sending RPC to {} to set port {} to {}", handler().data().deviceId(), portNumber, state);
+            String cmdBody = getRpcSetPortStateBody(state.equals(PORT_ENABLED) ? KEY_ENABLE : KEY_DISABLE, portNumber);
+            String response = netconfRpc(handler(),
+                              getRpcSetPortStateBody(state.equals(PORT_ENABLED) ? KEY_ENABLE : KEY_DISABLE,
+                              portNumber));
+            log.trace("Response from RPC: " + response);
+            result = response.contains(KEY_OK);
+        } catch (IllegalStateException e) {
+            log.error("Unable to set port admin state for {}/{} to {}", handler().data().deviceId(), portNumber,
+                      state, e);
+        }
+        return CompletableFuture.completedFuture(result);
+    }
+
+    @Override
+    public CompletableFuture<Boolean> enable(PortNumber portNumber) {
+        return setAdminState(portNumber, PORT_ENABLED);
+    }
+
+    @Override
+    public CompletableFuture<Boolean> disable(PortNumber portNumber) {
+        return setAdminState(portNumber, PORT_DISABLED);
+    }
+
+    @Override
+    public CompletableFuture<Boolean> isEnabled(PortNumber portNumber) {
+        boolean result = false;
+        try {
+            log.debug("Querying port state for port {} from device {}", portNumber, handler().data().deviceId());
+            String response = netconfGet(handler(), getPortStatusFilter(portNumber));
+            result = response.equals(PORT_ENABLED);
+            log.debug("Port {}/{} is {}", handler().data().deviceId(), portNumber, result);
+        } catch (IllegalStateException e) {
+            log.error("Unable to query port state for port {} from device {}", portNumber,
+                      handler().data().deviceId(), e);
+        }
+        return CompletableFuture.completedFuture(result);
+    }
+}
diff --git a/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisUtility.java b/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisUtility.java
new file mode 100644
index 0000000..ee55715
--- /dev/null
+++ b/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisUtility.java
@@ -0,0 +1,317 @@
+/*
+ * Copyright 2017 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.polatis.netconf;
+
+import org.apache.commons.configuration.HierarchicalConfiguration;
+import org.onlab.util.Frequency;
+import org.onlab.util.Spectrum;
+
+import org.slf4j.Logger;
+import static org.slf4j.LoggerFactory.getLogger;
+
+import com.google.common.collect.ImmutableList;
+import org.onosproject.net.PortNumber;
+import org.onosproject.net.device.PortDescription;
+import org.onosproject.net.AnnotationKeys;
+import org.onosproject.net.DefaultAnnotations;
+import org.onosproject.net.flow.DefaultFlowEntry;
+import org.onosproject.net.flow.FlowEntry;
+import org.onosproject.net.flow.FlowRule;
+import org.onosproject.net.driver.HandlerBehaviour;
+import org.onosproject.netconf.NetconfException;
+
+import static org.onosproject.net.optical.device.OmsPortHelper.omsPortDescription;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.configsAt;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.netconfGet;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.xmlOpen;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.xml;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.xmlClose;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.xmlEmpty;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.opticalRevision;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PAIR;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PAIRS;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PORT;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PORTID;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PORTPEER;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PORTDIR;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PORTCONFIG;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PRODINF;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_CONNS;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PORTSETSTATE;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PORTCONFIG_XMLNS;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PRODINF_XMLNS;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_CONNS_XMLNS;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_PORTSETSTATE_XMLNS;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_DATA_PORTCONFIG;
+import static org.onosproject.drivers.polatis.netconf.PolatisNetconfUtility.KEY_DATA_CONNS;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.text.ParseException;
+
+
+/**
+ * Polatis common utilities.
+ */
+public final class PolatisUtility {
+
+    public static final String DEFAULT_MANUFACTURER = "Polatis";
+    public static final String DEFAULT_DESCRIPTION_DATA = "Unknown";
+    public static final String KEY_MANUFACTURER = "manufacturer";
+    public static final String KEY_HWVERSION = "model-name";
+    public static final String KEY_SWVERSION = "software-version";
+    public static final String KEY_SERIALNUMBER = "serial-number";
+    public static final String KEY_INPUTPORTS = "inputPorts";
+    public static final String KEY_OUTPUTPORTS = "outputPorts";
+    public static final String KEY_PORTSTATUS = "status";
+    public static final String KEY_ENABLE = "ENABLE";
+    public static final String KEY_DISABLE = "DISABLE";
+    public static final String KEY_INGRESS = "ingress";
+    public static final String KEY_EGRESS = "egress";
+    public static final String VALUE_TRUE = "true";
+    public static final String VALUE_FALSE = "false";
+    public static final String VALUE_INPUT = "INPUT";
+    public static final String VALUE_OUTPUT = "OUTPUT";
+    public static final String VALUE_UNKNOWN = "UNKNOWN";
+    public static final String VALUE_CC = "CC";
+    public static final String KEY_RPCENABLE = "port-enab";
+    public static final String KEY_RPCDISABLE = "port-disab";
+    public static final String PORT_ENABLED = "ENABLED";
+    public static final String PORT_DISABLED = "DISABLED";
+    public static final String KEY_PORTLABEL = "label";
+    public static final String KEY_PEERPORT = "peer-port";
+    public static final String KEY_LINKBIDIR = "bidirectional";
+    public static final String KEY_LINKALLOWED = "allowed";
+    public static final String KEY_SRC = "ingress";
+    public static final String KEY_DST = "egress";
+    public static final String PAIR_COMPAT_REVISION = "2017-08-04";
+
+    public static final int POLATIS_NUM_OF_WAVELENGTHS = 39;
+
+    private static final Logger log = getLogger(PolatisDeviceDescription.class);
+
+    private PolatisUtility() {
+    }
+
+    /**
+     * Returns XML subtree filter term for NETCONF get[-config] RPC for retrieving product info from a Polatis switch.
+     *
+     * @return Filter term as string
+     */
+    public static String getProdInfoFilter() {
+        return new StringBuilder(xmlOpen(KEY_PRODINF_XMLNS))
+            .append(xmlClose(KEY_PRODINF))
+            .toString();
+    }
+
+    /**
+     * Returns XML subtree filter term for NETCONF get[-config] RPC for retrieving cross-connections on a
+     * Polatis switch.
+     *
+     * @return Filter term as string
+     */
+    public static String getConnectionsFilter() {
+        return new StringBuilder(xmlOpen(KEY_CONNS_XMLNS))
+                .append(xmlClose(KEY_CONNS))
+                .toString();
+    }
+
+    /**
+     * Returns XML subtree filter term for NETCONF get[-config] RPC for retrieving config and state data for all ports
+     * on a Polatis switch.
+     *
+     * @return Filter term as string
+     */
+    public static String getPortsFilter() {
+        return new StringBuilder(xmlOpen(KEY_PORTCONFIG_XMLNS))
+            .append(xmlOpen(KEY_PORT))
+            .append(xmlEmpty(KEY_PORTID))
+            .append(xmlEmpty(KEY_PORTSTATUS))
+            .append(xmlEmpty(KEY_PORTLABEL))
+            .append(xmlEmpty(KEY_PEERPORT))
+            .append(xmlClose(KEY_PORT))
+            .append(xmlClose(KEY_PORTCONFIG))
+            .toString();
+    }
+
+    /**
+     * Returns XML subtree filter term for NETCONF get[-config] RPC for retrieving config and state data for a specific
+     * port on a Polatis switch.
+     *
+     * @param portNum Port number as PortNumber object
+     * @return        Filter term as string
+     */
+    public static String getPortFilter(PortNumber portNum) {
+        return new StringBuilder(xmlOpen(KEY_PORTCONFIG_XMLNS))
+            .append(xmlOpen(KEY_PORT))
+            .append(xml(KEY_PORTID, portNum.toString()))
+            .append(xmlEmpty(KEY_PORTSTATUS))
+            .append(xmlEmpty(KEY_PORTLABEL))
+            .append(xmlEmpty(KEY_PEERPORT))
+            .append(xmlClose(KEY_PORT))
+            .append(xmlClose(KEY_PORTCONFIG))
+            .toString();
+    }
+
+    /**
+     * Returns XML subtree filter term for NETCONF get RPC for retrieving state data (only) for a specific port on a
+     * Polatis switch.
+     *
+     * @param portNum Port number as PortNumber object
+     * @return        Filter term as string
+     */
+    public static String getPortStatusFilter(PortNumber portNum) {
+        return new StringBuilder(xmlOpen(KEY_PORTCONFIG_XMLNS))
+            .append(xmlOpen(KEY_PORT))
+            .append(xml(KEY_PORTID, portNum.toString()))
+            .append(xmlEmpty(KEY_PORTSTATUS))
+            .append(xmlClose(KEY_PORT))
+            .append(xmlClose(KEY_PORTCONFIG))
+            .toString();
+    }
+
+     /**
+     * Returns XML body for NETCONF RPC for setting the admin status of a specific port on a Polatis switch.
+     *
+     * @param action  Action (enable/disable) to be performed on port as string
+     * @param portNum Port number as PortNumber object
+     * @return        RPC body (XML) as string
+     */
+    public static String getRpcSetPortStateBody(String action, PortNumber portNum) {
+        return new StringBuilder(xmlOpen(KEY_PORTSETSTATE_XMLNS))
+            .append(xmlOpen(action.equals(KEY_ENABLE) ? KEY_RPCENABLE : KEY_RPCDISABLE))
+            .append(portNum.toString())
+            .append(xmlClose(action.equals(KEY_ENABLE) ? KEY_RPCENABLE : KEY_RPCDISABLE))
+            .append(xmlClose(KEY_PORTSETSTATE))
+            .toString();
+    }
+
+     /**
+     * Returns a list of PortDescriptions from parsing the content of the reply to a get[-config] call to a
+     * Polatis switch.
+     *
+     * @param content        XML to be parsed as string
+     * @param numInputPorts  Number of input ports
+     * @param numOutputPorts Number of output ports
+     * @return               List of ports as PortDescription objects
+     */
+    public static List<PortDescription> parsePorts(String content, int numInputPorts, int numOutputPorts) {
+        List<HierarchicalConfiguration> subtrees = configsAt(content, KEY_DATA_PORTCONFIG);
+        List<PortDescription> portDescriptions = new ArrayList<PortDescription>();
+        for (HierarchicalConfiguration portConfig : subtrees) {
+            PortDescription parsedPort = parsePort(portConfig, numInputPorts, numOutputPorts == 0 ? true : false);
+            portDescriptions.add(parsedPort);
+        }
+        return portDescriptions;
+    }
+
+    /**
+     * Returns a single PortDescription from parsing a HierarchicalConfiguration object containing a Polatis switch
+     * port config.
+     *
+     * @param cfg            Single port as HierarchicalConfiguration object
+     * @param numInputPorts  Number of input ports
+     * @param isConfigurable Switch is CC
+     * @return               Single port as PortDescription object
+     */
+    public static PortDescription parsePort(HierarchicalConfiguration cfg, int numInputPorts, boolean isConfigurable) {
+        PortNumber portNumber = PortNumber.portNumber(cfg.getLong(KEY_PORTID));
+        String portType = VALUE_UNKNOWN;
+        if (isConfigurable) {
+            portType = VALUE_CC;
+        } else {
+            portType = portNumber.toLong() > numInputPorts ? VALUE_OUTPUT : VALUE_INPUT;
+        }
+        String peerPort = cfg.getString(KEY_PEERPORT);
+        DefaultAnnotations annotations = DefaultAnnotations.builder()
+                .set(AnnotationKeys.PORT_NAME, cfg.getString(KEY_PORTLABEL))
+                .set(KEY_PORTPEER, cfg.getString(KEY_PEERPORT))
+                .set(KEY_PORTDIR, portType)
+                .build();
+        return omsPortDescription(portNumber,
+                cfg.getString(KEY_PORTSTATUS).equals(PORT_ENABLED),
+                Spectrum.U_BAND_MIN, Spectrum.O_BAND_MAX,
+                Frequency.ofGHz(6_25), annotations);
+    }
+
+    /**
+     * Returns flow entries representing current cross-connections on a Polatis optical switch.
+     *
+     * @param behaviour HandlerBehaviour object associated with device being queried
+     * @return          Cross-connections as a collection of FlowEntry objects
+     */
+    public static Collection<FlowEntry> parseConnections(HandlerBehaviour behaviour) {
+        log.debug("Fetch connections...");
+        String reply = netconfGet(behaviour.handler(), getConnectionsFilter());
+        final String keyPairMode = String.format("%s.%s", KEY_DATA_CONNS, parseKeyPairCompat(behaviour));
+        List<HierarchicalConfiguration> subtrees = configsAt(reply, keyPairMode);
+        ImmutableList.Builder<FlowEntry> connectionsBuilder = ImmutableList.builder();
+        for (HierarchicalConfiguration connection : subtrees) {
+            connectionsBuilder.add(new DefaultFlowEntry(parseConnection(connection, behaviour),
+                                   FlowEntry.FlowEntryState.ADDED));
+        }
+        return connectionsBuilder.build();
+    }
+
+    /**
+     * Returns single cross-connection as FlowRule object from parsing HierarchicalConfiguration object.
+     *
+     * @param cfg       Single cross-connection as XML encoded in HierarchicalConfiguration object
+     * @param behaviour HandlerBehaviour object associated with device from which cross-connection has been retrieved
+     * @return          Cross-connection as a FlowEntry object
+     */
+    public static FlowRule parseConnection(HierarchicalConfiguration cfg, HandlerBehaviour behaviour) {
+        return PolatisOpticalUtility.toFlowRule(behaviour,
+                PortNumber.portNumber(cfg.getInt(KEY_SRC)),
+                PortNumber.portNumber(cfg.getInt(KEY_DST)));
+    }
+
+    /**
+     * Returns string containing the correct name of the YANG list node containing the cross-connections on a specific
+     * Polatis optical switch.
+     * <p>
+     * This handles the backwards incompatible change ('pairs' to 'pair') introduced in the Polatis optical-switch
+     * YANG module in revision 2017-08-04
+     *
+     * @param behaviour HandlerBehaviour object associated with the ONOS device representing a particular Polatis
+     *                  optical switch
+     * @return          Correct YANG list node name as string
+     */
+    public static String parseKeyPairCompat(HandlerBehaviour behaviour) {
+        String rev = opticalRevision(behaviour.handler());
+        if (rev == null) {
+            throw new IllegalStateException(new NetconfException("Failed to obtain the revision."));
+        }
+        String keyPairCompat;
+        try {
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            Date date = sdf.parse(PAIR_COMPAT_REVISION);
+
+            if (date.compareTo(sdf.parse(rev)) > 0) {
+                keyPairCompat = KEY_PAIRS;
+            } else {
+                keyPairCompat = KEY_PAIR;
+            }
+        } catch (ParseException e) {
+            throw new IllegalArgumentException(new NetconfException(String.format("Incorrect date format: %s", rev)));
+        }
+        return keyPairCompat;
+    }
+}
diff --git a/drivers/polatis/netconf/src/main/resources/polatis-drivers.xml b/drivers/polatis/netconf/src/main/resources/polatis-drivers.xml
index b1a8d45..e22bd79 100644
--- a/drivers/polatis/netconf/src/main/resources/polatis-drivers.xml
+++ b/drivers/polatis/netconf/src/main/resources/polatis-drivers.xml
@@ -21,6 +21,12 @@
                    impl="org.onosproject.net.optical.DefaultOpticalDevice"/>
         <behaviour api="org.onosproject.net.device.DeviceDescriptionDiscovery"
                    impl="org.onosproject.drivers.polatis.netconf.PolatisDeviceDescription"/>
+        <behaviour api="org.onosproject.net.behaviour.LinkDiscovery"
+		   impl="org.onosproject.drivers.polatis.netconf.PolatisLinkDiscovery"/>
+	<behaviour api="org.onosproject.net.behaviour.PortAdmin"
+                   impl="org.onosproject.drivers.polatis.netconf.PolatisPortAdmin"/>
+        <behaviour api="org.onosproject.net.behaviour.InternalConnectivity"
+                   impl="org.onosproject.drivers.polatis.netconf.PolatisInternalConnectivity"/>
         <behaviour api="org.onosproject.net.behaviour.PowerConfig"
                    impl="org.onosproject.drivers.polatis.netconf.PolatisPowerConfig"/>
         <behaviour api="org.onosproject.net.flow.FlowRuleProgrammable"
