
{"id":6391,"date":"2011-12-08T19:16:11","date_gmt":"2011-12-08T19:16:11","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=6391"},"modified":"2011-12-08T19:16:11","modified_gmt":"2011-12-08T19:16:11","slug":"tcp_rmem-vector-of-3-integers-min-default-max","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2011\/12\/08\/tcp_rmem-vector-of-3-integers-min-default-max\/","title":{"rendered":"tcp_rmem &#8211; vector of 3 INTEGERs: min, default, max"},"content":{"rendered":"<p><u>ABOUT tcp_rmem<\/u><\/p>\n<pre>\nmin: Minimal size of receive buffer used by TCP sockets.\n\nIt is  guaranteed to  each TCP socket,  even under  moderate memory\npressure.  Default: 1 page\n\ndefault: initial size of receive  buffer used by TCP sockets.  This value  overrides net.core.rmem_\ndefault  used by  other  protocols. Default: 87380  bytes. This value  results in window of  100535\nwith default setting  of tcp_adv_win_scale  and tcp_app_win:0 and  a bit less for default tcp_app_win.\nSee below about these variables.\n\nmax:  maximal  size of  receive  buffer  allowed for  automatically selected  receiver buffers  for  TCP\nsocket.  This  value does  not override  net.core.rmem_max.  Calling  setsockopt()  with SO_RCVBUF\ndisables automatic tuning of  that socket's receive buffer size, in which case this value is ignored.\nDefault: between 87380B and 4MB, depending on RAM size.\n<\/pre>\n<p><u>TYPICAL COMMANDLINE SESSION <\/u><br \/>\n[bash]<br \/>\n$cat \/proc\/sys\/net\/ipv4\/tcp_rmem<br \/>\n4096\t87380\t2003296<br \/>\n$<br \/>\n[\/bash]<\/p>\n<p><u>TYPICAL NETWORK RELATED SOURCE CODE<\/u><br \/>\n[c]<br \/>\n\/* the caller has to hold the sock lock *\/<br \/>\nstatic int rds_tcp_read_sock(struct rds_connection *conn, gfp_t gfp,<br \/>\n                             enum km_type km)<br \/>\n{<br \/>\n        struct rds_tcp_connection *tc = conn-&gt;c_transport_data;<br \/>\n        struct socket *sock = tc-&gt;t_sock;<br \/>\n        read_descriptor_t desc;<br \/>\n        struct rds_tcp_desc_arg arg;<\/p>\n<p>        \/* It&#8217;s like glib in the kernel! *\/<br \/>\n        arg.conn = conn;<br \/>\n        arg.gfp = gfp;<br \/>\n        arg.km = km;<br \/>\n        desc.arg.data = &amp;arg;<br \/>\n        desc.error = 0;<br \/>\n        desc.count = 1; \/* give more than one skb per call *\/<\/p>\n<p>        tcp_read_sock(sock-&gt;sk, &amp;desc, rds_tcp_data_recv);<br \/>\n        rdsdebug(&quot;tcp_read_sock for tc %p gfp 0x%x returned %dn&quot;, tc, gfp,<br \/>\n                 desc.error);<\/p>\n<p>        return desc.error;<br \/>\n}<br \/>\n[\/c]<\/p>\n<p><u>RELATED KNOWLEDGE<\/u><\/p>\n<pre>\nTCP  performance depends  not upon  the transfer  rate  itself, but rather upon  the product  of the\ntransfer  rate and  the round-trip delay.  This \"bandwidth*delay product\"  measures the amount of data\nthat  would \"fill the  pipe\"; it  is the  buffer space  required at sender  and  receiver  to  obtain\nmaximum throughput  on  the  TCP connection over  the path, i.e., the amount  of unacknowledged data\nthat  TCP must  handle in  order to  keep the  pipeline  full.  TCP performance  problems  arise when\nthe  bandwidth*delay product  is large.  We refer to an Internet  path operating in this region as a\n\"long, fat  pipe\", and a network  containing this path  as an \"LFN\" (pronounced \"elephan(t)\").\n \n\nHigh-capacity  packet satellite  channels  (e.g., DARPA's  Wideband Net) are LFN's.   For example, a DS1\nspeed satellite  channel has a bandwidth*delay product of 10**6  bits or more; this corresponds to\n100  outstanding  TCP segments  of  1200  bytes each.   Terrestrial fiber-optical paths will also fall\ninto the LFN class; for example, a cross-country  delay of  30 ms at  a DS3 bandwidth  (45Mbps) also\nexceeds 10**6 bits.\n<\/pre>\n<p>LINK<br \/>\n<a href=\"https:\/\/tools.ietf.org\/html\/rfc1323\">https:\/\/tools.ietf.org\/html\/rfc1323<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ABOUT tcp_rmem min: Minimal size of receive buffer used by TCP sockets. It is guaranteed to each TCP socket, even under moderate memory pressure. Default: 1 page default: initial size of receive buffer used by TCP sockets. This value overrides net.core.rmem_ default used by other protocols. Default: 87380 bytes. This value results in window of &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2011\/12\/08\/tcp_rmem-vector-of-3-integers-min-default-max\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;tcp_rmem &#8211; vector of 3 INTEGERs: min, default, max&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[19],"tags":[1385,1548],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/6391"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=6391"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/6391\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=6391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=6391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=6391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}