diff --git a/drivers/gnmi/src/main/java/org/onosproject/drivers/gnmi/AbstractGnmiHandlerBehaviour.java b/drivers/gnmi/src/main/java/org/onosproject/drivers/gnmi/AbstractGnmiHandlerBehaviour.java
index e363f4a..fda0bb5 100644
--- a/drivers/gnmi/src/main/java/org/onosproject/drivers/gnmi/AbstractGnmiHandlerBehaviour.java
+++ b/drivers/gnmi/src/main/java/org/onosproject/drivers/gnmi/AbstractGnmiHandlerBehaviour.java
@@ -16,6 +16,7 @@
 
 package org.onosproject.drivers.gnmi;
 
+import io.grpc.StatusRuntimeException;
 import org.onosproject.gnmi.api.GnmiClient;
 import org.onosproject.gnmi.api.GnmiClientKey;
 import org.onosproject.gnmi.api.GnmiController;
@@ -26,11 +27,20 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
 /**
  * Abstract implementation of a behaviour handler for a gNMI device.
  */
 public class AbstractGnmiHandlerBehaviour extends AbstractHandlerBehaviour {
 
+    // Default timeout in seconds for device operations.
+    private static final String DEVICE_REQ_TIMEOUT = "deviceRequestTimeout";
+    private static final int DEFAULT_DEVICE_REQ_TIMEOUT = 60;
+
     public static final String GNMI_SERVER_ADDR_KEY = "gnmi_ip";
     public static final String GNMI_SERVER_PORT_KEY = "gnmi_port";
     private static final String GNMI_SERVICE_NAME = "gnmi";
@@ -43,19 +53,13 @@
     protected GnmiClient client;
 
     protected boolean setupBehaviour() {
-        // FIXME: Should create GnmiHandshaker which initialize the client
-        // instead of create client here.
         deviceId = handler().data().deviceId();
 
         controller = handler().get(GnmiController.class);
         client = controller.getClient(deviceId);
 
         if (client == null) {
-            client = createClient();
-        }
-
-        if (client == null) {
-            log.warn("Can not create client for {} (see log above)", deviceId);
+            log.warn("Unable to find client for {}, aborting operation", deviceId);
             return false;
         }
 
@@ -90,4 +94,58 @@
         }
         return controller.getClient(deviceId);
     }
+
+    /**
+     * Returns the device request timeout driver property, or a default value
+     * if the property is not present or cannot be parsed.
+     *
+     * @return timeout value
+     */
+    private int getDeviceRequestTimeout() {
+        final String timeout = handler().driver()
+                .getProperty(DEVICE_REQ_TIMEOUT);
+        if (timeout == null) {
+            return DEFAULT_DEVICE_REQ_TIMEOUT;
+        } else {
+            try {
+                return Integer.parseInt(timeout);
+            } catch (NumberFormatException e) {
+                log.error("{} driver property '{}' is not a number, using default value {}",
+                        DEVICE_REQ_TIMEOUT, timeout, DEFAULT_DEVICE_REQ_TIMEOUT);
+                return DEFAULT_DEVICE_REQ_TIMEOUT;
+            }
+        }
+    }
+
+    /**
+     * Convenience method to get the result of a completable future while
+     * setting a timeout and checking for exceptions.
+     *
+     * @param future        completable future
+     * @param opDescription operation description to use in log messages. Should
+     *                      be a sentence starting with a verb ending in -ing,
+     *                      e.g. "reading...", "writing...", etc.
+     * @param defaultValue  value to return if operation fails
+     * @param <U>           type of returned value
+     * @return future result or default value
+     */
+    <U> U getFutureWithDeadline(CompletableFuture<U> future, String opDescription,
+                                U defaultValue) {
+        try {
+            return future.get(getDeviceRequestTimeout(), TimeUnit.SECONDS);
+        } catch (InterruptedException e) {
+            log.error("Exception while {} on {}", opDescription, deviceId);
+        } catch (ExecutionException e) {
+            final Throwable cause = e.getCause();
+            if (cause instanceof StatusRuntimeException) {
+                final StatusRuntimeException grpcError = (StatusRuntimeException) cause;
+                log.warn("Error while {} on {}: {}", opDescription, deviceId, grpcError.getMessage());
+            } else {
+                log.error("Exception while {} on {}", opDescription, deviceId, e.getCause());
+            }
+        } catch (TimeoutException e) {
+            log.error("Operation TIMEOUT while {} on {}", opDescription, deviceId);
+        }
+        return defaultValue;
+    }
 }
diff --git a/drivers/gnmi/src/main/java/org/onosproject/drivers/gnmi/GnmiHandshaker.java b/drivers/gnmi/src/main/java/org/onosproject/drivers/gnmi/GnmiHandshaker.java
new file mode 100644
index 0000000..d1ee1b8
--- /dev/null
+++ b/drivers/gnmi/src/main/java/org/onosproject/drivers/gnmi/GnmiHandshaker.java
@@ -0,0 +1,97 @@
+/*
+ * 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.gnmi;
+
+import org.onosproject.gnmi.api.GnmiClient;
+import org.onosproject.gnmi.api.GnmiController;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.MastershipRole;
+import org.onosproject.net.device.DeviceHandshaker;
+
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * Implementation of DeviceHandshaker for gNMI.
+ */
+public class GnmiHandshaker extends AbstractGnmiHandlerBehaviour implements DeviceHandshaker {
+
+    @Override
+    public CompletableFuture<Boolean> isReachable() {
+        return CompletableFuture
+                // gNMI requires a client to be created to
+                // check for reachability.
+                .supplyAsync(super::createClient)
+                .thenApplyAsync(client -> {
+                    if (client == null) {
+                        return false;
+                    }
+                    return handler()
+                            .get(GnmiController.class)
+                            .isReachable(handler().data().deviceId());
+                });
+    }
+
+    @Override
+    public void roleChanged(MastershipRole newRole) {
+        throw new UnsupportedOperationException("Mastership operation not supported");
+    }
+
+    @Override
+    public MastershipRole getRole() {
+        throw new UnsupportedOperationException("Mastership operation not supported");
+    }
+
+    @Override
+    public CompletableFuture<Boolean> connect() {
+        return CompletableFuture
+                .supplyAsync(super::createClient)
+                .thenComposeAsync(client -> {
+                    if (client == null) {
+                        return CompletableFuture.completedFuture(false);
+                    }
+                    return CompletableFuture.completedFuture(true);
+                });
+    }
+
+    @Override
+    public boolean isConnected() {
+        final GnmiController controller = handler().get(GnmiController.class);
+        final DeviceId deviceId = handler().data().deviceId();
+        final GnmiClient client = controller.getClient(deviceId);
+
+        if (client == null) {
+            return false;
+        }
+
+        return getFutureWithDeadline(client.isServiceAvailable(), "getting availability", false);
+    }
+
+    @Override
+    public CompletableFuture<Boolean> disconnect() {
+        final GnmiController controller = handler().get(GnmiController.class);
+        final DeviceId deviceId = handler().data().deviceId();
+        final GnmiClient client = controller.getClient(deviceId);
+        if (client == null) {
+            return CompletableFuture.completedFuture(true);
+        }
+        return client.shutdown()
+                .thenApplyAsync(v -> {
+                    controller.removeClient(deviceId);
+                    return true;
+                });
+    }
+}
diff --git a/drivers/gnmi/src/main/resources/gnmi-drivers.xml b/drivers/gnmi/src/main/resources/gnmi-drivers.xml
index 4ca539e..70c0b20 100644
--- a/drivers/gnmi/src/main/resources/gnmi-drivers.xml
+++ b/drivers/gnmi/src/main/resources/gnmi-drivers.xml
@@ -18,6 +18,8 @@
     <driver name="gnmi" manufacturer="gnmi" hwVersion="master" swVersion="master">
         <behaviour api="org.onosproject.net.device.DeviceDescriptionDiscovery"
                    impl="org.onosproject.drivers.gnmi.OpenConfigGnmiDeviceDescriptionDiscovery"/>
+        <behaviour api="org.onosproject.net.device.DeviceHandshaker"
+                   impl="org.onosproject.drivers.gnmi.GnmiHandshaker"/>
     </driver>
 </drivers>
 
diff --git a/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/GnmiClient.java b/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/GnmiClient.java
index 7f43d1f..242bc94 100644
--- a/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/GnmiClient.java
+++ b/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/GnmiClient.java
@@ -57,5 +57,13 @@
      */
     CompletableFuture<SetResponse> set(SetRequest request);
 
+    /**
+     * Check weather the gNMI service is available or not by sending a
+     * dummy get request message.
+     *
+     * @return true if gNMI service available; false otherwise
+     */
+    CompletableFuture<Boolean> isServiceAvailable();
+
     // TODO: Support gNMI subscription
 }
diff --git a/protocols/gnmi/ctl/src/main/java/org/onosproject/gnmi/ctl/GnmiClientImpl.java b/protocols/gnmi/ctl/src/main/java/org/onosproject/gnmi/ctl/GnmiClientImpl.java
index 74a9ec0..b8179a9 100644
--- a/protocols/gnmi/ctl/src/main/java/org/onosproject/gnmi/ctl/GnmiClientImpl.java
+++ b/protocols/gnmi/ctl/src/main/java/org/onosproject/gnmi/ctl/GnmiClientImpl.java
@@ -19,10 +19,13 @@
 import gnmi.Gnmi.CapabilityResponse;
 import gnmi.Gnmi.GetRequest;
 import gnmi.Gnmi.GetResponse;
+import gnmi.Gnmi.Path;
+import gnmi.Gnmi.PathElem;
 import gnmi.Gnmi.SetRequest;
 import gnmi.Gnmi.SetResponse;
 import gnmi.gNMIGrpc;
 import io.grpc.ManagedChannel;
+import io.grpc.Status;
 import io.grpc.StatusRuntimeException;
 import org.onosproject.gnmi.api.GnmiClientKey;
 import org.onosproject.grpc.ctl.AbstractGrpcClient;
@@ -37,6 +40,9 @@
  * Implementation of gNMI client.
  */
 public class GnmiClientImpl extends AbstractGrpcClient implements GnmiClient {
+    private static final PathElem DUMMY_PATH_ELEM = PathElem.newBuilder().setName("onos-gnmi-test").build();
+    private static final Path DUMMY_PATH = Path.newBuilder().addElem(DUMMY_PATH_ELEM).build();
+    private static final GetRequest DUMMY_REQUEST = GetRequest.newBuilder().addPath(DUMMY_PATH).build();
     private final Logger log = getLogger(getClass());
     private final gNMIGrpc.gNMIBlockingStub blockingStub;
 
@@ -60,6 +66,11 @@
         return supplyInContext(() -> doSet(request), "set");
     }
 
+    @Override
+    public CompletableFuture<Boolean> isServiceAvailable() {
+        return supplyInContext(this::doServiceAvailable, "isServiceAvailable");
+    }
+
     private CapabilityResponse doCapability() {
         CapabilityRequest request = CapabilityRequest.newBuilder().build();
         try {
@@ -87,4 +98,17 @@
             return null;
         }
     }
+
+    private boolean doServiceAvailable() {
+        try {
+            blockingStub.get(DUMMY_REQUEST);
+            return true;
+        } catch (StatusRuntimeException e) {
+            // This gRPC call should throw INVALID_ARGUMENT status exception
+            // since "/onos-gnmi-test" path does not exists in any config model
+            // For other status code such as UNIMPLEMENT, means the gNMI
+            // service is not available on the device.
+            return e.getStatus().getCode().equals(Status.Code.INVALID_ARGUMENT);
+        }
+    }
 }
diff --git a/protocols/grpc/api/src/main/java/org/onosproject/grpc/api/GrpcClientController.java b/protocols/grpc/api/src/main/java/org/onosproject/grpc/api/GrpcClientController.java
index 087898b..2e3ea5d 100644
--- a/protocols/grpc/api/src/main/java/org/onosproject/grpc/api/GrpcClientController.java
+++ b/protocols/grpc/api/src/main/java/org/onosproject/grpc/api/GrpcClientController.java
@@ -66,11 +66,12 @@
      * Check reachability of the gRPC server running on the given device.
      * Reachability can be tested only if a client is previously created
      * using {@link #createClient(GrpcClientKey)}.
-     * Different gRPC service may have different ways to test if it is
-     * reachable or not.
+     * Note that this only checks the reachability instead of checking service
+     * availability, different gRPC client checks service availability with
+     * different way.
      *
      * @param deviceId the device identifier
-     * @return true of client was created and is able to contact the gNMI server;
+     * @return true if client was created and is able to contact the gNMI server;
      *         false otherwise
      */
     boolean isReachable(DeviceId deviceId);
