当前位置:网站首页>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
边栏推荐
- 倍加福(P+F)R2000修改雷达IP
- The difference between get and post
- vulnhub Vegeta: 1
- Tech Talk 活动回顾|云原生 DevOps 的 Kubernetes 技巧
- China solar thermal market trend report, technical dynamic innovation and market forecast
- 是否需要提高代码阅读能力?这有技巧
- LeetCode Algorithm 剑指 Offer II 027. 回文链表
- find your present (2)
- Leetcode algorithm The first common node of two linked lists
- Tetris
猜你喜欢

Wechat side: what is consistent hash? In what scenario? What problems have been solved?

shopee开店入驻流水如何提交?

【文本数据挖掘】中文命名实体识别:HMM模型+BiLSTM_CRF模型(Pytorch)【调研与实验分析】

结合源码剖析Oauth2分布式认证与授权的实现流程

Database transaction Transanction

MySQL + JSON = King fried!!

The usage difference between isempty and isblank is so different that so many people can't answer it

京东618会议平板排行榜公布,新锐黑马品牌会参谋角逐前三名,向国货老大华为学习

Solve the problem of non secure websites requesting localhost to report CORS after chrome94

2022 safety officer-a certificate examination questions and answers
随机推荐
Recommended course: workplace writing training
Nuscenes -- remedies for missing image files or 0-size images encountered during dataset configuration
Memory alignment of structures
Tetris
Leetcode algorithm refers to offer II 027 Palindrome linked list
Push markdown format information to the nailing robot
Dynamic memory management (1)
2022年高处安装、维护、拆除考试模拟100题及模拟考试
New, Huawei cloud Kaitian apaas
Research Report on terahertz imaging system industry - market status analysis and development prospect forecast
The usage difference between isempty and isblank is so different that so many people can't answer it
[QT] QT event handling
【ROS玩转Turtlesim小海龟】
Stop using it indiscriminately. This is the real difference between @validated and @valid!!!
Research and investment strategy report on China's bridge anticorrosive coating industry (2022 Edition)
vulnhub DC: 2
Parental delegation mechanism
Common sense of resolution
Recommended movies: Northeast tiger, licorice pizza
Pousser l'information au format markdown vers le robot nail