I am working on a video streaming server which streams video at 6Mbps rate. When checked through Wireshark, I noticed that the window size does not go above 3100 or so. For testing purpose, I connected an IP Camera and checked window size. For this, I found that the window size is approximately 6100.
I increased the send buffer size of my application's TCP socket. But, no luck. It actually reduced the window size to 1560 or so. Any suggestion on how to increase the window size.
My application's target recipient is a device on LAN.
I increased the send buffer size of my application's TCP socket. But, no luck. It actually reduced the window size to 1560 or so.
The receive window size is controlled by the receive socket buffer size on the reciever.
Related
I am having difficulty about understanding tcp traffic between server working on 8000 port on my pc and my browser. I am trying to display an image in my browser that is hosted on this server. While loading the browser page, I started the wireshark and captured the traffic. My goal is to confirm that the transferred data with tcp is equal to 2621 bytes which is the size of the actual image.
Here is the traffic:
Here, I thought that the packet in which the image is transferred is this boxed packet. But its size is 262 bytes and not equal to actual image size. How can figure out in which packets the image is tranferred and how can I see its size? Thanks for helping.
Use Fiddler Classic to inspect HTTP/HTTPS traffic to and from browsers.
https://www.telerik.com/fiddler/fiddler-classic
I just read in my CS book :
At the source computer, the message or the file/document to be sent to another computer is firstly divided into very small parts called Packets.
Each packet is given a number serialwise e.g., 1,2,3...
All these packets are then sent to the address of the destination computer.
The destination computer receives the packets in random manner ( It may even receive packet 10 before packet 1 arrives). If a packet is garbled or lost, it is demanded again.
If this is the case (especially 4th one) then how can I play a song while it's being downloaded. According to 4th statement if packets come in random order then the song/movie shouldn't start before it's completely downloaded.
Il explain you what happen with the video, but for audio streaming it's almost the same. The audio has only a lower bit rate.
The client use the buffer to mitigate the effect of end-to-end delay.
The client tries to download the video's packets faster than it will process them and it saves them in the buffer. This operation is called prefetching.
Doing prefetching allows client to process and show the video even if some packets will arrive after others.
At the start of the video you have to wait that some pockets arrives in your buffer. When client's buffer have enought of them it let you see the video. For example on YouTube you see a little circle until your buffer is full enouth.
For example you start a video on YouTube of 35MB, the client calculate a 500Kbit buffer and will wait until 2Kbit. It means that you have to wait until client has downloaded 2Kbit of video.
If your connection go down client will continue to use packets stored in the buffer until it will be empty. At that point you have to wait that the clients download again 2Kbit of pockets.
If your connection is too fast and the buffer became full it stops to ask packets until buffer has some space again.
Notice that when you pause a streaming video your client still downloads.
I am trying to start TCP slow start congestion algoritham in my raspberry device. As it documented in RFC 2581, it needs to set ssthresh value greater than the congestion window (cwnd). So I have chnaged /sys/module/tcp_cubic/parameters# sudo nano initial_ssthresh value to 65000 and cwnd was set to 10 ( checked with ss -i). After this settings I tried to send big packet from raspberry of size 19000 bytes. According to slow start it first needs to send to the destination device 2 packtes and then 4, then 8 ..etc.
But its not happening at raspberry. it sending me 10 packtes. Did I do something worng ?. In this case How can i start slow start algoritham.
Thanks
When CWND is less than ssthresh, the connection is in slowstart. When the CWND becomes greater than the ssthresh, the connection goes into congestion avoidance.
What you're seeing is that newer versions of linux have the initial congestion window set to 10. Before it was the default setting, you could change your initial congestion window from 3 through an ip route command. I haven't tried it, but I'm guessing you can do the opposite here.
Long story short, your machine is doing slow start. It is just starting with a larger initial congestion window.
I am trying to understand TCP's advertised receive window size and how CUBIC congestion control works.
Can we set the initially advertised receive window size ? I tried setting SO_RCVBUF, but didn't affect.
What can change the advertised receive window during transmission - what actions/events will affect the receive window size ?
What is the relation between congestion control and receive window size?
I am using Linux 3.11.
Can we set the initially advertised receive window size ? I tried setting SO_RCVBUF, but didn't affect.
It does. You must have done it wrong. You have to set it before connecting the socket, or, in the case of a server, on the listening socket, from which all accepted sockets will inherit it. Setting it after the connect doesn't work if window scaling is required, as that is only negotiated durimg the connect handshake.
What can change the advertised receive window during transmission - what actions/events will affect the receive window size ?
Reading from the socket.
What is the relation between congestion control and receive window size?
Nil.
I'm trying to reverse engineer an application, and i need help understanding how TCP window size works. My MTU is 1460
My application transfers a file using TCP from point A to B. I know the following:
The file is split into segments of size 8K
Each segment is compressed
Then each segment is sent to point B over TCP. These segment for a text file can be of size 148 Bytes, and for a pdf 6000 Bytes.
For a text file, am i supposed to see the segments of 148 attached to one another to form one large TCP stream? and then it is split according to the Window Size?
Any help is appreciated.
The receiver application should see the data in teh same way, the sender application sent it. TCP uses byte-streaming and so it collects all the bytes in an in-order manner and delivers it to the application. MTU is largely an internal semantics to TCP and does not take into application-layer packet boundaries. If TCP has enough data to send in its send buffer (each TCP socket has its own send buffer, btw), then it will package its next segment worth MTU size and sends it; to be more precise, it deducts TCP and IP header from the MTU size.