当前位置:网站首页>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
边栏推荐
- Stop using it indiscriminately. This is the real difference between @validated and @valid!!!
- Environment configuration | vs2017 configuring openmesh source code and environment
- vulnhub Vegeta: 1
- 【WSL】SSH 远程连接及宿主机端口转发配置
- [Wuhan University] information sharing of the first and second postgraduate entrance examinations
- See how sparksql supports enterprise level data warehouse
- [postgraduate entrance examination English] prepare for 2023, learn list9 words
- Solve the problem of port occupation
- shopee开店入驻流水如何提交?
- 【Mongodb】READ_ME_TO_RECOVER_YOUR_DATA,数据库被恶意删除
猜你喜欢

加分利器 不负所托 | 知道创宇获攻防演练防守方感谢信!

Design and implementation of spark offline development framework

Second IPO of Huafang group: grown up in Zanthoxylum bungeanum, trapped in Zanthoxylum bungeanum

糖豆人登录报错解决方案

Leetcode: calculate the number of elements less than the current element on the right (sortedlist+bisect\u left)

花房集团二次IPO:成于花椒,困于花椒

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

A big factory interview must ask: how to solve the problem of TCP reliable transmission? 8 pictures for you to learn in detail

Analyze the implementation process of oauth2 distributed authentication and authorization based on the source code

High level application of SQL statements in MySQL database (II)
随机推荐
非单文件组件
详细了解Redis的八种数据类型及应用场景分析
Dynamic memory management (1)
Do you need to improve your code reading ability? It's a trick
Memory alignment of structures
2022-06-10 工作记录--JS-获取到某一日期N天后的日期
Programmers become gods by digging holes in one year, carrying flags in five years and becoming gods in ten years
EPICS record Reference 3 - - field available for all Records
O (n) complexity hand tear sorting interview questions | an article will help you understand counting sorting
Sword finger offer 42 Maximum sum of successive subarrays
JWT(Json Web Token)
Research Report on research and investment prospects of China's container coating industry (2022 Edition)
find your present (2)
Tech Talk 活动回顾|云原生 DevOps 的 Kubernetes 技巧
See how sparksql supports enterprise level data warehouse
【Laravel系列7.9】测试
Spark 离线开发框架设计与实现
2022年安全员-A证考题及答案
Source code reading | the process of reading text format STL by openmesh
糖豆人登录报错解决方案