3. A brief view(1)
Use it as rpc method:
var nc:NetConnection;
nc = new NetConnection()
nc.connect("rtmfp://127.0.0.1:1935/HelloWorld/");
nc.call("serverFunc1", new
Responder(onReply), ”hello”);
function onReply(result:Object):void {
dlog("onReply received value: " + result);
}
4. A brief view(2)
Attach Streams to RTMFP Connection:
var nc:NetConnection;
nc = new NetConnection()
nc.connect("rtmfp://127.0.0.1:1935/HelloWorld/");
sendStream = new
NetStream(nc,NetStream.DIRECT_CONNECTIONS);
sendStream.publish("media");
5. 主要内容
• History and Why we need it?
• How to analyze it?
• Layers
– UDP层的Multiplex与加密解密
– 会话建立、密钥协商、NAT穿透
– 类TCP的功能(flow、分片、ACK与重传、拥塞
控制)
7. Why we need it?
• “To securely deliver media flows over the
Internet”
• Peer to Peer video streaming
• 移动互联网环境下,延迟高,连接易断,IP
易变
• 层次化的组合设计(如tcp+ssl+http)导致建立
连接所需的TTL太多。
—> 在UDP的基础上重新实现TCP+SSL,以及
NAT穿透。
27. 承载Chunks
timestamp: 2字节。它的值是从1970-01-01 00:00:00 +0000 (UTC)到现在的毫秒数除以4,
然后取最低2个字节。
timestamp-echo: 2字节。what the timestamp field of a packet received from the other end
would be at the time this packet was transmitted
Padding: 0xFF. Chunk id never be 0xFF.
28. Chunks类型
session
• initiator hello
• responder hello
• initiator Ikeying
• responder Ikeying
• Redirected IHello
• Forwarded IHello
• responder cookie
change
control
• Ping
• Ping Reply
• Session Close
Request
• Session Close
Ack
Flow
• User Data
• Next User Data
• Buffer Probe
• ACK
• Flow Exception
report