To put it briefly, from the standpoint of receiving data , it is reasonable to control the problem of "It is inefficient even if a small amount of information is sent even though a large amount of data can be handled even though it can be handed off" It's a way to send it to your opponent with speed.
Please refer to this page for details. Specifically, it is displayed when a packet with TCP "Window field" set to 0 is observed along with Ack with the other party. On the other hand, the transmission of [TCP Window Update] tells the sender that "You can process the buffer, so please resume transmission! Um, did you see that the client sends a FIN flag in its first packet after the three way handshake is complete?
That is kind of a "Hello, Nevermind" behavior from the client. I am pretty sure that you can stop looking at any packet after packet 4, because basically the client declares the conversation over in packet 4. DUP Acks, Window update etc.
You need to find out why the client establishes the session only to finish it instantly. This is not a server problem. Jasper, thank you for the quick answer. Ok, the second trace is different. From the timings I deduct you capture very close or even on the client. You now need to do a simultaneous capture at client and server to see why the client packets never get acknowledged.
A well-behaved sender will just buffer the outgoing data. If the buffer on the sending side fills up too, then the sending app will block when it tries to write more data to the socket! This is a TCP stall. It can happen for a lot of reasons, but ultimately it just means the sender is transmitting faster than the receiver is reading. Once the app on the receiving end gets back around to reading from the socket, it will drain some of the buffered data, which frees up some space.
The receiver will then send a "window update" packet to tell the sender how much data it can transmit. The sender starts transmitting its buffered data and traffic should flow normally. I've worded this as if the sender and receiver are different, but in reality, both peers are exchanging window updates with every ACK packet, and either side can have its window fill up.
The overall message is that you don't need to send window update packets directly. It would actually be a bad idea to spoof one up. Regarding the exception you're seeing However, if the client is not reading fast enough, you might be losing data.
In your server, you should check the return value from your Socket. It could be less than the number of bytes you're trying to write. This happens if the sender's transmit buffer gets full, which can happen during a TCP stall. You might be losing bytes. For example, if you're trying to write bytes with each call to write, but one of the calls returns , then you need to send the remaining bytes on the next call.
Otherwise, the client won't see the remainder of that 8K block and your file will be shorter on the client side than on the server side. The error must be something else. A WindowUpdate occurs when the application on the receiving side has consumed already received data from the RX buffer causing the TCP layer to send a WindowUpdate to the other side to indicate that there is now more space available in the buffer.
Once the application on the receiver retrieves data from the TCP buffer, thereby freeing up space, the receiver should notify the sender that the TCP ZeroWindow condition no longer exists by sending a TCP WindowUpdate that advertises the current window size. A TCP Window Update has to do with communicating the available buffer size between the sender and the receiver.
Most likely is that the code is expecting some kind of data that it is not getting quite possibly well before this point that it is only now referencing.
Without seeing the code and the stack trace, it is really hard to say anything more. Do you get any details with the exception? It is not likely related to the TCP Window Update packet have you seen it repeat exactly for multiple instances? For example, if you use NIO selector, a window update may trigger the wake up of a writing channel. That in turn triggers the faulty logic in your code.
0コメント