Skip to content

Network Service

The Network Service is a gRPC & Go based network configuration service. The network settings of the Edge Devices are configured through this service.

Table of Contents

Top

Network.proto

Interface

Interface type holds settings for a Network Interface.

Field Type Label Description
GatewayInterface bool if true, route metric will be set to 1. Otherwise route metric is -1. Similarly, when the interface is requested,return value will be true if route metric is 1.
MacAddress string "20:87:56:b5:ed:e0"
DHCP string values can be 'enabled' or 'disabled'. for compatiblity reasons it is not boolean.
Static Interface.StaticConf Static field is StaticConf type instance.
DNSConfig Interface.Dns DNSConfig is dns type instance.
L2Conf Interface.L2
InterfaceName string Network interface name e.g: "enp2s0"
Label string Label for the interface e.g: "X1"

Interface.Dns

Type that contains Primary and Secondary DNS.

Field Type Label Description
PrimaryDNS string e.g: "1.1.1.2"
SecondaryDNS string e.g: "1.1.1.1"

Interface.L2

Field Type Label Description
StartingAddressIPv4 string e.g: 192.168.0.2
NetMask string e.g: 255.255.255.0
Range string e.g: 16
Gateway string e.g: 192.168.2.1
AuxiliaryAddresses Interface.L2.AuxiliaryAddressesEntry repeated Preserved addresses for other devices. These addresses won't be assigned to containers. e.g my_plc, 192.168.0.5

Interface.L2.AuxiliaryAddressesEntry

Field Type Label Description
key string
value string

Interface.StaticConf

StaticConf type holds IP Netmask and Gateway information

Field Type Label Description
IPv4 string e.g: 192.168.0.2
NetMask string e.g: 255.255.255.0
Gateway string e.g: 192.168.0.1

NetworkInterfaceRequest

Contains MAC address, used for retrieving specified Network Interface settings.

Field Type Label Description
mac string

NetworkInterfaceRequestWithLabel

Returns an Network Interface with

Field Type Label Description
label string

NetworkSettings

Contains multiple network interface settings. It can be used to apply or get the settings.

Field Type Label Description
Interfaces Interface repeated Network settings contains an array of Interfaces.Applying new settings or receiving current settings is supported for multiple ethernet typed network interfaces supported.
LabelMap NetworkSettings.LabelMapEntry repeated LabelMap contains port label and corresponding interface-name. e.g key : x1 value: enp2s0

NetworkSettings.LabelMapEntry

Field Type Label Description
key string
value string

NetworkService

Network service ,uses a UNIX Domain Socket "/var/run/devicemodel/network.sock" for GRPC communication. protoc generates both client and server instance for this Service. GRPC Status codes : https://developers.google.com/maps-booking/reference/grpc-api/status_codes .

Method Name Request Type Response Type Description
GetAllInterfaces .google.protobuf.Empty NetworkSettings Returns the settings of all ethernet typed network interfaces
GetInterfaceWithMac NetworkInterfaceRequest Interface Returns the current setting for the interface, with given MAC address.
GetInterfaceWithLabel NetworkInterfaceRequestWithLabel Interface Returns the current setting for the interface, with given Label.
ApplySettings NetworkSettings .google.protobuf.Empty Applies given configurations to Network Interfaces.

Device Info

Request Parameter: https://<IP>/device/edge/api/v2/info

Capabilities

host.networkservice

The Network Service capability enables an app to manage all network-related operations through a REST-based API. This includes applying settings, retrieving all network interfaces, and fetching specific interface details using labels or MAC addresses. The API is authenticated to ensure secure communication between the app and the host system.

By default, this capability is enabled. If it is disabled, no network-related information can be retrieved.

host.systemservice

The System Service capability enables an app to manage all system service-related operations through a REST-based API. This includes applying custom settings, retrieving firmware information, fetching resource statistics, and accessing system logs. The API is authenticated to ensure secure communication between the app and the host system.

By default, all capabilities are set to true. If the GetFirmwareInfo capability is set to false, the corresponding information cannot be retrieved.

API spec can be found here:

IED API 2.1.0

Response Parameters with layer-2 enabled

Parameter Name Data Type Description
deviceId String Unique identifier for the device
deviceName String Name of the device
firmwareVersion String Firmware version of the device
interfaceName String Name of the network interface
ipAddress String IP address assigned to the network interface
subnetMask String Subnet mask of the network interface
gateway String Gateway address for the network interface
macAddress String MAC address of the network interface
l2IPv4 String Layer 2 IPv4 address (if applicable)
l2SubnetMask String Layer 2 subnet mask (if applicable)
l2Gateway String Layer 2 gateway address (if applicable)

Sample response

{
  "deviceId": "973ad4260564446bacc93f2918bc6f11",
  "deviceName": "INFO",
  "networks": [
    {
      "interfaceName": "ens160",
      "ipAddress": "192.168.182.137",
      "subnetMask": "255.255.255.0",
      "gateway": "192.168.182.2",
      "macAddress": "00:0C:29:16:DD:5C"
    },
    {
      "interfaceName": "ens32",
      "ipAddress": "192.168.182.139",
      "subnetMask": "255.255.255.0",
      "gateway": "192.168.182.2",
      "macAddress": "00:0C:29:16:DD:70"
    },
    {
      "interfaceName": "ens33",
      "ipAddress": "192.168.182.138",
      "subnetMask": "255.255.255.0",
      "gateway": "192.168.182.2",
      "macAddress": "00:0C:29:16:DD:66"
    }
  ],
  "firmwareVersion": "ievd-dbg-1.24.0-4-gp"
}

NOTICE

The Layer 2 network information is available only when it is enabled.

Response Parameters without layer-2

Parameter Name Data Type Description
deviceId String Unique identifier for the device
deviceName String Name of the device
firmwareVersion String Firmware version of the device
interfaceName String Name of the network interface
ipAddress String IP address assigned to the network interface
subnetMask String Subnet mask of the network interface
gateway String Gateway address for the network interface
macAddress String MAC address of the network interface

Sample response

{
  "deviceId": "973ad4260564446bacc93f2918bc6f11",
  "deviceName": "INFO",
  "networks": [
    {
      "interfaceName": "ens160",
      "ipAddress": "192.168.182.137",
      "subnetMask": "255.255.255.0",
      "gateway": "192.168.182.2",
      "macAddress": "00:0C:29:16:DD:5C"
    },
    {
      "interfaceName": "ens32",
      "ipAddress": "192.168.182.139",
      "subnetMask": "255.255.255.0",
      "gateway": "192.168.182.2",
      "macAddress": "00:0C:29:16:DD:70"
    },
    {
      "interfaceName": "ens33",
      "ipAddress": "192.168.182.138",
      "subnetMask": "255.255.255.0",
      "gateway": "192.168.182.2",
      "macAddress": "00:0C:29:16:DD:66"
    }
  ],
  "firmwareVersion": "ievd-dbg-1.24.0-4-gp"
}

Scalar Value Types

.proto Type Notes C++ Java Python Go C# PHP Ruby
double double double float float64 double float Float
float float float float float32 float float Float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int int32 int integer Bignum or Fixnum (as required)
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long int64 long integer/string Bignum
uint32 Uses variable-length encoding. uint32 int int/long uint32 uint integer Bignum or Fixnum (as required)
uint64 Uses variable-length encoding. uint64 long int/long uint64 ulong integer/string Bignum or Fixnum (as required)
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int int32 int integer Bignum or Fixnum (as required)
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long int64 long integer/string Bignum
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int uint32 uint integer Bignum or Fixnum (as required)
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long uint64 ulong integer/string Bignum
sfixed32 Always four bytes. int32 int int int32 int integer Bignum or Fixnum (as required)
sfixed64 Always eight bytes. int64 long int/long int64 long integer/string Bignum
bool bool boolean boolean bool bool boolean TrueClass/FalseClass
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode string string string String (UTF-8)
bytes May contain any arbitrary sequence of bytes. string ByteString str []byte ByteString string String (ASCII-8BIT)