sipwise / rtpengine

The Sipwise media proxy for Kamailio
GNU General Public License v3.0
794 stars 372 forks source link

"Total relayed packet errors" question #1074

Open juha-h opened 4 years ago

juha-h commented 4 years ago

On some rtpengine hosts, "Total relayed packet errors" count is larger that some others. I tried to read from the source, how this count gets increased and found these:

In the first case, there should be error message "IPv4 routing failed" or "x_tables action failed: %s" in syslog. In the second case, there is no error message.

Is this interpretation correct, i.e., if no error messages appear in syslog, the packets were not rtp packet?

rfuchs commented 4 years ago

So if we're talking about errors that occur while forwarding in the kernel module, then mostly yes, with a few additional notes: 1) Errors stemming from problems sending the packet out are logged only if the log_errors option is enabled 2) A packet not being RTP is only an error when it must be RTP, e.g. when handling SRTP encryption. Otherwise non-RTP packets are forwarded without being counted as an error. 3) A few other cases are also counted as errors: a) If RTP payload types are restricted (when transcoding) and an unknown payload type is received b) If source addresses are restricted and a packet from the wrong source address is received and is dropped c) If SSRC is restricted (when transcoding) and a new/unknown SSRC is received d) If SRTP decryption fails (e.g. the auth tag doesn't match or for some other reason)

juha-h commented 4 years ago

OK, thanks for the answer. I had missed log_errors, which is xt_RTPENGINE module parameter.

juha-h commented 4 years ago

I tried to enable log_errors module parameter, but did not get set:

# rmmod xt_RTPENGINE 
# modprobe xt_RTPENGINE log_errors=1
# dmesg
...
[331342.088639] Unregistering xt_RTPENGINE module
[331410.213672] Registering xt_RTPENGINE module - version 8.5.1.1+0~mr8.5.1.1
# systool -vm xt_RTPENGINE
Module = "xt_RTPENGINE"

  Attributes:
    coresize            = "49152"
    initsize            = "0"
    initstate           = "live"
    refcnt              = "0"
    taint               = "OE"
    uevent              = <store method only>

  Sections:
    .bss                = "0xffffffffc13bd480"
    .data               = "0xffffffffc13bd000"
    .exit.text          = "0xffffffffc13b9af3"
    .gnu.linkonce.this_module= "0xffffffffc13bd140"
    .init.text          = "0xffffffffc1239000"
    .note.Linux         = "0xffffffffc13ba024"
    .note.gnu.build-id  = "0xffffffffc13ba000"
    .orc_unwind         = "0xffffffffc13bc01c"
    .orc_unwind_ip      = "0xffffffffc13bb680"
    .rodata             = "0xffffffffc13bab60"
    .rodata.str1.1      = "0xffffffffc13ba7b5"
    .rodata.str1.8      = "0xffffffffc13ba2c8"
    .smp_locks          = "0xffffffffc13ba260"
    .strtab             = "0xffffffffc123b638"
    .symtab             = "0xffffffffc123a000"
    .text               = "0xffffffffc13b4000"
    .text.unlikely      = "0xffffffffc13b9943"
    __mcount_loc        = "0xffffffffc13ba048"
    __param             = "0xffffffffc13bb5e0"

What was it that went wrong?