Project

General

Profile

Bug #2728

Align better with 48.103 for AoIP user plane (AMR marker bit for frame following ONSET)

Added by laforge over 3 years ago. Updated 2 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
12/09/2017
Due date:
% Done:

100%

Spec Reference:

Description

In most aspects we seem to do what 48.103 States. However, e.g. our payload types for RTP differ from whats specified there. Also not sure aboiut Details oft MARKER behavior and behavior with regard to lost frames on radio interface.


Related issues

Related to OsmoMGW - Feature #3798: Implement bandwidth-efficient AMR payload as per RFC 4867 Section 4.3Resolved02/12/2019

Associated revisions

Revision 9eea6a9d (diff)
Added by dexter almost 3 years ago

gscon: pick suitable payload type / encoding name for MGCP

The GSCON FSM does not care about the codec information when performing
interactions with the MGW. Before upgrading the client the codec
information was hardcoded to AMR inside the client. Now the client
offers APIs to set the codec information. Since this feature is new,
osmo-bsc does not set any codec information yet, which causes many of
the TTCN3 tests to fail. So lets add some logic to pick suitable codec
info.

- Hardcode ptime to 20 (is the same for all possible codecs)
- Select a codec according to the flags in userplane

Change-Id: Ibddc3492572b39f166e3a1b8b8120813ce2dadc2
Related: OS#2728

Revision 93916be8 (diff)
Added by dexter over 2 years ago

rsl: use 3GPP assigned payload type constants from libosmo-netif

The payload constants for AMR, EFR, GSM-FR, and GSM-HR are already
defined in libosmo-netif, there is no need to re-define them locally.

- include rtp.h from libosmo-netif in abis_rsl.c
- remove duplicate payload type constants

Change-Id: Ib6a866b29d863d6875c67748dbe6b6468941ab29
Related: OS#2728

Revision c80cce67 (diff)
Added by dexter over 2 years ago

gscon: use BSS-common payload types on BSS side

In cases where a codec has no fixed (IANA) payload type number, a
dynamically coosen payload type number is used. For the route between
BSC and MSC 3GPP as designated certain payload type numbers. However,
beond that, those payload type numbers may not necessarly apply. The
RTP communication between BTS and BSC still might run on a completely
different payload type number.

libosmo-netif contains a header file which payload type numbers
shall be used. Lets use those in order to signal the same payload type
numbers as we actually use in the RTP packets to the MGW.

Change-Id: I507a1b1446c8f140b2950d73cf737797604c1ac3
Related: OS#2728
Related: OS#3384

History

#1 Updated by laforge over 3 years ago

  • Description updated (diff)

#2 Updated by dexter almost 3 years ago

Note:
I just learned that there are profiles that are just statically defined by the payload type number. And there are dynamics payload types that require an rtpmap in SDP to be fully described.
https://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml
We also seem to use payload type 255 a lot, however this one seems to be illegal because the dynamic range is from 96 to 127 only.

#3 Updated by laforge almost 3 years ago

On Mon, Jun 04, 2018 at 07:55:24PM +0000, dexter [REDMINE] wrote:

I just learned that there are profiles that are just statically defined by the payload type number. And there are dynamics payload types that require an rtpmap in SDP to be fully described.
https://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml

yes, that's standard RTP operation since the 1990ies. However, the important part for AoIP is that 3GPP
actually defined some "fixed" types in the "dynamic payload type" range.

We also seem to use payload type 255 a lot, however this one seems to be illegal because the dynamic range is from 96 to 127 only.

please open an issue for this, I think this is a quite serious separate bug which should be resolved rather quickly.

#4 Updated by dexter almost 3 years ago

yes, that's standard RTP operation since the 1990ies. However, the important part for AoIP is that 3GPP
actually defined some "fixed" types in the "dynamic payload type" range.

Thats new to me. Is this defined in 3GPP TS 48.008?

please open an issue for this, I think this is a quite serious separate bug which should be resolved rather quickly.

In osmo-mgw I have elimiated the problem while cleaing up the SDP parser. In the client I got rid of the hardcoded SDP, so its gone there as well. See also #3334

#5 Updated by laforge almost 3 years ago

Hi dexter,

On Mon, Jun 11, 2018 at 07:44:24PM +0000, dexter [REDMINE] wrote:

yes, that's standard RTP operation since the 1990ies. However, the important part for AoIP is that 3GPP
actually defined some "fixed" types in the "dynamic payload type" range.

Thats new to me. Is this defined in 3GPP TS 48.008?

No. Please read the subject f this issue. It states exactly which 3GPP TS we have to match ;)

Specifically, I was referring to
"Table 5.4.2.2.1: Type of data transported versus RTP Payload Type" when
creating this issue. It lists 110 for EFR, 111 for HR, 112 for AMR

#6 Updated by dexter almost 3 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 50

The latest updates to osmo-mgw, which are currently in review also cover this topic. Both libosmo-mgcp and libosmo-mgcp-client now use the 3gpp/IANA defined payload types. So from the payload type perspective we should be good now.

See also:
https://gerrit.osmocom.org/#/c/osmo-mgw/+/9649/
https://gerrit.osmocom.org/#/c/osmo-mgw/+/9648/

What still remains is the MARKER behaviour / lost frames on radio topic.

#7 Updated by dexter almost 3 years ago

  • % Done changed from 50 to 60

As expected many of the BSC tests now fail because osmo-bsc does not set the codec information yet. I have now modifed gscon that it sets basic codec information. This should make the tests pass again.

See also:
https://gerrit.osmocom.org/#/c/osmo-bsc/+/9738/

The TTCN3 tests still use wrong/hardoced codec information. This is now also fixed.

See also:
https://gerrit.osmocom.org/#/c/osmo-ttcn3-hacks/+/9737/

#8 Updated by laforge almost 3 years ago

On Mon, Jun 25, 2018 at 07:41:19PM +0000, dexter [REDMINE] wrote:

https://gerrit.osmocom.org/#/c/osmo-bsc/+/9738/
https://gerrit.osmocom.org/#/c/osmo-ttcn3-hacks/+/9737/

both patches now merged.

#9 Updated by dexter almost 3 years ago

Note: I think we now should have a look at the RTP-Streams as well since there are still problmatic payload types inside the streams. (on a trace with AMR-HR/AMR-FR the streams are tagged with 98, which is wrong)

#10 Updated by dexter almost 3 years ago

  • % Done changed from 60 to 80

I have now changed the constants which are used for RTP streams in various places. I have changed those constants now so that they match the 3GPP recommendations:

https://gerrit.osmocom.org/#/c/libosmo-abis/+/9779 ortp: use 3GPP assigned payload type numbers
https://gerrit.osmocom.org/#/c/libosmo-netif/+/9780 rtp: use 3GPP assigned payload type numbers
https://gerrit.osmocom.org/#/c/osmo-bsc/+/9781 rsl: use 3GPP assigned payload type numbers
https://gerrit.osmocom.org/#/c/openbsc/+/9782 rtp_proxy: use 3GPP assigned payload type numbers

#11 Updated by dexter almost 3 years ago

There was the suggestion not only to change the various constants but also to limit the number of redundant definitions. When we put openbsc aside we still have 3 places where the payload type constants for the RTP-Streams are defined. (Note: We now focusing on the payload type tags used in the RTP packets, not on the ones in the MGCP messages.)

I have abandoned the changes I made in openbsc (osmo-nitb). I thought it would be better to use the 3gpp assigned payload types there as well, but its also true that we do not have any benefit from this while we introduce a regression risk.

In libosmo-netif I kept it the way it is as we do not want to introduce any dependencies here. So I did not do any further changes here.

In osmo-bsc I removed the constants completely and used the ones already present in libosmo-abis. This works fine. However, we need to make sure that we do not introduce a regression with nanoBTS. (I am also not sure about the nanoBTS support in osmo-bsc, the tests I did some months ago were not very promising but I also do not receive any complaints from the tester)

For now I tagged the change in osmo-bsc as WIP until I managed to do a test using the nanobts.

While working on the RTP stream payload types we also realized that osmo-mgw can not do payload type translation yet. See also #3384 If we resolve this, we may also very well stick to the non-3gpp payload types on the BSS/BTS side, however I would recommend to use the 3gpp assigned payload types there as well if there are no problems with nanoBTS.

#12 Updated by dexter almost 3 years ago

  • Status changed from In Progress to Stalled
  • % Done changed from 80 to 90

I think we are very close to complete here. The final bits (Payload type numbers inside the RTP stream) require a discussion.

#13 Updated by dexter over 2 years ago

  • Status changed from Stalled to In Progress
  • % Done changed from 90 to 80

Osmo-bsc now negotiates the payload types that we also use in the RTP packets. So on the BSS side the RTP flow is now coherent to what we have negotiated via MGCP/SDP

https://gerrit.osmocom.org/#/c/osmo-bsc/+/10173 gscon: use BSS-common payload types on BSS side

(There is also still work to do on osmo-msc, it does not yet set proper payload type in the MGCP/SDP, this has to be fixed as well.)

#14 Updated by dexter over 2 years ago

I have looked through the code of the MSC. We do not care about the codec much yet. I am currently fixing it. For the internal MNCC I think it will simple to fix, but for the external MNCC we will have to be a bit harder since we need to exchange the codecs with the PBX as well.

The patches that fix the BSC side are not through the review yet. I see there are merge conflicts I have to fix.

#15 Updated by dexter over 2 years ago

I noticed there were a lot of changes in osmo-bsc, so I have revised my patch to use consistant payload types in RTP packets and MGCP.
See also: https://gerrit.osmocom.org/#/c/osmo-bsc/+/10287

#16 Updated by dexter over 2 years ago

On the MSC side I now extract the Speech Codec (Choosen) field. Based on the content I can set the codec that has to be negotiated to the MGW on the RAN side. The codec information on the CN side is the same when we run with the internal MNCC. When we run on the external MNCC we must take the codec information from the MNCC data we get via the socket.

Unfortunately there ssems to be problems with the external MNCC interface. I do not understand how it is used to signal dynamic payload types. I contacted holger to get some info about this but I fear we have to upgrade the MNCC interface a bit.

#17 Updated by dexter over 2 years ago

Note: Probably also interesting in the context of this ticket and Speech Codec (Choosen): #3529

#18 Updated by laforge over 2 years ago

dexter: What's the status here? Notes about the MNCC interface are not applicable here. What's needed is an analysis/update of which parts of 48.103 we are compliant to, which parts we are not, and which parts we don't know. And then add checkbox items or sub-tasks for those incompatible/dont-know items here. Thanks!

#19 Updated by dexter over 2 years ago

A lot of the compliance was depending on correct signaling on the MGCP side, especially payload types were a problem here. Most of this is now fiexed but we still have a problem is osmo-msc. When we use the external MNCC we do not negotiate the payload type, this leads into violation of 48.103 because we get incorrect payload type numbers in the RTP packets. Apart from that most things look ok. I have gone over the spec and checked some points:

4.    Transport over TDM:
           (Not implemented yet)
5.     Transport over IP:
           OK: Port numbering
           OK: Same ports for Send/Receive
5.4.2:    RTP
        OK: RTP Header version
        OK: No Padding
        OK: No Extension
        OK: CSRC=0
        CHECK: Marker Bit, unknown yet, must check.
        OK: Payload type (when codec is correctly negotiated,
            there are problems in osmo-msc and MNCC so that we
            do not know the right codec and therefore the payload
            type will be wrong then. In principle osmo-mgw does
            patch the payload types inthe RTP stream so that they
            are correct on the egress connection.)
        OK: Packetization time (20ms)
        OK: RTCP (optional)
5.5    RTP Multiplexing:
        (Not Implemented yet)
5.6    Transport of CSData:
        (Not omplemented yet)
5.7    Transport during local switching
        (We do not release any endpoints while local switching, this looks ok.)

I did not check the marker bit yet. The spec says that on AMR the ONSET frame must have the marker bit set and also the voice frame that follows after the ONSET. This still needs to be checked. I also found that we do not have RTP multiplexing, nor do we have CSData, but I think those are not all important anyway.

#20 Updated by laforge over 2 years ago

Ok, so we need to check for the marker bit usage, and then we can close this issue.

#21 Updated by dexter over 2 years ago

I now had a look at the marker behaviour. The spec says that the mark bit should be set for every ONSET frame and for the following voice frame. In the trace I can only see a marker once when the RTP stream starts, so I think there is a problem here. This needs to be investigated on osmo-bts. As far as I understood the payload is generated by the phy and used 1:1 in the RTP stream, we just add the RTP header.

Attached one finds a trace that shows the problem. I also did a trace with GSM-FR and the behavior is exactly the same there, so my guess is that we just have the same marker behavior for all codecs and did not program an exception for AMR.

#22 Updated by laforge over 2 years ago

On Tue, Oct 09, 2018 at 09:49:29AM +0000, dexter [REDMINE] wrote:

I now had a look at the marker behaviour. The spec says that the mark
bit should be set for every ONSET frame and for the following voice
frame. In the trace I can only see a marker once when the RTP stream
starts, so I think there is a problem here.

Sad :/

This needs to be investigated on osmo-bts. As far as I understood the
payload is generated by the phy and used 1:1 in the RTP stream, we
just add the RTP header.

Yes, and the marker bit is part of the RTP header which we generate.

grep for things like lchan_set_marker() and lchan->rtp_tx_marker in the osmo-bts source
code and you should find some code that is supposed to set the marker bits.

The common part above l1sap uses osmo_rtp_send_frame_ext() with lchan->rtp_tx_marker
as a flag to state whether or not the marker bit shall be sent in the next RTP frame.
Once it has been set once, it is reset to false.

You an see that rtp_tx_marker is set by osmo-bts-sysmo and osmo-bts-lc15
in the AMR related use cases...

#23 Updated by laforge over 2 years ago

it may make sense to shift this over to msuraev as he had been working on AMR DTX in the past?

#24 Updated by dexter over 2 years ago

  • Assignee changed from dexter to msuraev

I think it makes sense when max does it, he probably knows better where to fix it.

msuraev Have a look at update #19. The only thing that is still missing is the slightly different marker behavior when AMR is used.

#25 Updated by msuraev over 2 years ago

  • Status changed from In Progress to Stalled

#26 Updated by laforge about 2 years ago

  • Related to Feature #3798: Implement bandwidth-efficient AMR payload as per RFC 4867 Section 4.3 added

#27 Updated by laforge almost 2 years ago

  • Subject changed from Align better with 48.103 for AoIP user plane to Align better with 48.103 for AoIP user plane (AMR marker bit for frame following ONSET)
  • Assignee changed from msuraev to sysmocom

#28 Updated by laforge over 1 year ago

  • Assignee deleted (sysmocom)

#29 Updated by dexter about 1 year ago

In #2978 we implement the implement the correct setting of the marker bit for osmo-bts-trx. The marker bit is now set in the first actual voice frame after ONSET (The ONSET frame itself exists only on the radio link, it does not generate an RTP frame)

#30 Updated by laforge 11 months ago

#31 Updated by laforge 2 months ago

  • Status changed from Stalled to Resolved
  • % Done changed from 80 to 100

this should have been closed 10 motnhs ago, when #2978 was closed.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)