RTSP基于TCP传输请求和响应报文,RTP基于UDP传输流媒体数据,RTCP基于UDP传送传输质量信息(如丢包和延迟)。

比如喀什一个局域网内10个人同时点播广州的同一个源,喀什和广州之间就要传10x4Mbps的数据。1. 是为讨论下文编的; 2. 4Mbps算不上高清。

在局域网和城域网之间有个proxy,喀什和广州之间传1路,局域网内1变10: pkt = recv(); for (i = 0; i < n_receiver; i++) send(pkt).

包从网络->网卡->核心->用户态,简单判断和修改,再用户态->核心->网卡->网络,memcpy次数非常多。本例改都都不改。

Programming Protocol-independent Packet Processors (P4) is an open source, domain-specific programming language for network devices, specifying how data plane devices (switches, routers, NICs, filters, etc.) process packets. SmartNICs with P4 support: Netronome offers its P4 programmable devices under its the Agilio SmartNICs line of products, which include three series: CX (see Figure 5), FX and LX. The heart of those devices is the Netronome flagship silicon chip called NFP (Network Flow Processor or Netronome Flow Processor). CX series is the most diverse family with low-end NFP-4000 matched with 2GB of DDR3 RAM. The network interfaces available here vary from 2 x 10 GbE to 2 x 40 GbE. The cards are available in a low-profile PCI and in OCPv2 form factor. FX series right now includes only one card, a modified version of Agilio CX 2 x 10 GbE with an additional quad-core ARMv8 processor with 2 GB of RAM on-board. The LX series is the most powerful family and is built as a high-profile PCI card with 2 x 40 GbE or 1 x 100 GbE interfaces and NFP-6480 silicon with 8GB of DDR3-1866Mhz DRAM w/ECC. P4的网站上还列出了更多智能网卡。

请看下面的语言:
IP[] _receivers
  loop rtp_1_to_n { # coroutine to relay/pass on RTP packets
    pkt = recv()
    for ip in _receivers:
    sendto(pkt, ip)
  endfor
}

我们把它叫做DPTD: Data Plane Transmission Description. 笑够了再往下看,也许我们能增强并实现它呢?

DPTD里没有指针。if pkt[1:4] == 000001h 这样检查数组下标是否越界时不用检查a[1], a[2], a[3]3次。没有goto语句。
for i = 0 to 1000 step 1 for j = 0 to 10 for k = 0 = 10编译时遇到两条出错信息:
1. for最多套2层
2. 每个for最多循环100次
这样程序好像没法写成死的了吧?默认网络字节顺序。

Linux kernel里可不能像用户态程序那样用阻塞式recv等。好像有kernel thread。有人在用户态下做了个C的协程库(只能用全局变量)。写个kernel module, 实现协程库功能是可以做到的。

该module解释执行DPTD不难。解释执行没有那么慢,Java还能写Web服务器呢: Tomcat.

难点有2:
1. DPTD与外界的交互,如启动和停止协程,修改_receivers。
2. 做成编译型。

1)好像不是太难,handle = dptd_exec('loop rtp_1_to_n ...'), 像Javascript和Python的exec/eval,把代码传进去,返回handle,如123,然后用handle来start和stop。dptd_exec('IP[] _receivers'); 定义_receivers, dptd_exec('_receivers += 192.168.0.1'),可参考JS和Python Engine的做法。
2. 做成编译型好像挺难但不是做不到。关键每个协程得有自己的堆栈。我在DOS下写flood fill时干过mov old_sp, sp; mov sp, 大内存块地址,递归,mov sp, old_sp. kernel咋加载a.out的?

Erlang能"一行怒解TCP", 但语法贼晦涩。

不好意思,我标题党的。

参考资料: The Linux Virtual Server Venture (LVS) permits load adjusting of organized administrations, for example, web and mail servers utilizing Layer 4 Exchanging. search(章文嵩 百科), search(IPVS, iptables and kube-proxy).

RTSP, RTP, RTCP, RTMP傻傻分不清?的更多相关文章

  1. SIP SDP RTSP RTP RTCP webrtc

    rfc1889  rfc2326  rfc3261  rfc3550  rfc3856  rfc6120. SIP SDP RTSP  RTP RTCP,就像他们出现的顺序一样,他们在实际应用中的启用 ...

  2. RTSP,RTP,RTCP的区别

    下面的文章讲解的都非常详细,可以参考OpenRTSP的源码学习.这个是live555库里面的工具Demo http://www.360doc.com/content/12/0516/23/782850 ...

  3. 浅谈协议(二)——视频流协议 [RTP/RTCP/RTMP/HTTP_FLV]

  4. RTP RTCP RTSP

    1.RTP  over UDP和RTP over RTSP有什么区别?2.RTP over RTSP是不是就是RTP over TCP?3.RTP over TCP 打包视频是不是要加4个字节的头,是 ...

  5. EasyPusher RTSP推流/EasyRTMP RTMP推流Android安卓摄像头视频偏暗的问题解决方案

    本文转自EasyDarwin团队成员JOHN的博客:http://blog.csdn.net/jyt0551/article/details/75730226 在我们测试EasyPusher/Easy ...

  6. 流媒体协议介绍(rtp/rtcp/rtsp/rtmp/mms/hls)

    RTP           参考文档 RFC3550/RFC3551 Real-time Transport Protocol)是用于Internet上针对多媒体数据流的一种传输层协议.RTP协议详细 ...

  7. [转]流媒体协议介绍(rtp/rtcp/rtsp/rtmp/mms/hls)

    [转]流媒体协议介绍(rtp/rtcp/rtsp/rtmp/mms/hls) http://blog.csdn.net/tttyd/article/details/12032357 RTP       ...

  8. [转帖]十分钟快速理解DPI和PPI,不再傻傻分不清!

    十分钟快速理解DPI和PPI,不再傻傻分不清! https://baijiahao.baidu.com/s?id=1605834796518990333&wfr=spider&for= ...

  9. RTP/RTCP、TCP、UDP、RTMP、RTSP

    OSI中的层 功能 TCP/IP协议族 应用层 文件传输,电子邮件,文件服务,虚拟终端 TFTP,FTP,HTTP,SNMP,SMTP,DNS,RIP,Telnet 表示层 数据格式化,代码转换,数据 ...

随机推荐

  1. TT模板的作用及使用

    一.假如你在ef中添加一个实体,没有模板,你需要在DAL层中新建一个"莫某Dal"和"I某某Dal"以及在公共的DbSession中加你的这个dal,然后需要在 ...

  2. spring-cloud-square开发实战(三种类型全覆盖)

    欢迎访问我的GitHub 这里分类和汇总了欣宸的全部原创(含配套源码):https://github.com/zq2599/blog_demos 本篇概览 前文<五分钟搞懂spring-clou ...

  3. Nginx高级特性实操

    导读 nginx从入门到精通,点我直达 下载nginx与安装 点我直达 安装依赖 yum -y install gcc zlib zlib-devel pcre-devel openssl opens ...

  4. istio ServiceMesh

    什么是ServiceMesh?什么是Istio? 微服务的一种概念,随着微服务的来临,衍生出一系列的问题,比如服务发现.负载均衡.路由.流量控制.服务间通讯的可靠性.微服务的监控等一系列的问题.使用a ...

  5. MapReduce Service更换集群外部时钟源,仅需10步

    摘要:MapReduce Service 集群使用NTP进行时钟同步.本文简要介绍了MapReduce Service集群NTP机制及NTP的配置方式. 本文分享自华为云社区<MapReduce ...

  6. Part 18 $http service in AngularJS

    In Angular there are several built in services. $http service is one of them. In this video, we will ...

  7. Json跨域登录问题的之Access-Control-Allow-Origin 站点跨域请求的问题

    跨域调用json问题 闲暇之时,做了一个博客站点,站点发布网络之后程序功能完成,最后发现了一个跨域的问题,比如我使用abc.com打开系统,一切正常,后台没有任何文件请求报错问题,然后我又使用了www ...

  8. oracle基础:怎样把查询的null转换为0、打印、定义变量

    https://blog.csdn.net/xuxile/article/details/49943665 oracle怎样把查询的null转换为0 1.查询的null转换为0 NVL(Expr1,E ...

  9. Python 练习 进程

    ... """ 创建2个进程, 每一个进程都打出当前的时间和进程的标识,持续打十次. """ import multiprocessing ...

  10. 微信小程序(五)

    JavaScript: JavaScript 是一种轻量的,解释型的,面对对象的头等函数语言,是一种动态的基于原型和多范式的脚本语言,支持面向对象,命令式和函数式的编程风格. Nodejs 中的Jav ...