当前位置:网站首页>协议圣经-谈端口和四元组
协议圣经-谈端口和四元组
2022-07-24 10:28:00 【qianbo_insist】
先聊一些库和开源软件
服务器软件制作的一些库,很多库有如下问题:
1、 坚持使用四元组来做一个会话session
像老牌的rtp lib库 jrtplib是使用这样的元组来标识session的,udp 传入和tcp传入不同,假定使用代理,除了二层协议代理,如果使用四层代理,你得到的源端口和源IP是一样的,这样会产生一个错误,就是即使是rtp协议中的ssrc 不一样,他也缓存为一个ssrc,使用getssrc 函数发生错误,这是他的bug
2、 不识别ssrc
这个和上面的问题是一个,但又不是一个,识别ssrc是一个元组中的多个通道的正常做法,当然可以使用payload来识别不同的源,比如音频和视频,但这不够。比如zlMediaServer,也是不识别的,发现同样元组的数据,ssrc和以前不一样,直接丢弃,这是不对的。
3、做法
不应该把四元组作为铜带,应该把ssrc 和payload 分离出来,比如在做代理的时候。
tcp代理没有问题,session会话变了,端口变了。
udp 代理,若使用同样的IP,同样的端口,很多软件都发生错误。
我的做法是udp 在传输层使用不同的端口,只要分辨出不同的IP来源,就为其分配不同的端口,这样像那些server 还是可以用的。
4 总结
就这么几句话,如果我们能理解,说明我们是个实干家,在实践中懂得了这些理论。后期增加代码来说明。
边栏推荐
- MySQL performance optimization (IV): how to use indexes efficiently and correctly
- 《nlp入门+实战:第二章:pytorch的入门使用 》
- [electronic device note 4] inductance parameters and type selection
- ECCV 2022 | Tsinghua proposes the first transformer to embed spectral sparsity
- Basic SQL operations
- Sentinel 实现 pull 模式规则持久化
- The best time to buy and sell stocks (leetcode-121)
- OpenGL drawing simple triangles
- Add a love power logo to your website
- Erlang学习番外
猜你喜欢

zoj-Swordfish-2022-5-6

Sentinel implements the persistence of pull pattern rules

Arduino + AD9833 waveform generator

What is NFT? How to develop NFT system?

Knapsack problem of dynamic programming -- three lectures on knapsack (01 knapsack, complete knapsack, multiple knapsack)

Dynamic programming -- a collection of stock problems

ZOJ 2770 differential restraint system -- 2 -- May 20, 2022

Image processing: rgb565 to rgb888

Zoj1137+ operation 1 -- May 28, 2022

高精尖中心论文入选国际顶会ACL 2022,进一步拓展长安链隐私计算能力
随机推荐
Set up mail server with dynamic ip+mdaemon
[electronic device note 4] inductance parameters and type selection
Curse of knowledge
NiO knowledge points
Arduino + AD9833 波形发生器
Erlang学习番外
Zoj1137+ operation 1 -- May 28, 2022
Will not be rejected! Learn the distributed architecture notes sorted out by Alibaba Daniel in 35 days, with a salary increase of 20K
Analysis of Kube proxy IPVS mode
MySQL——锁
Mysql database JDBC programming
The optimal time to buy and sell stocks includes the freezing period (leetcode-309)
Selnium checks three conditions when it cannot locate an element
Kotlin advanced
MySQL - 唯一索引
Sentinel 实现 pull 模式规则持久化
Configuration description and componentization development steps of various documents in the scaffold
Tree array-
Activity exception lifecycle
Golang migrate is easy to use