Skip to content

Built In Modules and Ports

Justine Sherry edited this page Feb 10, 2017 · 24 revisions

Built-In Modules and Ports

The module_msg.proto file is stored in bess/protobuf/ and it supplies the glue between bessd modules and bessctl modules. Whenever you call a function in bessctl, a corresponding function is called on modules in bessd. This file lists all modules, their initialization parameters and any functions that may be called on them. The communication between bessctl and bessd is handled by grpc and protobuf.

Table of Contents

Top

module_msg.proto

### ACLArg
Field Type Label Description
rules ACLArg.Rule repeated
### ACLArg.Rule
Field Type Label Description
src_ip string optional
dst_ip string optional
src_port uint32 optional
dst_port uint32 optional
established bool optional
drop bool optional
### BPFArg
Field Type Label Description
filters BPFArg.Filter repeated
### BPFArg.Filter
Field Type Label Description
priority int64 optional
filter string optional
gate int64 optional
### BPFCommandClearArg The BPF module has a command `clear()` that takes no parameters. Example in bessctl: filter::BPF("src port 80") filter.clear() This command removes all filters from the module.
Field Type Label Description
### BufferArg
Field Type Label Description
### BypassArg
Field Type Label Description
### DumpArg
Field Type Label Description
interval double optional
### EtherEncapArg
Field Type Label Description
### ExactMatchArg
Field Type Label Description
fields ExactMatchArg.Field repeated
### ExactMatchArg.Field
Field Type Label Description
size uint64 optional
mask uint64 optional
name string optional
offset int64 optional
### ExactMatchCommandAddArg The ExactMatch module has a command `add(...)` that takes two parameters. The ExactMatch initializer specifies what fields in a packet to inspect; add() specifies which values to check for over these fields. Add() inserts a new rule into the ExactMatch module such that traffic matching i that bytestring will be forwarded out a specified gate. Example use: `add(fields=[aton('12.3.4.5'), aton('5.4.3.2')], gate=2)`
Field Type Label Description
gate uint64 optional The gate to forward out packets that mach this rule.
fields bytes repeated The exact match values to check for
### ExactMatchCommandClearArg The ExactMatch module has a command `clear()` which takes no parameters. This command removes all rules from the ExactMatch module.
Field Type Label Description
### ExactMatchCommandDeleteArg The ExactMatch module has a command `delete(...)` which deletes an existing rule. Example use: `delete(fields=[aton('12.3.4.5'), aton('5.4.3.2')])`
Field Type Label Description
fields bytes repeated The field values for the rule to be deleted.
### ExactMatchCommandSetDefaultGateArg The ExactMatch module has a command `setDefaultGate(...)` which takes one parameter. This command routes all traffic which does _not_ match a rule to a specified gate. Example use in bessctl: `setDefaultGate(gate=2)`
Field Type Label Description
gate uint64 optional The gate number to send the default traffic out.
### FlowGenArg
Field Type Label Description
template bytes optional
pps double optional
flow_rate double optional
flow_duration double optional
arrival string optional
duration string optional
quick_rampup bool optional
ip_src_range uint32 optional
ip_dst_range uint32 optional
port_src_range uint32 optional
port_dst_range uint32 optional
### GenericDecapArg
Field Type Label Description
bytes uint64 optional
### GenericEncapArg
Field Type Label Description
fields GenericEncapArg.Field repeated
### GenericEncapArg.Field
Field Type Label Description
size uint64 optional
attr_name string optional
value uint64 optional
### HashLBArg
Field Type Label Description
gates int64 repeated
mode string optional
### HashLBCommandSetGatesArg The HashLB module has a command `setGates(...)` which takes one parameter. This function takes in a list of gate numbers to send hashed traffic out over. Example use in bessctl: `lb.setGates(gates=[0,1,2,3])`
Field Type Label Description
gates int64 repeated A list of gate numbers to load balance traffic over
### HashLBCommandSetModeArg The HashLB module has a command `setMode(...)` which takes one parameter. The mode specifies whether the load balancer will hash over the src/dest ethernet header (l2), over the src/dest IP addresses (l3), or over the flow 5-tuple (l4). Example use in bessctl: `lb.setMode('l2')`
Field Type Label Description
mode string optional What fields to hash over, l1, l2, or l3 are only valid values.
### IPEncapArg
Field Type Label Description
### IPLookupArg
Field Type Label Description
### IPLookupCommandAddArg
Field Type Label Description
prefix string optional
prefix_len uint64 optional
gate uint64 optional
### IPLookupCommandClearArg
Field Type Label Description
### L2ForwardArg
Field Type Label Description
size int64 optional
bucket int64 optional
### L2ForwardCommandAddArg
Field Type Label Description
entries L2ForwardCommandAddArg.Entry repeated
### L2ForwardCommandAddArg.Entry
Field Type Label Description
addr string optional
gate int64 optional
### L2ForwardCommandDeleteArg
Field Type Label Description
addrs string repeated
### L2ForwardCommandLookupArg
Field Type Label Description
addrs string repeated
### L2ForwardCommandLookupResponse
Field Type Label Description
gates uint64 repeated
### L2ForwardCommandPopulateArg
Field Type Label Description
base string optional
count int64 optional
gate_count int64 optional
### L2ForwardCommandSetDefaultGateArg
Field Type Label Description
gate int64 optional
### MACSwapArg
Field Type Label Description
### MeasureArg
Field Type Label Description
warmup int64 optional
### MeasureCommandGetSummaryArg
Field Type Label Description
### MeasureCommandGetSummaryResponse
Field Type Label Description
timestamp double optional
packets uint64 optional
bits uint64 optional
total_latency_ns uint64 optional
latency_min_ns uint64 optional
latency_avg_ns uint64 optional
latency_max_ns uint64 optional
latency_50_ns uint64 optional
latency_99_ns uint64 optional
### MergeArg
Field Type Label Description
### MetadataTestArg
Field Type Label Description
read MetadataTestArg.ReadEntry repeated
write MetadataTestArg.WriteEntry repeated
update MetadataTestArg.UpdateEntry repeated
### MetadataTestArg.ReadEntry
Field Type Label Description
key string optional
value int64 optional
### MetadataTestArg.UpdateEntry
Field Type Label Description
key string optional
value int64 optional
### MetadataTestArg.WriteEntry
Field Type Label Description
key string optional
value int64 optional
### NATArg
Field Type Label Description
rules NATArg.Rule repeated
### NATArg.Rule
Field Type Label Description
internal_addr_block string optional
external_addr_block string optional
### NoOpArg
Field Type Label Description
### PortIncArg
Field Type Label Description
port string optional
burst int64 optional
prefetch bool optional
### PortIncCommandSetBurstArg
Field Type Label Description
burst int64 optional
### PortOutArg
Field Type Label Description
port string optional
### QueueArg
Field Type Label Description
size uint64 optional
burst int64 optional
prefetch bool optional
### QueueCommandSetBurstArg
Field Type Label Description
burst int64 optional
### QueueCommandSetSizeArg
Field Type Label Description
size uint64 optional
### QueueIncArg
Field Type Label Description
port string optional
qid uint64 optional
burst int64 optional
prefetch bool optional
### QueueIncCommandSetBurstArg
Field Type Label Description
burst int64 optional
### QueueOutArg
Field Type Label Description
port string optional
qid uint64 optional
### RandomUpdateArg
Field Type Label Description
fields RandomUpdateArg.Field repeated
### RandomUpdateArg.Field
Field Type Label Description
offset int64 optional
size uint64 optional
min uint64 optional
max uint64 optional
### RandomUpdateCommandClearArg
Field Type Label Description
### RewriteArg
Field Type Label Description
templates bytes repeated
### RewriteCommandClearArg
Field Type Label Description
### RoundRobinArg
Field Type Label Description
gates int64 repeated
mode string optional
### RoundRobinCommandSetGatesArg
Field Type Label Description
gates int64 repeated
### RoundRobinCommandSetModeArg
Field Type Label Description
mode string optional
### SetMetadataArg
Field Type Label Description
attrs SetMetadataArg.Attribute repeated
### SetMetadataArg.Attribute
Field Type Label Description
name string optional
size uint64 optional
value_int uint64 optional
value_bin bytes optional
offset int64 optional
### SinkArg
Field Type Label Description
### SourceArg
Field Type Label Description
pkt_size uint64 optional
burst uint64 optional
### SourceCommandSetBurstArg
Field Type Label Description
burst uint64 optional
### SourceCommandSetPktSizeArg
Field Type Label Description
pkt_size uint64 optional
### SplitArg
Field Type Label Description
size uint64 optional
name string optional
offset int64 optional
### TimestampArg
Field Type Label Description
### UpdateArg
Field Type Label Description
fields UpdateArg.Field repeated
### UpdateArg.Field
Field Type Label Description
offset int64 optional
size uint64 optional
value uint64 optional
### UpdateCommandClearArg
Field Type Label Description
### UrlFilterArg
Field Type Label Description
blacklist UrlFilterArg.Url repeated
### UrlFilterArg.Url
Field Type Label Description
host string optional
path string optional
### VLANPopArg
Field Type Label Description
### VLANPushArg
Field Type Label Description
tci uint64 optional
### VLANSplitArg
Field Type Label Description
### VXLANDecapArg
Field Type Label Description
### VXLANEncapArg
Field Type Label Description
dstport uint64 optional
### WildcardMatchArg
Field Type Label Description
fields WildcardMatchArg.Field repeated
### WildcardMatchArg.Field
Field Type Label Description
size uint64 optional
offset uint64 optional
attribute string optional
### WildcardMatchCommandAddArg
Field Type Label Description
gate uint64 optional
priority int64 optional
values uint64 repeated
masks uint64 repeated
### WildcardMatchCommandClearArg
Field Type Label Description
### WildcardMatchCommandDeleteArg
Field Type Label Description
values uint64 repeated
masks uint64 repeated
### WildcardMatchCommandSetDefaultGateArg
Field Type Label Description
gate uint64 optional
## Scalar Value Types
.proto Type Notes C++ Type Java Type Python Type
double double double float
float 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
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
uint32 Uses variable-length encoding. uint32 int int/long
uint64 Uses variable-length encoding. uint64 long int/long
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long
sfixed32 Always four bytes. int32 int int
sfixed64 Always eight bytes. int64 long int/long
bool bool boolean boolean
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode
bytes May contain any arbitrary sequence of bytes. string ByteString str