fuchsia.netemul.network

PROTOCOLS

NetworkManager

Defined in fuchsia.netemul.network/network.fidl

Manages virtual networks.

ListNetworks

Lists emulated networks by name.

Request

NameType

Response

NameType
nets vector<string>

CreateNetwork

Creates a new network with given name and config.

Request

NameType
name string
config NetworkConfig

Response

NameType
status zx/status
net Network?

GetNetwork

Gets a handle to a network.

Request

NameType
name string

Response

NameType
net Network?

EndpointManager

Defined in fuchsia.netemul.network/network.fidl

Manages virtual endpoints.

ListEndpoints

Lists endpoints by name.

Request

NameType

Response

NameType
endp vector<string>

CreateEndpoint

Creates endpoint with given name and config.

Request

NameType
name string
config EndpointConfig

Response

NameType
status zx/status
endpoint Endpoint?

GetEndpoint

Gets a handle to an endpoint.

Request

NameType
name string

Response

NameType
endpoint Endpoint?

FakeEndpoint

Defined in fuchsia.netemul.network/network.fidl

Fake endpoint can be added to a network to snoop or inject packets.

Write

Write Data packet to network.

Request

NameType
data vector<uint8>

OnData

Called when network receives a data packet.

Response

NameType
data vector<uint8>

Network

Defined in fuchsia.netemul.network/network.fidl

Virtual network.

GetConfig

Gets network configuration.

Request

NameType

Response

NameType
config NetworkConfig

GetName

Gets network name.

Request

NameType

Response

NameType
name string

SetConfig

Updates network configuration.

Request

NameType
config NetworkConfig

Response

NameType
status zx/status

AttachEndpoint

Attaches endpoint with given name to network.

Request

NameType
name string

Response

NameType
status zx/status

RemoveEndpoint

Removes endpoint with given name from network.

Request

NameType
name string

Response

NameType
status zx/status

CreateFakeEndpoint

Injects a fake endpoint.

Request

NameType
ep request<FakeEndpoint>

DeviceProxy

Defined in fuchsia.netemul.network/network.fidl

Simple interface to serve devices over fidl.

ServeDevice

Fulfills the device request. The fulfilled requests's protocol is defined by the Endpoint's EndpointBacking.

Request

NameType
req handle<channel>

Endpoint

Defined in fuchsia.netemul.network/network.fidl

Virtual ethernet endpoint.

GetConfig

Request

NameType

Response

NameType
config EndpointConfig

GetName

Gets endpoint name.

Request

NameType

Response

NameType
name string

SetLinkUp

Sends link up or down signal

Request

NameType
up bool

Response

NameType

GetDevice

Opens a channel with the underlying device protocol. The resulting DeviceConnection variant is defined by this Endpoint's EndpointBacking.

Request

NameType

Response

NameType
device DeviceConnection

GetProxy

Gets a proxy to open requests with zircon ethernet device.

Request

NameType
proxy request<DeviceProxy>

SetupHandle

Defined in fuchsia.netemul.network/network.fidl

Handle returned when using NetworkContext.Setup for quick network configuration. Networks and endpoints created by Setup are tied to the lifecycle of the SetupHandle's channel.

NetworkContext

Defined in fuchsia.netemul.network/network.fidl

Main entry point to manage virtual networks and endpoints.

GetNetworkManager

Request

NameType
net_manager request<NetworkManager>

GetEndpointManager

Request

NameType
endp_manager request<EndpointManager>

Setup

Creates a collection of networks described by networks. status is ZX_OK for success setup_handle is a resource that references and maintains the lifecycle of the created networks and endpoints.

Request

NameType
networks vector<NetworkSetup>

Response

NameType
status zx/status
setup_handle SetupHandle?

STRUCTS

LatencyConfig

Defined in fuchsia.netemul.network/network.fidl

Provides emulated latency configuration.

NameTypeDescriptionDefault
average uint64

Average latency, in ms.

No default
std_dev uint64

Latency standard deviation, in ms.

No default

ReorderConfig

Defined in fuchsia.netemul.network/network.fidl

Provides emulated packet reordering configuration.

NameTypeDescriptionDefault
store_buff uint32

Size of buffer, in packets, to store and forward with randomized order.

No default
tick uint64

Tick/deadline in ms to empty buffer, regardless of full state. 0 will cause buffer to flush only when full (dangerous).

No default

EndpointConfig

Defined in fuchsia.netemul.network/network.fidl

Configuration used to create an endpoint.

NameTypeDescriptionDefault
mtu uint16

Fake ethernet mtu.

No default
mac fuchsia.net/MacAddress?

Fake ethernet mac address, if not provided will be set to randomized local mac, using endpoint name as seed.

No default
backing EndpointBacking

Backing type of emulated endpoint.

No default

NetworkSetup

Defined in fuchsia.netemul.network/network.fidl

Convenience struct for creating entire network setups.

NameTypeDescriptionDefault
name string

Network name, must be unique in network context.

No default
config NetworkConfig

NetworkConfig to use when creating network.

No default
endpoints vector<EndpointSetup>

Collection of endpoints to create and attach to network.

No default

EndpointSetup

Defined in fuchsia.netemul.network/network.fidl

Convenience struct for creating endpoints along with network setup.

NameTypeDescriptionDefault
name string

Endpoint name, must be unique in network context.

No default
config EndpointConfig?

Optional endpoint config, if not provided defaults will be used. Default values are: mtu = 1500, backing = ETHERTAP, mac = randomized.

No default
link_up bool

Start endpoint with link status up.

No default

ENUMS

EndpointBacking

Type: uint32

Defined in fuchsia.netemul.network/network.fidl

Backing of an emulated endpoint.

NameValueDescription
ETHERTAP 1

Endpoint backed by ethertap device.

NETWORK_DEVICE 2

Endpoint backed by a network-tun device. The created fuchsia.hardware.network.Device always acts as a virtual ethernet device.

TABLES

NetworkConfig

Defined in fuchsia.netemul.network/network.fidl

Used to configure a network with emulated adversity conditions.

OrdinalNameTypeDescription
1 latency LatencyConfig

Latency configuration.

2 packet_loss LossConfig

Packet loss configuration.

3 reorder ReorderConfig

Packet reordering configuration.

UNIONS

LossConfig

Defined in fuchsia.netemul.network/network.fidl

Provides emulated packet loss configuration.

NameTypeDescription
random_rate uint8

Rate of packet loss expressed as independent drop probability [0-100].

DeviceConnection

Defined in fuchsia.netemul.network/network.fidl

A connection to an endpoint's underlying protocol.

NameTypeDescription
ethernet fuchsia.hardware.ethernet/Device

Set if the endpoint's backing is ETHERTAP.

network_device fuchsia.hardware.network/DeviceInstance

Set if the endpoint's backing is NETWORK_DEVICE.