blob: 4d03a4b0528cd19c48dde300e3b513dff3ee88f1 [file] [log] [blame]
Pau Espin Pedrolb1202722017-05-03 12:38:05 +02001[[osmux]]
2= OSmux: reduce of SAT uplink costs by protocol optimizations
3
4== Problem
5
6In case of satellite based GSM systems, the transmission cost on the back-haul
7is relatively expensive. The billing for such SAT uplink is usually done in a
8pay-per-byte basis. Thus, reducing the amount of bytes transfered would
9significantly reduce the cost of such uplinks. In such environment, even
10seemingly small protocol optimizations, eg. message batching and trunking, can
11result in significant cost reduction.
12
13This is true not only for speech codec frames, but also for the constant
14background load caused by the signalling link (A protocol). Optimizations in
15this protocol are applicable to both VSAT back-haul (best-effort background IP)
16as well as Inmarsat based links (QoS with guaranteed bandwidth).
17
18== Proposed solution
19
20In order to reduce the bandwidth consumption, this document proposes to develop
21a multiplex protocol that will be used to proxy voice and signalling traffic
22through the SAT links.
23
24=== Voice
25
26For the voice case, we propose a protocol that provides:
27
28* Batching: that consists of putting multiple codec frames on the sender side
29 into one single packet to reduce the protocol header overhead. This batch
30 is then sent as one RTP/UDP/IP packet at the same time. Currently, AMR 5.9
31 codec frames are transported in a RTP/UDP/IP protocol stacking. This means
32 there are 15 bytes of speech codec frame, plus a 2 byte RTP payload header,
33 plus the RTP (12 bytes), UDP (8 bytes) and IP (20 bytes) overhead. This means
34 we have 40 byte overhead for 17 byte payload.
35
36* Trunking: in case of multiple concurrent voice calls, each of them will
37 generate one speech codec frame every 20ms. Instead of sending only codec
38 frames of one voice call in a given IP packet, we can 'interleave' or trunk
39 the codec frames of multiple calls into one IP. This further increases the
40 IP packet size and thus improves the payload/overhead ratio.
41
42Both techniques should be applied without noticeable impact in terms of user
43experience. As the satellite back-haul has very high round trip time (several
44hundred milliseconds), adding some more delay is not going to make things
45significantly worse.
46
47For the batching, the idea consists of batching multiple codec frames on the
48sender side, A batching factor (B) of '4' means that we will send 4 codec
49frames in one underlying protocol packet. The additional delay of the batching
50can be computed as (B-1)*20ms as 20ms is the duration of one codec frame.
51Existing experimentation has shown that a batching factor of 4 to 8 (causing a
52delay of 60ms to 140ms) is acceptable and does not cause significant quality
53degradation.
54
55The main requirements for such voice RTP proxy are:
56
57* Always batch codec frames of multiple simultaneous calls into single UDP
58 message.
59
60* Batch configurable number codec frames of the same call into one UDP
61 message.
62
63* Make sure to properly reconstruct timing at receiver (non-bursty but
64 one codec frame every 20ms).
65
66* Implementation in libosmo-netif to make sure it can be used
67 in osmo-bts (towards osmo-bsc), osmo-bsc (towards osmo-bts and
68 osmo-bsc_nat) and osmo-bsc_nat (towards osmo-bsc)
69
70* Primary application will be with osmo-bsc connected via satellite link to
71 osmo-bsc_nat.
72
73* Make sure to properly deal with SID (silence detection) frames in case
74 of DTX.
75
76* Make sure to transmit and properly re-construct the M (marker) bit of
77 the RTP header, as it is used in AMR.
78
79* Primary use case for AMR codec, probably not worth to waste extra
80 payload byte on indicating codec type (amr/hr/fr/efr). If we can add
81 the codec type somewhere without growing the packet, we'll do it.
82 Otherwise, we'll skip this.
83
84=== Signalling
85
86Signalling uses SCCP/IPA/TCP/IP stacking. Considering SCCP as payload, this
87adds 3 (IPA) + 20 (TCP) + 20 (IP) = 43 bytes overhead for every signalling
88message, plus of course the 40-byte-sized TCP ACK sent in the opposite
89direction.
90
91While trying to look for alternatives, we consider that none of the standard IP
92layer 4 protocols are suitable for this application. We detail the reasons
93why:
94
95* TCP is a streaming protocol aimed at maximizing the throughput of a stream
96 withing the constraints of the underlying transport layer. This feature is
97 not really required for the low-bandwidth and low-pps GSM signalling.
98 Moreover, TCP is stream oriented and does not conserve message boundaries.
99 As such, the IPA header has to serve as a boundary between messages in the
100 stream. Moreover, assuming a generally quite idle signalling link, the
101 assumption of a pure TCP ACK (without any data segment) is very likely to
102 happen.
103
104* Raw IP or UDP as alternative is not a real option, as it does not recover
105 lost packets.
106
107* SCTP preserves message boundaries and allows for multiple streams
108 (multiplexing) within one connection, but it has too much overhead.
109
110For that reason, we propose the use of LAPD for this task. This protocol was
111originally specified to be used on top of E1 links for the A interface, who
112do not expose any kind of noticeable latency. LAPD resolves (albeit not as
113good as TCP does) packet loss and copes with packet re-ordering.
114
115LAPD has a very small header (3-5 octets) compared to TCPs 20 bytes. Even if
116LAPD is put inside UDP, the combination of 11 to 13 octets still saves a
117noticable number of bytes per packet. Moreover, LAPD has been modified for less
118reliable interfaces such as the GSM Um interface (LAPDm), as well as for the
119use in satellite systems (LAPsat in ETSI GMR).
120
121== OSmux protocol
122
123The OSmux protocol is the core of our proposed solution. This protocol operates
124over UDP or, alternatively, over raw IP. The designated default UDP port number
125and IP protocol type have not been yet decided.
126
127Every OSmux message starts with a control octet. The control octet contains a
1282-bit Field Type (FT) and its location starts on the 2nd bit for backward
129compatibility with older versions (used to be 3 bits). The FT defines the
130structure of the remaining header as well as the payload.
131
132The following FT values are assigned:
133
134* FT == 0: LAPD Signalling
135* FT == 1: AMR Codec
136* FT == 2: Dummy
137* FT == 3: Reserved for Fture Use
138
139There can be any number of OSmux messages batched up in one underlaying packet.
140In this case, the multiple OSmux messages are simply concatenated, i.e. the
141OSmux header control octet directly follows the last octet of the payload of the
142previous OSmux message.
143
144
145=== LAPD Signalling (0)
146
Pau Espin Pedrolac70cf92017-07-18 18:56:22 +0200147[packetdiag]
148----
149{
150 colwidth = 32
151 node_height = 40
152
153 0: -
154 1-2: FT
155 3-7: ----
156 8-15: PL-LENGTH
157 16-31: LAPD header + payload
158}
159----
Pau Espin Pedrolb1202722017-05-03 12:38:05 +0200160
161Field Type (FT): 2 bits::
Pau Espin Pedrolac70cf92017-07-18 18:56:22 +0200162The Field Type allocated for LAPD Signalling is "0".
Pau Espin Pedrolb1202722017-05-03 12:38:05 +0200163
164This frame type is not yet supported inside OsmoCom and may be subject to
165change in future versions of the protocol.
166
167
168=== AMR Codec (1)
169
170This OSmux packet header is used to transport one or more RTP-AMR packets for a
171specific RTP stream identified by the Circuit ID field.
172
Pau Espin Pedrolac70cf92017-07-18 18:56:22 +0200173[packetdiag]
174----
175{
176 colwidth = 32
177 node_height = 40
178
179 0: M
180 1-2: FT
181 3-5: CTR
182 6: F
183 7: Q
184 8-15: Red. TS/SeqNR
185 16-23: Circuit ID
186 24-27: AMR FT
187 28-31: AMR CMR
188}
189----
Pau Espin Pedrolb1202722017-05-03 12:38:05 +0200190
191Marker (M): 1 bit::
192This is a 1:1 mapping from the RTP Marker (M) bit as specified in RFC3550
193Section 5.1 (RTP) as well as RFC3267 Section 4.1 (RTP-AMR). In AMR, the Marker
194is used to indicate the beginning of a talk-spurt, i.e. the end of a silence
195period. In case more than one AMR frame from the specific stream is batched into
196this OSmux header, it is guaranteed that the first AMR frame is the first in the
197talkspurt.
198
199Field Type (FT): 2 bits::
200The Field Type allocated for AMR codec is "1".
201
202Frame Counter (CTR): 2 bits::
203Provides the number of batched AMR payloads (starting 0) after the header. For
204instance, if there are 2 AMR payloads batched, CTR will be "1".
205
206AMR-F (F): 1 bit::
207This is a 1:1 mapping from the AMR F field in RFC3267 Section 4.3.2. In case
208there are multiple AMR codec frames with different F bit batched together, we
209only use the last F and ignore any previous F.
210
211AMR-Q (Q): 1 bit::
212This is a 1:1 mapping from the AMR Q field (Frame quality indicator) in RFC3267
213Section 4.3.2. In case there are multiple AMR codec frames with different Q bit
214batched together, we only use the last Q and ignore any previous Q.
215
216Circuit ID Code (CIC): 8 bits::
217Identifies the Circuit (Voice call), which in RTP is identified by {srcip,
218srcport, dstip, dstport, ssrc}.
219
220Reduced/Combined Timestamp and Sequence Number (RCTS): 8 bits::
221Resembles a combination of the RTP timestamp and sequence number. In the GSM
222system, speech codec frames are generated at a rate of 20ms. Thus, there is no
223need to have independent timestamp and sequence numbers (related to a 8kHz
224clock) as specified in AMR-RTP.
225
226AMR Codec Mode Request (AMR-FT): 4 bits::
227This is a mapping from te AMR FT field (Frame type index) in RFC3267 Section
2284.3.2. The length of each codec frame needs to be determined from this field. It
229is thus guaranteed that all frames for a specific stream in an OSmux batch are
230of the same AMR type.
231
232AMR Codec Mode Request (AMR-CMR): 4 bits::
233The RTP AMR payload header as specified in RFC3267 contains a 4-bit CMR field.
234Rather than transporting it in a separate octet, we squeeze it in the lower four
235bits of the clast octet. In case there are multiple AMR codec frames with
236different CMR, we only use the last CMR and ignore any previous CMR.
237
238==== Additional considerations
239
240* It can be assumed that all OSmux frames of type AMR Codec contain at least 1
241 AMR frame.
242* Given a batch factor of N frames (N>1), it can not be assumed that the amount
243 of AMR frames in any OSmux frame will always be N, due to some restrictions
244 mentioned above. For instance, a sender can decide to send before queueing the
245 expected N frames due to timing issues, or to conform with the restriction
246 that the first AMR frame in the batch must be the first in the talkspurt
247 (Marker M bit).
248
249
250=== Dummy (2)
251
252This kind of frame is used for NAT traversal. If a peer is behind a NAT, its
253source port specified in SDP will be a private port not accessible from the
254outside. Before other peers are able to send any packet to it, they require the
255mapping between the private and the public port to be set by the firewall,
256otherwise the firewall will most probably drop the incoming messages or send it
257to a wrong destination. The firewall in most cases won't create a mapping until
258the peer behind the NAT sends a packet to the peer residing outside.
259
260In this scenario, if the peer behind the nat is expecting to receive but never
261transmit audio, no packets will ever reach him. To solve this, the peer sends
262dummy packets to let the firewall create the port mapping. When the other peers
263receive this dummy packet, they can infer the relation between the original
264private port and the public port and start sending packets to it.
265
266When opening a connection, the peer is expected to send dummy packets until it
267starts sending real audio, at which point dummy packets are not needed anymore.
268
Pau Espin Pedrolac70cf92017-07-18 18:56:22 +0200269[packetdiag]
270----
271{
272 colwidth = 32
273 node_height = 40
274
275 0: -
276 1-2: FT
277 3-5: CTR
278 6-7: --
279 8-15: ----
280 16-23: Circuit ID
281 24-27: AMR FT
282 28-31: ----
283}
284----
Pau Espin Pedrolb1202722017-05-03 12:38:05 +0200285
286Field Type (FT): 2 bits::
287The Field Type allocated for AMR codec is "2".
288
289Frame Counter (CTR): 2 bits::
290Provides the number of dummy batched AMR payloads (starting 0) after the header.
291For instance, if there are 2 AMR payloads batched, CTR will be "1".
292
293Circuit ID Code (CIC): 8 bits::
294Identifies the Circuit (Voice call), which in RTP is identified by {srcip,
295srcport, dstip, dstport, ssrc}.
296
297AMR Codec Mode Request (AMR-FT): 4 bits::
298This field must contain any valid value described in the AMR FT field (Frame
299type index) in RFC3267 Section 4.3.2.
300
301==== Additional considerations
302
303* After the header, additional padding needs to be allocated to conform with CTR
304and AMR FT fields. For instance, if CTR is 0 and AMR FT is AMR 6.9, a padding
305of 17 bytes is to be allocated after the header.
306
307* On receival of this kind of OSmux frame, it's usually enough for the reader to
308 discard the header plus the calculated padding and keep operating.
309
Pau Espin Pedrol1ce6c622017-07-19 13:21:25 +0200310== Sequence Charts
311
312=== Trunking
313
314Following chart shows how trunking works for 3 concurrent calls from different
315MS on a given BTS. In this case only uplink data is shown, but downlink follows
316the same idea. Batching factor is set to 1 to easily illustrate trunking mechanism.
317
318It can be seen how 3 RTP packets from 3 different Ms (a, b, and c) arrive to the
319BSC from the BTS. The BSC generates 3 OSmux frames and stores and sends them
320together in one UDP packet to the BSC-NAT. The BSC-NAT decodes the three OSmux
321frames, identifies each of them through CID values and transform them back to
322RTP before sending them to the MGW.
323
324["mscgen"]
325----
326msc {
327 hscale = 2;
328 bts [label="BTS"], bsc [label="BSC"], bscnat [label="BSC-NAT"], mgw [label="MGW"];
329
330 ...;
331 --- [label="3 Regular RTP-AMR calls using OSmux (has been ongoing for some time)"];
332
333 bts => bsc [label="RTP-AMR[seq=y,ssrc=MSa]"];
334 bts => bsc [label="RTP-AMR[seq=x,ssrc=MSb]"];
335 bts => bsc [label="RTP-AMR[seq=z,ssrc=MSc]"];
336 bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m,AMR(y)],Osmux[ft=2,cid=i+1,seq=n,AMR(x)],Osmux[ft=2,cid=i+2,seq=l,AMR(z)]]"];
337 bscnat => mgw [label="RTP-AMR[seq=o,ssrc=r] (originally seq=y,ssrc=MSa)"];
338 bscnat => mgw [label="RTP-AMR[seq=p,ssrc=s] (originally seq=x,ssrc=MSb)"];
339 bscnat => mgw [label="RTP-AMR[seq=q,ssrc=t] (originally seq=z,ssrc=MSc)"];
340 bts => bsc [label="RTP-AMR[seq=y+1,ssrc=MSa]"];
341 bts => bsc [label="RTP-AMR[seq=x+1,ssrc=MSb]"];
342 bts => bsc [label="RTP-AMR[seq=z+1,ssrc=MSc]"];
343 bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+1,AMR(y+1)],Osmux[ft=2,cid=i+1,seq=n+1,AMR(x+1)],Osmux[ft=2,cid=i+2,seq=l+1,AMR(z+1)]]"];
344 bscnat => mgw [label="RTP-AMR[seq=o+1,ssrc=r] (originally seq=y+1,ssrc=MSa)"];
345 bscnat => mgw [label="RTP-AMR[seq=p+1,ssrc=s] (originally seq=x+1,ssrc=MSb)"];
346 bscnat => mgw [label="RTP-AMR[seq=q+1,ssrc=t] (originally seq=z+1,ssrc=MSc)"];
347 bts => bsc [label="RTP-AMR[seq=y+2,ssrc=MSa]"];
348 bts => bsc [label="RTP-AMR[seq=x+2,ssrc=MSb]"];
349 bts => bsc [label="RTP-AMR[seq=z+2,ssrc=MSc]"];
350 bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+2,AMR(y+2)],Osmux[ft=2,cid=i+1,seq=n+2,AMR(x+2)],Osmux[ft=2,cid=i+2,seq=l+2,AMR(z+2)]]"];
351 bscnat => mgw [label="RTP-AMR[seq=o+2,ssrc=r] (originally seq=y+2,ssrc=MSa)"];
352 bscnat => mgw [label="RTP-AMR[seq=p+2,ssrc=s] (originally seq=x+2,ssrc=MSb)"];
353 bscnat => mgw [label="RTP-AMR[seq=q+2,ssrc=t] (originally seq=z+2,ssrc=MSc)"];
354}
355----
356
357=== Batching
358
359Following chart shows how batching with a factor of 3 works. To easilly
360illustrate batching, only uplink and one concurrent call is considered.
361
362It can be seen how 3 RTP packets from MSa arrive to the BSC from the BTS. The
363BSC queues the 3 RTP packets and once the batchfactor is reached, an OSmux frame
364is generated and sent to the BSC-NAT. The BSC-NAT decodes the OSmux frames,
365transforms each AMR payload into an RTP packet and each RTP packet is scheduled
366for delivery according to expected proportional time delay (and timestamp field
367is set accordingly).
368
369["mscgen"]
370----
371msc {
372 hscale = 2;
373 bts [label="BTS"], bsc [label="BSC"], bscnat [label="BSC-NAT"], mgw [label="MGW"];
374
375 ...;
376 --- [label="Regular RTP-AMR call using OSmux with batch factor 3 (has been ongoing for some time)"];
377
378 bts => bsc [label="RTP-AMR[seq=x,ssrc=MSa]"];
379 bts => bsc [label="RTP-AMR[seq=x+1,ssrc=MSa]"];
380 bts => bsc [label="RTP-AMR[seq=x+2,ssrc=MSa]"];
381 bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m,AMR(x),AMR(x+1),AMR(x+2)]]"];
382 bscnat => mgw [label="RTP-AMR[seq=o,ssrc=r] (originally seq=x,ssrc=MSa)"];
383 bscnat => mgw [label="RTP-AMR[seq=o+1,ssrc=r] (originally seq=x+1,ssrc=MSa)"];
384 bscnat => mgw [label="RTP-AMR[seq=o+2,ssrc=r] (originally seq=x+2,ssrc=MSa)"];
385 bts => bsc [label="RTP-AMR[seq=x+3,ssrc=MSa]"];
386 bts => bsc [label="RTP-AMR[seq=x+4,ssrc=MSa]"];
387 bts => bsc [label="RTP-AMR[seq=x+5,ssrc=MSa]"];
388 bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+1,AMR(x+3),AMR(x+4),AMR(x+5)]]"];
389 bscnat => mgw [label="RTP-AMR[seq=o+3,ssrc=r] (originally seq=x+3,ssrc=MSa)"];
390 bscnat => mgw [label="RTP-AMR[seq=o+4,ssrc=r] (originally seq=x+4,ssrc=MSa)"];
391 bscnat => mgw [label="RTP-AMR[seq=o+5,ssrc=r] (originally seq=x+5,ssrc=MSa)"];
392 bts => bsc [label="RTP-AMR[seq=x+6,ssrc=MSa]"];
393 bts => bsc [label="RTP-AMR[seq=x+7,ssrc=MSa]"];
394 bts => bsc [label="RTP-AMR[seq=x+8,ssrc=MSa]"];
395 bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+2,AMR(x+6),AMR(x+7),AMR(x+8)]]"];
396 bscnat => mgw [label="RTP-AMR[seq=o+6,ssrc=r] (originally seq=x+6,ssrc=MSa)"];
397 bscnat => mgw [label="RTP-AMR[seq=o+7,ssrc=r] (originally seq=x+7,ssrc=MSa)"];
398 bscnat => mgw [label="RTP-AMR[seq=o+8,ssrc=r] (originally seq=x+8,ssrc=MSa)"];
399}
400----
401
402=== Trunking and Batching
403
404Following chart shows how trunking and batching work together. The chart shows 2
405concurrent calls from different MS on a given BTS, and BSC is configured with a
406batch factor of 3. Again only uplink data is shown, but downlink follows the
407same idea. Batching factor is set to 1 to easily illustrate trunking mechanism.
408
409["mscgen"]
410----
411msc {
412 hscale = 2;
413 bts [label="BTS"], bsc [label="BSC"], bscnat [label="BSC-NAT"], mgw [label="MGW"];
414
415 ...;
416 --- [label="2 Regular RTP-AMR call using OSmux with batch factor 3 (has been ongoing for some time)"];
417
418 bts => bsc [label="RTP-AMR[seq=x,ssrc=MSa]"];
419 bts => bsc [label="RTP-AMR[seq=y,ssrc=MSb]"];
420 bts => bsc [label="RTP-AMR[seq=x+1,ssrc=MSa]"];
421 bts => bsc [label="RTP-AMR[seq=y+1,ssrc=MSb]"];
422 bts => bsc [label="RTP-AMR[seq=x+2,ssrc=MSa]"];
423 bts => bsc [label="RTP-AMR[seq=y+2,ssrc=MSb]"];
424 bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m,AMR(x),AMR(x+1),AMR(x+2)],Osmux[ft=2,cid=i+1,seq=n,AMR(y),AMR(y+1),AMR(y+2)]]"];
425 bscnat => mgw [label="RTP-AMR[seq=o,ssrc=r] (originally seq=x,ssrc=MSa)"];
426 bscnat => mgw [label="RTP-AMR[seq=p,ssrc=s] (originally seq=y,ssrc=MSb)"];
427 bscnat => mgw [label="RTP-AMR[seq=o+1,ssrc=r] (originally seq=x+1,ssrc=MSa)"];
428 bscnat => mgw [label="RTP-AMR[seq=p+1,ssrc=s] (originally seq=y+1,ssrc=MSb)"];
429 bscnat => mgw [label="RTP-AMR[seq=o+2,ssrc=r] (originally seq=x+2,ssrc=MSa)"];
430 bscnat => mgw [label="RTP-AMR[seq=p+2,ssrc=s] (originally seq=y+2,ssrc=MSb)"];
431 bts => bsc [label="RTP-AMR[seq=x+3,ssrc=MSa]"];
432 bts => bsc [label="RTP-AMR[seq=y+3,ssrc=MSb]"];
433 bts => bsc [label="RTP-AMR[seq=x+4,ssrc=MSa]"];
434 bts => bsc [label="RTP-AMR[seq=y+4,ssrc=MSb]"];
435 bts => bsc [label="RTP-AMR[seq=x+5,ssrc=MSa]"];
436 bts => bsc [label="RTP-AMR[seq=y+5,ssrc=MSb]"];
437 bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+1,AMR(x+3),AMR(x+4),AMR(x+5)],Osmux[ft=2,cid=i+1,seq=n+1,AMR(y+3),AMR(y+4),AMR(y+5)]]"];
438 bscnat => mgw [label="RTP-AMR[seq=o+3,ssrc=r] (originally seq=x+3,ssrc=MSa)"];
439 bscnat => mgw [label="RTP-AMR[seq=p+3,ssrc=s] (originally seq=y+3,ssrc=MSb)"];
440 bscnat => mgw [label="RTP-AMR[seq=o+4,ssrc=r] (originally seq=x+4,ssrc=MSa)"];
441 bscnat => mgw [label="RTP-AMR[seq=p+4,ssrc=s] (originally seq=y+4,ssrc=MSb)"];
442 bscnat => mgw [label="RTP-AMR[seq=o+5,ssrc=r] (originally seq=x+5,ssrc=MSa)"];
443 bscnat => mgw [label="RTP-AMR[seq=p+5,ssrc=s] (originally seq=y+5,ssrc=MSb)"];
444}
445----
446
447=== Marker bit
448
449As described earlier, the Marker bit is always expected to relate to the first
450AMR payload of an OSmux frame. Thus, special considerations may be followed when
451the OSmux encoder receives an RTP packet with a marker bit. For instance,
452previously enqueued RTP packets may be sent even if the configured batch factor
453is not reached.
454
455We again use the scenario with 2 concurrent calls and a batch factor of 3.
456
457["mscgen"]
458----
459msc {
460 hscale = 2;
461 bts [label="BTS"], bsc [label="BSC"], bscnat [label="BSC-NAT"], mgw [label="MGW"];
462
463 ...;
464 --- [label="2 Regular RTP-AMR call using OSmux with batch factor 3 (has been ongoing for some time)"];
465
466 bts => bsc [label="RTP-AMR[seq=x,ssrc=MSa]"];
467 bts => bsc [label="RTP-AMR[seq=y,ssrc=MSb]"];
468 bts => bsc [label="RTP-AMR[seq=x+1,ssrc=MSa]"];
469 bts => bsc [label="RTP-AMR[seq=y+1,ssrc=MSb]"];
470 bts => bsc [label="RTP-AMR[seq=x+2,ssrc=MSa]"];
471 bts => bsc [label="RTP-AMR[seq=y+2,ssrc=MSb]"];
472 bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m,AMR(x),AMR(x+1),AMR(x+2)],Osmux[ft=2,cid=i+1,seq=n,AMR(y),AMR(y+1),AMR(y+2)]]"];
473 bscnat => mgw [label="RTP-AMR[seq=o,ssrc=r] (originally seq=x,ssrc=MSa)"];
474 bscnat => mgw [label="RTP-AMR[seq=p,ssrc=r] (originally seq=y,ssrc=MSb)"];
475 bscnat => mgw [label="RTP-AMR[seq=o+1,ssrc=r] (originally seq=x+1,ssrc=MSa)"];
476 bscnat => mgw [label="RTP-AMR[seq=p+1,ssrc=s] (originally seq=y+1,ssrc=MSb)"];
477 bscnat => mgw [label="RTP-AMR[seq=o+2,ssrc=r] (originally seq=x+2,ssrc=MSa)"];
478 bscnat => mgw [label="RTP-AMR[seq=p+2,ssrc=s] (originally seq=y+2,ssrc=MSb)"];
479 bts => bsc [label="RTP-AMR[seq=x+3,ssrc=MSa]"];
480 bts => bsc [label="RTP-AMR[seq=y+3,ssrc=MSb]"];
481 bts => bsc [label="RTP-AMR[seq=x+4,ssrc=MSa]"];
482 bts => bsc [label="RTP-AMR[seq=y+4,ssrc=MSb] with Marker bit set M=1"];
483 bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+1,AMR(x+3),AMR(x+4)],Osmux[ft=2,cid=i+1,seq=n+1,AMR(y+3)]]"];
484 bscnat => mgw [label="RTP-AMR[seq=o+3,ssrc=r] (originally seq=x+3,ssrc=MSa)"];
485 bscnat => mgw [label="RTP-AMR[seq=p+3,ssrc=s] (originally seq=y+3,ssrc=MSb)"];
486 bscnat => mgw [label="RTP-AMR[seq=o+4,ssrc=r] (originally seq=x+4,ssrc=MSa)"];
487 bts => bsc [label="RTP-AMR[seq=x+5,ssrc=MSa]"];
488 bts => bsc [label="RTP-AMR[seq=y+5,ssrc=MSb]"];
489 bts => bsc [label="RTP-AMR[seq=x+6,ssrc=MSa]"];
490 bts => bsc [label="RTP-AMR[seq=y+6,ssrc=MSb]"];
491 bsc => bscnat [label="UDP[Osmux[ft=2,cid=i,seq=m+2,AMR(x+5),AMR(x+6)],Osmux[ft=2,cid=i+1,seq=n+2,AMR(y+4),AMR(y+5),AMR(y+6)]]"];
492 bscnat => mgw [label="RTP-AMR[seq=p+4,ssrc=s] (originally seq=y+4,ssrc=MSb)"];
493 bscnat => mgw [label="RTP-AMR[seq=o+5,ssrc=r] (originally seq=x+5,ssrc=MSa)"];
494 bscnat => mgw [label="RTP-AMR[seq=p+5,ssrc=s] (originally seq=y+5,ssrc=MSb)"];
495 bscnat => mgw [label="RTP-AMR[seq=o+6,ssrc=r] (originally seq=x+6,ssrc=MSa)"];
496 bscnat => mgw [label="RTP-AMR[seq=p+6,ssrc=s] (originally seq=y+6,ssrc=MSb)"];
497}
498----
Pau Espin Pedrolb1202722017-05-03 12:38:05 +0200499
500== Evaluation: Expected traffic savings
501
Pau Espin Pedrol53ce68f2017-07-19 15:31:55 +0200502The following figure shows the growth in traffic saving (in %) depending on the
503number of concurrent numbers of callings for a given set of batching factor
504values:
505
506["python2"]
Pau Espin Pedrolb1202722017-05-03 12:38:05 +0200507----
Pau Espin Pedrol53ce68f2017-07-19 15:31:55 +0200508from pychart import *
509theme.get_options()
510theme.scale_factor = 5
511theme.use_color = 1
512theme.reinitialize()
513
514IP_HEADER=20
515UDP_HEADER=8
516RTP_HEADER=12
517OSMUX_HEADER=4
518AMR59_PAYLOAD=17
519
520def osmux_get_size(calls, payloads):
521 return IP_HEADER + UDP_HEADER + (OSMUX_HEADER + AMR59_PAYLOAD * payloads) * calls
522
523def rtp_get_size(calls, payloads):
524 return calls * payloads * (IP_HEADER + UDP_HEADER + RTP_HEADER + AMR59_PAYLOAD)
525
526def calc_traffic_saving(calls, payloads):
527 return 100 - 100.0 * osmux_get_size(calls, payloads) / rtp_get_size(calls, payloads)
528
529# The first value in each tuple is the X value, and subsequent values are Y values for different lines.
530def gen_table():
531 data = []
532 for calls in range(1, 9):
533 col = (calls,)
534 for factor in range(1, 9):
535 col += (calc_traffic_saving(calls, factor),)
536 data.append(col)
537 return data
538
539def do_plot(data):
540 xaxis = axis.X(format="/hL%d", tic_interval = 1, label="Concurrent calls")
541 yaxis = axis.Y(format="%d%%", tic_interval = 10, label="Traffic Saving")
542 ar = area.T(x_axis=xaxis, y_axis=yaxis, y_range=(None,None), x_grid_interval=1, x_grid_style=line_style.gray70_dash3)
543 for y in range(1, len(data[0])):
544 plot = line_plot.T(label="bfactor "+str(y), data=data, ycol=y, tick_mark=tick_mark.circle1)
545 ar.add_plot(plot)
546 ar.draw()
547
548data = gen_table()
549do_plot(data)
Pau Espin Pedrolb1202722017-05-03 12:38:05 +0200550----
551
Pau Espin Pedrol53ce68f2017-07-19 15:31:55 +0200552The results show a saving of 15.79% with only one concurrent call and with
553batching disabled (bfactor 1), that quickly improves with more concurrent calls
554(due to trunking).
Pau Espin Pedrolb1202722017-05-03 12:38:05 +0200555
Pau Espin Pedrol53ce68f2017-07-19 15:31:55 +0200556By increasing the batching of messages to 4, the results show a saving of 56.68%
557with only one concurrent call. Trunking slightly improves the situation with
558more concurrent calls.
Pau Espin Pedrolb1202722017-05-03 12:38:05 +0200559
Pau Espin Pedrol53ce68f2017-07-19 15:31:55 +0200560A batching factor of 8 provides very little improvement with regards to batching
5614 messages. Still, we risk to degrade user experience. Thus, we consider a
562batching factor of 3 and 4 is adecuate.
Pau Espin Pedrolb1202722017-05-03 12:38:05 +0200563
564== Other proposed follow-up works
565
566The following sections describe features that can be considered in the mid-run
567to be included in the OSmux infrastructure. They will be considered for future
568proposals as extensions to this work. Therefore, they are NOT included in
569this proposal.
570
571=== Encryption
572
573Voice streams within OSmux can be encrypted in a similar manner to SRTP
574(RFC3711). The only potential problem is the use of a reduced sequence number,
575as it wraps in (20ms * 2^256 * B), i.e. 5.12s to 40.96s. However, as the
576receiver knows at which rate the codec frames are generated at the sender, he
577should be able to compute how much time has passed using his own timebase.
578
579Another alternative can be the use of DTLS (RFC 6347) that can be used to
580secure datagram traffic using TLS facilities (libraries like openssl and
581gnutls already support this).
582
583=== Multiple OSmux messages in one packet
584
585In case there is already at least one active voice call, there will be
586regular transmissions of voice codec frames. Depending on the batching
587factor, they will be sent every 70ms to 140ms. The size even of a
588batched (and/or trunked) codec message is still much lower than the MTU.
589
590Thus, any signalling (related or unrelated to the call causing the codec
591stream) can just be piggy-backed to the packets containing the voice
592codec frames.