SRTP decryption failed after client seq wrap on transcoded WebRTC call (mr26.2.1.2)

Đã đóng
#2,220 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

  • #2221 của @armanbahlakeh-ct — đã đóng, không merge

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
43/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c
Lĩnh vực
audio-video-rtc, backend

Hướng nghiên cứu

Start by examining the attached SRTP debug log around the sequence number wrap at 10:34:37.6 and compare the ROC values with the packet summary for the same interval. Then trace the SRTP decryption and rollover counter handling in rtpengine's userspace forwarding path; the issue names no source files or tests. Done means reproducing the decryption failure under uplink packet loss and identifying why the stream stops forwarding after the wrap.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

rtpengine version the issue has been seen with

26.2.1.2+0~mr26.2.1.2 (also seen on mr26.2.1.1)

Used distribution and its version

Debian GNU/Linux 12 (bookworm)

Linux kernel version used

6.12.95+deb12-cloud-amd64

CPU architecture issue was seen on (see uname -m)

x86_64

Expected behaviour you didn't see

Audio from a WebRTC client keeps being decrypted and forwarded for the whole call.

Unexpected behaviour you saw

On transcoded calls between a WebRTC client (DTLS-SRTP AEAD_AES_256_GCM, opus) and a plain RTP peer (PCMU), rtpengine at some point starts logging Discarded SRTP packet: decryption failed for the client's stream and stops forwarding that direction until the call ends. The client keeps sending on the same 5-tuple; the other direction keeps working.

In our tests it happens in the same second the client's RTP sequence number wraps from 65535 to 0, and only when the client's uplink has some packet loss. With srtp debug enabled, the ROC logged for the client's SSRC rises during the call before the client has wrapped. We did not see this on mr14.1.1.20.

We'd appreciate any help understanding what is happening here, or whether something in our setup could cause it.

Steps to reproduce the problem
  1. WebRTC client (Chrome) <-> rtpengine <-> plain RTP peer. Flags on the WebRTC side:
    replace-origin rtcp-mux-accept rtcp-mux-offer ICE=force RTP/SAVPF SDES-off codec-strip-all codec-transcode-opus codec-transcode-PCMA codec-transcode-PCMU asymmetric-codecs always-transcode loop-protect
    Plain RTP side: ICE=remove RTP/AVP always-transcode asymmetric-codecs
  2. Add about 2% random packet loss on the client's uplink.
  3. Keep the call up until the client's sequence number wraps (11 to 22 minutes in, depending on the start sequence).

It happened on every attempt with packet loss.

Additional program output to the terminal or logs illustrating the issue

Attached (IPs masked, SRTP keys and payloads removed):

  • rtpengine.conf.txt: the config.
  • rtpengine-run3-srtp-debug.log: the call with srtp loglevel 7. Client SSRC 28930993. Its sequence number wraps at 10:34:37.6, and the first decryption failed is logged at 10:34:37.670.
  • rtpengine-run3-pcap-summary.txt: a packet count per second and per direction from a pcap on the rtpengine host, plus backward sequence steps in the stream rtpengine sends to the plain RTP peer.
Anything else?

Userspace forwarding only (no kernel module). The full pcap is available if useful.

Ngôn ngữ chính
Perl
Star
992
Fork
459
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sipwise/rtpengine

Tất cả issue của sipwise/rtpengine

Issue tương tự

Thêm issue về Perl

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.