Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to use JSONC instead of JSON for easy readability #702

Merged
merged 7 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/pfcpiface/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

var (
configPath = flag.String("config", "upf.json", "path to upf config")
configPath = flag.String("config", "upf.jsonc", "path to upf config")
)

func init() {
Expand Down
3 changes: 3 additions & 0 deletions conf/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def __init__(self, fname):
self.table_size_far_lookup = 0

def parse(self, ifaces):
if self.conf is None:
print("Error loading configuration file.")

# Maximum number of flows to manage ip4 frags for re-assembly
try:
self.max_ip_defrag_flows = int(self.conf["max_ip_defrag_flows"])
Expand Down
2 changes: 1 addition & 1 deletion conf/up4.bess
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ qerFailGate = 4
qerStatusDropGate = 5
qerUnmeteredGate = 6
interfaces = ["access", "core"]
parser = Parser('conf/upf.json')
parser = Parser('conf/upf.jsonc')
parser.parse(interfaces)

# Catch core & access MAC/IPv4 addresses
Expand Down
172 changes: 0 additions & 172 deletions conf/upf.json

This file was deleted.

178 changes: 178 additions & 0 deletions conf/upf.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
// Copyright: 2019-present Intel Corporation
// Copyright: 2020-present Open Networking Foundation
// License: Apache-2.0
{
// UPF support various configuration modes:
// "af_packet"` to enable AF_PACKET mode,
// "af_xdp" to enable AF_XDP mode,
// "cndp" to enable CNDP mode,
// "dpdk" to enable DPDK mode,
// "sim" to generate synthetic traffic from BESS's Source module,
// "" when running with UP4
"mode": "dpdk",

"table_sizes": {
// Example sizes based on sim mode and 50K sessions. Customize as per your control plane
// 50K per unique tuple, we send 4 unique PDR patterns
"pdrLookup": 50000,
// 4 PDRs per session
"flowMeasure": 200000,
// there are 2 QERs and 2 entries per QER
"appQERLookup": 200000,
// there is 1 session QER and 2 entries per session QER
"sessionQERLookup": 100000,
// there are 3 FARs
"farLookup": 150000
},

// [Optional] Set the log level to one of \"panic\", \"fatal\", \"error\", \"warning\", \"info\", \"debug\", \"trace\"
"log_level": "info",

// Use the sim block to enable simulation using either Source module or via il_trafficgen
"sim": {
// At this point we can simulate either N3/N6 or N3/N9 traffic, so choose n6 or n9 below
"core": "n6",
"max_sessions": 50000,
"start_ue_ip": "16.0.0.1",
"start_enb_ip": "11.1.1.129",
"start_aupf_ip": "13.1.1.199",
"n6_app_ip": "6.6.6.6",
"n9_app_ip": "9.9.9.9",
"start_n3_teid": "0x30000000",
"start_n9_teid": "0x90000000",
"uplink_mbr": 500000,
// Make sure uplink_gbr is configured less than uplink_mbr if 'qfi' in pfcpiface/grpcsim.go is for GBR flows. Current default 'qfi' value is for Non-GBR flows
"uplink_gbr": 50000,
"downlink_mbr": 1000000,
// Make sure downlink_gbr is configured less than downlink_mbr if 'qfi' in pfcpiface/grpcsim.go is for GBR flows. Current default 'qfi' value is for Non-GBR flows
"downlink_gbr": 100000,
"pkt_size": 128,
"total_flows": 5000
},

// Max IP frag table entries (for IPv4 reassembly). Uncomment line below to enable
// "max_ip_defrag_flows": "1000",

// Uncomment line below to enable
// "ip_frag_with_eth_mtu": "1518",

// Enable hardware offload of checksum. Might disable vector PMD
"hwcksum": false,

// Enable PDU Session Container extension
"gtppsc": false,

// Enable Intel Dynamic Device Personalization (DDP)
"ddp": false,

// [Optional] Telemetry-See this link for details: https://github.com/omec-project/bess/blob/master/bessctl/module_tests/timestamp.py
"measure_upf": true,

// [Optional] Whether to enable flow-level measurements
"measure_flow": false,

// N3 interface
"access": {
// "cndp_jsonc_file": "conf/cndp_upf_1worker.jsonc",
"ifname": "ens803f2"
},

// N6 or N9 interface (depending on the UPF's deployment [PSA-UPF or I-UPF])
"core": {
// "cndp_jsonc_file": "conf/cndp_upf_1worker.jsonc",
// Uncomment line below to enable UE IP natting. It could be a single IP or multiple IPs
// "ip_masquerade": "18.0.0.1 or 18.0.0.2 or 18.0.0.3",
"ifname": "ens803f3"
},

// Number of worker threads. Default: 1
"workers": 1,

// Parameters for handling outgoing requests
"max_req_retries": 5,
"resp_timeout": "2s",

// Whether to enable Network Token Functions
"enable_ntf": false,

// [Optional] Whether to enable End Marker Support
// "enable_end_marker": false,

// [Optional] Whether to enable Notify BESS feature
// "enable_notify_bess": false,

// Whether to enable P4Runtime feature
"enable_p4rt": false,
// "conn_timeout": "1000",
// "read_timeout": "25",
// "notify_sockaddr": "/tmp/notifycp",
// "endmarker_sockaddr": "/tmp/pfcpport",

// Whether to enable UPF HeartBeatTimer feature
"enable_hbTimer": false,
// "heart_beat_interval": "5s",

// Whether to enable GTPu Path Monitoring
"enable_gtpu_path_monitoring": false,

"qci_qos_config": [
{
// Default values for QERs with QCI/QFI not listed below
"qci": 0,
"cbs": 50000,
"ebs": 50000,
"pbs": 50000,
"burst_duration_ms": 10,
"priority": 7
},
{
"qci": 9,
"cbs": 2048,
"ebs": 2048,
"pbs": 2048,
"priority": 6
},
{
"qci": 8,
"cbs": 2048,
"ebs": 2048,
"pbs": 2048,
"priority": 5
}
],

// [Optional] Slice-wide meter rate limits
"slice_rate_limit_config": {
// Uplink policer
"n6_bps": 500000000,
"n6_burst_bytes": 625000,
// Downlink policer
"n3_bps": 500000000,
"n3_burst_bytes": 625000
},

// Control plane controller settings
"cpiface": {
"peers": ["148.162.12.214"],
// [Optional] Below parameters
"dnn": "internet",
"http_port": "8080",
"enable_ue_ip_alloc": false,
// "use_fqdn": "true",
// "hostname": "upf-0",
"ue_ip_pool": "10.250.0.0/16"
},

// p4rtc interface settings,
"p4rtciface": {
"access_ip": "172.17.0.1/32",
"p4rtc_server": "onos",
"p4rtc_port": "51001",
// [Optional] Set the UP4 slice identifier that this PFCP Agent instance belongs to. Default: 0
"slice_id": 0,
// [Optional] Default TC is ELASTIC
"default_tc": 3,
// [Optional] Whether to wipe out PFCP state from UP4 datapath on UP4 restart. Default: false
"clear_state_on_restart": false
}
}
Loading
Loading