设计并行算法来预防 DDOS?

发布于 2025-01-05 06:11:32 字数 107 浏览 5 评论 0原文

我的多核机器正在接收数据包并将它们均匀地分布在其核心之间(有点循环)。每个核心应仅根据其原始地址来决定是让数据包通过还是丢弃它。

我需要找到无锁算法和数据结构来实现这一点。你能帮忙吗?

My multicore machine is receiving packets and distributes them evenly (sort-of round robin) among its cores. Each core should decide whether to let the packet pass or drop it, depending solely on its origin address.

I need to find lock-less algorithm and data structure to allow this. Can you help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暗藏城府 2025-01-12 06:11:32

如果您喜欢使用 Java,或者查看 Java 源代码的设计,您可以选择一个随机密钥,然后从 http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/ConcurrentHashMap.html。给定队列,如果它是 http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/ConcurrentLinkedQueue.html

大部分 java.util.concurrent 是由于到Doug Lea,在 http://gee.cs 上有相关信息。 oswego.edu/dl/concurrency-interest/index.html

对于您的特定问题可能有点过分,但可能会满足对该领域数据结构信息的一般要求。

If you are happy to use Java, or look at the design of Java source, you could chose a random key and then retrieve a queue from http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/ConcurrentHashMap.html. Given the queue, you could add the packet to it without blocking if it was a http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/ConcurrentLinkedQueue.html

Much of java.util.concurrent is due to Doug Lea, who has information on it at http://gee.cs.oswego.edu/dl/concurrency-interest/index.html.

Possibly overkill for your particular problem, but might satisfy a general request for info on data structures in this area.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文