LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 11-25-2008, 06:00 PM   #1
jbraswell314
LQ Newbie
 
Registered: Nov 2008
Posts: 3

Rep: Reputation: 0
Change kernel to always be in tcp quick ack mode


Hi, my Java program is running into some occasional-yet-significant delay when writing to a TCP socket. The problem seems to be that my side is delaying packets because it's waiting for the other side to send more data so that my side can piggy-back its data on the next ack to the other side.

It looks like I can fix this by calling tcp_enter_quickack_mode (found here: http://lxr.linux.no/linux+v2.6.27.7/...p_input.c#L178 ). However, i) I can't call this from Java, and ii) even if I use C/C++, I have to call it before every send because the kernel turns it back off after every send - it looks like the pingpong flag is the relevant one?

Has anyone ever modified the kernel so that this setting is always off? I'm no expert, so I'm a little wary of making changes without a voice of experience.

Thanks
 
Old 11-26-2008, 02:08 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,561
Blog Entries: 54

Rep: Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927
Quote:
Originally Posted by jbraswell314 View Post
The problem seems to be that my side is delaying packets because it's waiting for the other side to send more data so that my side can piggy-back its data on the next ack to the other side.
This network stack really is a well-constructed thing. ACK's play their own part in ensuring the connection is handled well. "Modifying" how your stack works may well break compatibility. From how you posted your question I think the problem is not sender-side but receiver-side. Maybe the default doc http://myhsc.pbwiki.com/Inside_Linux_TCP:elayed_Ack can tell you (better than I can) why you shouldn't muck with this the way you want to?..
 
Old 11-26-2008, 06:48 PM   #3
jbraswell314
LQ Newbie
 
Registered: Nov 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Well, unfortunately, I have no choice but to muck with it...I only have a TCP API to work with in this case, and latency minimization is critical.

I made the change I discussed, but it didn't fix my problem. That change only made me send my acks faster.

I think the problem has to do instead with the congestion window. Is there a list somewhere of all the reasons a congestion window shrinks? (I have slow start disabled.)
 
Old 11-26-2008, 07:49 PM   #4
jbraswell314
LQ Newbie
 
Registered: Nov 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Hmm, looks like I can just set the minimum congestion window (min_cwnd) to something large enough to handle all of my data.

Sound right?
 
Old 11-27-2008, 12:54 AM   #5
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,095
Blog Entries: 2

Rep: Reputation: 111Reputation: 111
you probably need to set socket option TCP_NODELAY on the sender side, what's most likely happening is the tcp packets aren't being sent until you've filled the buffer as opposed to immediately when you write a block of data. I think you can also set this with the tcp_low_latency in /proc but that would be system wide instead of just for one connection.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TCP - ACK frequency meir129 Linux - Networking 2 04-08-2014 02:01 PM
TCP handshake fails, SYN/ACK ignored by system. xnomad Linux - Networking 1 09-28-2011 12:10 PM
Linux change TCP kernel Parameter for TCP DELAY ACK TICKS linux_mando Linux - Networking 5 08-22-2006 09:20 AM
Disntiguishing between ACK packets in a TCP connection!! vishamr2000 Linux - Networking 3 05-23-2006 02:08 AM
TCP retransmission and duplicated ack enjoyzj Linux - Networking 0 06-05-2004 07:19 PM


All times are GMT -5. The time now is 08:52 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration