Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In my LAN, I have a router that runs a Samba server and my PC connects to the router.

I wiresharked during a uploading to the server and a downloading from the server.

The wireshar results show that:

  • During the uploading, the server sends an ACK every 0.6ms average
  • During the downloading, my PC send an ACK every 0.025ms average

As a consequence, the downloading generates about 120000 frames while the uploading only generates 70000 frames. And the downloading rate is about 12.7Mbytes/s while the uploading rate is 20Mbyte/s.

So I want to figure out the possible reason for this.

share|improve this question
    
A number of things could be determining this, switch performance and buffer sizes, disk capabilities on either end. –  SpacemanSpiff Jan 10 '12 at 23:00
    
The reason for what? –  mailq Jan 10 '12 at 23:01

2 Answers 2

There are mainly two mechanisms to reduce the amount of ACK packets returned - the Nagle algorithm and Delayed ACKs - both described in RFC 1122. Both are optional, so there will be hosts which are either configured not to use them or have the appropriate implementation missing. Especially Samba can be instructed to disable the Nagle algorithm by using socket options = TCP_NODELAY in the configuration.

Your difference in upstream / downstream data rates for SMB file copies is likely to have other reasons than an abundance of TCP ACK packets though.

share|improve this answer
    
Yes, the main reason for this is the capabilities of CPU. My PC is capable of sending a packet every 12.5us average while the router sends a packet every 90us average. So, the uploading should be 7 time faster, but it didn't. That's why I think the ACK also has a quite important influence. –  sliter Jan 10 '12 at 23:52
    
@sliter The number of ACKs would only influence the throughput if your router is operating at the maximum forwarding capacity regarding its packets per second performance (each received / forwarded / processed packet will obviously cost CPU performance) or if your upstream can't handle the sustained data rate needed for the ACKs. I would suggest looking into your router's/Samba server's performance metrics to check if the CPU is bottlenecking there on both occasions. –  the-wabbit Jan 11 '12 at 21:12
    
@MilesErickson thank you –  the-wabbit Jan 11 '12 at 21:13

The TCP implementation ACKs every other data packet. So you should see, typically, two data packets received and then an ACK sent. The sender, of course, is not waiting for the ACK anyway. It will continue to transmit until the window is full, even in the absence of an ACK.

There are other factors potentially at play here, such as Nagle and delayed ACK. But it doesn't look like you're seeing the affects of them.

share|improve this answer
    
This is exactly what I saw for the downloading, my PC ACKs after receiving two packets but not for the uploading. Besides, where the kernel's implementation for ACKing every other data packet? –  sliter Jan 10 '12 at 23:44
    
What did you see during the uploading? The logic for ACKing is primarily in the __tcp_ack_snd_check function in tcp_input.c and tcp_send_delayed_ack in tcp_output.c. –  David Schwartz Jan 10 '12 at 23:50
    
For uploading, between two ACKs, there are around 22 frames transmitted. My guess is that, for uploading the delayed ACK is activated. Because, the time between ACKs is 0.6ms which is smaller than TCP_DELACK_MAX(2ms) and larger than TCP_DELACK_MIN(0.4ms). What you think? –  sliter Jan 11 '12 at 9:02
    
Even so, the window should be large enough that the ACKs shouldn't be affecting performance. –  David Schwartz Jan 11 '12 at 19:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.