diff --git a/drivers/zte/BUILD b/drivers/zte/BUILD
new file mode 100644
index 0000000..b560a12
--- /dev/null
+++ b/drivers/zte/BUILD
@@ -0,0 +1,43 @@
+COMPILE_DEPS = CORE_DEPS + JACKSON + [
+    "@commons_jxpath//jar",
+    "@javax_ws_rs_api//jar",
+    "@httpcore_osgi//jar",
+    "//core/store/serializers:onos-core-serializers",
+    "//drivers/utilities:onos-drivers-utilities",
+    "//models/openconfig:onos-models-openconfig",
+    "//protocols/netconf/api:onos-protocols-netconf-api",
+    "//protocols/rest/api:onos-protocols-rest-api",
+    "//apps/odtn/api:onos-apps-odtn-api",
+    "//apps/optical-model:onos-apps-optical-model",
+    "//drivers/optical:onos-drivers-optical",
+]
+
+BUNDLES = [
+    ":onos-drivers-zte",
+    "//drivers/utilities:onos-drivers-utilities",
+]
+
+osgi_jar_with_tests(
+    resources = glob(["src/main/resources/**"]),
+    resources_root = "src/main/resources",
+    deps = COMPILE_DEPS,
+)
+
+onos_app(
+    app_name = "org.onosproject.drivers.zte",
+    category = "Drivers",
+    description = "Adds support for ZTE devices.",
+    included_bundles = BUNDLES,
+    required_apps = [
+        "org.onosproject.netconf",
+        "org.onosproject.restsb",
+        "org.onosproject.netconf",
+        "org.onosproject.config",
+        "org.onosproject.odtn-api",
+        "org.onosproject.drivers.netconf",
+        "org.onosproject.drivers.optical",
+        "org.onosproject.optical-model",
+    ],
+    title = "ZTE Drivers",
+    url = "http://onosproject.org",
+)
diff --git a/drivers/zte/src/main/java/org/onosproject/drivers/zte/ZteDeviceDiscoveryImpl.java b/drivers/zte/src/main/java/org/onosproject/drivers/zte/ZteDeviceDiscoveryImpl.java
new file mode 100644
index 0000000..9f23f7b
--- /dev/null
+++ b/drivers/zte/src/main/java/org/onosproject/drivers/zte/ZteDeviceDiscoveryImpl.java
@@ -0,0 +1,225 @@
+/*
+ * Copyright 2019-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.zte;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.io.CharSource;
+import org.apache.commons.configuration.HierarchicalConfiguration;
+import org.apache.commons.configuration.XMLConfiguration;
+import org.apache.commons.configuration.tree.xpath.XPathExpressionEngine;
+import org.onlab.packet.ChassisId;
+import org.onosproject.drivers.utilities.XmlConfigParser;
+import org.onosproject.net.ChannelSpacing;
+import org.onosproject.net.DefaultAnnotations;
+import org.onosproject.net.Device;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.OchSignal;
+import org.onosproject.net.OduSignalType;
+import org.onosproject.net.Port.Type;
+import org.onosproject.net.PortNumber;
+import org.onosproject.net.device.DefaultDeviceDescription;
+import org.onosproject.net.device.DefaultPortDescription;
+import org.onosproject.net.device.DefaultPortDescription.Builder;
+import org.onosproject.net.device.DeviceDescription;
+import org.onosproject.net.device.DeviceDescriptionDiscovery;
+import org.onosproject.net.device.PortDescription;
+import org.onosproject.net.driver.AbstractHandlerBehaviour;
+import org.onosproject.net.optical.device.OchPortHelper;
+import org.onosproject.netconf.NetconfController;
+import org.onosproject.netconf.NetconfException;
+import org.onosproject.netconf.NetconfSession;
+import org.onosproject.odtn.behaviour.OdtnDeviceDescriptionDiscovery;
+import org.onosproject.net.AnnotationKeys;
+import org.slf4j.Logger;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+import static org.slf4j.LoggerFactory.getLogger;
+
+public class ZteDeviceDiscoveryImpl
+        extends AbstractHandlerBehaviour
+        implements OdtnDeviceDescriptionDiscovery, DeviceDescriptionDiscovery {
+    private final Logger log = getLogger(getClass());
+
+    @Override
+    public DeviceDescription discoverDeviceDetails() {
+        DeviceId deviceId = handler().data().deviceId();
+        log.info("Discovering ZTE device {}", deviceId);
+
+        NetconfController controller = handler().get(NetconfController.class);
+        NetconfSession session = controller.getDevicesMap().get(deviceId).getSession();
+
+        String hwVersion = "ZTE hw";
+        String swVersion = "ZTE sw";
+        String serialNumber = "000000000000";
+
+        try {
+            String reply = session.requestSync(buildDeviceInfoRequest());
+            XMLConfiguration cfg = (XMLConfiguration) XmlConfigParser.loadXmlString(getDataOfRpcReply(reply));
+            hwVersion = cfg.getString("components.component.state.hardware-version");
+            swVersion = cfg.getString("components.component.state.software-version");
+            serialNumber = cfg.getString("components.component.state.serial-no");
+        } catch (NetconfException e) {
+            log.error("ZTE device discovery error.", e);
+        }
+
+        return new DefaultDeviceDescription(deviceId.uri(),
+                Device.Type.OTN,
+                "ZTE",
+                hwVersion,
+                swVersion,
+                serialNumber,
+                new ChassisId(1));
+    }
+
+    private String buildDeviceInfoRequest() {
+        StringBuilder rpc = new StringBuilder();
+        rpc.append("<rpc xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">");
+        rpc.append("<get>");
+        rpc.append("<filter xmlns:ns0=\"urn:ietf:params:xml:ns:netconf:base:1.0\" ns0:type=\"subtree\">");
+        rpc.append("<components xmlns=\"http://openconfig.net/yang/platform\">");
+        rpc.append("<component>");
+        rpc.append("<name>CHASSIS-1-1</name>");
+        rpc.append("<state></state>");
+        rpc.append("</component>");
+        rpc.append("</components>");
+        rpc.append("</filter>");
+        rpc.append("</get>");
+        rpc.append("</rpc>");
+
+        return rpc.toString();
+    }
+
+    private String getDataOfRpcReply(String rpcReply) {
+        String data = null;
+        int begin = rpcReply.indexOf("<data>");
+        int end = rpcReply.lastIndexOf("</data>");
+        if (begin != -1 && end != -1) {
+            data = (String) rpcReply.subSequence(begin, end + "</data>".length());
+        } else {
+            data = rpcReply;
+        }
+        return data;
+    }
+
+    @Override
+    public List<PortDescription> discoverPortDetails() {
+        DeviceId deviceId = handler().data().deviceId();
+        log.info("Discovering ZTE device ports {}", deviceId);
+
+        NetconfController controller = handler().get(NetconfController.class);
+        NetconfSession session = controller.getDevicesMap().get(deviceId).getSession();
+        XMLConfiguration cfg = new XMLConfiguration();
+        try {
+            String reply = session.requestSync(buildPortDetailRequest(), 30);
+            String data = getDataOfRpcReply(reply);
+            if (data == null) {
+                log.error("No valid response found from {}:\n{}", deviceId, reply);
+                return ImmutableList.of();
+            }
+            cfg.load(CharSource.wrap(data).openStream());
+            return discoverPorts(cfg);
+        } catch (Exception e) {
+            log.error("ZTE device port discovery error.", e);
+        }
+
+        return ImmutableList.of();
+    }
+
+    private String buildPortDetailRequest() {
+        StringBuilder rpc = new StringBuilder();
+        rpc.append("<rpc xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">");
+        rpc.append("<get>");
+        rpc.append("<filter xmlns:ns0=\"urn:ietf:params:xml:ns:netconf:base:1.0\" ns0:type=\"subtree\">");
+        rpc.append("<components xmlns=\"http://openconfig.net/yang/platform\">");
+        rpc.append("</components>");
+        rpc.append("</filter>");
+        rpc.append("</get>");
+        rpc.append("</rpc>");
+
+        return rpc.toString();
+    }
+
+    private List<PortDescription> discoverPorts(XMLConfiguration cfg) {
+        cfg.setExpressionEngine(new XPathExpressionEngine());
+        List<HierarchicalConfiguration> components = cfg.configurationsAt("components/component");
+        return components.stream()
+                .filter(this::isPortComponent)
+                .map(this::toPortDescriptionInternal)
+                .filter(Objects::nonNull)
+                .collect(Collectors.toList());
+    }
+
+    private boolean isPortComponent(HierarchicalConfiguration component) {
+        String name = component.getString("name");
+        String type = component.getString("state/type");
+
+        return name != null && name.startsWith("PORT") && type != null
+                && type.equals("openconfig-platform-types:PORT");
+    }
+
+    private PortDescription toPortDescriptionInternal(HierarchicalConfiguration component) {
+        Map<String, String> annotations = new HashMap<>();
+        String name = component.getString("name");
+        String type = component.getString("state/type");
+
+        annotations.put(OdtnDeviceDescriptionDiscovery.OC_NAME, name);
+        annotations.put(OdtnDeviceDescriptionDiscovery.OC_TYPE, type);
+        annotations.putIfAbsent(AnnotationKeys.PORT_NAME, name);
+
+        // PORT-1-4-C1
+        String[] textStr = name.split("-");
+
+        // use different value of portNumber on the same equipment
+        String portComponentIndex = textStr[textStr.length - 1];
+        int slotIndex = Integer.parseInt(textStr[2]);
+        int slotPortIndex = Integer.parseInt(portComponentIndex.substring(1));
+        int portNumber = slotIndex * 10 + slotPortIndex;
+
+        annotations.putIfAbsent(ONOS_PORT_INDEX, portComponentIndex);
+        annotations.putIfAbsent(CONNECTION_ID, "connection:" + Integer.parseInt(portComponentIndex.substring(1)));
+
+        if (portComponentIndex.charAt(0) == 'L') {
+            // line
+            annotations.putIfAbsent(PORT_TYPE, OdtnPortType.LINE.value());
+            OchSignal signalId = OchSignal.newDwdmSlot(ChannelSpacing.CHL_50GHZ, 1);
+            return OchPortHelper.ochPortDescription(
+                    PortNumber.portNumber(portNumber + 100L),
+                    true,
+                    OduSignalType.ODUC2,
+                    true,
+                    signalId,
+                    DefaultAnnotations.builder().putAll(annotations).build());
+        } else if (portComponentIndex.charAt(0) == 'C') {
+            // client
+            annotations.putIfAbsent(PORT_TYPE, OdtnPortType.CLIENT.value());
+            Builder builder = DefaultPortDescription.builder();
+            builder.withPortNumber(PortNumber.portNumber(portNumber))
+                    .isEnabled(true)
+                    .portSpeed(100000L)
+                    .type(Type.PACKET)
+                    .annotations(DefaultAnnotations.builder().putAll(annotations).build());
+
+            return builder.build();
+        }
+
+        return null;
+    }
+}
diff --git a/drivers/zte/src/main/java/org/onosproject/drivers/zte/ZteDriversLoader.java b/drivers/zte/src/main/java/org/onosproject/drivers/zte/ZteDriversLoader.java
new file mode 100644
index 0000000..f11c503
--- /dev/null
+++ b/drivers/zte/src/main/java/org/onosproject/drivers/zte/ZteDriversLoader.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2019-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.zte;
+
+import org.onosproject.net.driver.AbstractDriverLoader;
+import org.osgi.service.component.annotations.Component;
+
+@Component(immediate = true)
+public class ZteDriversLoader extends AbstractDriverLoader {
+    public ZteDriversLoader() {
+        super("/zte-drivers.xml");
+    }
+}
diff --git a/drivers/zte/src/main/java/org/onosproject/drivers/zte/ZteNetconfDeviceTransceiver.java b/drivers/zte/src/main/java/org/onosproject/drivers/zte/ZteNetconfDeviceTransceiver.java
new file mode 100644
index 0000000..c064426
--- /dev/null
+++ b/drivers/zte/src/main/java/org/onosproject/drivers/zte/ZteNetconfDeviceTransceiver.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2019-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.zte;
+
+import com.google.common.base.Strings;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.Port;
+import org.onosproject.net.PortNumber;
+import org.onosproject.net.device.DeviceService;
+import org.onosproject.odtn.behaviour.ConfigurableTransceiver;
+import org.onosproject.odtn.behaviour.PlainTransceiver;
+import org.slf4j.Logger;
+
+import java.util.Collections;
+import java.util.List;
+
+import static org.onosproject.odtn.behaviour.OdtnDeviceDescriptionDiscovery.OC_NAME;
+import static org.slf4j.LoggerFactory.getLogger;
+
+public class ZteNetconfDeviceTransceiver
+        extends PlainTransceiver
+        implements ConfigurableTransceiver {
+
+    private final Logger log = getLogger(getClass());
+    private static final String ANOTATION_NAME = "xc:operation";
+
+    @Override
+    public List<CharSequence> enable(PortNumber client, PortNumber line, boolean enable) {
+        DeviceId deviceId = handler().data().deviceId();
+        log.info("Discovering ZTE device {}", deviceId);
+
+        Port port = handler().get(DeviceService.class).getPort(deviceId, client);
+        if (port == null) {
+            log.warn("{} does not exist on {}", client, deviceId);
+            return Collections.emptyList();
+        }
+
+        String component = port.annotations().value(OC_NAME);
+        if (Strings.isNullOrEmpty(component)) {
+            log.warn("{} annotation not found on {}@{}", OC_NAME, client, deviceId);
+            return Collections.emptyList();
+        }
+
+        String componentName = component.replace("PORT", "TRANSCEIVER");
+        return enable(componentName, enable);
+    }
+
+
+}
diff --git a/drivers/zte/src/main/java/org/onosproject/drivers/zte/ZtePortStatisticsDiscovery.java b/drivers/zte/src/main/java/org/onosproject/drivers/zte/ZtePortStatisticsDiscovery.java
new file mode 100644
index 0000000..94e1875
--- /dev/null
+++ b/drivers/zte/src/main/java/org/onosproject/drivers/zte/ZtePortStatisticsDiscovery.java
@@ -0,0 +1,163 @@
+/*
+ * Copyright 2019-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.zte;
+
+import com.google.common.base.Strings;
+import com.google.common.collect.Lists;
+import org.apache.commons.configuration.XMLConfiguration;
+import org.onosproject.drivers.utilities.XmlConfigParser;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.Port;
+import org.onosproject.net.device.DefaultPortStatistics;
+import org.onosproject.net.device.DeviceService;
+import org.onosproject.net.device.PortStatistics;
+import org.onosproject.net.device.PortStatisticsDiscovery;
+import org.onosproject.net.driver.AbstractHandlerBehaviour;
+import org.onosproject.netconf.NetconfController;
+import org.onosproject.netconf.NetconfException;
+import org.onosproject.netconf.NetconfSession;
+import org.slf4j.Logger;
+
+import java.util.Collection;
+import java.util.List;
+
+import static org.onosproject.odtn.behaviour.OdtnDeviceDescriptionDiscovery.OC_NAME;
+import static org.slf4j.LoggerFactory.getLogger;
+
+public class ZtePortStatisticsDiscovery extends AbstractHandlerBehaviour
+        implements PortStatisticsDiscovery {
+
+    private static final Logger LOG = getLogger(ZtePortStatisticsDiscovery.class);
+
+    @Override
+    public Collection<PortStatistics> discoverPortStatistics() {
+        DeviceId deviceId = handler().data().deviceId();
+        LOG.debug("Discovering ZTE PortStatistics for device {}", deviceId);
+
+        NetconfController controller = handler().get(NetconfController.class);
+
+        if (null == controller) {
+            LOG.error("Cannot find NetconfController");
+            return null;
+        }
+
+        NetconfSession session = controller.getDevicesMap().get(deviceId).getSession();
+
+        if (null == session) {
+            LOG.error("No session available for device {}", deviceId);
+            return null;
+        }
+
+        DeviceService deviceService = this.handler().get(DeviceService.class);
+        List<Port> ports = deviceService.getPorts(deviceId);
+
+        Collection<PortStatistics> portStatistics = Lists.newArrayList();
+
+        ports.stream()
+                .filter(Port::isEnabled)
+                .filter(this::isClientPort)
+                .forEach(port -> portStatistics.add(discoverSpecifiedPortStatistics(session, deviceId, port)));
+
+        return portStatistics;
+    }
+
+    private boolean isClientPort(Port port) {
+        String portName = port.annotations().value(OC_NAME);
+        if (Strings.isNullOrEmpty(portName)) {
+            return false;
+        }
+        String[] portInfos = portName.split("-");
+        return portInfos.length == 4 && portInfos[3].startsWith("C");
+    }
+
+    private String getDataOfRpcReply(String rpcReply) {
+        String data = null;
+        int begin = rpcReply.indexOf("<data>");
+        int end = rpcReply.lastIndexOf("</data>");
+        if (begin != -1 && end != -1) {
+            data = (String) rpcReply.subSequence(begin, end + "</data>".length());
+        } else {
+            data = rpcReply;
+        }
+        return data;
+    }
+
+    private PortStatistics discoverSpecifiedPortStatistics(NetconfSession session, DeviceId deviceId, Port port) {
+
+        String portName = port.annotations().value(OC_NAME);
+        String rpc = buildPortStatisticsRequest("INTERFACE" + portName.substring("PORT".length()));
+
+        try {
+            String reply = session.requestSync(rpc);
+            XMLConfiguration cfg = (XMLConfiguration) XmlConfigParser.loadXmlString(getDataOfRpcReply(reply));
+            DefaultPortStatistics.Builder builder = DefaultPortStatistics.builder();
+
+            builder.setPort(port.number())
+                    .setPacketsReceived(getInteger(cfg, "in-pks"))
+                    .setPacketsSent(getInteger(cfg, "out-pkts"))
+                    .setBytesReceived(getInteger(cfg, "in-octets"))
+                    .setBytesSent(getInteger(cfg, "out-octets"))
+                    .setPacketsRxDropped(getInteger(cfg, "in-fcs-errors"))
+                    .setPacketsTxDropped(getInteger(cfg, "carrier-transitions"))
+                    .setPacketsRxErrors(getInteger(cfg, "in-errors"))
+                    .setPacketsTxErrors(getInteger(cfg, "out-errors"))
+                    .setDeviceId(deviceId);
+
+            return builder.build();
+        } catch (NetconfException e) {
+            LOG.error("ZTE device portStatistic request error.", e);
+            return null;
+        }
+    }
+
+    private String buildPortStatisticsRequest(String portName) {
+        StringBuilder rpc = new StringBuilder();
+        rpc.append("<rpc xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">");
+        rpc.append("<get>");
+        rpc.append("<filter xmlns:ns0=\"urn:ietf:params:xml:ns:netconf:base:1.0\" ns0:type=\"subtree\">");
+        rpc.append("<interfaces xmlns=\"http://openconfig.net/yang/interfaces\">");
+        rpc.append("<interface>");
+        rpc.append("<name>");
+        rpc.append(portName);
+        rpc.append("</name>");
+        rpc.append("<state>");
+        rpc.append("<counters>");
+        rpc.append("</counters>");
+        rpc.append("</state>");
+        rpc.append("</interface>");
+        rpc.append("</interfaces>");
+        rpc.append("</filter>");
+        rpc.append("</get>");
+        rpc.append("</rpc>");
+
+        return rpc.toString();
+    }
+
+    private int getInteger(XMLConfiguration cfg, String item) {
+        String numString = cfg.getString("interfaces.interface.state.counters." + item);
+        if (Strings.isNullOrEmpty(numString)) {
+            LOG.debug("Cannot get port statistic data for {}, set 0 as default.", item);
+            return 0;
+        }
+
+        try {
+            return Integer.parseInt(numString);
+        } catch (NumberFormatException e) {
+            LOG.warn("Cannot convert data for {}", item);
+            return 0;
+        }
+    }
+}
diff --git a/drivers/zte/src/main/java/org/onosproject/drivers/zte/ZteTransceiver.java b/drivers/zte/src/main/java/org/onosproject/drivers/zte/ZteTransceiver.java
new file mode 100644
index 0000000..3a713ad
--- /dev/null
+++ b/drivers/zte/src/main/java/org/onosproject/drivers/zte/ZteTransceiver.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright 2019-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.zte;
+
+import com.google.common.base.Strings;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.Port;
+import org.onosproject.net.PortNumber;
+import org.onosproject.net.device.DeviceService;
+import org.onosproject.net.driver.AbstractHandlerBehaviour;
+import org.onosproject.odtn.behaviour.ConfigurableTransceiver;
+import org.onosproject.odtn.behaviour.OdtnTerminalDeviceDriver.Operation;
+import org.onosproject.odtn.utils.openconfig.OpenConfigAssignmentHandler;
+import org.onosproject.odtn.utils.openconfig.OpenConfigChannelHandler;
+import org.onosproject.odtn.utils.openconfig.OpenConfigConfigOfAssignmentHandler;
+import org.onosproject.odtn.utils.openconfig.OpenConfigConfigOfChannelHandler;
+import org.onosproject.odtn.utils.openconfig.OpenConfigLogicalChannelAssignmentsHandler;
+import org.onosproject.odtn.utils.openconfig.OpenConfigLogicalChannelsHandler;
+import org.onosproject.odtn.utils.openconfig.OpenConfigTerminalDeviceHandler;
+import org.onosproject.yang.gen.v1.openconfigterminaldevice.rev20170708.openconfigterminaldevice.terminallogicalchanassignmentconfig.AssignmentTypeEnum;
+import org.slf4j.Logger;
+
+import java.util.Collections;
+import java.util.List;
+
+import static org.onosproject.odtn.behaviour.OdtnDeviceDescriptionDiscovery.OC_NAME;
+import static org.slf4j.LoggerFactory.getLogger;
+
+public class ZteTransceiver extends AbstractHandlerBehaviour
+        implements ConfigurableTransceiver {
+
+    private final Logger log = getLogger(getClass());
+
+    private static final String ANOTATION_NAME = "xc:operation";
+
+    private final int[] clientPortIndexs = new int[] {
+            20975681, 18878529, 19927105, 17829953,
+            20975745, 18878593, 19927169, 17830017,
+            20975809, 18878657, 19927233, 17830081,
+            20975873, 18878721, 19927297, 17830145
+    };
+
+    private final int[] linePortIndexs = new int[] {
+            21499969, 19402817, 20451393, 18354241,
+            21500033, 19402881, 20451457, 18354305
+    };
+
+    @Override
+    public List<CharSequence> enable(PortNumber client, PortNumber line, boolean enable) {
+        DeviceId deviceId = handler().data().deviceId();
+        log.info("Discovering ZTE device {}", deviceId);
+
+        Port clientPort = handler().get(DeviceService.class).getPort(deviceId, client);
+        if (clientPort == null) {
+            log.warn("{} does not exist on {}", client, deviceId);
+            return Collections.emptyList();
+        }
+
+        String clientName = clientPort.annotations().value(OC_NAME);
+        if (Strings.isNullOrEmpty(clientName)) {
+            log.warn("{} annotations not exist on {}@{}", OC_NAME, client, deviceId);
+            return Collections.emptyList();
+        }
+
+        Port linePort = handler().get(DeviceService.class).getPort(deviceId, line);
+        if (linePort == null) {
+            log.warn("{} does not exist on {}", line, deviceId);
+            return Collections.emptyList();
+        }
+
+        String lineName = linePort.annotations().value(OC_NAME);
+        if (Strings.isNullOrEmpty(lineName)) {
+            log.warn("{} annotations not exist on {}@{}", OC_NAME, line, deviceId);
+            return Collections.emptyList();
+        }
+
+        int clientIndex, lineIndex;
+
+        try {
+            clientIndex = getPortIndex(clientName);
+            lineIndex = getPortIndex(lineName);
+        } catch (IllegalArgumentException e) {
+            return Collections.emptyList();
+        }
+
+        // create <terminal-device xmlns="http://openconfig.net/yang/terminal-device">
+        //        </terminal-device>
+        OpenConfigTerminalDeviceHandler terminalDevice = new OpenConfigTerminalDeviceHandler();
+        // add <logical-channels></logical-channels>
+        OpenConfigLogicalChannelsHandler logicalChannels =
+                new OpenConfigLogicalChannelsHandler(terminalDevice);
+        // add <channel><index>"clientIndex"</index></channel>
+        OpenConfigChannelHandler channel =
+                new OpenConfigChannelHandler(clientIndex, logicalChannels);
+
+        // add <channel xc:operation="merge/delete">
+        if (enable) {
+            channel.addAnnotation(ANOTATION_NAME, Operation.MERGE.value());
+        } else {
+            channel.addAnnotation(ANOTATION_NAME, Operation.DELETE.value());
+        }
+
+        // add <config><index>"clientIndex"</index></config>
+        OpenConfigConfigOfChannelHandler configOfChannel =
+                new OpenConfigConfigOfChannelHandler(channel);
+        configOfChannel.addIndex(clientIndex);
+
+        // add <logical-channel-assignments></logical-channel-assignments>
+        OpenConfigLogicalChannelAssignmentsHandler logicalChannelAssignments =
+                new OpenConfigLogicalChannelAssignmentsHandler(channel);
+
+        // add <assignment><index>1</index></assignment>
+        OpenConfigAssignmentHandler assignment =
+                new OpenConfigAssignmentHandler(1, logicalChannelAssignments);
+
+        // add <config><assignment-type>LOGICAL_CHANNEL</assignment-type>
+        //             <logical-channel>"lineIndex"</logical-channel>
+        //     </config>
+        OpenConfigConfigOfAssignmentHandler configOfAssignment =
+                new OpenConfigConfigOfAssignmentHandler(assignment);
+        configOfAssignment.addAssignmentType(AssignmentTypeEnum.LOGICAL_CHANNEL);
+        configOfAssignment.addLogicalChannel("" + lineIndex);
+
+        return terminalDevice.getListCharSequence();
+    }
+
+    // index should be fixed
+    private int getPortIndex(String portName) throws IllegalArgumentException {
+        //PORT-1-4-C1
+        String[] portInfos = portName.split("-");
+        if (portInfos.length == 4) {
+            throw new IllegalArgumentException("ZTE device port name illegal.");
+        }
+
+        int slotIndex = Integer.parseInt(portInfos[2]);
+        int index = Integer.parseInt(portInfos[3].substring(1));
+
+        if (portInfos[3].startsWith("C")) {
+            return clientPortIndexs[index * 4 - slotIndex];
+        } else if (portInfos[3].startsWith("C")) {
+            return linePortIndexs[index * 4 - slotIndex];
+        }
+
+        throw new IllegalArgumentException("Connot match port index for ZTE device.");
+    }
+
+}
diff --git a/drivers/zte/src/main/java/org/onosproject/drivers/zte/package-info.java b/drivers/zte/src/main/java/org/onosproject/drivers/zte/package-info.java
new file mode 100644
index 0000000..df337be
--- /dev/null
+++ b/drivers/zte/src/main/java/org/onosproject/drivers/zte/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2019-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.
+ */
+
+/**
+ * Zte netconf drivers.
+ */
+package org.onosproject.drivers.zte;
\ No newline at end of file
diff --git a/drivers/zte/src/main/resources/zte-drivers.xml b/drivers/zte/src/main/resources/zte-drivers.xml
new file mode 100644
index 0000000..1f1d728
--- /dev/null
+++ b/drivers/zte/src/main/resources/zte-drivers.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2016 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="zte-netconf" manufacturer="ZTE" hwVersion="ZTE hw" swVersion="ZTE sw">
+        <behaviour api="org.onosproject.net.device.DeviceDescriptionDiscovery"
+                   impl="org.onosproject.drivers.zte.ZteDeviceDiscoveryImpl"/>
+        <behaviour api="org.onosproject.odtn.behaviour.OdtnDeviceDescriptionDiscovery"
+                   impl="org.onosproject.drivers.zte.ZteDeviceDiscoveryImpl"/>
+        <behaviour api ="org.onosproject.net.optical.OpticalDevice"
+                   impl="org.onosproject.net.optical.DefaultOpticalDevice"/>
+        <behaviour api="org.onosproject.odtn.behaviour.ConfigurableTransceiver"
+                   impl="org.onosproject.drivers.zte.ZteNetconfDeviceTransceiver"/>
+        <behaviour api="org.onosproject.net.device.PortStatisticsDiscovery"
+                   impl="org.onosproject.drivers.zte.ZtePortStatisticsDiscovery"/>
+    </driver>
+</drivers>
diff --git a/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfSessionMinaImpl.java b/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfSessionMinaImpl.java
index e89449e..2a574ab 100644
--- a/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfSessionMinaImpl.java
+++ b/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfSessionMinaImpl.java
@@ -653,19 +653,20 @@
         // FIXME potentially re-writing chunked encoded String?
         request = formatXmlHeader(request);
         request = formatRequestMessageId(request, messageId);
+        int useTimeout = timeout > 0 ? timeout : replyTimeout;
         log.debug("Sending request to NETCONF with timeout {} for {}",
-                replyTimeout, deviceInfo.name());
+                  useTimeout, deviceInfo.name());
         CompletableFuture<String> futureReply = request(request, messageId);
         String rp;
         try {
-            rp = futureReply.get(replyTimeout, TimeUnit.SECONDS);
+            rp = futureReply.get(useTimeout, TimeUnit.SECONDS);
             replies.remove(messageId); // Why here???
         } catch (InterruptedException e) {
             Thread.currentThread().interrupt();
             throw new NetconfException("Interrupted waiting for reply for request" + request, e);
         } catch (TimeoutException e) {
             throw new NetconfException("Timed out waiting for reply for request " +
-                    request + " after " + replyTimeout + " sec.", e);
+                    request + " after " + useTimeout + " sec.", e);
         } catch (ExecutionException e) {
             log.warn("Closing session {} for {} due to unexpected Error", sessionID, deviceInfo, e);
             stopClient();
diff --git a/tools/build/bazel/modules.bzl b/tools/build/bazel/modules.bzl
index b74f857..3a37146 100644
--- a/tools/build/bazel/modules.bzl
+++ b/tools/build/bazel/modules.bzl
@@ -109,6 +109,7 @@
     "//drivers/polatis/openflow:onos-drivers-polatis-openflow-oar",
     "//drivers/odtn-driver:onos-drivers-odtn-driver-oar",
     "//drivers/stratum:onos-drivers-stratum-oar",
+    "//drivers/zte:onos-drivers-zte-oar",
 ]
 
 ONOS_PROVIDERS = [
