diff --git a/protocols/gnmi/BUILD b/protocols/gnmi/BUILD
index 30599ae..0b6b6e6 100644
--- a/protocols/gnmi/BUILD
+++ b/protocols/gnmi/BUILD
@@ -1,12 +1,13 @@
 BUNDLES = [
-    "//protocols/gnmi/stub:gnmi_java_grpc",
-    "//protocols/gnmi/stub:gnmi_java_proto",
+    "//protocols/gnmi/stub:onos-protocols-gnmi-stub",
+    "//protocols/gnmi/ctl:onos-protocols-gnmi-ctl",
+    "//protocols/gnmi/api:onos-protocols-gnmi-api",
 ]
 
 onos_app(
     app_name = "org.onosproject.protocols.gnmi",
     category = "Protocol",
-    description = "ONOS gNMI protocol subsystem",
+    description = "gNMI protocol subsystem",
     included_bundles = BUNDLES,
     required_apps = [
         "org.onosproject.protocols.grpc",
diff --git a/protocols/gnmi/api/BUILD b/protocols/gnmi/api/BUILD
new file mode 100644
index 0000000..1cf1a3d
--- /dev/null
+++ b/protocols/gnmi/api/BUILD
@@ -0,0 +1,8 @@
+COMPILE_DEPS = CORE_DEPS + [
+    "//protocols/grpc/api:onos-protocols-grpc-api",
+    "//protocols/gnmi/stub:onos-protocols-gnmi-stub",
+]
+
+osgi_jar(
+    deps = COMPILE_DEPS,
+)
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
new file mode 100644
index 0000000..5beb238
--- /dev/null
+++ b/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/GnmiClient.java
@@ -0,0 +1,67 @@
+/*
+ * 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.gnmi.api;
+
+import com.google.common.annotations.Beta;
+import gnmi.Gnmi.CapabilityResponse;
+import gnmi.Gnmi.GetRequest;
+import gnmi.Gnmi.GetResponse;
+import gnmi.Gnmi.SetRequest;
+import gnmi.Gnmi.SetResponse;
+import org.onosproject.grpc.api.GrpcClient;
+
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * Client to control a gNMI server.
+ */
+@Beta
+public interface GnmiClient extends GrpcClient {
+
+    /**
+     * Gets capability from a target.
+     *
+     * @return the capability response
+     */
+    CompletableFuture<CapabilityResponse> capability();
+
+    /**
+     * Retrieves a snapshot of data from the device.
+     *
+     * @param request the get request
+     * @return the snapshot of data from the device
+     */
+    CompletableFuture<GetResponse> get(GetRequest request);
+
+    /**
+     * Modifies the state of data on the device.
+     *
+     * @param request the set request
+     * @return the set result
+     */
+    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/api/src/main/java/org/onosproject/gnmi/api/GnmiClientKey.java b/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/GnmiClientKey.java
new file mode 100644
index 0000000..bc18b9a
--- /dev/null
+++ b/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/GnmiClientKey.java
@@ -0,0 +1,41 @@
+/*
+ * 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.gnmi.api;
+
+import com.google.common.annotations.Beta;
+import org.onosproject.grpc.api.GrpcClientKey;
+import org.onosproject.net.DeviceId;
+
+/**
+ * Key that uniquely identifies a gNMI client.
+ */
+@Beta
+public class GnmiClientKey extends GrpcClientKey {
+
+    private static final String GNMI = "gnmi";
+
+    /**
+     * Creates a new gNMI client key.
+     *
+     * @param deviceId    ONOS device ID
+     * @param serverAddr  gNMI server address
+     * @param serverPort  gNMI server port
+     */
+    public GnmiClientKey(DeviceId deviceId, String serverAddr, int serverPort) {
+        super(GNMI, deviceId, serverAddr, serverPort);
+    }
+}
diff --git a/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/GnmiController.java b/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/GnmiController.java
new file mode 100644
index 0000000..f4964ed
--- /dev/null
+++ b/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/GnmiController.java
@@ -0,0 +1,28 @@
+/*
+ * 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.gnmi.api;
+
+import com.google.common.annotations.Beta;
+import org.onosproject.grpc.api.GrpcClientController;
+
+/**
+ * Controller of gNMI devices.
+ */
+@Beta
+public interface GnmiController
+        extends GrpcClientController<GnmiClientKey, GnmiClient> {
+}
diff --git a/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/GnmiEvent.java b/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/GnmiEvent.java
new file mode 100644
index 0000000..5129926
--- /dev/null
+++ b/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/GnmiEvent.java
@@ -0,0 +1,46 @@
+/*
+ * 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.gnmi.api;
+
+import com.google.common.annotations.Beta;
+import org.onosproject.event.AbstractEvent;
+
+/**
+ * Representation of an event received from a gNMI device.
+ */
+@Beta
+public final class GnmiEvent extends AbstractEvent<GnmiEvent.Type, GnmiEventSubject> {
+
+    /**
+     * Type of gNMI event.
+     */
+    public enum Type {
+        /**
+         * Update.
+         */
+        UPDATE,
+
+        /**
+         * Sync response.
+         */
+        SYNC_RESPONSE
+    }
+
+    protected GnmiEvent(Type type, GnmiEventSubject subject) {
+        super(type, subject);
+    }
+}
diff --git a/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/GnmiEventListener.java b/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/GnmiEventListener.java
new file mode 100644
index 0000000..0fe2fd3
--- /dev/null
+++ b/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/GnmiEventListener.java
@@ -0,0 +1,27 @@
+/*
+ * 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.gnmi.api;
+
+import com.google.common.annotations.Beta;
+import org.onosproject.event.EventListener;
+
+/**
+ * A listener of events received from gNMI devices.
+ */
+@Beta
+public interface GnmiEventListener extends EventListener<GnmiEvent> {
+}
diff --git a/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/GnmiEventSubject.java b/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/GnmiEventSubject.java
new file mode 100644
index 0000000..d1563ed
--- /dev/null
+++ b/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/GnmiEventSubject.java
@@ -0,0 +1,34 @@
+/*
+ * 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.gnmi.api;
+
+import com.google.common.annotations.Beta;
+import org.onosproject.net.DeviceId;
+
+/**
+ * Information about an event generated by a gNMI device .
+ */
+@Beta
+public interface GnmiEventSubject {
+
+    /**
+     * Returns the deviceId associated to this subject.
+     *
+     * @return the device ID
+     */
+    DeviceId deviceId();
+}
diff --git a/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/package-info.java b/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/package-info.java
new file mode 100644
index 0000000..5f07b46
--- /dev/null
+++ b/protocols/gnmi/api/src/main/java/org/onosproject/gnmi/api/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+/**
+ * gNMI protocol API.
+ */
+package org.onosproject.gnmi.api;
\ No newline at end of file
diff --git a/protocols/gnmi/ctl/BUILD b/protocols/gnmi/ctl/BUILD
new file mode 100644
index 0000000..db4cd44
--- /dev/null
+++ b/protocols/gnmi/ctl/BUILD
@@ -0,0 +1,23 @@
+COMPILE_DEPS = CORE_DEPS + KRYO + [
+    "//protocols/gnmi/api:onos-protocols-gnmi-api",
+    "//protocols/gnmi/stub:onos-protocols-gnmi-stub",
+    "//protocols/grpc/api:onos-protocols-grpc-api",
+    "//protocols/grpc/ctl:onos-protocols-grpc-ctl",
+    "//protocols/grpc:grpc-core-repkg",
+    "@com_google_protobuf//:protobuf_java",
+    "@io_grpc_grpc_java//netty",
+    "@io_grpc_grpc_java//protobuf-lite",
+    "@io_grpc_grpc_java//stub",
+    "@com_google_api_grpc_proto_google_common_protos//jar",
+]
+
+TEST_DEPS = TEST + [
+    "@minimal_json//jar",
+    "@io_grpc_grpc_java//core:inprocess",
+    "@io_grpc_grpc_java//protobuf-lite",
+]
+
+osgi_jar_with_tests(
+    test_deps = TEST_DEPS,
+    deps = COMPILE_DEPS,
+)
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
new file mode 100644
index 0000000..22b226b
--- /dev/null
+++ b/protocols/gnmi/ctl/src/main/java/org/onosproject/gnmi/ctl/GnmiClientImpl.java
@@ -0,0 +1,113 @@
+/*
+ * 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 protocols.gnmi.ctl.java.org.onosproject.gnmi.ctl;
+
+import gnmi.Gnmi.CapabilityRequest;
+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.GnmiClient;
+import org.onosproject.gnmi.api.GnmiClientKey;
+import org.onosproject.grpc.ctl.AbstractGrpcClient;
+import org.slf4j.Logger;
+
+import java.util.concurrent.CompletableFuture;
+
+import static org.slf4j.LoggerFactory.getLogger;
+
+/**
+ * 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;
+
+    GnmiClientImpl(GnmiClientKey clientKey, ManagedChannel managedChannel) {
+        super(clientKey);
+        this.blockingStub = gNMIGrpc.newBlockingStub(managedChannel);
+    }
+
+    @Override
+    public CompletableFuture<CapabilityResponse> capability() {
+        return supplyInContext(this::doCapability, "capability");
+    }
+
+    @Override
+    public CompletableFuture<GetResponse> get(GetRequest request) {
+        return supplyInContext(() -> doGet(request), "get");
+    }
+
+    @Override
+    public CompletableFuture<SetResponse> set(SetRequest request) {
+        return supplyInContext(() -> doSet(request), "set");
+    }
+
+    @Override
+    public CompletableFuture<Boolean> isServiceAvailable() {
+        return supplyInContext(this::doServiceAvailable, "isServiceAvailable");
+    }
+
+    private CapabilityResponse doCapability() {
+        CapabilityRequest request = CapabilityRequest.newBuilder().build();
+        try {
+            return blockingStub.capabilities(request);
+        } catch (StatusRuntimeException e) {
+            log.warn("Unable to get capability from {}: {}", deviceId, e.getMessage());
+            return null;
+        }
+    }
+
+    private GetResponse doGet(GetRequest request) {
+        try {
+            return blockingStub.get(request);
+        } catch (StatusRuntimeException e) {
+            log.warn("Unable to get data from {}: {}", deviceId, e.getMessage());
+            return null;
+        }
+    }
+
+    private SetResponse doSet(SetRequest request) {
+        try {
+            return blockingStub.set(request);
+        } catch (StatusRuntimeException e) {
+            log.warn("Unable to set data to {}: {}", deviceId, e.getMessage());
+            return null;
+        }
+    }
+
+    private boolean doServiceAvailable() {
+        try {
+            return blockingStub.get(DUMMY_REQUEST) != null;
+        } 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/gnmi/ctl/src/main/java/org/onosproject/gnmi/ctl/GnmiControllerImpl.java b/protocols/gnmi/ctl/src/main/java/org/onosproject/gnmi/ctl/GnmiControllerImpl.java
new file mode 100644
index 0000000..7ddc3f0
--- /dev/null
+++ b/protocols/gnmi/ctl/src/main/java/org/onosproject/gnmi/ctl/GnmiControllerImpl.java
@@ -0,0 +1,59 @@
+/*
+ * 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 protocols.gnmi.ctl.java.org.onosproject.gnmi.ctl;
+
+import io.grpc.ManagedChannel;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Service;
+import org.onosproject.gnmi.api.GnmiEvent;
+import org.onosproject.gnmi.api.GnmiEventListener;
+import org.onosproject.grpc.ctl.AbstractGrpcClientController;
+import org.onosproject.gnmi.api.GnmiClient;
+import org.onosproject.gnmi.api.GnmiClientKey;
+import org.onosproject.gnmi.api.GnmiController;
+import org.slf4j.Logger;
+
+import static org.slf4j.LoggerFactory.getLogger;
+
+/**
+ * Implementation of gNMI controller.
+ */
+@Component(immediate = true)
+@Service
+public class GnmiControllerImpl
+        extends AbstractGrpcClientController<GnmiClientKey, GnmiClient, GnmiEvent, GnmiEventListener>
+        implements GnmiController {
+    private final Logger log = getLogger(getClass());
+
+    @Activate
+    public void activate() {
+        super.activate();
+        log.info("Started");
+    }
+
+    @Deactivate
+    public void deactivate() {
+        super.deactivate();
+        log.info("Stopped");
+    }
+
+    @Override
+    protected GnmiClient createClientInstance(GnmiClientKey clientKey, ManagedChannel channel) {
+        return new GnmiClientImpl(clientKey, channel);
+    }
+}
diff --git a/protocols/gnmi/ctl/src/main/java/org/onosproject/gnmi/ctl/package-info.java b/protocols/gnmi/ctl/src/main/java/org/onosproject/gnmi/ctl/package-info.java
new file mode 100644
index 0000000..ae46aa4
--- /dev/null
+++ b/protocols/gnmi/ctl/src/main/java/org/onosproject/gnmi/ctl/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+/**
+ * Implementation classes of the gNMI protocol subsystem.
+ */
+package protocols.gnmi.ctl.java.org.onosproject.gnmi.ctl;
\ No newline at end of file
diff --git a/protocols/gnmi/stub/BUILD b/protocols/gnmi/stub/BUILD
index 3b1a2dc..cf79265 100644
--- a/protocols/gnmi/stub/BUILD
+++ b/protocols/gnmi/stub/BUILD
@@ -1,43 +1,14 @@
-load("//tools/build/bazel:osgi_java_library.bzl", "wrapped_osgi_jar")
-load("@io_grpc_grpc_java//:java_grpc_library.bzl", "java_grpc_library")
+load("//tools/build/bazel:osgi_java_library.bzl", "osgi_proto_jar")
 
-wrapped_osgi_jar(
-    name = "gnmi_java_grpc",
-    jar = ":gnmi_java_grpc_native",
-    visibility = ["//visibility:public"],
+PROTOS = [
+    "@com_github_openconfig_gnmi//:gnmi_proto",
+    "@com_github_openconfig_gnmi//:gnmi_ext_proto",
+]
+
+osgi_proto_jar(
+    grpc_proto_lib = "@com_github_openconfig_gnmi//:gnmi_proto",
+    proto_libs = PROTOS,
     deps = [
-        "@io_grpc_grpc_java//core",
-        "@io_grpc_grpc_java//protobuf",
-        "@io_grpc_grpc_java//stub",
-    ],
-)
-
-wrapped_osgi_jar(
-    name = "gnmi_java_proto",
-    jar = ":gnmi_java_proto_native",
-    visibility = ["//visibility:public"],
-    deps = [
-        "@com_google_protobuf//:protobuf_java",
-    ],
-)
-
-java_proto_library(
-    name = "gnmi_java_proto_native",
-    visibility = ["//visibility:public"],
-    deps = [":gnmi_proto"],
-)
-
-java_grpc_library(
-    name = "gnmi_java_grpc_native",
-    srcs = [":gnmi_proto"],
-    deps = [":gnmi_java_proto_native"],
-)
-
-proto_library(
-    name = "gnmi_proto",
-    srcs = ["src/main/proto/gnmi.proto"],
-    deps = [
-        "@com_google_protobuf//:any_proto",
-        "@com_google_protobuf//:descriptor_proto",
+        "@com_google_api_grpc_proto_google_common_protos//jar",
     ],
 )
diff --git a/protocols/gnmi/stub/src/main/proto/COMMIT_ID b/protocols/gnmi/stub/src/main/proto/COMMIT_ID
deleted file mode 100644
index acf773d..0000000
--- a/protocols/gnmi/stub/src/main/proto/COMMIT_ID
+++ /dev/null
@@ -1,2 +0,0 @@
-https://github.com/openconfig/gnmi/blob/master/proto/gnmi/gnmi.proto
-9c8d9e965b3e854107ea02c12ab11b70717456f2
diff --git a/protocols/gnmi/stub/src/main/proto/gnmi.proto b/protocols/gnmi/stub/src/main/proto/gnmi.proto
deleted file mode 100644
index 1f3bb7c..0000000
--- a/protocols/gnmi/stub/src/main/proto/gnmi.proto
+++ /dev/null
@@ -1,423 +0,0 @@
-//
-// Copyright 2016 Google Inc. All Rights Reserved.
-//
-// 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.
-//
-syntax = "proto3";
-
-import "google/protobuf/any.proto";
-import "google/protobuf/descriptor.proto";
-
-// Package gNMI defines a service specification for the gRPC Network Management
-// Interface. This interface is defined to be a standard interface via which
-// a network management system ("client") can subscribe to state values,
-// retrieve snapshots of state information, and manipulate the state of a data
-// tree supported by a device ("target").
-//
-// This document references the gNMI Specification which can be found at
-// http://github.com/openconfig/reference/blob/master/rpc/gnmi
-package gnmi;
-
-// Define a protobuf FileOption that defines the gNMI service version.
-extend google.protobuf.FileOptions {
-    // The gNMI service semantic version.
-    string gnmi_service = 1001;
-}
-
-// gNMI_service is the current version of the gNMI service, returned through
-// the Capabilities RPC.
-option (gnmi_service) = "0.5.0";
-
-service gNMI {
-    // Capabilities allows the client to retrieve the set of capabilities that
-    // is supported by the target. This allows the target to validate the
-    // service version that is implemented and retrieve the set of models that
-    // the target supports. The models can then be specified in subsequent RPCs
-    // to restrict the set of data that is utilized.
-    // Reference: gNMI Specification Section 3.2
-    rpc Capabilities(CapabilityRequest) returns (CapabilityResponse);
-    // Retrieve a snapshot of data from the target. A Get RPC requests that the
-    // target snapshots a subset of the data tree as specified by the paths
-    // included in the message and serializes this to be returned to the
-    // client using the specified encoding.
-    // Reference: gNMI Specification Section 3.3
-    rpc Get(GetRequest) returns (GetResponse);
-    // Set allows the client to modify the state of data on the target. The
-    // paths to modified along with the new values that the client wishes
-    // to set the value to.
-    // Reference: gNMI Specification Section 3.4
-    rpc Set(SetRequest) returns (SetResponse);
-    // Subscribe allows a client to request the target to send it values
-    // of particular paths within the data tree. These values may be streamed
-    // at a particular cadence (STREAM), sent one off on a long-lived channel
-    // (POLL), or sent as a one-off retrieval (ONCE).
-    // Reference: gNMI Specification Section 3.5
-    rpc Subscribe(stream SubscribeRequest) returns (stream SubscribeResponse);
-}
-
-// Notification is a re-usable message that is used to encode data from the
-// target to the client. A Notification carries two types of changes to the data
-// tree:
-//  - Deleted values (delete) - a set of paths that have been removed from the
-//    data tree.
-//  - Updated values (update) - a set of path-value pairs indicating the path
-//    whose value has changed in the data tree.
-// Reference: gNMI Specification Section 2.1
-message Notification {
-    int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
-    Path prefix = 2;              // Prefix used for paths in the message.
-    // An alias for the path specified in the prefix field.
-    // Reference: gNMI Specification Section 2.4.2
-    string alias = 3;
-    repeated Update update = 4;   // Data elements that have changed values.
-    repeated Path delete = 5;     // Data elements that have been deleted.
-}
-
-// Update is a re-usable message that is used to store a particular Path,
-// Value pair.
-// Reference: gNMI Specification Section 2.1
-message Update {
-    Path path = 1;                      // The path (key) for the update.
-    Value value = 2 [deprecated=true];  // The value (value) for the update.
-    TypedValue val = 3;                 // The explicitly typed update value.
-    uint32 duplicates = 4;              // Number of coalesced duplicates.
-}
-
-// TypedValue is used to encode a value being sent between the client and
-// target (originated by either entity).
-message TypedValue {
-    // One of the fields within the val oneof is populated with the value
-    // of the update. The type of the value being included in the Update
-    // determines which field should be populated. In the case that the
-    // encoding is a particular form of the base protobuf type, a specific
-    // field is used to store the value (e.g., json_val).
-    oneof value {
-        string string_val = 1;            // String value.
-        int64 int_val = 2;                // Integer value.
-        uint64 uint_val = 3;              // Unsigned integer value.
-        bool bool_val = 4;                // Bool value.
-        bytes bytes_val = 5;              // Arbitrary byte sequence value.
-        float float_val = 6;              // Floating point value.
-        Decimal64 decimal_val = 7;        // Decimal64 encoded value.
-        ScalarArray leaflist_val = 8;     // Mixed type scalar array value.
-        google.protobuf.Any any_val = 9;  // protobuf.Any encoded bytes.
-        bytes json_val = 10;              // JSON-encoded text.
-        bytes json_ietf_val = 11;         // JSON-encoded text per RFC7951.
-        string ascii_val = 12;            // Arbitrary ASCII text.
-    }
-}
-
-// Path encodes a data tree path as a series of repeated strings, with
-// each element of the path representing a data tree node name and the
-// associated attributes.
-// Reference: gNMI Specification Section 2.2.2.
-message Path {
-    // Elements of the path are no longer encoded as a string, but rather within
-    // the elem field as a PathElem message.
-    repeated string element = 1 [deprecated=true];
-    string origin = 2;                              // Label to disambiguate path.
-    repeated PathElem elem = 3;                     // Elements of the path.
-    string target = 4;                              // The name of the target
-    // (Sec. 2.2.2.1)
-}
-
-// PathElem encodes an element of a gNMI path, along ith any attributes (keys)
-// that may be associated with it.
-// Reference: gNMI Specification Section 2.2.2.
-message PathElem {
-    string name = 1;                    // The name of the element in the path.
-    map<string, string> key = 2;        // Map of key (attribute) name to value.
-}
-
-// Value encodes a data tree node's value - along with the way in which
-// the value is encoded. This message is deprecated by gNMI 0.3.0.
-// Reference: gNMI Specification Section 2.2.3.
-message Value {
-    option deprecated = true;
-    bytes value = 1;      // Value of the variable being transmitted.
-    Encoding type = 2;    // Encoding used for the value field.
-}
-
-// Encoding defines the value encoding formats that are supported by the gNMI
-// protocol. These encodings are used by both the client (when sending Set
-// messages to modify the state of the target) and the target when serializing
-// data to be returned to the client (in both Subscribe and Get RPCs).
-// Reference: gNMI Specification Section 2.3
-enum Encoding {
-    JSON = 0;           // JSON encoded text.
-    BYTES = 1;          // Arbitrarily encoded bytes.
-    PROTO = 2;          // Encoded according to out-of-band agreed Protobuf.
-    ASCII = 3;          // ASCII text of an out-of-band agreed format.
-    JSON_IETF = 4;      // JSON encoded text as per RFC7951.
-}
-
-// Error message previously utilised to return errors to the client. Deprecated
-// in favour of using the google.golang.org/genproto/googleapis/rpc/status
-// message in the RPC response.
-// Reference: gNMI Specification Section 2.5
-message Error {
-    option deprecated = true;
-    uint32 code = 1;                // Canonical gRPC error code.
-    string message = 2;             // Human readable error.
-    google.protobuf.Any data = 3;   // Optional additional information.
-}
-
-// Decimal64 is used to encode a fixed precision decimal number. The value
-// is expressed as a set of digits with the precision specifying the
-// number of digits following the decimal point in the digit set.
-message Decimal64 {
-    int64 digits = 1;         // Set of digits.
-    uint32 precision = 2;     // Number of digits following the decimal point.
-}
-
-// ScalarArray is used to encode a mixed-type array of values.
-message ScalarArray {
-    // The set of elements within the array. Each TypedValue message should
-    // specify only elements that have a field identifier of 1-7 (i.e., the
-    // values are scalar values).
-    repeated TypedValue element = 1;
-}
-
-// SubscribeRequest is the message sent by the client to the target when
-// initiating a subscription to a set of paths within the data tree. The
-// request field must be populated and the initial message must specify a
-// SubscriptionList to initiate a subscription. The message is subsequently
-// used to define aliases or trigger polled data to be sent by the target.
-// Reference: gNMI Specification Section 3.5.1.1
-message SubscribeRequest {
-    oneof request {
-        SubscriptionList subscribe = 1; // Specify the paths within a subscription.
-        Poll poll = 3;                  // Trigger a polled update.
-        AliasList aliases = 4;          // Aliases to be created.
-    }
-}
-
-// Poll is sent within a SubscribeRequest to trigger the device to
-// send telemetry updates for the paths that are associated with the
-// subscription.
-// Reference: gNMI Specification Section Section 3.5.1.4
-message Poll {
-}
-
-// SubscribeResponse is the message used by the target within a Subscribe RPC.
-// The target includes a Notification message which is used to transmit values
-// of the path(s) that are associated with the subscription. The same message
-// is to indicate that the target has sent all data values once (is
-// synchronized).
-// Reference: gNMI Specification Section 3.5.1.4
-message SubscribeResponse {
-    oneof response {
-        Notification update = 1;          // Changed or sampled value for a path.
-        // Indicate target has sent all values associated with the subscription
-        // at least once.
-        bool sync_response = 3;
-        // Deprecated in favour of google.golang.org/genproto/googleapis/rpc/status
-        Error error = 4 [deprecated=true];
-    }
-}
-
-// SubscriptionList is used within a Subscribe message to specify the list of
-// paths that the client wishes to subscribe to. The message consists of a
-// list of (possibly prefixed) paths, and options that relate to the
-// subscription.
-// Reference: gNMI Specification Section 3.5.1.2
-message SubscriptionList {
-    Path prefix = 1;                          // Prefix used for paths.
-    repeated Subscription subscription = 2;   // Set of subscriptions to create.
-    // Whether target defined aliases are allowed within the subscription.
-    bool use_aliases = 3;
-    QOSMarking qos = 4;                       // DSCP marking to be used.
-    // Mode of the subscription.
-    enum Mode {
-        STREAM = 0; // Values streamed by the target (Sec. 3.5.1.5.2).
-        ONCE = 1;   // Values sent once-off by the target (Sec. 3.5.1.5.1).
-        POLL = 2;   // Values sent in response to a poll request (Sec. 3.5.1.5.3).
-    }
-    Mode mode = 5;
-    // Whether elements of the schema that are marked as eligible for aggregation
-    // should be aggregated or not.
-    bool allow_aggregation = 6;
-    // The set of schemas that define the elements of the data tree that should
-    // be sent by the target.
-    repeated ModelData use_models = 7;
-    // The encoding that the target should use within the Notifications generated
-    // corresponding to the SubscriptionList.
-    Encoding encoding = 8;
-    // An optional field to specify that only updates to current state should be
-    // sent to a client. If set, the initial state is not sent to the client but
-    // rather only the sync message followed by any subsequent updates to the
-    // current state. For ONCE and POLL modes, this causes the server to send only
-    // the sync message (Sec. 3.5.2.3).
-    bool updates_only = 9;
-}
-
-// Subscription is a single request within a SubscriptionList. The path
-// specified is interpreted (along with the prefix) as the elements of the data
-// tree that the client is subscribing to. The mode determines how the target
-// should trigger updates to be sent.
-// Reference: gNMI Specification Section 3.5.1.3
-message Subscription {
-    Path path = 1;                    // The data tree path.
-    SubscriptionMode mode = 2;        // Subscription mode to be used.
-    uint64 sample_interval = 3;       // ns between samples in SAMPLE mode.
-    // Indicates whether values that not changed should be sent in a SAMPLE
-    // subscription.
-    bool suppress_redundant = 4;
-    // Specifies the maximum allowable silent period in nanoseconds when
-    // suppress_redundant is in use. The target should send a value at least once
-    // in the period specified.
-    uint64 heartbeat_interval = 5;
-}
-
-// SubscriptionMode is the mode of the subscription, specifying how the
-// target must return values in a subscription.
-// Reference: gNMI Specification Section 3.5.1.3
-enum SubscriptionMode {
-    TARGET_DEFINED = 0;  // The target selects the relevant mode for each element.
-    ON_CHANGE      = 1;  // The target sends an update on element value change.
-    SAMPLE         = 2;  // The target samples values according to the interval.
-}
-
-// QOSMarking specifies the DSCP value to be set on transmitted telemetry
-// updates from the target.
-// Reference: gNMI Specification Section 3.5.1.2
-message QOSMarking {
-    uint32 marking = 1;
-}
-
-// Alias specifies a data tree path, and an associated string which defines an
-// alias which is to be used for this path in the context of the RPC. The alias
-// is specified as a string which is prefixed with "#" to disambiguate it from
-// data tree element paths.
-// Reference: gNMI Specification Section 2.4.2
-message Alias {
-    Path path = 1;     // The path to be aliased.
-    string alias = 2;  // The alias value, a string prefixed by "#".
-}
-
-// AliasList specifies a list of aliases. It is used in a SubscribeRequest for
-// a client to create a set of aliases that the target is to utilize.
-// Reference: gNMI Specification Section 3.5.1.6
-message AliasList {
-    repeated Alias alias = 1;    // The set of aliases to be created.
-}
-
-// SetRequest is sent from a client to the target to update values in the data
-// tree. Paths are either deleted by the client, or modified by means of being
-// updated, or replaced. Where a replace is used, unspecified values are
-// considered to be replaced, whereas when update is used the changes are
-// considered to be incremental. The set of changes that are specified within
-// a single SetRequest are considered to be a transaction.
-// Reference: gNMI Specification Section 3.4.1
-message SetRequest {
-    Path prefix = 1;                // Prefix used for paths in the message.
-    repeated Path delete = 2;       // Paths to be deleted from the data tree.
-    repeated Update replace = 3;    // Updates specifying elements to be replaced.
-    repeated Update update = 4;     // Updates specifying elements to updated.
-}
-
-// SetResponse is the response to a SetRequest, sent from the target to the
-// client. It reports the result of the modifications to the data tree that were
-// specified by the client. Errors for this RPC should be reported using the
-// https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto
-// message in the RPC return. The gnmi.Error message can be used to add additional
-// details where required.
-// Reference: gNMI Specification Section 3.4.2
-message SetResponse {
-    Path prefix = 1;                      // Prefix used for paths.
-    // A set of responses specifying the result of the operations specified in
-    // the SetRequest.
-    repeated UpdateResult response = 2;
-    Error message = 3 [deprecated=true]; // The overall status of the transaction.
-    int64 timestamp = 4;                 // Timestamp of transaction (ns since epoch).
-}
-
-// UpdateResult is used within the SetResponse message to communicate the
-// result of an operation specified within a SetRequest message.
-// Reference: gNMI Specification Section 3.4.2
-message UpdateResult {
-    // The operation that was associated with the Path specified.
-    enum Operation {
-        INVALID = 0;
-        DELETE = 1;           // The result relates to a delete of Path.
-        REPLACE = 2;          // The result relates to a replace of Path.
-        UPDATE = 3;           // The result relates to an update of Path.
-    }
-    // Deprecated timestamp for the UpdateResult, this field has been
-    // replaced by the timestamp within the SetResponse message, since
-    // all mutations effected by a set should be applied as a single
-    // transaction.
-    int64 timestamp = 1 [deprecated=true];
-    Path path = 2;                            // Path associated with the update.
-    Error message = 3 [deprecated=true];      // Status of the update operation.
-    Operation op = 4;                         // Update operation type.
-}
-
-// GetRequest is sent when a client initiates a Get RPC. It is used to specify
-// the set of data elements for which the target should return a snapshot of
-// data. The use_models field specifies the set of schema modules that are to
-// be used by the target - where use_models is not specified then the target
-// must use all schema models that it has.
-// Reference: gNMI Specification Section 3.3.1
-message GetRequest {
-    Path prefix = 1;                      // Prefix used for paths.
-    repeated Path path = 2;               // Paths requested by the client.
-    // Type of elements within the data tree.
-    enum DataType {
-        ALL = 0;                            // All data elements.
-        CONFIG = 1;                         // Config (rw) only elements.
-        STATE = 2;                          // State (ro) only elements.
-        // Data elements marked in the schema as operational. This refers to data
-        // elements whose value relates to the state of processes or interactions
-        // running on the device.
-        OPERATIONAL = 3;
-    }
-    DataType type = 3;                    // The type of data being requested.
-    Encoding encoding = 5;                // Encoding to be used.
-    repeated ModelData use_models = 6;    // The schema models to be used.
-}
-
-// GetResponse is used by the target to respond to a GetRequest from a client.
-// The set of Notifications corresponds to the data values that are requested
-// by the client in the GetRequest.
-// Reference: gNMI Specification Section 3.3.2
-message GetResponse {
-    repeated Notification notification = 1;   // Data values.
-    Error error = 2 [deprecated=true];       // Errors that occurred in the Get.
-}
-
-// CapabilityRequest is sent by the client in the Capabilities RPC to request
-// that the target reports its capabilities.
-// Reference: gNMI Specification Section 3.2.1
-message CapabilityRequest {
-}
-
-// CapabilityResponse is used by the target to report its capabilities to the
-// client within the Capabilities RPC.
-// Reference: gNMI Specification Section 3.2.2
-message CapabilityResponse {
-    repeated ModelData supported_models = 1;    // Supported schema models.
-    repeated Encoding supported_encodings = 2;  // Supported encodings.
-    string gNMI_version = 3;                    // Supported gNMI version.
-}
-
-// ModelData is used to describe a set of schema modules. It can be used in a
-// CapabilityResponse where a target reports the set of modules that it
-// supports, and within the SubscribeRequest and GetRequest messages to specify
-// the set of models from which data tree elements should be reported.
-// Reference: gNMI Specification Section 3.2.3
-message ModelData {
-    string name = 1;            // Name of the model.
-    string organization = 2;    // Organization publishing the model.
-    string version = 3;         // Semantic version of the model.
-}
