Summary:ASTERISK-10424: log complaining about tos setting
Reporter:paul miller (idkpmiller)Labels:
Date Opened:2007-10-01 23:53:26Date Closed:2007-10-29 15:57:50
Versions:Frequency of
Description:If you set tos = ef in iax.conf then the log (full) says tos cannot be set to 184, ee actual entries below:

[Oct  2 18:08:34] VERBOSE[18529] logger.c:   == Using TOS bits 184
[Oct  2 18:08:34] WARNING[18529] netsock.c: Unable to set TOS to 184

If you set tos = af41 then "Using TOS bits 136" is shown in the log.
Something is wrong with using ef although it is the recommended value. I have yet to check to see if the packets are being marked correctly.

Comments:By: paul miller (idkpmiller) 2007-10-02 00:20:13

I have just checked the packet marking when tos = ef and they are being set correctly.
I have also checked when the tos = af41 the packets are still marked as ef. this was after stopping and restarting asterisk, the log file showed the setting had taken and was set to 136 which was not reflected in the packets.

[EDIT] Ignore the above note, I had rc.local set to mark the packets and it was overiding them. now I see AF41 packets being marked correctly when configured in iax.conf. And when configured for ef I see packets marked as 0 which is more inline with the reported issue.

By: snuffy (snuffy) 2007-10-02 04:00:30

This will happen when your not running asterisk as root.
There was mention of a change that could be made to allow your 'asterisk' user to mark packets as EF.
Linux will reserve the right to mark packets with EF to only root

By: paul miller (idkpmiller) 2007-10-02 04:43:38

Wouldnt this mean that RTP should have the same issue? There is certainly no complaints in the log about RTP which I have set to be marked as EF. I can do a check with wireshark to confirm.
[EDIT] I have checked RTP and the packets are not marked as EF. This is inconsistant behaviour to IAX where the inability to set the packets to EF is logged, maybe this fault should be closed and a new one opened against the logging behaviour of RTP?
I have also set SIP to ef in sip.conf and it too is not marked on the packets and therefore confirms what you have previously said. it would appear the real issue is that RTP does not log the issue whereas SIP and IAX signalling traffic logs that there is a problem.

By: pj (pj) 2007-10-02 11:19:55

is possible, that non root asterisk have rights to set up dscp in signaling or media packets?
i have read wiki, but no mention about this found here...

By: paul miller (idkpmiller) 2007-10-03 00:50:29

Sould I close this fault and reopen a logging fault with RTP as per my earlier note?
£it would appear the real issue is that RTP does not log the issue whereas SIP and IAX signalling traffic logs that there is a problem"

suggestions please?

By: Jason Parker (jparker) 2007-10-05 13:10:53

I'm not sure I see the issue.  There is no setting for TOS directly in RTP.

By: paul miller (idkpmiller) 2007-10-06 00:02:48

so put simply,
log warning is provided if you set IAX or SIP signalling to ef
but this only covers signalling in the case of SIP.
There is no warning if you set audio or video in sip.conf to ef, would seem there is a gap, settings are being set but no module is logging any issue.

By: Jason Parker (jparker) 2007-10-15 14:04:09

rtp is logging an error message...  From rtp.c, ast_rtp_settos()

if ((res = setsockopt(rtp->s, IPPROTO_IP, IP_TOS, &tos, sizeof(tos))))
   ast_log(LOG_WARNING, "Unable to set TOS to %d\n", tos);

Are you sure you aren't confusing the warning messages?

By: paul miller (idkpmiller) 2007-10-16 05:16:28

Are you suggesting the lines in the log:
[Oct 2 18:08:34] VERBOSE[18529] logger.c: == Using TOS bits 184
[Oct 2 18:08:34] WARNING[18529] netsock.c: Unable to set TOS to 184

may actually be generated by RTP?
if so then it changes as stated when I set sip signalling tos below ef i.e. af41 which to me implied the log messages pointed to SIP signalling tos marking. I have not seen anything regarding RTP specifically in the log if I set it to ef although looking at the code you stated it would be obvious which flow was unable to be set!

Can someone please set RTP and SIP signalling to EF and tell me if they see a warning message logged for both flows when asterisk is set to non root.


By: Alessandro Polverini (alessandro polverini) 2007-10-26 04:38:52

I'm using asterisk 1.4.13 on Debian hence asterisk is not being run as root.
I see all those messages on the console.
Is there any workaround or the only possibility beside not setting the TOS is to run asterisk as root?

By: Jason Parker (jparker) 2007-10-26 11:24:49

No, it would look something like this

WARNING[12345] rtp.c: Unable to set TOS to 184

Note the rtp.c

By: paul miller (idkpmiller) 2007-10-27 22:30:22

It would seem that no-one has submitted a log entry that shows RTP.c being unable to set the TOS field to EF. I surmise that there is a problem with the logging of RTP.c in this area.

[EDIT] It would seem the statement above is incorrect, I have recently moved to 1.4.13 and in the log I have just seem the following entry for a call:

[Oct 26 05:59:11] WARNING[20172] rtp.c: Unable to set TOS to 184
[Oct 26 05:59:11] WARNING[20172] udptl.c: UDPTL unable to set TOS to 184

I am not sure if this is a fix between 1.4.11 and the current but either way I now see the media flow reporting issues with setting EF. I believe the bug can be closed.


By: Jason Parker (jparker) 2007-10-29 15:57:50

Closing, per reporter.