imsd/tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jorijn van der Graaf c93df591f1
imsd: no CRLF keepalive on the idle flow unless CRLF_KEEPALIVE names an interval
imsd sent a double CRLF, the ping of RFC 5626 4.4.1, on its idle TCP
flow to the P-CSCF every 30 seconds. On a phone that costs far more
than four bytes. The modem brings the ims bearer up for it; 11 to 13 s
later the bearer goes dormant, which the modem reports to
ModemManager, and 90 s after that the modem makes a file-system
request to rmtfs. Each of the two can wake a phone that has gone back to
sleep: in a loop of suspends on the dev phone (KPN, 2026-11-20, the
fp6 journal's 2026-11-20-modem-echo-wakes capture) the modem ended 29
sleeps of 29, 15 with the report and 14 with that request, and none
reached its 150-second alarm; with imsd held still all six did. Awake
and idle on a USB port the phone's battery lost 140 mA with the ping
and 59 mA without it (2026-11-24, one window of 40 min and one of 33).

No registration of imsd's negotiates keep-alives: its REGISTER has no
"outbound" in Supported and no reg-id (RFC 5626 4.2.1), and no "keep"
in the Via (RFC 6223).

The ping is now sent only where CRLF_KEEPALIVE=<whole seconds> names
an interval. An empty value is as none; any other that is no whole
number of seconds is reported in the journal and sends none
(imsd::util::WholeSeconds).

What a ping does for a flow, outside a call: sent more often than a
P-CSCF's timer for a flow it hears nothing on, it keeps that P-CSCF from
dropping the flow, and it draws the reset of a P-CSCF that has lost the
flow. The setting is for such a network. On the phone the ping also kept
the connection tracker's entry for the P-CSCF's ESP, without which the
firewall dropped what the network started; the commit before this one
gives the firewall a rule for ESP instead. Without the ping, a close by
the network is answered, outside a call, with a reconnect and a
re-REGISTER. A flow the network has dropped without closing, where it
answers the next bytes on it with a reset, is found at those bytes:
where they are the refresh's, it fails once and the same reconnect
follows; where they are a call's INVITE, the flow is reopened for the
call; where they are a call's BYE, the BYE is lost: imsd sends no BYE
again, as before. Where they are a text's MESSAGE, it is lost with the
flow and the text's wait decides. An incoming call sends no request on
the flow before its BYE, and without the ping the flow can have been
silent, or dropped without a close, since long before such a call came
(AGENTS.md §7.6). A flow that died with no close and no reset reaching
the phone is noticed when the refresh's re-REGISTER gets no answer, or
sooner where TCP gives up on bytes imsd sent on it before that (924.6 s
or more after them by the kernel's default tcp_retries2), and until
1.2.3 a ping's were among those every 30 s outside a call; a bearer that
left under a registered daemon was noticed at the refresh under the ping
as well (2026-10-02, AGENTS.md §7.2).

Tested: the suites, WholeSeconds in tests/Util; the daemon of this
commit and 1.2.3's on the workstation against a stand-in network that
prints every ping and can close a silent flow or forget it (the fp6
journal's 2026-11-24-crlf-keepalive capture, bench-keepalive.sh: no ping
by default, with CRLF_KEEPALIVE=0 or with an empty value, 1.2.3's three
in 100 s, the setting's, none over UDP, a value that is no number, the
reconnect at each close, the failed refresh and the reconnect on a
forgotten flow, neither a close nor a forgotten flow under the setting
or under 1.2.3's pings, a ping of 1.2.3's reset on a forgotten flow; and
bench-hangup.sh of the 2026-11-24-bye-resend capture: a placed call's
BYE not delivered where the network had forgotten or closed the flow
under the call, by this daemon as by 1.2.3's on the forgetting one). On
the dev phone on KPN, the binary of the range's tip: no packet on the
ims netdev in two idle minutes where 1.2.3 put one each way every 30 s,
the setting's start line and its pings, the line for a value that is no
number. And there, with builds of this change from before the commit of
the call's resend was put under it: the refresh after 1800 awake seconds
answered on the flow, silent until then, twice; and two loops of
suspends with no packet on the netdev, of six sleeps, none ended by the
modem, and of seven, one ended by it, for a file-system request no
packet had preceded (with the pings and the same ModemManager the modem
ended 5 of 8 on 2026-11-20). No network that closes or forgets an idle
flow has been met.
2026-11-25 11:50:16 +01:00
..
Aka aka: the ISIM application of a card, its identity files and the identity they hold 2026-11-23 19:32:58 +01:00
Engine imsd: when the client flow is found dead before any response to a call's INVITE, one reconnect and the INVITE again, else the call ends 2026-11-25 10:24:07 +01:00
Ipsec ipsec: the default offer names the null cipher beside aes-cbc 2026-11-23 11:19:04 +01:00
Messages aka: the ISIM application of a card, its identity files and the identity they hold 2026-11-23 19:32:58 +01:00
Qmi tests: every suite returns 1 for a failure, not the count 2026-11-22 17:35:11 +01:00
Sdp tests: every suite returns 1 for a failure, not the count 2026-11-22 17:35:11 +01:00
Sip sip: a received message's header section is unfolded where it is framed 2026-11-22 17:35:12 +01:00
Sms sms, engine, imsd: a segment that gets no answer, or an RP-ERROR with cause 41, is sent once more with TP-RD set 2026-11-22 17:35:12 +01:00
Util imsd: no CRLF keepalive on the idle flow unless CRLF_KEEPALIVE names an interval 2026-11-25 11:50:16 +01:00