-
Notifications
You must be signed in to change notification settings - Fork 124
OFP TCP Keepalive Timer is not working as expected due to keepalive count (t_keepcnt) is not incremented and validated while processing Keepalive Timer #280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, My understanding is that it is validating the time spent (in ticks) versus the max to wait: ofp_tcp_timer.c I don't use the same codebase ... but what are the values of always_keepalive and inp->inp_socket->so_options for you? Best regards, P.S. Please have a look at my work on NFP (my version of ofp): http://www.netinosoft.org |
Please check the below values for variables (as requested) In my case, Below if condition never gets TRUE and TCP is resetting the keepalive timer forever. if ((int)(ofp_timer_ticks(0) - tp->t_rcvtime) >= I have printed all 4 variables below : if conditions like this 6000 >= 780000 will never gets TRUE soon as Ticks value and Recv Time is keep on incrementing and here comparison with big constant value 780000. Regards, |
Hi @manishmatey I did a little experiment: I changed:
I am getting this: That is, the connection was dropped after the specified time. Note that t_rcvtime remains constant as there is no traffic from the other side.... Now, you may add similar log messages and check if the connection is dropped in your case. |
I have few queries on the above test :
Regards, |
Hi @manishmatey My understanding is that this the case were the remote device becomes unaccessible due to connectivity issue or remote has crashed. To simulate this case I shut down the network interface of the remote device.. that is, there are NO keepalive responses (received or sent). I don't understand your point: you are actively using keepalive mechanism to keep the connection up ... if you have responses it means the connection is up and should not be terminated... |
HI @bogdanPricope , Thanks for the reply so below is my understanding : if ((int)(ofp_timer_ticks(0) - tp->t_rcvtime) >= TP_KEEPIDLE(tp) + TP_MAXIDLE(tp)) and keepalive count variable t_keepcnt is not used anywhere to drop the TCP connection. File : ofp_tcp_timer.c If I comment the above if condition [if (delta > 6000) delta = 6000;] then keepalive probe starting after 2 hours. Is this condition is having issue? I have just commented this code as workaround. Is this above if condition [if (delta > 6000) delta = 6000;] has issue? |
Hi @manishmatey I get that in your case the remote side is still accessible ... it just stopped sending "payload" data. What you are seeing is that keepalive messages are sent every minute despite having a TCP_KEEPIDLE ("The time (in seconds) the connection needs to remain idle before TCP starts sending keepalive probes") of 120 minutes. However, even without he unwanted keepalives the behavior will not change: after 120 minutes (TCP_KEEPIDLE) OFP will send a keepalive and the remote side will answer: t_rcvtime will be updated and connection will not be dropped. I am not a TCP expert but my understanding is that this is the expected behavior for the keepalive mechanism..... (is not meant to monitor TCP payload traffic but only if the remote is alive and on the remote side the connection is still active (was not closed, etc.)) Regards, |
Hi Team,
When a TCP connection is established, Ideally TCP connection should get terminated when there is no data exchange between client and server for sometime.
TCP will start keepalive timer and if no data exchange happened between client and server for few keepalive packets (ideally 8 to 10) then TCP connection will be dropped.
I did not find anywhere TCP keepalive count is getting incremented and checked while processing TCP keepalive timer.
Can somebody confirm if this a bug in OFP code itself?
OR
Where TCP keepalive count is getting incremented in OFP TCP code?
Any help will be appreciated.
The text was updated successfully, but these errors were encountered: