1xBTS 1xBTS

Platform Notes

The default configuration runs every node on 127.0.0.1 with unprivileged ports, so a single host needs no root, capabilities or extra addresses on Linux or macOS. Nodes on separate hosts, or talking to other vendors’ equipment, must use the standard (spec) ports.

Interfaces

InterfaceBetweenTransportSingle-host defaultSpec port between hosts
Abis signalingBTS ↔ BSCTCP56045604
Abis trafficBTS ↔ BSCUDPBSC 17022, one BTS port per calloperator-chosen
A1pMSC → BSCSCTP1400114001
A1p over UDPMSC → BSCUDPBSC 9899, MSC 99009899
A2p voiceBSC ↔ MSCRTP/UDPone port pair per calloperator-chosen
A9EV-DO cell or BSC → PCFUDP or TCP56035603
A8EV-DO cell or BSC ↔ PCFGRE-in-UDPAN 17040, BSC 17048, PCF 17041native GRE (IP protocol 47)
A10PCF ↔ PDSNGRE-in-UDPPCF 17042, PDSN 17043native GRE (IP protocol 47)
A11PCF ↔ PDSNUDPPCF 17044, PDSN 17045699 on both ends
A21EV-DO cell ↔ BSCUDPAN 17049, BSC 45974597 on both ends

A11 and A21 use one port on both ends, so on a shared address the single-host default moves one end to a different port. Native GRE delivers every GRE packet for an address to every node on it, so GRE-in-UDP is the single-host default.

SCTP

A1p uses kernel SCTP when the host provides it. When it does not, A1p falls back to the bundled userspace SCTP stack over UDP, and logs a warning on Linux. macOS always uses SCTP over UDP. To use kernel SCTP on Linux:

Terminal window
sudo modprobe sctp
echo sctp | sudo tee /etc/modules-load.d/1xbts-sctp.conf

Both ends of an association must use the same transport. An MSC on kernel SCTP cannot reach a BSC that fell back to UDP. Set a1p.sctp.backend to kernel or usrsctp to disable the fallback.

Between hosts

LinuxmacOS
A1p on native SCTPsctp kernel module"backend": "usrsctp" and root
A11 on UDP 699CAP_NET_BIND_SERVICEno privilege needed
Native GRE for A8/A10CAP_NET_RAWroot

Grant the capabilities on Linux, and repeat after each rebuild:

Terminal window
sudo setcap cap_net_bind_service,cap_net_raw+ep target/release/cdma-nib

Then set the spec ports and native GRE on the nodes that face another host. For a PCF and PDSN on separate machines:

config/pcf.local.json:

{
"a8_bearer": { "mode": "raw_gre" },
"a10_bearer": { "mode": "raw_gre" },
"a11": { "bind_addr": "192.0.2.10:699", "peer_addr": "192.0.2.20:699" }
}

config/pdsn.local.json:

{
"a10_bearer": { "mode": "raw_gre" },
"a11": { "bind_addr": "192.0.2.20:699", "peer_addr": "192.0.2.10:699" }
}

config/bts.local.json, for an EV-DO cell:

{ "evdo": { "a9": { "a8_transport": "raw_gre" }, "a21": { "bind_addr": "192.0.2.30:4597", "iws_addr": "192.0.2.40:4597" } } }

To run several nodes on spec ports on one host, give each its own address, for example 127.0.0.2, 127.0.0.3 and 127.0.0.4. Linux answers on all of 127.0.0.0/8. macOS needs sudo ifconfig lo0 alias 127.0.0.N up for each one, after every reboot.

Docker services

LinuxmacOS
docker compose up -ddocker compose -f docker-compose.yml -f docker-compose.macos.yml up -d

The fou-nat packet gateway uses the kernel’s fou and ipip modules. On Linux, load them before starting the container with sudo modprobe fou ipip. On macOS the container runs inside Docker Desktop’s virtual machine.

Esc