When does the TCP engine decide to send an ACK? Unicorn Meta Zoo #1: Why another podcast? ...

What is the least dense liquid under normal conditions?

Can I criticise the more senior developers around me for not writing clean code?

finding a tangent line to a parabola

What's parked in Mil Moscow helicopter plant?

What do you call the part of a novel that is not dialog?

Where did Arya get these scars?

Are all CP/M-80 implementations binary compatible?

"My boss was furious with me and I have been fired" vs. "My boss was furious with me and I was fired"

What *exactly* is electrical current, voltage, and resistance?

What is it called when you ride around on your front wheel?

Vigenère cipher in Ruby

Israeli soda type drink

PIC mathematical operations weird problem

Why didn't the Space Shuttle bounce back into space as many times as possible so as to lose a lot of kinetic energy up there?

Multiple options vs single option UI

What’s with the clanks in Endgame?

Protagonist's race is hidden - should I reveal it?

The art of proof summarizing. Are there known rules, or is it a purely common sense matter?

Is accepting an invalid credit card number a security issue?

Reattaching fallen shelf to wall?

How can I wire a 9-position switch so that each position turns on one more LED than the one before?

What was Apollo 13's "Little Jolt" after MECO?

What's the difference between using dependency injection with a container and using a service locator?

Multiple fireplaces in an apartment building?



When does the TCP engine decide to send an ACK?



Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manara
Come Celebrate our 10 Year Anniversary!Finding cause of TCP retransmission within a LANUpload speed spikes: tries to increate to 100% and then falls back againIs a low-bandwidth arp-scan potentially disruptive to persistent TCP connections on the same LAN?Looking for advice to find the bottleneck of Samba serverWhy data sending is heavier for CPU than data receiving?Needs help to understand the wireshark results of a data transferringRoot cause behind increase in throughputlinux: upload / download difference on network sharesUbuntu server domain controller samba transfer speedsIs RST, ACK expected in a TCP Health Check





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







3















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 wireshark 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 120,000 frames while the uploading only generates 70,000 frames. And the downloading rate is about 12.7Mbytes/s while the uploading rate is 20Mbytes/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


















3















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 wireshark 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 120,000 frames while the uploading only generates 70,000 frames. And the downloading rate is about 12.7Mbytes/s while the uploading rate is 20Mbytes/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














3












3








3








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 wireshark 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 120,000 frames while the uploading only generates 70,000 frames. And the downloading rate is about 12.7Mbytes/s while the uploading rate is 20Mbytes/s.



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










share|improve this question
















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 wireshark 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 120,000 frames while the uploading only generates 70,000 frames. And the downloading rate is about 12.7Mbytes/s while the uploading rate is 20Mbytes/s.



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







linux networking samba tcp file-transfer






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 8 mins ago









Elias Zamaria

1034




1034










asked Jan 10 '12 at 22:53









slitersliter

15526




15526













  • 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



















  • 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

















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





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





The reason for what?

– mailq
Jan 10 '12 at 23:01










2 Answers
2






active

oldest

votes


















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



















2














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








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "2"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f348666%2fwhen-does-the-tcp-engine-decide-to-send-an-ack%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









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
















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














2












2








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















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














share|improve this answer



share|improve this answer








edited Jan 10 '12 at 23:27









Skyhawk

13.5k34591




13.5k34591










answered Jan 10 '12 at 23:22









the-wabbitthe-wabbit

36.2k1181151




36.2k1181151













  • 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



















  • 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

















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





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





@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













2














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
















2














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














2












2








2







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













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












share|improve this answer



share|improve this answer










answered Jan 10 '12 at 23:32









David SchwartzDavid Schwartz

28.7k14474




28.7k14474













  • 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



















  • 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

















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





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





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





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





Even so, the window should be large enough that the ACKs shouldn't be affecting performance.

– David Schwartz
Jan 11 '12 at 19:18


















draft saved

draft discarded




















































Thanks for contributing an answer to Server Fault!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f348666%2fwhen-does-the-tcp-engine-decide-to-send-an-ack%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

Список ссавців Італії Природоохоронні статуси | Список |...

Українські прізвища Зміст Історичні відомості |...