Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What to do about message accumulation in TCP sliding window

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how to pile up messages in TCP sliding window". In daily operation, I believe that many people have doubts about how to pile up messages in TCP sliding window. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to stack messages in TCP sliding window". Next, please follow the editor to study!

Online questions:

The client cannot push data to the server.

Troubleshooting:

Ping ip or telnet port are all normal and do not work.

Through the wireshark crawl message view, it is found that a strange phenomenon is that the window is not fixed, but the overall trend is gradually reduced to 0. 5%. The server message is as follows:

15 IP 41win 29.680256 IP 110.89.84.123.1950 > 110.89.84.126.52021: Flags [.], ack 107925, win 38, options [nop,nop,TS val 1604471956 ecr 1606303303], length 0 0x0000: 0022462c a12f d067e50f e893 0800 4500. "FMag.Universe .g.E. 0x0010: 0034a79b 4000 4006d417 0b0c 547b 0b0c .4..@ .@ .T {. 0x0020: 547e 079e cb35 0c6f 535c 531b 640c 8010 T~...5.oS\ S.D. 0x0030: 0026 8383 0000 0101 080a 5fa2 4c94 5fbe. &. _ L. 0x0040: 3e47 > G15 Flags 41 IP 29.719474 IP 110.89.84.123.1950 > 110.89.84.126.52021: Flags [.], ack 112269, win 5, options [nop,nop,TS val 1604471996 ecr 1606303303], length 0 0x0000: 0022 462c a12f d067 e50f e893 0800 4500. "F .g.E. 0x0010: 0034 a79c 4000 4006 d416 0b0c 547b 0b0c .4..@ .T {.. 0x0020: 547e 079e cb35 0c6f 535c 531b 7504 8010 T~...5.oS\ S.U. 0x0030: 0005 7284 0000 0101 080a 5fa2 4cbc 5fbe.. r._.L._. 0x0040: 3e47 > G15 Flags 41 IP 29.934875 IP 110.89.84.126.52021 > 110.89.84.123.1950: Flags [P.], seq 112269Vera 112909, ack 88, win 115, options [nop,nop,TS val 1606303559 ecr 1604471996], length 640 0x0000: d067e50f e8930022462c a12f 0800 4500 .g. " . /.. E. 0x0010: 02b4 5a89 4000 4006 1eaa 0b0c 547e 0b0c .Z. @ .T. 0x0020: 547b cb35 079e 531b 7504 0c6f 535c 8018 T {.5... S.U. Os. 0x0030: 0073 c1b7 0000 0101 080a 5fbe 3f47 5fa2. S. _.? Gang.15 5fbe 3f47 5fa2 29.975487 IP 110.89.84.123.1950 > 110.89.84.126.52021: Flags [.], ack 116613, win 10, options [nop,nop,TS val 1604472252 ecr 1606303559], length 0 0x0000: 0022 462c a12f d067 e50f e893 0800 4500. "F . / .g.E. 0x0010: 0034 a79e 4000 4006 d414 0b0c 547b 0b0c .4..@ .T {. 0x0020: 547e 079e cb35 0c6f 535c 531b 85fc 8010 T~...5.oS\ S. 0x0030: 000a 5f87 0000 0101 080a 5fa2 4dbc 5fbe.. _. _ .M. _. 0x0040: IP 110.89.84.126.52021 > 110.89.84.123.1950: Flags [P.], seq 116613 IP 117893, ack 88, win 115, options [nop,nop,TS val 1606303816 ecr 1604472252], length 1280 0x0000: d067 e50f e893 0022 462c a12f 0800 4500 .g. . /.. E. 0x0010: 0534 5a8d 4000 4006 1c26 0b0c 547e 0b0c .4Z. @. &. T. 0x0020: 547b cb35 079e 531b 85fc 0c6f 535c 8018 T {.5.... 0x0030: 0073 c437 0000 0101 080a 5fbe 4048 5fa2 .s.7. 0x0040: 4dbc 2037 3435 6634 3361 3238 3334 6534 M..745f43a2834e4 0x0050: 6465 3462 3561 3862 6630 3031 3333 6564 de4b5a8bf00133ed 0x0060: 6462 3401 0d01 0400 0000 5308 0b10 0000 db4.S. A315 IP 41V 30.192523 IP 110.89.84.123.1950 > 110.89.84.126.52021: Flags [.], ack 117893, win 0, options [nop,nop,TS val 1604472469 ecr 1606303816], length 0 0x0000: 0022462c a12f d067 e50f e893 0800 4500. "FMag.Universe .g.E. 0x0010: 0034 a79f 4000 4006 d413 0b0c 547b 0b0c .4..@ .@ .T {. 0x0020: 547e 079e cb35 0c6f 535c 531b 8afc 8010 T~...5.oS\ S. 0x0030: 0000 58b7 0000 0101 080a 5fa2 4e95 5fbe.. X._.N._. 0x0040: 4048 @ H15 0x0000 41Vera 30.406872 IP 110.89.84.126.52021 > 110.89.84.123.1950: Flags [.], ack 88, win 115, options [nop,nop,TS val 1606304031 ecr 1604472469], length 0 0x0000: d067 e50f e893 0022 462c a12f 0800 4500 .g. "FMag.Bash. E. 0x0010: 0034 5a8e 4000 4006 2125 0b0c 547e 0b0c .4Z. @. @.% .T. 0x0020: 547b cb35 079e 531b 8afb 0c6f 535c 8010 T {.5.... 0x0030: 0073 bf37 0000 0101 080a 5fbe 411f 5fa2 .s.7. _ .A. _. 0x0040: 4e95 N.15 IP 41V 30.407143 IP 110.89.84.123.1950 > 110.89.84.126.52021: Flags [.], ack 117893, win 0, options [nop,nop,TS val 1604472683 ecr 1606303816], length 0 0x0000: 0022 462c a12f d067 e50f e893 0800 4500. "F . / .g.E. 0x0010: 0034 a7a0 4000 4006 d412 0b0c 547b 0b0c .4..@ .T {. 0x0020: 547e 079e cb35 0c6f 535c 531b 8afc 8010 T~...5.oS\ S. 0x0030: 0000 57e1 0000 0101 080a 5fa2 4f6b 5fbe.. W._.Ok_. 0x0040: 4048

So far, the server has been replying that the server window is 0, so that the client data cannot be sent back to the server.

Looking at the send and receive buffers of the server TCP kernel through netstat-ano, it is found that the server accepts certain bytes of buffer, but it can not be sent all the time.

[root@xdja tomcat] # netstat-antActive Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address Statetcp 00 110.89.84.123 Proto Recv-Q Send-Q Local Address Foreign Address Statetcp 14468 110.89.84.33 1950 ESTABLISHEDtcp 00:: 1950:: * LISTENtcp 115005 0 :: ffff:110.89.84.123:1950:: ffff:110.89.84.126:52021 ESTABLISHED

Conclusion:

It can be judged that the client has been sending data, but the server processing data is slower than the client sending data, resulting in a backlog of data on the server.

Solution:

The background is changed to asynchronous processing. If a TCP message is received, it will be cached into the business first, and then thread consumption will be started.

At this point, the study on "how to pile up messages in the TCP sliding window" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report