在XDP eBPF中分割一个数据包

huangapple go评论127阅读模式
英文:

Split a packet in XDP eBPF

问题

在XDP eBPF中,是否可能从一个传入的数据包生成多个数据包?或者可能存在其他基于内核的解决方案?

英文:

Is it possible to generate several packets out of one incoming packet in XDP eBPF? Or probably there are other kernel based solutions?

答案1

得分: 1

XDP程序目前是一进一出(或丢弃)一个数据包。在TC层,您可以使用bpf_clone_redirect辅助函数,它可以将当前数据包的副本发送到指定的网络接口,然后您可以修改当前数据包。

另一种常见的技术称为“端口镜像”,通常用于监视流量以实现多种目的。这也可以在普通的TC中设置,而无需使用eBPF:

英文:

No, XDP programs are as of now, one packet in, one packet out (or drop). At the TC layer you do have access to the bpf_clone_redirect helper function which as the name suggest can send a close of the current packet to a given network interface, after which you can modify the current packet.

Another common technique to called "port mirroring" typically used for monitoring traffic for a number of purposes. Which can also be setup in plain TC without eBPF:

huangapple
  • 本文由 发表于 2023年4月7日 05:49:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/75954021.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定