summaryrefslogtreecommitdiff
path: root/cmake/config/ipcp
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/config/ipcp')
-rw-r--r--cmake/config/ipcp/broadcast.cmake9
-rw-r--r--cmake/config/ipcp/common.cmake58
-rw-r--r--cmake/config/ipcp/eth.cmake22
-rw-r--r--cmake/config/ipcp/local.cmake39
-rw-r--r--cmake/config/ipcp/udp.cmake16
-rw-r--r--cmake/config/ipcp/unicast.cmake16
6 files changed, 160 insertions, 0 deletions
diff --git a/cmake/config/ipcp/broadcast.cmake b/cmake/config/ipcp/broadcast.cmake
new file mode 100644
index 00000000..f521ed8e
--- /dev/null
+++ b/cmake/config/ipcp/broadcast.cmake
@@ -0,0 +1,9 @@
+# Broadcast IPCP configuration options for Ouroboros
+
+set(IPCP_BROADCAST_TARGET ipcpd-broadcast)
+
+set(IPCP_BROADCAST_MPL 100 CACHE STRING
+ "Default maximum packet lifetime for the Broadcast IPCP, in ms")
+
+set(IPCP_BROADCAST_MTU 1400 CACHE STRING
+ "Layer MTU advertised by the Broadcast IPCP, in bytes")
diff --git a/cmake/config/ipcp/common.cmake b/cmake/config/ipcp/common.cmake
new file mode 100644
index 00000000..7dbc252b
--- /dev/null
+++ b/cmake/config/ipcp/common.cmake
@@ -0,0 +1,58 @@
+# Common IPCP configuration options for Ouroboros
+# Options affecting all IPC Process types
+
+# Connection manager
+set(CONNMGR_RCV_TIMEOUT 1000 CACHE STRING
+ "Timeout for the connection manager to wait for OCEP info (ms).")
+
+# Debugging
+set(IPCP_DEBUG_LOCAL FALSE CACHE BOOL
+ "Use PID as address for local debugging")
+
+# QoS cube priorities (0-99, higher = more priority)
+set(IPCP_QOS_CUBE_BE_PRIO 50 CACHE STRING
+ "Priority for best effort QoS cube (0-99)")
+set(IPCP_QOS_CUBE_VIDEO_PRIO 90 CACHE STRING
+ "Priority for video QoS cube (0-99)")
+set(IPCP_QOS_CUBE_VOICE_PRIO 99 CACHE STRING
+ "Priority for voice QoS cube (0-99)")
+
+# Validate QoS cube priorities
+if((IPCP_QOS_CUBE_BE_PRIO LESS 0) OR (IPCP_QOS_CUBE_BE_PRIO GREATER 99))
+ message(FATAL_ERROR "Invalid priority for best effort QoS cube (must be 0-99)")
+endif()
+if((IPCP_QOS_CUBE_VIDEO_PRIO LESS 0) OR (IPCP_QOS_CUBE_VIDEO_PRIO GREATER 99))
+ message(FATAL_ERROR "Invalid priority for video QoS cube (must be 0-99)")
+endif()
+if((IPCP_QOS_CUBE_VOICE_PRIO LESS 0) OR (IPCP_QOS_CUBE_VOICE_PRIO GREATER 99))
+ message(FATAL_ERROR "Invalid priority for voice QoS cube (must be 0-99)")
+endif()
+
+# Threading
+set(IPCP_MIN_THREADS 4 CACHE STRING
+ "Minimum number of worker threads in the IPCP")
+set(IPCP_ADD_THREADS 4 CACHE STRING
+ "Number of extra threads to start when an IPCP faces thread starvation")
+set(IPCP_SCHED_THR_MUL 2 CACHE STRING
+ "Number of scheduler threads per QoS cube")
+
+# Linux-specific
+if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ set(IPCP_LINUX_TIMERSLACK_NS 100 CACHE STRING
+ "Slack value for high resolution timers on Linux systems.")
+endif()
+
+# Per-flow statistics exposed via the RIB (requires FUSE).
+if(HAVE_FUSE)
+ set(IPCP_FLOW_STATS TRUE CACHE BOOL
+ "Enable per-flow statistics via the RIB")
+ if(IPCP_FLOW_STATS)
+ message(STATUS "IPCP flow statistics enabled")
+ endif()
+
+ set(IPCP_ETH_FLOW_STATS FALSE CACHE BOOL
+ "Enable ipcpd-eth flow statistics via RIB")
+ if(IPCP_ETH_FLOW_STATS)
+ message(STATUS "ipcpd-eth flow statistics enabled")
+ endif()
+endif()
diff --git a/cmake/config/ipcp/eth.cmake b/cmake/config/ipcp/eth.cmake
new file mode 100644
index 00000000..d336d647
--- /dev/null
+++ b/cmake/config/ipcp/eth.cmake
@@ -0,0 +1,22 @@
+# Ethernet IPCP configuration options for Ouroboros
+# Options for eth-llc and eth-dix IPCPs
+
+set(IPCP_ETH_LLC_TARGET ipcpd-eth-llc)
+set(IPCP_ETH_DIX_TARGET ipcpd-eth-dix)
+
+set(IPCP_ETH_RD_THR 1 CACHE STRING
+ "Number of reader threads in Ethernet IPCP")
+set(IPCP_ETH_WR_THR 1 CACHE STRING
+ "Number of writer threads in Ethernet IPCP")
+set(IPCP_ETH_QDISC_BYPASS false CACHE BOOL
+ "Bypass the Qdisc in the kernel when using raw sockets")
+set(IPCP_ETH_SNDBUF 0 CACHE STRING
+ "Raw socket SO_SNDBUF in bytes; 0 = leave kernel default (wmem_default)")
+set(IPCP_ETH_RCVBUF 0 CACHE STRING
+ "Raw socket SO_RCVBUF in bytes; 0 = leave kernel default (rmem_default)")
+set(IPCP_ETH_LO_MTU 9000 CACHE STRING
+ "Restrict Ethernet MTU over loopback interfaces")
+set(IPCP_ETH_MGMT_FRAME_SIZE 9000 CACHE STRING
+ "Management frame buffer size for Ethernet IPCPs")
+set(IPCP_ETH_MPL 100 CACHE STRING
+ "Default maximum packet lifetime for the Ethernet IPCPs, in ms")
diff --git a/cmake/config/ipcp/local.cmake b/cmake/config/ipcp/local.cmake
new file mode 100644
index 00000000..70423cd1
--- /dev/null
+++ b/cmake/config/ipcp/local.cmake
@@ -0,0 +1,39 @@
+# Local IPCP configuration options for Ouroboros
+
+set(IPCP_LOCAL_TARGET ipcpd-local)
+
+set(IPCP_LOCAL_MPL 50 CACHE STRING
+ "Default maximum packet lifetime for the Local IPCP, in ms")
+
+set(IPCP_LOCAL_MTU 65000 CACHE STRING
+ "Layer MTU advertised by the Local IPCP, in bytes")
+
+set(IPCP_LOCAL_POLLING FALSE CACHE BOOL
+ "Enable active polling in the Local IPCP for low-latency mode")
+
+# IPCP_LOCAL_MTU must fit in the largest enabled GSPP and PUP class
+# (sender-side allocation: daemons use GSPP, apps use PUP). Reserve a
+# margin for sizeof(struct ssm_pk_buff) + HEADSPACE + TAILSPACE.
+math(EXPR _ssm_pk_overhead
+ "${SSM_PK_BUFF_HEADSPACE} + ${SSM_PK_BUFF_TAILSPACE} + 64")
+
+foreach(_pool GSPP PUP)
+ set(_largest 0)
+ foreach(_pair "256;256" "512;512" "1K;1024" "2K;2048" "4K;4096"
+ "16K;16384" "64K;65536" "256K;262144" "1M;1048576")
+ list(GET _pair 0 _name)
+ list(GET _pair 1 _bytes)
+ if(SSM_${_pool}_${_name}_BLOCKS GREATER 0
+ AND _bytes GREATER _largest)
+ set(_largest ${_bytes})
+ endif()
+ endforeach()
+ math(EXPR _avail "${_largest} - ${_ssm_pk_overhead}")
+ if(IPCP_LOCAL_MTU GREATER _avail)
+ message(FATAL_ERROR
+ "IPCP_LOCAL_MTU (${IPCP_LOCAL_MTU}) exceeds largest enabled "
+ "SSM_${_pool} class minus per-block overhead "
+ "(${_largest} - ${_ssm_pk_overhead} = ${_avail} bytes). "
+ "Lower IPCP_LOCAL_MTU or enable a larger SSM_${_pool}_*_BLOCKS.")
+ endif()
+endforeach()
diff --git a/cmake/config/ipcp/udp.cmake b/cmake/config/ipcp/udp.cmake
new file mode 100644
index 00000000..af84a844
--- /dev/null
+++ b/cmake/config/ipcp/udp.cmake
@@ -0,0 +1,16 @@
+# UDP IPCP configuration options for Ouroboros
+# Options for udp4 and udp6 IPCPs
+
+set(IPCP_UDP4_TARGET ipcpd-udp4)
+set(IPCP_UDP6_TARGET ipcpd-udp6)
+
+set(IPCP_UDP_RD_THR 3 CACHE STRING
+ "Number of reader threads in UDP IPCPs")
+set(IPCP_UDP_WR_THR 3 CACHE STRING
+ "Number of writer threads in UDP IPCPs")
+set(IPCP_UDP_MPL 5000 CACHE STRING
+ "Default maximum packet lifetime for the UDP IPCPs, in ms")
+set(IPCP_UDP4_MTU 1472 CACHE STRING
+ "Fallback UDP4 layer MTU when getsockopt(IP_MTU) is unavailable, in bytes")
+set(IPCP_UDP6_MTU 1452 CACHE STRING
+ "Fallback UDP6 layer MTU when getsockopt(IPV6_MTU) is unavailable, in bytes")
diff --git a/cmake/config/ipcp/unicast.cmake b/cmake/config/ipcp/unicast.cmake
new file mode 100644
index 00000000..b8d4d516
--- /dev/null
+++ b/cmake/config/ipcp/unicast.cmake
@@ -0,0 +1,16 @@
+# Unicast IPCP configuration options for Ouroboros
+
+set(IPCP_UNICAST_TARGET ipcpd-unicast)
+
+set(IPCP_UNICAST_MPL 100 CACHE STRING
+ "Default maximum packet lifetime for the Unicast IPCP, in ms")
+set(IPCP_UNICAST_MTU 1400 CACHE STRING
+ "Layer MTU advertised by the Unicast IPCP, in bytes (TODO: derive per-flow from n-1 path MTU minus DT PCI)")
+set(PFT_SIZE 256 CACHE STRING
+ "Prefix forwarding table size for the Unicast IPCP")
+
+# Protocol debugging
+set(DEBUG_PROTO_DHT FALSE CACHE BOOL
+ "Add DHT protocol debug logging")
+set(DEBUG_PROTO_LS FALSE CACHE BOOL
+ "Add link state protocol debug logging")