
{"id":1384,"date":"2010-04-23T09:17:37","date_gmt":"2010-04-23T03:47:37","guid":{"rendered":"http:\/\/www.jeffrin.in\/?p=1384"},"modified":"2010-04-23T09:17:37","modified_gmt":"2010-04-23T03:47:37","slug":"tcp-tuning-tcp_syncookies","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2010\/04\/23\/tcp-tuning-tcp_syncookies\/","title":{"rendered":"tcp tuning tcp_syncookies"},"content":{"rendered":"<p>tcp_syncookies.<br \/>\nSend out syncookies when the syn backlog queue of a socket overflows. This is to prevent against the common &#8220;syn flood attack&#8221;. Disabled (0) by default.<\/p>\n<pre class=\"brush:bash\">\n:--:cat \/proc\/sys\/net\/ipv4\/tcp_syncookies\n0\n:--:\n<\/pre>\n<pre class=\"brush:c\">\nadded from linux kernel source.\n\/*\n160  * Generate a syncookie.  mssp points to the mss, which is returned\n161  * rounded down to the value encoded in the cookie.\n162  *\/\n163 __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, __u16 *mssp)\n164 {\n165         const struct iphdr *iph = ip_hdr(skb);\n166         const struct tcphdr *th = tcp_hdr(skb);\n167         int mssind;\n168         const __u16 mss = *mssp;\n169\n170         tcp_synq_overflow(sk);\n171\n172         \/* XXX sort msstab[] by probability?  Binary search? *\/\n173         for (mssind = 0; mss &gt; msstab[mssind + 1]; mssind++)\n174                 ;\n175         *mssp = msstab[mssind] + 1;\n176\n177         NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESSENT);\n178\n179         return secure_tcp_syn_cookie(iph-&gt;saddr, iph-&gt;daddr,\n180                                      th-&gt;source, th-&gt;dest, ntohl(th-&gt;seq),\n181                                      jiffies \/ (HZ * 60), mssind);\n182 }\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>tcp_syncookies. Send out syncookies when the syn backlog queue of a socket overflows. This is to prevent against the common &#8220;syn flood attack&#8221;. Disabled (0) by default. :&#8211;:cat \/proc\/sys\/net\/ipv4\/tcp_syncookies 0 :&#8211;: added from linux kernel source. \/* 160 * Generate a syncookie. mssp points to the mss, which is returned 161 * rounded down to &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2010\/04\/23\/tcp-tuning-tcp_syncookies\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;tcp tuning tcp_syncookies&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[1059],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/1384"}],"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=1384"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/1384\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=1384"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=1384"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=1384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}