Get desktop application:
View/edit binary Protocol Buffers messages
------------------------------------------------------------------------------
Optional: Response should include the device-specific capabilities of the device identified by `device_id` in addition to server-wide capabilities. Added in v1.5.0
The full semantic version string (e.g. "1.1.0-rc.1") corresponding to the version of the P4Runtime API currently implemented by the server.
Used for experimental features before proposing them for standardization. Added in 1.5.0.
Gets the current P4 forwarding-pipeline config.
Read one or more P4 entities from the target.
When specified, only return table entries for the given role. Added in 1.4.0.
Sets the P4 forwarding-pipeline config.
------------------------------------------------------------------------------
Deprecated in 1.4.0.
Added in 1.4.0.
(message has no fields)
Represents the bidirectional stream between the controller and the switch (initiated by the controller), and is managed for the following purposes: - connection initiation through client arbitration - indicating switch session liveness: the session is live when switch sends a positive client arbitration update to the controller, and is considered dead when either the stream breaks or the switch sends a negative update for client arbitration - the controller sending/receiving packets to/from the switch - streaming of notifications from the switch
------------------------------------------------------------------------------
Used by the server to asynchronously report errors which occur when processing StreamMessageRequest messages.
Update one or more P4 entities on the target.
------------------------------------------------------------------------------
Deprecated in v1.4.0
Added in v1.4.0
The write batch, comprising a list of Update operations. The P4Runtime server may arbitrarily reorder messages within a batch to maximize performance.
(message has no fields)
Used in: , , ,
Used in:
Used in:
Using int32 as ports is deprecated, use watch_port instead.
Used in:
Added in v1.6.0. The group's pre-action that gets composed with the selected member action.
Determines how the group selects a per-packet action.
Determines the resources used by the group.
Added in v1.5.0.
Used in:
Uses the mode specified by the action selector.
Uses the hash mode specified by the action selector or a target-defined hash mode if there is none.
Picks the action randomly.
Added in v1.5.0.
Used in:
Uses the `selector_size_semantics` specified by the action selector.
Uses the `sum_of_weights` `selector_size_semantics` for this group.
Uses the `sum_of_members` `selector_size_semantics` for this group.
------------------------------------------------------------------------------
Used in:
Max number of weighted member entries in this group. It cannot be modified after a group has been created. It must not exceed the static max_group_size included in P4Info. If the max size is not known at group creation-time, the client may leave this field unset (default value 0), in which case the static max_group_size value will be used and the group will be able to include up to max_group_size weighted member entries.
Used in:
Using int32 as ports is deprecated, use watch_port instead.
------------------------------------------------------------------------------
Used in:
A backup replica used as a fallback when the primary replica port goes down. Added in v1.5.0.
Used in:
A packet may be cloned by setting the clone_session_id field of PSA ingress/egress output metadata to session_id of a programmed clone session entry. Multiple clones may be created via a single clone session entry by using the replicas message. The clones may be distinguished in the egress using the instance field. The class_of_service field of the clone's egress input metadata will be set to the respective value programmed in the clone session entry. Note that in case of multiple clones, all clones, defined for a clone session, will get the same class of service. The packet_length_bytes field must be set to a non-zero value if the clone packet(s) should be truncated to the given value (in bytes). The packet length is also common to all clones in the clone session. If the packet_length_bytes field is 0, no truncation on the clone(s) will be performed.
Used in:
Used in: , , ,
------------------------------------------------------------------------------ For WriteRequest, Update.Type must be MODIFY. For ReadRequest, the scope is defined as follows: - All counter cells for all counters if counter_id = 0 (default). - All counter cells for given counter_id if index is unset (default).
Used in:
------------------------------------------------------------------------------ Used to configure the digest extern only, not to stream digests or acks
Used in:
a DigestList message is streamed when the following conditions are met: - there is at least one digest ready - the oldest digest in the list has been waiting for at least max_timeout_ns nanoseconds or we have gathered max_list_size digests already
Used in:
max timeout for outstanding digest data
max size for a digest list
timeout for DigestListAck message
Used in:
identifies the digest extern instance
identifies a list of entries, used by receiver to ack
List of entries: each call to the Digest<T>::pack() method corresponds to one entry and we can have as little as one entry.
Timestamp at which the server generated the message (in nanoseconds since Epoch)
Used by the controller to ack a DigestList message. To avoid flooding the controller, the switch must not generate digest notifications for the same data until a DigestListAck message with the same list_id is received or the ack timeout (ack_timeout_ns field in DigestEntry.Config) expires.
Used in: ,
Used in:
Optional. The digest list acknowledgement message that caused the error.
------------------------------------------------------------------------------ For WriteRequest, Update.Type must be MODIFY. INSERT and DELETE on direct counters is not allowed and will return an error. The insertion/deletion should happen as part of INSERT/DELETE on the associated table-entry. For ReadRequest, the scope is defined as follows: - All counter cells for all tables if table_entry.table_id = 0. - All counter cells of a table if table_entry.table_id is present and table_entry.match is empty.
Used in:
The associated table entry. This field is required. table_entry.action is ignored. Other fields specify the match.
------------------------------------------------------------------------------ For WriteRequest, Update.Type must be MODIFY. INSERT and DELETE on direct meters is not allowed and will return an error. The insertion/deletion should happen as part of INSERT/DELETE on the associated table-entry. For ReadRequest, the scope is defined as follows: - All meter cells for all tables if table_entry.table_id = 0. - All meter cells of a table if table_entry.table_id is present and table_entry.match is empty.
Used in:
The associated table entry. This field is required. table_entry.action is ignored. Other fields specify the match.
Added in v1.4.0
Used in: , ,
Error message used to report a single P4-entity error for a Write RPC.
gRPC canonical error code (see https://developers.google.com/maps-booking/reference/grpc-api/status_codes)
Detailed error message.
Target and architecture specific space to which this error belongs. We encourage using triplet: <target>-<arch>-<vendor>, e.g."targetX-psa-vendor1" or "targetY-psa-vendor2".
Numeric code drawn from target-specific error space above.
Optional: Allows reporting back additional target-specific details on the error.
Used in:
the extern_type_id is unique for a given architecture and must be in the range [0x81, 0xfe].
id of the instance
field_match_type ::= exact | ternary | lpm | range | optional
Used in: ,
Architecture-specific match value; it corresponds to the other_match_type in the P4Info MatchField message.
Matches can be performed on arbitrarily-large inputs; the protobuf type 'bytes' is used to model arbitrarily-large values.
Used in:
Used in:
in bits
If the Optional match should be a wildcard, the FieldMatch must be omitted. Otherwise, this behaves like an exact match.
Used in:
A Range is logically a set that contains all values numerically between 'low' and 'high' inclusively.
Used in:
Used in:
Used in: ,
Target-specific P4 configuration.
Metadata (cookie) opaque to the target. A control plane may use this field to uniquely identify this config. There are no restrictions on how such value is computed, or where this is stored on the target, as long as it is returned with a GetForwardingPipelineConfig RPC. When reading the cookie, we need to distinguish those cases where a cookie is NOT present (e.g. not set in the SetForwardingPipelineConfigRequest, therefore we wrap the actual uint64 value in a protobuf message.
Used in:
Specifies the fields to populate in the response.
Used in:
Default behaviour. Returns a ForwardingPipelineConfig with all fields set as stored by the target.
Reply by setting only the cookie field, omitting all other fields.
Reply by setting the p4info and cookie fields.
Reply by setting the p4_device_config and cookie fields.
Used in:
The only fields that are required to be set in each TableEntry are the "key" fields (table_id, match and priority) along with controller_metadata, metadata and idle_timeout_ns.
Timestamp at which the server generated the message (in nanoseconds since Epoch)
An index as a protobuf message. In proto3, fields cannot be optional and there is no difference between an unset integer field and an integer field set to 0. This is inconvenient for reading from P4 array-like structures, such as indirect counters and meters. We need a way to do a wildcard read on these but we cannot use a default zero index value to do so, as zero is a valid index (first entry in the array). We therefore wrap the index in a message.
Used in: , ,
Used in: ,
The role for which the primary client is being arbitrated. For use-cases where multiple roles are not needed, the controller can leave this unset, implying default role and full pipeline access.
The stream RPC with the highest election_id is the primary. The 'primary' controller instance populates this with its latest election_id. Switch populates with the highest election ID it has received from all connected controllers.
Switch populates this with OK for the client that is the primary, and with an error status for all other connected clients (at every primary client change). The controller does not populate this field.
Modeled to support both RFC 2698: A Two Rate Three Color Marker (trTCM) and RFC 2697: A Single Rate Three Color Marker (srTCM) based on the `type` of the corresponding MeterSpec. The trTCM meters a packet stream and marks its packets based on two rates, Peak Information Rate (PIR) and Committed Information Rate (CIR), and their associated burst sizes to be either green, yellow, or red. A packet is marked red if it exceeds the PIR. Otherwise it is marked either yellow or green depending on whether it exceeds or doesn't exceed the CIR. For this meter type, `eburst` must be unset. The srTCM meters a packet stream and marks its packets based on one rate, Committed Information Rate (CIR), and its associated burst size as well as an Excess Burst Size (EBS) to be either green, yellow, or red. Roughly, a packet is marked green if it doesn't exceed the CIR. Otherwise it is marked either yellow or green depending on whether it exceeds or doesn't exceed the EBS. For this meter type, it must be the case that `cir == pir && cburst == pburst`.
Used in: , ,
Committed information rate (units per sec)
Committed burst size
Peak information rate (units per sec)
Peak burst size
Excess burst size (only used by srTCM). Added in 1.4.0.
Added in v1.4.0
Used in: , ,
------------------------------------------------------------------------------ For WriteRequest, Update.Type must be MODIFY. For ReadRequest, the scope is defined as follows: - All meter cells for all meters if meter_id = 0 (default). - All meter cells for given meter_id if index is unset (default).
Used in:
Added in v1.4.0
The (port, instance) pair must be unique for each replica in a given multicast group entry. A packet may be multicast by setting the multicast_group field of PSA ingress output metadata to multicast_group_id of a programmed multicast group entry. The port and instance fields of each replica's egress input metadata will be set to the respective values programmed in the multicast group entry.
Used in:
Arbitrary metadata from the controller that is opaque to the target. Added in 1.4.0.
Used in: , ,
for bit<W>, int<W>
for varbit<W>
safe (non-serializable) enums only
serializable enums only
Used in: , ,
If the header is invalid (is_valid is "false"), then the bitstrings repeated field must be empty.
Used in:
The length of this repeated field must always be equal to the compile-time size of the header stack, which is specified in P4Info.
Used in: ,
An empty string indicates that none of the union members are valid and valid_header must therefore be unset.
Used in:
The length of this repeated field must always be equal to the compile-time size of the header union stack, which is specified in P4Info.
Used in:
Used in:
dynamic bitwidth of the field
Packet sent from the switch to the controller.
Used in:
This will be based on P4 header annotated as @controller_header("packet_in"). At most one P4 header can have this annotation.
Any metadata associated with Packet-IO (controller Packet-In or Packet-Out) needs to be modeled as P4 headers carrying special annotations @controller_header("packet_out") and @controller_header("packet_in") respectively. There can be at most one header each with these annotations. These special headers are captured in P4Info ControllerPacketMetadata.
Used in: ,
This refers to Metadata.id coming from P4Info ControllerPacketMetadata.
Packet sent from the controller to the switch.
Used in: ,
This will be based on P4 header annotated as @controller_header("packet_out"). At most one P4 header can have this annotation.
Used in:
Optional. The packet out message that caused the error.
------------------------------------------------------------------------------ Only one instance of a Packet Replication Engine (PRE) is expected in the P4 pipeline. Hence, no instance id is needed to access the PRE.
Used in:
------------------------------------------------------------------------------
Used in:
Used for replicas created for cloning and multicasting actions.
Used in: ,
Using uint32 as ports is deprecated, use port field instead. Deprecated in v1.4.0
Added in v1.4.0
List of backup replicas used as a fallback when the primary replica port (and all higher-preference backup replica ports) are down. Added in v1.5.0.
Used in:
Uniquely identifies this role. Deprecated in 1.4.0.
Added in 1.4.0.
Describes the role configuration, i.e. what operations, P4 entities, behaviors, etc. are in the scope of a given role. If config is not set (default case), it implies all P4 objects and control behaviors are in scope, i.e. full pipeline access. The format of this message is out-of-scope of P4Runtime.
------------------------------------------------------------------------------ Reserved controller-specified SDN port numbers for reference.
SDN ports are numbered starting form 1.
0xfffffeff: The maximum value of an SDN port (physical or logical).
Reserved SDN port numbers (0xffffff00 - 0xffffffff) 0xfffffffa: Recirculate the packet back to ingress
0xfffffffd: Send to CPU
Used in:
Verify that the target can realize the given config. Do not modify the forwarding state in the target. Returns error if config is not provided of if the provided config cannot be realized.
Save the config if the target can realize it. Do not modify the forwarding state in the target. Any subsequent read/write requests must refer to fields in the new config. Returns error if config is not provided of if the provided config cannot be realized.
Verify, save and realize the given config. Clear the forwarding state in the target. Returns error if config is not provided of if the provided config cannot be realized.
Realize the last saved, but not yet committed, config. Update the forwarding state in the target by replaying the write requests since the last config was saved. Config should not be provided for this action type. Returns an error if no saved config is found or if a config is provided with this message.
Verify, save and realize the given config, while preserving the forwarding state in the target. This is an advanced use case to enable changes to the P4 forwarding pipeline configuration with minimal traffic loss. P4Runtime does not impose any constraints on the duration of the traffic loss. The support for this option is not expected to be uniform across all P4Runtime targets. A target that does not support this option may return an UNIMPLEMENTED error. For targets that support this option, an INVALID_ARGUMENT error is returned if no config is provided, or if the existing forwarding state cannot be preserved for the given config by the target.
Used by the server to asynchronously report errors which occur when processing StreamMessageRequest messages.
Used in:
gRPC canonical error code (see https://developers.google.com/maps-booking/reference/grpc-api/status_codes)
Optional. An explanation of the error.
Optional. Target and architecture specific space to which this error belongs. We encourage using triplet: <target>-<arch>-<vendor>, e.g."targetX-psa-vendor1" or "targetY-psa-vendor2".
Optional. Numeric code drawn from target-specific error space above.
Used by the server to convey additional information about the error. One of the fields must be set (so that the client can identify which type of stream message triggered the error), but that field may be set to its default value.
Used in:
Optional. The architecture-specific stream message that caused the error.
table_actions ::= action_specification | action_profile_specification
Used in:
Used in: , , ,
Should only be set if the match implies a TCAM lookup, i.e. at least one of the match fields is Optional, Ternary or Range. A higher number indicates higher priority. Only a highest priority entry that matches the packet must be selected. Multiple entries in the same table with the same priority value are permitted. See Section "TableEntry" in the specification for details of the behavior.
Metadata (cookie) opaque to the target. There is no requirement of where this is stored, as long as it is returned with the rest of the entry in a Read RPC. This is deprecated in favor of the more flexible metadata field.
meter_config, counter_data and meter_counter_data are convenience fields that enable the controller to configure the direct resources associated with the table at the same time as a match-action entry is inserted or modified. Table write: - If the table does not contain a direct resource, then setting the corresponding direct resource field in any table write operation will return an error. - When inserting a new table entry, leaving these fields unset means that the direct resources of this table (if any) will assume default values. For counters, the default value is 0, and for meters, the default value is always green. - When updating a table entry, leaving meter_config unset will reset the meter (if any) to its default configuration, while leaving counter_data or meter_counter_data unset means that the counter (if any) will not be updated. Table read: - If the table does not contain a direct resource, then the corresponding field will not be set in the read table entry. - If meter_config is unset in the request, or if the meter has a default configuration, meter_config will not be set in the response. - If counter_data or meter_counter_data is unset in the request, it will be unset in the response as well.
Per color counters for tables with a direct meter. Added in v1.4.0
Set to true if the table entry is being used to update the non-const default action of the table. If true, the "match" field must be empty and the "action" field must be populated with a valid direct action.
The TTL for the entry, in nanoseconds. A value of 0 means that the table entry never "expires".
Table write: this field should be left unset. Table read: if the table supports idle timeout and time_since_last_hit is set in the request, this field will be set in the response.
Arbitrary metadata from the controller that is opaque to the target.
True if and only if the entry cannot be deleted or modified, i.e. any of the following: + Any entry read from a table declared with `const entries` + The default entry read from a table declared with `const default_action` + Any entry declared with `entries` without the `const` qualifier before `entries`, where the individual entry has the `const` qualifier on it in the P4 source code. Note: Older P4Runtime API servers before the `is_const` field was added to this message will not return a value for `is_const` in the first two cases above, but newer P4Runtime API servers will. Added in 1.4.0.
Used in:
Time elapsed - in nanoseconds - since the table entry was last "hit" as part of a data plane table lookup.
Used in: , ,
Highest 64 bits of a 128 bit number.
Lowest 64 bits of a 128 bit number.
Used in:
Used in:
------------------------------------------------------------------------------ For writing and reading matches in a parser value set. A state transition on an empty value set will never be taken. The number of matches must be at most the size of the value set as specified by the size argument of the value_set constructor in the P4 program. For Write Requests: - MODIFY will write the given matches in the repeated field to the value set. - INSERT and DELETE are not allowed. For Read Requests: - All matches for all value-set entries if value_set_id = 0 - All matches of the value-set if a valid value_set_id is specified - The 'match' field must never be set in the ReadRequest
Used in:
A member in a P4 value set. Each member defines a list of matches, which can have different match types.
Used in:
Used in:
Required. This is the default behavior. The batch is processed in a non-atomic manner from a data plane point of view. Each operation within the batch must be attempted even if one or more encounter errors. Every data plane packet is guaranteed to be processed according to table contents as they are between two individual operations of the batch, but there could be several packets processed that see each of these intermediate stages.
Optional. Operations within the batch are committed to data plane until an error is encountered. At this point, the operations must be rolled back such that both software and data plane state is consistent with the state before the batch was attempted. The resulting behavior is all-or-none, except the batch is not atomic from a data plane point of view. Every data plane packet is guaranteed to be processed according to table contents as they are between two individual operations of the batch, but there could be several packets processed that see each of these intermediate stages.
Optional. Every data plane packet is guaranteed to be processed according to table contents before the batch began, or after the batch completed and the operations were programmed to the hardware. The batch is therefore treated as a transaction.