Skip to content

[sip_overload] Add RFC 7339/7415 SIP overload control - #13

Draft
darwvin-dev wants to merge 6 commits into
masterfrom
feature/sip-overload-control
Draft

darwvin-dev wants to merge 6 commits into
masterfrom
feature/sip-overload-control

Conversation

@darwvin-dev

@darwvin-dev darwvin-dev commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

Implement standardized hop-by-hop SIP overload control rather than another local-only rate limiter.

RFC 7339 / RFC 7415 client behavior

  • automatically advertise oc and configurable oc-algo on locally generated Via headers
  • enforce RFC 7339 mandatory loss advertisement when client advertisement is enabled
  • parse oc, oc-algo, oc-validity and oc-seq from downstream responses
  • maintain per-peer shared-memory feedback state
  • default omitted validity to 500 ms
  • reject stale/duplicate sequence feedback
  • support loss-based percentage reduction
  • support RFC 7415 rate-based request limits

Server behavior

  • oc_set_local() publishes local overload feedback
  • oc_clear_local() ends overload with a newer sequence and zero validity
  • feedback is placed only on the top Via of locally generated replies
  • only send overload feedback to peers which advertised oc
  • negotiate an algorithm the peer advertised; mandatory loss provides the compatibility fallback

Core hook

Adds a small generic Via-parameter provider hook to msg_translator.

The hook is composable: up to multiple independent providers can register and their parameters are concatenated in registration order, so sip_overload does not monopolize Via extension support for future modules.

Operations

Events and statistics cover accepted feedback, malformed/stale records, expiry, allowed/throttled requests and server-side updates.

Initialization validates RFC requirements and cleans all lock/shared-memory allocations on failure.

Draft pending full compile/runtime validation.

benceszigeti and others added 6 commits October 5, 2026 13:55
Rework the httpd module to process MI/HTTP requests asynchronously
across one or more named listeners, each with its own worker pool,
configured via "[name]"-prefixed modparams (e.g. "[critical]port").
This lets MI traffic be handled in parallel and isolates critical
listeners from general ones. README documents the new syntax and
"workers" param; httpd_split() also tolerates extra whitespace
around the "[name]" prefix and value.
…ter-upstream

httpd: async MI processing via multiple listeners/workers
A comma inside a quoted Via parameter value was taken as the separator
of the next Via body, so e.g. a RFC 7339 'oc-algo="loss,rate"' was
truncated to '"loss' and the rest of the Via header was lost. Keep
commas while inside a quoted string and add parser unit tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Allow modules to register providers (register_via_param_provider())
for extra parameters placed on locally generated Via headers and on the
top Via of locally generated replies. Several providers may be
registered; their parameters are concatenated in registration order.
On replies, a provided parameter replaces a parameter with the same
name already present in the top Via (e.g. a valued "oc=20" replaces
the bare "oc" sent by the client), while branch/rport/received are
never touched.

When no provider is registered, the generated messages are byte for
byte identical to the current ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Implement standard hop-by-hop SIP overload control using the Via oc,
oc-algo, oc-validity and oc-seq parameters.

Client side: advertise "oc" and the supported algorithms on locally
generated Vias, keep per-peer feedback received in replies in bounded
shared memory (stale/duplicate sequences rejected, default validity
500ms) and take admission decisions in oc_check() - random loss for
the "loss" algorithm, the RFC 7415 leaky bucket for "rate".

Server side: oc_set_local() / oc_clear_local() publish the local
overload state, placed on the top Via of locally generated replies,
only towards clients which advertised "oc" support and using an
algorithm the client advertised (falling back to the mandatory "loss").

Events and statistics cover accepted, malformed, stale and expired
feedback, allowed and throttled requests and server side updates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@darwvin-dev
darwvin-dev force-pushed the feature/sip-overload-control branch from 144b9b2 to 1352a80 Compare October 7, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants