当前位置:网站首页>Uip1.0 active sending problem understanding
Uip1.0 active sending problem understanding
2022-06-24 23:03:00 【ToneSole】
Recently LPC1768 Debugging uIP1.0 Network protocol code , The setting configures the mode of sending without subcontracting , The number of bytes originally intended to be sent and returned should not be too large , I have locally customized protocols . When debugging later , Find out TCP The agreement actually has the problem of sticking and unpacking
The problem of sticking bags is the most annoying , Originally, this light protocol stack has been out for many years , Now many people have found that they don't play this embedded thing , Looking for one uIP The protocol stack was not found , Finally, only the only slightly valuable article can be found on AMO Forum
Because it is used on the device side uIP Of TCP Server configuration , After the upper computer is connected to the device, it sends the specified protocol , But I found something on the device side TCP The server cannot actively send !!!! This is very annoying . Originally a duplex communication , Live into a single job
The problem is that
1. UI End send 14 Byte packet request to device , Device reply 56 byte , The equipment uIP The cache is 56*10 byte , That is, a single time uIP At most, I can only reply to 10 A frame . So if TCP Send sticky packets ,, Like, all of a sudden 20 individual 14 Byte request , Then the device will not respond at one time !!!!! The problem is coming , Need reply 20 When I get a bag uIP Not so much , You can only reply to 10 individual , So the rest 10 What can I do ???
2. The solution to the above problem is to do it on the device side ack Respond to , Reply first 10 A bag for UI,UI This time will reply to a ACK Give the equipment , Equipment received ACK Then process the remaining packages .
3. good , Follow the above ideas , Now there's another problem , Namely UI End send 14 Byte requests are a continuous process , Then it's possible UI First time received 10 When I get a bag , The second time is just about to be sent 14 byte , that TCP The agreement will put this ACK Flag Put it in 14 Bytes of TCP Send to the device together on the protocol ( In this way, the equipment cannot determine whether it is going to deal with ACK still newdata), Normally, it should be handled first ack My bag , Processing returned , To deal with newdata, This requires the device to store the received data as a cache ,. There is still a problem with sitting in a circular cache like this , Is that when UI After sending fast , The cache on the device side will still be full !
4. Suddenly thought of another idea
because uIP Now the default receive cache and send cache are the same memory , So let me make a distinction here , Receive cache settings 14*4 * 2 byte , The returned cache is set to 56*8 byte , In this case, can I guarantee that I can communicate symmetrically on the network ? Because the device's receive cache , Never more than 14*4 * 2 Byte receive , In this way, the returned value is 56*4*2 byte !!
Debug the code in the evening to test the idea ? Update later if feasible
边栏推荐
- ACL (access control list) basic chapter - Super interesting learning network
- find your present (2)
- Annotation
- MySQL + JSON = King fried!!
- Solve the problem of port occupation
- 加分利器 不负所托 | 知道创宇获攻防演练防守方感谢信!
- Do you need to improve your code reading ability? It's a trick
- 开发规范~参数校验异常、异常返回提示切面
- ThreadLocal local thread
- 机器学习编译入门课程学习笔记第一讲 机器学习编译概述
猜你喜欢

大厂面试必问:如何解决TCP可靠传输问题?8张图带你详细学习

Combine pod identity in aks and secret in CSI driver mount key vault

ThreadLocal memory leak

环境配置 | VS2017配置OpenMesh源码和环境
Based on the codeless platform, users deeply participated in the construction, and digital data + Nanjing Fiberglass Institute jointly built a national smart laboratory solution

2022 simulated 100 questions and simulated examination of high-altitude installation, maintenance and demolition

Tetris

倍加福(P+F)R2000修改雷达IP

go Cobra命令行工具入门

vulnhub Vegeta: 1
随机推荐
源码阅读 | OpenMesh读取文本格式stl的过程
Are you afraid of being asked MySQL related questions during the interview? This 30000 word essence summary + 100 interview questions, and it's enough to hang the interviewer
剑指 Offer 13. 机器人的运动范围
vulnhub Vegeta: 1
【Mongodb】READ_ME_TO_RECOVER_YOUR_DATA,数据库被恶意删除
[postgraduate entrance examination English] prepare for 2023, learn list8 words
Data communication foundation - Ethernet port mirroring and link aggregation
Solve the problem of non secure websites requesting localhost to report CORS after chrome94
Dynamic memory management (1)
The difference between get and post
2022-06-16 工作记录--JS-判断字符串型数字有几位 + 判断数值型数字有几位 + 限制文本长度(最多展示n个字,超出...)
Code farmers should also understand the IPv4 subnet division of point networks
[postgraduate entrance examination English] prepare for 2023, learn list9 words
Solve the problem of port occupation
Design and implementation of spark offline development framework
Principle of IP routing
双亲委派机制
cat写多行内容到文件
别再乱用了,这才是 @Validated 和 @Valid 的真正区别!!!
vulnhub Vegeta: 1