Hi all,
I have a request for comments regarding osmo-mgw, particularly the fmtp for AMR octet-align mode and the two GSM-HR variants.
We are currently reviewing/writing patches to allow flexible use of fmtp in libosmo-mgcp-client. The plan is to be able to indicate which GSM-HR variant (RFC5993 or 3GPP TS 101.318) is in use.
Also we are fixing the ability to indicate AMR mode (octet-align=1 vs 0) properly, per payload type nr instead of once per SDP body.
Example of MGCP with SDP, showing two codecs, AMR as 112 and GSM-HR as 111, each with a fmtp as I'm discussing now:
CRCX 2 7@mgw MGCP 1.0 C: 2 v=0 c=IN IP4 123.12.12.123 m=audio 5904 RTP/AVP 112 111 a=rtpmap:112 AMR/8000/1 a=fmtp:112 octet-align=1 a=rtpmap:111 GSM-HR-08/8000/1 a=fmtp:111 gsm-hr-format=3gpp-ts-101.318 a=ptime:20
That means that each MGW client tells osmo-mgw exactly what AMR and HR formats to send to the RTP peer, and also restricts exactly which format to expect from that RTP peer. So BSC and MSC need to know things about BTS and BSS, in advance: - the BSC needs configured knowledge of each BTS's octet-align and gsm-hr-format. - the MSC needs configured knowledge of what the BSC will do. - what if there are divergent formats in different BTS of a BSS, does MSC need to know that too? There is certainly no way to indicate octet-align nor HR variant in standard A interface proto.
So far so complex, BUT:
In practical testing, I see from logging that osmo-mgw is already quite capable of detecting which AMR octet-align mode and which HR format is actually arriving from the RTP peer (from the BTS...).
I see this log line:
DRTP NOTICE (rtpbridge/1@bsc0 I:FA1F785D) rx_rtp(44 bytes): Expected RTP AMR octet-aligned=1 but got octet-aligned=0. check the config of your call-agent! (mgcp_network.c:1525)
And I'm thinking, where is the problem, just do what you need to do; all the information it needs to do the right thing is already available to osmo-mgw. So why even the need to configure {AMR octet-align|GSM-HR mode} in SDP?
Idea: - the first RTP packet arriving is examined, and from then on the peer is known to use that format. - when later, an RTP needs to be forwarded back to that peer, we convert to the format that the peer uses, iff it is necessary. - for sanity we could hold back forwarding RTP before the details of the recipient are known, i.e. wait for each peer to send the first RTP to MGW.
Example for an RTP stream in GSM-HR format:
A MGW B |--HR(3gpp)-->|--x drop | (don't know B's preference yet, cannot send) | [3gpp]| | (now know A uses the 3gpp format) | |<--HR(rfc)--| | |[rfc] | (now know B uses the RFC format) | [convert] | |<--HR(3gpp)--| | |--HR(3gpp)-->|--HR(rfc)-->| |<--HR(3gpp)--|<--HR(rfc)--|
There is an important difference between AMR octet-align and GSM-HR:
- 'octet-align=(0|1)' is a defined standard fmtp that already exists, and it may be necessary to forward this accurately to PBX. We may not get around having to explicitly set this.
- GSM-HR format is a new fmtp we are inventing now. So the idea is most relevant here: if we can always just autodetect the right thing to do, then why introduce a non-standard fmtp? (plus all the MGW client vty cfg needed)
What do you think? Thanks!
~N
Hi Neels,
On Thu, Dec 07, 2023 at 02:19:08AM +0100, Neels Hofmeyr wrote:
That means that each MGW client tells osmo-mgw exactly what AMR and HR formats to send to the RTP peer, and also restricts exactly which format to expect from that RTP peer. So BSC and MSC need to know things about BTS and BSS, in advance:
- the BSC needs configured knowledge of each BTS's octet-align and gsm-hr-format.
- the MSC needs configured knowledge of what the BSC will do.
- what if there are divergent formats in different BTS of a BSS, does MSC need to know that too? There is certainly no way to indicate octet-align nor HR variant in standard A interface proto.
IMHO, the BSC and its colocated MGW should "hide" all the RAN-internal details from the MSC. A MSC should never have to know anything specific about each and every BTS, or even how many BTS there are.
The AoIP interface is the only where the RTP format / codec types / payload types are specified. We should always use what's specified in TS 48.103.
So if a BTS has some differnt format on the Abis side, the bsc-colocated MGW would need to convert to the one format specified by TS 48.103 on AoIP
- 'octet-align=(0|1)' is a defined standard fmtp that already exists, and it may be necessary to forward this accurately to PBX. We may not get around having to explicitly set this.
Yes, following the spec where there is one is a good idea.
- GSM-HR format is a new fmtp we are inventing now. So the idea is most relevant here: if we can always just autodetect the right thing to do, then why introduce a non-standard fmtp? (plus all the MGW client vty cfg needed)
I would do whatever is less effort here, given that the interest in GSM-HR is very low in 2023, and we have to conserve our capacity to where it really matters.
On Thu, Dec 07, 2023 at 01:49:20PM +0100, Harald Welte wrote:
IMHO, the BSC and its colocated MGW should "hide" all the RAN-internal details from the MSC. A MSC should never have to know anything specific about each and every BTS, or even how many BTS there are.
so AMR oa/be mode should be:
BTS <--whatever-bts-needs--> MGW@BSC <--fixed-as-in-3GPP-spec--> MGW@MSC
The AoIP interface is the only where the RTP format / codec types / payload types are specified. We should always use what's specified in TS 48.103.
3GPP TS 48.103 references TS 26.102, which says
10.2 AMR The bandwidth efficient mode of RFC 4867 [21] shall be used. CRC and robust sorting shall not be applied.
So 3GPP says use octet-align=0 on the A-interface:
BTS <--whatever-bts-needs--> MGW@BSC <--octet-align=0--> MGW@MSC
In osmo-bsc, I read that all our BTS currently use octet-align=1. I also see osmo-bsc indicating octet-align=1 to the MGW, unconditionally. https://gitea.osmocom.org/cellular-infrastructure/osmo-bsc/src/commit/71f96f...
Then we want this:
BTS <--octet-align=1--> MGW@BSC <--octet-align=0--> MGW@MSC
Which means our 2G BTS use a different align than specified to be used on the A-interface in 3GPP. For AMR, we'd *always* convert each RTP packet between OA (BTS) and BE (CN) at osmo-bsc's MGW, once per call leg.
So far, osmo-bsc indicates octet-align=1 to both sides, also the CN. Are you sure we should change that?
In our osmocom world, it seems practical to instead agree on OA=1 from RAN up to osmo-msc, even though it does not match 3GPP TS 26.102: - OA=1 is the status quo of what osmo-bsc tells its MGW to pass to the CN. - We can do IuUP->AMR conversion directly as OA=1 (for 2G and 3G alike). - To PBX, there's no problem with flexible OA: if the PBX asks for octet-align=0, osmo-msc can forward that to osmo-mgw. osmo-mgw will then transcode to BE.
I think, best to add VTY options in osmo-bsc and osmo-msc for which fixed AMR mode to use on the A-interface; Default would be current behavior: OA=1 on the A-interface. A user can then configure conform to 3GPP instead, if desired.
Makes sense?
~N
Hi Neels,
On Fri, Dec 08, 2023 at 04:46:22AM +0100, Neels Hofmeyr wrote:
I think, best to add VTY options in osmo-bsc and osmo-msc for which fixed AMR mode to use on the A-interface; Default would be current behavior: OA=1 on the A-interface. A user can then configure conform to 3GPP instead, if desired.
Agreed, thanks.