Protocol 123 of 81Layer 7FrameAssembly v3.3.0
Raw .mdllms-full.txt
bsapEmerson / Bristol Babcock Synchronous Asynchronous Protocol (BSAP/IP)

bsap — Port 1234 Bristol Babcock BSAP Water & Pipeline Telemetry

Default Port / Protocol
UDP 1234 (or TCP 1234 via transport tcp)
Host Endpoint Rule
Dual-Stack IPv4/IPv6
Wireshark Display Filter
udp.port == 1234 || tcp.port == 1234
Standards & Specs
Emerson OpenBSI / Bristol Babcock ControlWave BSAP IP Specification
Wire Stack:Ethernet II[802.1Q / QinQ / MPLS]IPv4 / IPv6UDP 1234 (or TCP 1234 via transport tcp) (transport tcp|udp)Bristol Babcock BSAP
L2 Tagging: vlan · qinq · repeatable mpls · fcsHost Family: Dual-Stack IPv4/IPv6L3 QoS & TTL: ttl · dscp · ecnL4 State: transport tcp|udp|sctp (default udp)

What It Does on the Wire

Municipal water distribution and gas SCADA RTUs using ControlWave / Bristol Babcock controllers run BSAP on port 1234 — bsap constructs IP RBE headers plus Remote Database poll, read, and write frames.

Bristol Synchronous Asynchronous Protocol over IP (bsap) connects Emerson ControlWave, Bristol Babcock Network 3000 / DPC 3330 RTUs, and OpenBSI SCADA masters across municipal water/wastewater distribution and natural-gas SCADA networks on UDP or TCP port 1234. BSAP/IP encapsulates Remote Database Access (RDB / NDB) and poll messages with 16-bit Destination Address (dst), 16-bit Source Address (src), 8-bit Sequence Number (seqnum), Application Function Code (poll, read RDB Read, write RDB Write), starting signal/list addr, count, and 32-bit value payloads.

FrameAssembly encodes BSAP/IP headers and RDB payloads cleanly over default UDP 1234 or stateful TCP 1234 (transport tcp).

01. Application

Municipal Water & Gas Distribution SCADA Firewall Rules (Port 1234)

Verify SCADA DMZ firewalls restrict UDP/TCP 1234 strictly to authorized OpenBSI / TopServer masters and ControlWave RTU IPs, blocking stray internet/IT scanning on port 1234.

02. Application

OT IDS Detection of Unauthorized ControlWave RDB Writes (bsap write)

Generate bsap poll and bsap read baseline traffic followed by an unauthorized bsap write to pump/valve signal addresses to validate Dragos, Claroty, and Nozomi alerts.

03. Application

Radio / Cellular BSAP/UDP vs Leased-Line BSAP/TCP (transport tcp)

Test SCADA front-end processors across both connectionless UDP 1234 telemetry and TCP 1234 (transport tcp) sessions.

Fig. 1 · RFC Octet & Bit Schematic

RFC Wire Header Layout (bsap)

Select any 32-bit wire word or field slice below to inspect which .frasm modifiers control those octets and what defaults the compiler writes.

0 ··············· 15 · 16 ··············· 31 bit
Selected Wire Segment
Bristol Babcock BSAP Wire PDU & Payload (Variable)
Controlling .frasm Modifiers
bsap read · dst · seqnum · addr · transport · payload · hexpayload
Compiler Default Behavior
RFC-compliant Bristol Babcock BSAP defaults (Emerson OpenBSI / Bristol Babcock ControlWave BSAP IP Specification)

Minimal Quickstart (bsap_quickstart.frasm)

Select Preview Packets to compile in-browser and inspect timestamps + wire byte lengths, or open directly in the Playground.

bsap_quickstart.frasm7 lines
Open in Playground
host openbsi_srv { ip 10.123.1.10 }
host cw_rtu_10 { ip 10.123.4.10 }
compile {
openbsi_srv -> cw_rtu_10 bsap read dst 10 src 1 seqnum 1 addr 100 count 2 wait 5ms
openbsi_srv <- cw_rtu_10 bsap read isresponse dst 1 src 10 seqnum 1 addr 100 value 420
}

Handled Automatically on the Wire

  • Defaults to UDP destination port 1234 (transport tcp switches to stateful TCP 1234) and calculates the BSAP/IP message length header automatically.
  • Encodes 16-bit BSAP node addresses (dst, src), 8-bit seqnum, and RDB function codes (poll, read, write, plus response flag bit when isresponse is set).
  • Packs 16-bit signal addr, item count, and 32-bit data value fields for RDB Read responses and RDB Write commands.
Multi-Frame Example

Water Booster Station ControlWave RTU Cycle: BSAP Poll, Tank Level Read & Pump Setpoint Write

Polls ControlWave RTU 10 over UDP 1234, reads reservoir level RDB addr 200, and issues an RDB write (addr 205, value 65) with RTU acknowledgment.

bsap_controlwave_scada.frasm14 lines
Open in Playground
host water_scada { ip 172.24.12.5 }
host booster_rtu { ip 172.24.12.50 }
compile {
// 1. BSAP Node Status Poll (seqnum 1) -> RTU Response
water_scada -> booster_rtu bsap poll dst 50 src 1 seqnum 1 wait 4ms
water_scada <- booster_rtu bsap poll isresponse dst 1 src 50 seqnum 1 wait 10ms
// 2. Remote Database (RDB) Read of Reservoir Tank Level (addr 200, count 2)
water_scada -> booster_rtu bsap read dst 50 src 1 seqnum 2 addr 200 count 2 wait 5ms
water_scada <- booster_rtu bsap read isresponse dst 1 src 50 seqnum 2 addr 200 value 1840 wait 15ms
// 3. RDB Write of Booster Pump VFD Speed Setpoint (addr 205 = 65%)
water_scada -> booster_rtu bsap write dst 50 src 1 seqnum 3 addr 205 count 1 value 65 wait 5ms
water_scada <- booster_rtu bsap write isresponse dst 1 src 50 seqnum 3 addr 205 value 65
}
Terminal Commands (FrameAssembly CLI v3.3.0)
# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show bsap_controlwave_scada.frasm

# 2. Compile .frasm -> classic .pcap, nanosecond .pcapng, or pipe via '-'
frameassembly bsap_controlwave_scada.frasm bsap_controlwave_scada.pcap
frameassembly bsap_controlwave_scada.frasm bsap_controlwave_scada.pcapng

# 3. Round-trip .pcap <-> .frasm whenever you want to scrub or tweak an existing capture
frameassembly reverse bsap_controlwave_scada.pcap bsap_controlwave_scada_edited.frasm

# 4. Verify dissected protocol fields in tshark
tshark -r bsap_controlwave_scada.pcap -Y "udp.port == 1234 || tcp.port == 1234"

All bsap Keywords & Header Options

Every sub-keyword and header option is lowercase [a-z0-9]+ with zero underscores — mix and match them in any order after bsap:

src_host -> dst_host bsap [read | write | poll | func "<text_or_num>"] [dst <0..65535>] [src <0..65535>] [seqnum <0..255>] [addr <0..65535>] [count <0..65535>] [value <number>] [isresponse] [transport <udp|tcp>]
Keyword / OptionAccepted ValueDefaultEffect on Packet
read | write | poll | func "<text_or_num>" | [isresponse]BSAP Application Function selector + Response flagpoll, requestSelects Poll, RDB Read, RDB Write, or numeric BSAP function byte and toggles response direction.
dst <0..65535> | src <0..65535>16-bit BSAP Destination & Source RTU/Master Node Addressesdst 1, src 0Writes the 2-byte Destination and Source BSAP node addresses in the BSAP/IP header.
seqnum <0..255>8-bit BSAP Message Sequence Number (0..255)1Writes the 1-byte transaction Sequence Number echoed by the RTU.
addr <0..65535> | count <0..65535> | value <number>16-bit RDB Signal Index/Address, Point Count, and 32-bit Signal Valueaddr 1, count 1, value 0Populates RDB Read/Write request lists and data values.
transport <udp|tcp>udp or tcpudpSwitches Layer 4 between BSAP/UDP (1234) and BSAP/TCP (1234).

Cross-Layer Wrappers Valid with bsap

802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol

15 options
OptionRange / FormatDefaultEffect on Packet
wait <number><ns|us|ms|s|m>Time gap (ns, us, ms, s, m)10msAdvances the packet timestamp clock after sending this packet and before the next packet (wait 0ns sends back-to-back).
comment "<text>"Quoted UTF-8 annotationOmittedAttaches an Enhanced Packet Block opt_comment annotation when compiling to .pcapng (Wireshark pkt_comment filter).
payload "<text>" | hexpayload "<hex>"Quoted text or hex bytes (choose one)OmittedAppends or overrides raw payload bytes ("deadbeef", "de:ad:be:ef", or "\x01\x02") and updates packet lengths and checksums.
srcmac <mac> | dstmac <mac> | ethertype <0..65535>Colon/hyphen/Cisco MAC · EtherType 0..65535 (e.g. 0x0800)Host MAC / RFC multicast MAC / auto EtherTypeOverrides the 14-byte Ethernet II source MAC, destination MAC, or standalone Layer 2 16-bit EtherType.
fcs | badfcsEthernet CRC-32 trailer flags (choose one)Omittedfcs appends a valid IEEE 802.3 4-byte CRC-32 Frame Check Sequence trailer; badfcs XOR-corrupts the CRC-32 for NIC/tap negative tests.
vlan <0..4095> [pcp <0..7>] [dei <0|1>]VLAN ID 0..4095, PCP 0..7, DEI 0..1UntaggedWraps the packet in an IEEE 802.1Q VLAN tag (0x8100) with optional 802.1p QoS priority.
qinq <0..4095> [innervlan <0..4095>]Outer S-VLAN 0..4095, Inner C-VLAN 0..4095Untagged (innervlan 1 when qinq is set)Double-tags the packet with outer IEEE 802.1ad S-Tag (0x88a8) plus inner IEEE 802.1Q C-Tag (0x8100).
mpls <0..1048575> [label <0..1048575>] [exp|tc <0..7>] [bos <0|1>] [mplsttl <0..255>]Repeatable label stack (0..1048575, exp/tc 0..7, bos 0..1, ttl 0..255)Unlabeled (auto bos=0 on outer labels, bos=1 on bottom)Prepends one or more 32-bit MPLS label shims (0x8847, e.g. mpls 16000 mpls 24010) ahead of Layer 2 EoMPLS or Layer 3 payloads.
ttl <0..255> [dscp <0..63>] [ecn <0..3>]TTL/Hop Limit 0..255, DSCP 0..63, ECN 0..3ttl 64, dscp 0, ecn 0Sets IPv4 TTL or IPv6 Hop Limit plus DiffServ (DSCP) and ECN QoS markings.
ipid <0..65535> [df] [mf] [fragoffset <0..8191>] [routeralert] [badipchecksum]IPv4 ID, DF/MF flags, offset 0..8191, Router Alert & checksum faultipid 1, flags 0, fragoffset 0, valid RFC 1071 checksumSets IPv4 Identification/fragmentation, injects RFC 2113 Router Alert (20 04 00 00), or corrupts the 16-bit IPv4 header checksum (badipchecksum).
flowlabel <0..1048575>20-bit IPv6 Flow Label (0..1048575)0Sets the 20-bit IPv6 Flow Label for ECMP routing tests (valid on IPv6 endpoint pairs only).
srcport <0..65535> | dstport <0..65535>Port number 0..65535srcport 49152 (remembered), UDP 1234 (or TCP 1234 via transport tcp)Overrides source or destination port and remembers the port pair automatically on <- replies.
transport <tcp|udp|sctp>tcp, udp, or sctp (dual TCP/UDP + universal L7 SCTP)transport udpSwitches Layer 4 transport between stateful TCP, connectionless UDP, or Castagnoli CRC-32c SCTP association.
badchecksum | nochecksumL4 checksum fault or UDP zero-checksum flagValid RFC checksum / CRC-32cbadchecksum corrupts the L4 checksum for negative firewall/NIC offload tests; nochecksum writes 0x0000 in UDP headers.
seq <number> | acknum <number> | win|window <0..65535> | urgent <0..65535> | syn | ack | psh | fin | rst | urg | ece | cwrTCP sequence/ack numbers, window, flags, SACK, TCP-MD5 & TFO optionspsh ack, win 65535, automatic TCP seq/acknumWhen using TCP (transport tcp or default TCP): overrides automatic TCP sequence tracking, flags, or mss/wscale/sackperm/sackblock/tsval/tsecr/tcpmd5/tfo.

Gotchas & Quick Fixes

Swap dst and src BSAP Node IDs on <- RTU Replies

Valid v3.3.0 Syntax
scada -> rtu bsap read dst 50 src 1 seqnum 2 addr 200 scada <- rtu bsap read isresponse dst 1 src 50 seqnum 2 addr 200 value 100

Just like DNP3 and ROC Plus, <- swaps Ethernet/IP/UDP addresses automatically, while dst and src explicitly set the application-layer BSAP node fields.

Keep seqnum Within 8-Bit Bounds (0..255)

Rejected
scada -> rtu bsap poll seqnum 1000
Valid v3.3.0 Syntax
scada -> rtu bsap poll seqnum 1

BSAP sequence numbers are 1 octet wide (0..=255) and wrap modulo 256.

Field Guide 03
Poke Stateful Firewalls, Suricata, Zeek & OT Conduits