{"id":178459,"date":"2025-10-04T05:03:09","date_gmt":"2025-10-04T05:03:09","guid":{"rendered":"https:\/\/www.newsbeep.com\/uk\/178459\/"},"modified":"2025-10-04T05:03:09","modified_gmt":"2025-10-04T05:03:09","slug":"linux-6-18-will-be-a-big-improvement-for-servers-encountering-ddos-attacks","status":"publish","type":"post","link":"https:\/\/www.newsbeep.com\/uk\/178459\/","title":{"rendered":"Linux 6.18 Will Be A Big Improvement For Servers Encountering DDoS Attacks"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" alt=\"LINUX NETWORKING\" src=\"https:\/\/www.newsbeep.com\/uk\/wp-content\/uploads\/2025\/10\/linuxnetworking.webp.webp\" width=\"100\" height=\"100\"\/><br \/>\nA set of patches merged via the networking pull request for the Linux 6.18 will help servers better cope with distributed denial of service &#8220;DDoS&#8221; attacks. Thanks to a Google engineer there are some significant optimizations found in the Linux 6.18 kernel code for more efficiently handling of UDP receive performance under stress, such as in DDoS scenarios.<\/p>\n<p>Merged for Linux 6.18 as part of the networking changes is <a href=\"https:\/\/lore.kernel.org\/netdev\/20250916160951.541279-1-edumazet@google.com\/\" rel=\"nofollow noopener\" target=\"_blank\">this patch series<\/a> from Google engineer Eric Dumazet. Dumazet explains there:&#13;<br \/>\n<\/p>\n<p>&#8220;This series is the result of careful analysis of UDP stack, to optimize the receive side, especially when under one or several UDP sockets are receiving a DDOS attack.&#13;<\/p>\n<p>I have measured a 47 % increase of throughput when using IPv6 UDP packets with 120 bytes of payload, under DDOS.&#13;\n<\/p>\n<p>16 cpus are receiving traffic targeting a single socket.&#13;\n<\/p>\n<p>Even after adding NUMA aware drop counters, we were suffering from false sharing between packet producers and the consumer.&#13;\n<\/p>\n<p>1) First four patches are shrinking struct ipv6_pinfo size and reorganize fields to get more efficient TX path. They should also benefit TCP, by removing one cache line miss.&#13;\n<\/p>\n<p>2) patches 5 &amp; 6 changes how sk-&gt;sk_rmem_alloc is read and updated. They reduce reduce spinlock contention on the busylock.&#13;\n<\/p>\n<p>3) Patches 7 &amp; 8 change the ordering of sk_backlog (including  sk_rmem_alloc) sk_receive_queue and sk_drop_counters for  better data locality.&#13;\n<\/p>\n<p>4) Patch 9 removes the hashed array of spinlocks in favor of a per-udp-socket one.&#13;\n<\/p>\n<p>5) Final patch adopts skb_attempt_defer_free(), after TCP got  good results with it.&#8221;<\/p>\n<p>A 47% increase of throughput in this receiving of DDoS scenario! <\/p>\n<p align=\"center\"><img decoding=\"async\" src=\"https:\/\/www.newsbeep.com\/uk\/wp-content\/uploads\/2025\/10\/1759554189_166_image\" alt=\"Linux server\"\/><\/p>\n<p>Eric Dumazet further added in <a href=\"https:\/\/lore.kernel.org\/netdev\/20250919164308.2455564-1-edumazet@google.com\/\" rel=\"nofollow noopener\" target=\"_blank\">this patch alone<\/a> being able to process 14.2M more packets per second while under attack on an Intel Xeon Linux server:<br \/>\n<br \/>&#8220;busylock was protecting UDP sockets against packet floods, but unfortunately was not protecting the host itself.&#13;<\/p>\n<p>Under stress, many cpus could spin while acquiring the busylock, and NIC had to drop packets. Or packets would be dropped in cpu backlog if RPS\/RFS were in place.&#13;\n<\/p>\n<p>This patch replaces the busylock by intermediate lockless queues. (One queue per NUMA node).&#13;\n<\/p>\n<p>This means that fewer number of cpus have to acquire the UDP receive queue lock.&#13;\n<\/p>\n<p>Most of the cpus can either:&#13;<br \/>\n<br \/>&#8211; immediately drop the packet.&#13;<br \/>\n<br \/>&#8211; or queue it in their NUMA aware lockless queue.&#13;\n<\/p>\n<p>Then one of the cpu is chosen to process this lockless queue in a batch.&#13;\n<\/p>\n<p>The batch only contains packets that were cooked on the same NUMA node, thus with very limited latency impact.&#13;\n<\/p>\n<p>Tested:&#13;\n<\/p>\n<p>DDOS targeting a victim UDP socket, on a platform with 6 NUMA nodes (Intel(R) Xeon(R) 6985P-C)&#13;\n<\/p>\n<p>Before:&#13;\n<\/p>\n<p>nstat -n ; sleep 1 ; nstat | grep Udp&#13;<br \/>\n<br \/>Udp6InDatagrams                 1004179            0.0&#13;<br \/>\n<br \/>Udp6InErrors                    3117               0.0&#13;<br \/>\n<br \/>Udp6RcvbufErrors                3117               0.0&#13;\n<\/p>\n<p>After:&#13;<br \/>\n<br \/>nstat -n ; sleep 1 ; nstat | grep Udp&#13;<br \/>\n<br \/>Udp6InDatagrams                 1116633            0.0&#13;<br \/>\n<br \/>Udp6InErrors                    14197275           0.0&#13;<br \/>\n<br \/>Udp6RcvbufErrors                14197275           0.0&#13;\n<\/p>\n<p>We can see this host can now process 14.2 M more packets per second while under attack, and the victim socket can receive 11 % more packets.&#8221;<\/p>\n<p>The timing of this work landing for Linux 6.18 is great with this kernel version expected to become this year&#8217;s Long Term Support (LTS) kernel version and thus will see a lot of enterprise\/server use moving forward.<\/p>\n","protected":false},"excerpt":{"rendered":"A set of patches merged via the networking pull request for the Linux 6.18 will help servers better&hellip;\n","protected":false},"author":2,"featured_media":178460,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[5870,59,5869,5867,5866,5873,5871,5868,5872,5865,5876,86,5874,5875,56,54,55],"class_list":{"0":"post-178459","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-technology","8":"tag-desktop-linux","9":"tag-gb","10":"tag-linux-benchmarking","11":"tag-linux-hardware-benchmarks","12":"tag-linux-hardware-reviews","13":"tag-linux-how-to","14":"tag-linux-performance","15":"tag-linux-server-benchmarks","16":"tag-open-source-graphics","17":"tag-phoronix","18":"tag-phoronix-test-suite","19":"tag-technology","20":"tag-ubuntu-benchmarks","21":"tag-ubuntu-hardware","22":"tag-uk","23":"tag-united-kingdom","24":"tag-unitedkingdom"},"_links":{"self":[{"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/posts\/178459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/comments?post=178459"}],"version-history":[{"count":0,"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/posts\/178459\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/media\/178460"}],"wp:attachment":[{"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/media?parent=178459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/categories?post=178459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.newsbeep.com\/uk\/wp-json\/wp\/v2\/tags?post=178459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}