Subject: x-pn-tng/tcp encapsulation.

From: Tianbo Kuang <[email-masked]>
Date: Tue, 13 Nov 2001 09:56:20 -0700

Hi,

I have some questions about transporting rtsp data on interleaved tcp
connection.
    (1) rfc2326 says the RTP data packets are encapsulated by an ascii
dollar sign (hex 24), followed by channel id, length and data. My
question is: how can we tell the start of a data packet if the data area
also contains a (24, channel id) combination?
    (2) From my captured data, I saw realserver always uses x-pn-tng/tcp
as the transport protocol, although my realplayer 8 basic reported
x-pn-tng/tcp, x-real-rdt/tcp, rtp/avp/tcp. I know x-real-rdt is
realnetwork's properitary protocol. But what is x-pn-tng? Does it have
the same data encapsulation as rdt or rtp/tcp interleaved?
    (3) I analyzed the captured data from a streaming session. From the
data I can see the server is RealServer 8.0.1.367. I was using
realplayer 8 basic. The setup process chose x-pn-tng/tcp as the
transport protocol with audio in channel 0 and video in channel 1. I
searched 2400 and 2401 as the start of a new data packet (assuming it
has the same encapsulation as rtp/tcp). However, some of the length
fields are not correct as shown as follows,
    I have marked in the frame the total IP packet length is 1041 (minus
40 length tcp/ip header = 1021). However, the first audio data has the
length of 397. The second audio data has a length of 616 while the video
data has length 5666. The total length is much bigger than the total ip
packet. Although a rtsp message may only contain part of a data packet,
the next frame has a total length 1301 with the first audio data 615,
second audio data 62 and third audio data 612. Since 615+62+612 +3*4=
1301, the total length is correct and it doesn't look to contain
information about the previous message.  I've noticed other inconsistant
points. What's wrong here?

Thanks,

P.S. Anybody knows how to force realplayer 8 basic to use rtp? I addd
HKEY_CLASSES_ROOT\Software\RealNetworks\RealPlayer\6.0\Preferences\UseRTP
1. It doesn't work.

--Tianbo

 - - - - - - - - - - - - - - - - - - - - Frame 62 - - - - - - - - - - -
- - - - - - - - -
ADDR  HEX                                               ASCII
0000: 08 02 75 00 00 07 50 ca 38 0f 00 07 0e b9 27 25 | ..u...PÊ8....¹'%

0010: 00 a0 24 0a c8 2d 00 cc aa aa 03 00 00 00 08 00 | . $.È-.Ìªª......

0020: 45 00 04 25 5f ca 40 00 30 06 10 3f 3f d1 d5 41 | E..%_Ê@.0..??ÑÕA

                   ^^^^^
                   IP header, total length x425 (decimal 1041)
0030: c0 a8 01 0f 02 2a 09 0b 72 c4 99 b7 71 f4 d0 7d | À¨...*..rÄ?·qôÐ}

0040: 50 18 7d 78 89 59 00 00 24 00 01 8d 42 00 1a 08 | P.}x?Y..$..?B...

                                               ^^^^^^^^^
                                               channel 0, length x18d
(decimal 397)
0050: 00 00 09 48 00 00 81 02 42 97 40 49 23 03 24 a4 | ...H..?.B-@I#.$¤

0060: 11 53 14 aa 31 de 59 9d 7f a8 18 f1 2a fe 27 c6 | .S.ª1ÞY?¨.ñ*þ'Æ

0070: fe 61 b6 2e fb dd 5b 75 3c 3d 17 f2 e0 ef ef b4 | þa¶.ûÝ[u<=.òàïï´

0080: 63 ba 0b 30 dd f2 f3 c4 92 51 b6 ff 0e 3b 91 8c | cº.0ÝòóÄ?Q¶ÿ.;??

0090: d4 21 08 47 33 21 10 7d 34 9f 2c 96 31 f7 32 08 | Ô!.G3!.}4Y,-1÷2.

00a0: 8c 21 08 43 a3 41 c0 41 2d 49 49 24 1b 64 83 00 | ?!.C£AÀA-II$.df.

00b0: 05 32 29 87 9e 79 e7 93 09 8a 42 90 48 24 12 14 | .2)??yç?.SB?H$..

00c0: c8 a4 29 47 9e 79 e7 9e 4e 26 29 84 c2 61 30 98 | È¤)G?yç?N&)?Âa0~

00d0: 4c 24 12 89 07 9e bc 94 48 24 1e 48 24 29 04 82 | L$.?.?¼?H$.H$).,

00e0: 41 20 90 48 24 12 09 07 9e d2 89 04 83 c9 0d 20 | A ?H$...?Ò?.fÉ.
00f0: 90 48 25 12 14 82 41 20 f3 c9 84 e2 61 30 98 79 | ?H%..,A óÉ?âa0~y

0100: 20 98 a7 13 0f 3c 9c 4c 26 13 09 84 82 41 20 90 |  ~§..<?L&..?,A ?

0110: 48 24 1e 79 20 90 d2 0f 3c f2 41 20 90 48 24 12 | H$.y ?Ò.<òA ?H$.

0120: 09 04 83 cf 3c f2 41 20 98 48 24 1e 79 e4 82 41 | ..fÏ<òA ~H$.yä,A

0130: 20 90 48 24 12 0f 3c 9c 79 20 90 48 24 12 09 04 |  ?H$..<?y ?H$...

0140: a3 c9 04 82 41 20 90 79 e7 92 09 84 c2 61 30 98 | £É.,A ?yç?.?Âa0~

0150: 4c 26 13 0f 3c f2 41 20 90 48 24 1e 79 30 90 48 | L&..<òA ?H$.y0?H

0160: 24 12 09 04 82 41 20 90 79 e7 92 09 04 82 41 20 | $...,A ?yç?..,A
0170: f3 c9 44 82 41 20 90 48 24 12 09 07 9e 79 e4 82 | óÉD,A ?H$...?yä,

0180: 41 e7 92 8f 3c 94 48 24 12 09 04 82 41 20 90 48 | Aç??<?H$...,A ?H

0190: 24 12 09 04 85 e4 a2 51 20 94 4a 24 12 09 04 82 | $...?ä¢Q ?J$...,

01a0: 41 20 90 48 24 12 09 04 82 41 ea 51 28 90 4a 25 | A ?H$...,AêQ(?J%

01b0: 12 09 04 82 41 20 90 48 24 12 09 04 82 41 20 f3 | ...,A ?H$...,A ó

01c0: c9 44 a2 41 28 94 48 24 12 09 07 92 09 04 82 41 | ÉD¢A(?H$...?..,A

01d0: 20 90 48 24 13 09 84 82 41 24 00 02 68 42 00 1b |  ?H$..?,A$..hB..

                                                    ^^^^^^^^^
                                                    channel 0, length
x268 (decimal 616)
01e0: 88 00 00 09 8a 00 00 01 81 44 d1 40 00 25 0a e4 | ^...S...?DÑ@.%.ä

01f0: c5 00 0c 70 3f ff 6e 38 11 a7 e7 da 6d 0a 38 19 | Å..p?ÿn8.§çÚm.8.

0200: 24 2f e0 64 b3 27 98 31 fd d5 04 d1 f8 1f f6 a4 | $/àd³'~1ýÕ.Ñø.ö¤

0210: 23 81 ec 7c 04 6d 8d 36 cf 79 30 69 0f b1 84 53 | #?ì|.m?6Ïy0i.±?S

0220: a5 37 ac 0d 68 2e c9 24 01 16 22 3f 23 99 74 58 | ¥7¬.h.É$.."?#?tX

                                          ^^^^^^^^^
                                           channel 1, length x1622
(decimal 5666)
0230: 31 39 fb b0 01 b1 a1 55 6c 47 48 92 01 05 51 71 | 19û°.±¡UlGH?..Qq

0240: 86 d8 a8 00 99 10 bc 27 3d c2 c3 87 d4 aa 8a 7a | ?Ø¨.?.¼'=ÂÃ?ÔªSz

0250: 88 5d 12 8d 68 2c 08 2f 17 e4 09 79 ad 87 3c d5 | ^].?h,./.ä.y?<Õ

0260: 4a eb f5 11 04 38 59 77 7e 67 43 10 11 14 d8 cc | Jëõ..8Yw~gC...ØÌ

0270: c6 2c 00 00 1a b6 d4 84 06 e2 43 db 02 ec 59 a9 | Æ,...¶Ô?.âCÛ.ìY©

0280: 11 a7 70 82 e6 d8 47 7a d1 86 5a 33 44 2c 34 29 | .§p,æØGzÑ?Z3D,4)

0290: 32 80 15 89 00 81 d2 98 85 f4 12 c1 7f d2 58 77 | 2?.?.?Ò~?ô.ÁÒXw

02a0: af 10 80 35 a1 31 51 b2 19 2c 21 a6 7c bf 75 18 | ¯.?5¡1Q².,!¦|¿u.

02b0: ad 2f 1b e1 1a 02 d1 20 4b 20 30 c1 ba 6c 0f 96 | /.á..Ñ K 0Áºl.-

02c0: e8 d6 ab ea 12 3e 8c c6 1d 3a 2e 8f ec 54 14 d4 | èÖ«ê.>?Æ.:.?ìT.Ô

02d0: 98 40 71 31 70 0c 9f f9 48 4d 85 09 98 7c 99 88 | [email-masked]?.~|?^

02e0: 90 1a 06 1a 61 a1 33 9f e6 97 82 87 9e ee b7 8b | ?...a¡3Yæ-,??î·<

02f0: 50 01 d6 a3 a6 29 71 41 68 5d 0a 42 9d 75 ef 9e | P.Ö£¦)qAh].B?uï?

0300: a0 ce 7a 60 04 0f 49 a3 85 01 0b fb 80 6c 5f a4 |  Îz`..I£?..û?l_¤

0310: 61 54 00 11 cf a2 05 ab f4 06 71 9d c9 84 5b 8a | aT..Ï¢.«ô.q?É?[S

0320: b3 90 d1 c0 7c fd df 93 c0 ba d6 10 11 f6 5d e6 | ³?ÑÀ|ýß?ÀºÖ..ö]æ

0330: 1e ff 51 83 0e 86 4f 7a 26 f6 e5 dd 69 4a 59 cf | .ÿQf.?Oz&öåÝiJYÏ

0340: 81 95 a2 78 e5 a3 0e cb 5e cb 35 1b b4 95 52 c1 | ?*¢xå£.Ë^Ë5.´*RÁ

0350: c6 b5 31 b9 98 55 3d 56 7a 46 44 bd 4d c8 5d 0e | Æµ1¹~U=VzFD½MÈ].

0360: fc d1 35 5d 13 c0 1b 2e e3 10 cd 4a 55 4d 79 04 | üÑ5].À..ã.ÍJUMy.

0370: a2 36 36 ce e8 01 51 8e 25 31 5b 90 0c f9 da c2 | ¢66Îè.Q?%1[?.ùÚÂ

0380: 6b 78 4c 61 00 31 1d c1 9d 24 07 ae c2 a1 5f 0c | kxLa.1.Á?$.®Â¡_.

0390: d3 55 b9 bb 47 38 b9 dd fa 93 01 a0 65 88 ec 70 | ÓU¹»G8¹Ýú?. e^ìp

03a0: f5 0b 46 71 f5 30 09 d5 f0 d9 8d 98 10 9d 08 c6 | õ.Fqõ0.ÕðÙ?~.?.Æ

03b0: dc 8c 9b f0 95 6b 58 e5 fd bc 7b 8b 73 47 77 d4 | Ü?>ð*kXåý¼{03c0:
9e c5 17 70 a1 aa 70 d6 e4 79 d3 12 18 ff 4f 32 | ?Å.p¡ªpÖäyÓ..ÿO2
03d0: cc 63 1d a8 54 6d b6 2d 99 9a bb 7c 45 17 6b 6d | Ìc.¨Tm¶-?s»|E.km

03e0: 65 88 0f 17 03 0d 62 24 39 51 ad 56 11 56 fb cd | e^....b$9QV.VûÍ

03f0: 55 8e 63 91 d3 5b a1 e1 cf 88 0c 2c 77 68 5b 3c | U?c?Ó[¡áÏ^.,wh[<

0400: f6 b7 80 d5 62 dd 77 7a b6 35 58 59 33 d2 94 d0 | ö·?ÕbÝwz¶5XY3Ò?Ð

0410: 92 12 61 18 0d 43 d3 1a 50 09 2d e9 a9 6d 03 5e | ?.a..CÓ.P.-é©m.^

0420: 09 97 c6 0d 5d bf bc f2 55 62 bb 86 35 d6 5e 5f | .-Æ.]¿¼òUb»?5Ö^_

0430: f3 bb f5 b3 c6 6f 0b 21 df 24 df 0b e0 d5 47 d1 | ó»õ³Æo.!ß$ß.àÕGÑ

0440: 05 5c e9 38 66                                  | .\é8f

---

From: Rob Lanphier <[email-masked]>
Date: Mon, 19 Nov 2001 14:01:33 -0800

Hi Tianbo,

Answers to your questions inline...

>also contains a (24, channel id) combination?

I'm not sure what you mean by this.  The idea is that the interleaved data 
looks as follows:
     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |      "$"      |  channel id   |             length            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                             data                              |
    |                             ....                              |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

> the same data encapsulation as rdt or rtp/tcp interleaved?

x-pn-tng is a synonym for x-real-rdt/tcp.  More information can be found in 
our RTSP Proxy Whitepaper:

http://docs.real.com/docs/proxykit/rtspd.pdf

> second audio data 62 and third audio data 612. Since 615+62+612 
> +3*4=1301, the total length is correct and it doesn't look to contain 

I'm not sure.  I'll look into this, and respond offline (we're getting into 
RealSystem specifics that aren't of general interest on this list).

>HKEY_CLASSES_ROOT\Software\RealNetworks\RealPlayer\6.0\Preferences\UseRTP

The key is as follows:
HKEY_CLASSES_ROOT\Software\RealNetworks\RealMediaSDK\6.0\Preferences\UseRTP

However, that won't necessarily force the server to use RTP.  Be sure to 
try this on something like an .au file or an .mov file with standard 
datatypes in it (e.g. H.261 video and mu-law audio).

Rob