PROTO_BINS module
Admin Guide
Section titled “Admin Guide”Overview
Section titled “Overview”This module implements a secure Binary communication protocol over TLS, to be used by the OpenSIPS clustering engine provided by the clusterer module.
Once loaded, you will be able to define BINS listeners in your configuration file by adding their IP and, optionally, a listening port, similar to this example:
...socket = bins:127.0.0.1 # change the listening IPsocket = bins:127.0.0.1:5557 # change the listening IP and port...Dependencies
Section titled “Dependencies”OpenSIPS Modules
Section titled “OpenSIPS Modules”The following modules must be loaded before this module:
- tls_openssl or tls_wolfssl, depending on the desired TLS library
- tls_mgm.
External Libraries or Applications
Section titled “External Libraries or Applications”The following libraries or applications must be installed before running OpenSIPS with this module loaded:
- None.
Exported Parameters
Section titled “Exported Parameters”bins_port (integer)
Section titled “bins_port (integer)”The default port to be used by all BINS listeners.
Default value is 5556.
...modparam("proto_bins", "bins_port", 5557)...bins_handshake_timeout (integer)
Section titled “bins_handshake_timeout (integer)”Sets the timeout (in milliseconds) for the SSL/TLS handshake sequence to complete. It may be necessary to increase this value when using a CPU intensive cipher for the connection to allow time for keys to be generated and processed.
The timeout is invoked during acceptance of a new connection (inbound) and during the wait period when a new session is being initiated (outbound).
Default value is 100.
param("proto_tls", "bins_handshake_timeout", 200) # number of millisecondsbins_send_timeout (integer)
Section titled “bins_send_timeout (integer)”Sets the timeout (in milliseconds) for blocking send operations to complete.
The send timeout is invoked for all TLS write operations, excluding the handshake process (see: bins_handshake_timeout)
Default value is 100 ms.
...modparam("proto_bins", "bins_send_timeout", 200)...bins_max_msg_chunks (integer)
Section titled “bins_max_msg_chunks (integer)”The maximum number of chunks in which a BINS message is expected to arrive via TCP. If a received packet is more fragmented than this, the connection is dropped (either the connection is very overloaded and this leads to high fragmentation - or we are the victim of an ongoing attack where the attacker is sending very fragmented traffic in order to decrease server performance).
Default value is 32.
...modparam("proto_bins", "bins_max_msg_chunks", 8)...bins_async (integer)
Section titled “bins_async (integer)”Specifies whether the TCP/TLS connect and write operations should be done in an asynchronous mode (non-blocking connect and write) or not. If disabled, OpenSIPS will block and wait for TCP/TLS operations like connect and write.
Default value is 1 (enabled).
...modparam("proto_bins", "bins_async", 0)...bins_async_max_postponed_chunks (integer)
Section titled “bins_async_max_postponed_chunks (integer)”If bins_async is enabled, this specifies the maximum number of BINS messages that can be stashed for later/async writing. If the connection pending writes exceed this number, the connection will be marked as broken and dropped.
Default value is 32.
...modparam("proto_bins", "bins_async_max_postponed_chunks", 16)...bins_async_local_connect_timeout (integer)
Section titled “bins_async_local_connect_timeout (integer)”If bin_async is enabled, this specifies the number of milliseconds that a connect will be tried in blocking mode (optimization). If the connect operation lasts more than this, the connect will go to async mode and will be passed to TCP MAIN for polling.
Default value is 100 ms.
...modparam("proto_bins", "bins_async_local_connect_timeout", 200)...bins_async_handshake_timeout (integer)
Section titled “bins_async_handshake_timeout (integer)”If tls_async is enabled, this specifies the number of milliseconds that a TLS handshake should be tried in blocking mode (optimization). If the handshake operation lasts more than this, the write will go to async mode and will be passed to tls MAIN for polling.
Default value is 10 ms.
... modparam("proto_tls", "bins_async_handshake_timeout", 100) ...trace_destination (string)
Section titled “trace_destination (string)”Trace destination as defined in the tracing module. Currently the only tracing module is proto_hep. Network events such as connect, accept and connection closed events shall be traced along with errors that could appear in the process. For each connection that is created an event containing information about the client and server certificates, master key and network layer information shall be sent.
Default value is none(not defined).
...modparam("proto_hep", "hep_id", "[hep_dest]10.0.0.2;transport=tcp;version=3")modparam("proto_bins", "trace_destination", "hep_dest")...trace_on (int)
Section titled “trace_on (int)”This controls whether tracing for tls is on or not. You still need to define trace destinationin order to work, but this value will be controlled using mi function mi bins trace.
...modparam("proto_bins", "trace_on", 1)...Exported MI Functions
Section titled “Exported MI Functions”bins_trace
Section titled “bins_trace”Name: bins_trace
Parameters:
- trace_mode(optional): set bins tracing on and off. This parameter
can be missing and the command will show the current tracing
status for this module( on or off );
Possible values:
- on
- off
MI FIFO Command Format:
opensips-cli -x mi bins_trace onContributors
Section titled “Contributors”By Commit Statistics
Section titled “By Commit Statistics”Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)
| # | Name | DevScore | Commits | Lines++ | Lines— |
|---|---|---|---|---|---|
| 1. | Vlad Patrascu (@rvlad-patrascu) | 15 | 4 | 1119 | 25 |
| 2. | Stefan Darius (@dariusstefan) | 11 | 5 | 362 | 72 |
| 3. | Liviu Chircu (@liviuchircu) | 5 | 3 | 13 | 7 |
| 4. | Bogdan-Andrei Iancu (@bogdan-iancu) | 4 | 2 | 5 | 3 |
| 5. | Maksym Sobolyev (@sobomax) | 4 | 2 | 4 | 5 |
| 6. | Nick Altmann (@nikbyte) | 3 | 1 | 2 | 2 |
| 7. | Razvan Crainea (@razvancrainea) | 3 | 1 | 1 | 1 |
(1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits)
(2) including any documentation-related commits, excluding merge commits
(3) ignoring whitespace edits, renamed files and auto-generated files
By Commit Activity
Section titled “By Commit Activity”| # | Name | Commit Activity |
|---|---|---|
| 1. | Stefan Darius (@dariusstefan) | Jun 2026 - Jul 2026 |
| 2. | Razvan Crainea (@razvancrainea) | Jun 2026 - Jun 2026 |
| 3. | Bogdan-Andrei Iancu (@bogdan-iancu) | Apr 2021 - May 2023 |
| 4. | Maksym Sobolyev (@sobomax) | Feb 2023 - Feb 2023 |
| 5. | Liviu Chircu (@liviuchircu) | Apr 2022 - Apr 2022 |
| 6. | Vlad Patrascu (@rvlad-patrascu) | Feb 2021 - Oct 2021 |
| 7. | Nick Altmann (@nikbyte) | May 2021 - May 2021 |
(1) including any documentation-related commits, excluding merge commits
Documentation
Section titled “Documentation”Contributors
Section titled “Contributors”Last edited by: Razvan Crainea (@razvancrainea), Vlad Patrascu (@rvlad-patrascu).
License
Section titled “License”All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0