b2a3 setsockopt: TCP_MAXRT - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Development > FreeBSD Development

FreeBSD Development Kernel development, writing drivers, coding, and questions regarding FreeBSD internals.

Reply
 
Thread Tools Display Modes
  #1  
Old September 5th, 2012, 16:55
Juan_ma Juan_ma is offline
Junior Member
 
Join Date: Sep 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default setsockopt: TCP_MAXRT

Hi,

Do you know if BSD 4.4 standard tcp option is available in FreeBSD: TCP_MAXRT? I cannot see it in the man pages.

Does any body know if it is going to be supported?

Thanks,

Juanma
Reply With Quote
  #2  
Old September 5th, 2012, 17:04
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,725
Thanks: 47
Thanked 2,023 Times in 1,862 Posts
Default

From tcp(4):
Code:
     rexmit_min, rexmit_slop
                        Adjust the retransmit timer calculation for TCP.  The
                        slop is typically added to the raw calculation to take
                        into account occasional variances that the SRTT
                        (smoothed round-trip time) is unable to accommodate,
                        while the minimum specifies an absolute minimum.
                        While a number of TCP RFCs suggest a 1 second minimum,
                        these RFCs tend to focus on streaming behavior, and
                        fail to deal with the fact that a 1 second minimum has
                        severe detrimental effects over lossy interactive con-
                        nections, such as a 802.11b wireless link, and over
                        very fast but lossy connections for those cases not
                        covered by the fast retransmit code.  For this reason,
                        we use 200ms of slop and a near-0 minimum, which gives
                        us an effective minimum of 200ms (similar to Linux).
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #3  
Old September 5th, 2012, 19:40
Juan_ma Juan_ma is offline
Junior Member
 
Join Date: Sep 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for you quick reply SirDice.

I'm not sure rexmit_min, rexmit_slop can be used for what I would like.

I would like to use TCP_MAXRT in order to say TCP connection is broken once this timer is elapsed. Another way of achieving it would be to do it by means of TM_TCP_MAX_REXMIT option. rexmit_min, rexmit_slop seems to be more related to the minimum time to start retransmission.

Here you have what BSD 4.4 socket API says about it:

Sets the amount of time in seconds before the connection is broken once TCP starts retransmitting, or probing a zero window when the peer does not respond. A TCP_MAXRT value of 0 means the system default, and -1 means retransmit forever. If a positive value is specified, it may be rounded up to the connection next retransmission time. Note that unless the TCP_MAXRT value is -1 (transmit forever), the connection can also be broken if the number of maximum retransmission TM_TCP_MAX_REXMIT has been reached. See TM_TCP_MAX_REXMIT below.
Default 0. Meaning: use the system default of TM_TCP_MAX_REXMIT times network computed round trip time for an established connection. For a non-established connection, since there is no computed round trip time yet, the connection can be broken when either 75 seconds or when TM_TCP_MAX_REXMIT times default network round trip time have elapsed, whichever occurs first).
Reply With Quote
  #4  
Old September 6th, 2012, 17:11
expl's Avatar
expl expl is offline
Member
 
Join Date: Oct 2009
Location: In your shell, stealing your cookies.
Posts: 639
Thanks: 0
Thanked 113 Times in 104 Posts
Default

Quote:
Originally Posted by Juan_ma View Post
Thanks for you quick reply SirDice.

I'm not sure rexmit_min, rexmit_slop can be used for what I would like.

I would like to use TCP_MAXRT in order to say TCP connection is broken once this timer is elapsed. Another way of achieving it would be to do it by means of TM_TCP_MAX_REXMIT option. rexmit_min, rexmit_slop seems to be more related to the minimum time to start retransmission.

Here you have what BSD 4.4 socket API says about it:

Sets the amount of time in seconds before the connection is broken once TCP starts retransmitting, or probing a zero window when the peer does not respond. A TCP_MAXRT value of 0 means the system default, and -1 means retransmit forever. If a positive value is specified, it may be rounded up to the connection next retransmission time. Note that unless the TCP_MAXRT value is -1 (transmit forever), the connection can also be broken if the number of maximum retransmission TM_TCP_MAX_REXMIT has been reached. See TM_TCP_MAX_REXMIT below.
Default 0. Meaning: use the system default of TM_TCP_MAX_REXMIT times network computed round trip time for an established connection. For a non-established connection, since there is no computed round trip time yet, the connection can be broken when either 75 seconds or when TM_TCP_MAX_REXMIT times default network round trip time have elapsed, whichever occurs first).
You can implement this behavior using SO_RCVTIMEO and SO_SNDTIMEO flags on socket covered in setsockopt.

edit:
This will not work if you are running multithreaded environment or asynchronous sockets.
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] ipfw: setsockopt(IP_DUMMYNET_CONFIGURE): Protocol not available Sandra Firewalls 2 April 16th, 2012 04:19


All times are GMT +1. The time now is 05:04.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0