Environment schema
Authoritative schema for the environment YAML (e.g. config/lab.yaml).
The environment YAML is the file you pass with -c (sometimes called the config). It declares the network functions under test, the wire stacks they speak, and how each connects to its peers. For the narrative walkthrough, see Configuring environments; for the message bodies that flows send over these transports, see the flow schema.
Synopsis
Top-level fields
| Name | Type | Required | Description |
|---|---|---|---|
nfs | []NF | yes | Inventory of NFs in this env |
transports | map[string]Transport | yes | Wire-stack table; keys are transport IDs that NFs reference |
diameter_dictionary_path | string | no | Path to an XML file extending the embedded Diameter AVP dictionary. Process-wide; applies to every Diameter transport. |
NF entry
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | Unique within the env |
role | enum | yes | gnb, amf, smf, ausf, udm, pcf, nrf, upf, mme, pgw, af, pcrf, external |
plmn | PLMN | role-specific | { mcc, mnc }. Required for Diameter roles (mme, pgw, af, pcrf): both mcc and mnc must be set or config load fails. Optional for other roles. |
transport | string | no | Transport ID this NF uses |
gnb | GNBProperties | role-specific | Set when role: gnb |
amf | AMFProperties | role-specific | Set when role: amf |
GNBProperties
| Name | Type | Required | Description |
|---|---|---|---|
global_id | GlobalID | yes | gNB identity advertised in NGSetupRequest |
global_id.plmn | PLMN | yes | gNB PLMN |
global_id.gnb_id | string | yes | gNB ID (decimal or hex string) |
global_id.bit_length | int | yes | gNB ID bit length, typically 22, 24, 28, or 32 |
supported_tas | []SupportedTA | yes | TAC + PLMNs + slices |
supported_tas[].tac | int | yes | Tracking Area Code |
supported_tas[].plmns[].plmn | PLMN | yes | PLMN within the TA |
supported_tas[].plmns[].slices[] | SliceConfig | yes | { sst, sd } |
paging_drx | int | no | DRX coefficient (32, 64, 128, 256) |
uplane | UplaneConfig | no | User-plane traffic generator config |
auto_reply.handover_request | bool | no | Stub-reply to inbound HandoverRequest (used by handover_source flow) |
AMFProperties
| Name | Type | Required | Description |
|---|---|---|---|
served_guami | AMFServedGuami | no | GUAMI advertised in NGSetupResponse. Defaults if nil. |
relative_capacity | uint8 | no | NGSetupResponse field |
allowed_gnbs | []AMFAllowedGNB | no | Empty = accept any gNB. Match is on RanNodeName. |
Transport
| Name | Type | Required | Description |
|---|---|---|---|
protocol | enum | yes | ngap, diameter, sbi, rest, pfcp |
ngap | NgapTransportConfig | role-specific | Set when protocol: ngap |
diameter | DiameterConfig | role-specific | Set when protocol: diameter |
sbi | SBITransportConfig | role-specific | Set when protocol: sbi |
rest | RESTTransportConfig | role-specific | Set when protocol: rest |
pfcp | PFCPTransportConfig | role-specific | Set when protocol: pfcp |
NGAP transport
| Name | Type | Required | Description |
|---|---|---|---|
mode | string | no | client or server. Defaults: client if peers non-empty, server otherwise. |
local_sctp | string | yes | Bind/dial-source IP |
local_gtpu | string | no | IP advertised as N3 endpoint in PduSessionResourceSetupResponse |
peers | []AMFConfig | client-mode | List of { address, port } AMFs to dial |
Diameter transport
RFC 6733 shape: one local identity, peer table, optional realm-based routing table.
local (DiameterLocalConfig):
| Name | Type | Required | Description |
|---|---|---|---|
origin_host | string | yes | Our Origin-Host advertised in CER |
origin_realm | string | yes | Our Origin-Realm |
vendor_id | uint32 | no | Vendor-Id AVP (3GPP=10415) |
product_name | string | no | Product-Name AVP |
application_ids | []uint32 | yes | App IDs advertised: S6a=16777251, Gx=16777238, Rx=16777236 |
watchdog_interval | duration | no | DWR/DWA cadence |
listen | DiameterListenConfig | no | Set to enable inbound peer connections (Responder role) |
listen.transport | string | yes (with listen) | sctp or tcp |
listen.addr / listen.port | string / int | yes | Local bind |
responder.timeout | duration | no | Pure-Responder readiness wait at Start |
peers (one per remote peer):
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | Local nickname referenced in routes |
transport | string | yes | sctp or tcp |
addr | string | yes | Remote address |
port | int | yes | Remote port |
sctp_ppid | uint32 | no | RFC 6733 §2.1; default 46 if unset |
destination_host | string | yes | Must match remote's origin_host in CEA |
destination_realm | string | yes | Must match remote's origin_realm |
connection_mode | string | no | initiator (default; we dial), responder (we wait), both (we dial and accept; RFC 6733 §5.6.4 election) |
tls | bool | no | TLS to this peer |
routes (RFC 6733 §6.1):
| Name | Type | Required | Description |
|---|---|---|---|
realm | string | yes | Destination-Realm to match |
application_ids | []uint32 | yes | Apps this route handles |
local_action | string | no | local, relay (default), proxy, redirect |
peers[].name | string | yes | Reference into peers |
peers[].rating | int | no | Higher rating wins |
SBI transport
| Name | Type | Required | Description |
|---|---|---|---|
base_url | string | client-mode | Set for client mode. Mutually exclusive with listen. |
nf_type | string | no | Advertised NFType (UDM, AUSF, AMF, ...) |
nf_instance_id | string | no | UUID identity |
tls.* | string | no | CA / cert / key paths |
oauth2.enabled | bool | no | Enable OAuth2 client-credentials |
oauth2.token_url | string | OAuth2 | Token endpoint |
oauth2.client_id | string | OAuth2 | Client ID |
oauth2.client_secret_env | string | OAuth2 | Env var name holding the secret (never put secrets in YAML) |
listen.addr / listen.port | string / int | server-mode | Bind |
server.answer_timeout | duration | no | Default 10s — caps how long the listener blocks on the FSM before returning 504 |
server.read_header_timeout | duration | no | Default 30s — http.Server.ReadHeaderTimeout |
REST transport
Generic HTTP/2 for non-3GPP peers. Same shape as SBI without OpenAPI.
| Name | Type | Required | Description |
|---|---|---|---|
base_url | string | client-mode | Mutually exclusive with listen |
listen.addr / listen.port | string / int | server-mode | Bind |
auth.type | string | no | none, basic, bearer, api_key |
auth.username_env / auth.password_env | string | basic | Env var names |
auth.token_env | string | bearer | Env var name holding the token |
auth.header / auth.value_env | string | api_key | Custom header name + env var holding the value |
tls.* | string | no | CA / cert / key paths |
server.answer_timeout / server.read_header_timeout | duration | no | Same defaults as SBI |
PFCP transport
| Name | Type | Required | Description |
|---|---|---|---|
mode | string | yes | client or server |
local | string | server: yes; client: optional | host:port; 0.0.0.0:0 for ephemeral client |
peer.addr | string | client | Remote PFCP node IP |
peer.port | int | client | Remote PFCP UDP port (8805 default) |
node_id.type | string | yes | ipv4, ipv6, or fqdn |
node_id.value | string | yes | Address or FQDN advertised in AssociationSetupRequest/Response |
Examples
Single-gNB lab (canonical)
See config/lab.yaml.
Diameter MME → HSS
See config/lab-diameter.yaml. Shipped peers point at d3x-edge in HSS-server mode.
PFCP loopback
See config/lab-pfcp.yaml. SMF + UPF on 127.0.0.1:18805.
SBI loopback
See config/lab-sbi.yaml. UDM + AUSF servers + matching client peers, all on 127.0.0.1.
Multi-NF
See config/lab-multinf.yaml. Two gNBs sharing one NGAP transport, plus an MME on Diameter, plus a remote UDM on SBI — the canonical multi-NF reference.
Notes
- Multiple NFs may reference the same transport ID when they share a wire (e.g. two MMEs on one Diameter peer pool).
- The validator runs at config load. Any invalid combination (
mode: clientwith no peers,protocol: sbiwith bothbase_urlandlistenset, ...) fails before the daemon binds. - Secrets must come from environment variables — every
*_envfield is a name, not a value.
Where to go next
- Configuring environments — walkthrough per protocol.
- Environments — the two-table model.
- Running flows and suites — load an env with
-c.