简体   繁体   English

DPDK中使用的IP地址和MAC地址

[英]IP address and MAC address used in DPDK

Hello Stackoverflow experts,你好 Stackoverflow 专家,

I have been struggling with how to use the ip fragmentation provided by DPDK.一直在纠结如何使用DPDK提供的ip分片。 and was wondering I have the correct concept of IP address and the MAC address used in rte-mbuf ethernet header.并且想知道我有正确的 IP 地址概念和 rte-mbuf 以太网标头中使用的 MAC 地址。

Is Ip address alone in the header of rte-mbuf can be used to transfer from local to remote? rte-mbuf 头中的ip地址是否可以用于从本地传输到远程? I see in the DPDK sample applications that the ip address is used in the hashed tables such as IP fragment table after the packets are received, but the fact that data is actually received just by using ethernet mac address, gives me the impression that IP address is only defined by the DPDK user (developers using DPDK API) and not used in actual data transfer.我在DPDK示例应用程序中看到,收到数据包后,在散列表(例如IP分片表)中使用了IP地址,但实际上仅使用以太网mac地址接收数据的事实给我的印象是IP地址仅由 DPDK 用户(使用 DPDK API 的开发人员)定义,不用于实际数据传输。

Is there something missing to what I understand?我的理解有什么遗漏吗?

You are right.你是对的。 Most DPDK examples work on the second level of the OSI model, ie they only care about MAC addresses, not IP.大多数 DPDK 示例工作在 OSI 模型的第二层,即它们只关心 MAC 地址,而不关心 IP。

The IP reassembly example is based on L2 forwarding example, ie it acts as an Ethernet bridge. IP 重组示例基于 L2 转发示例,即它充当以太网桥接器。 Though, it requires IP addresses to be analyzed, ie source and destination IPs must match for all the fragments of the same flow.但是,它需要分析 IP 地址,即同一流的所有片段的源 IP 和目标 IP 必须匹配。

Now answering your questions:现在回答你的问题:

Is Ip address alone in the header of rte-mbuf can be used to transfer from local to remote? rte-mbuf 头中的ip地址是否可以用于从本地传输到远程?

If you mean transfer using rte_eth_tx_burst() then no, IP header is not enough.如果您的意思是使用rte_eth_tx_burst()进行传输,那么不,IP 标头是不够的。 The ethernet header must be filled properly as well.以太网头也必须正确填写。

IP address is only defined by the DPDK user (developers using DPDK API) and not used in actual data transfer. IP 地址仅由 DPDK 用户(使用 DPDK API 的开发人员)定义,不用于实际数据传输。

Since the reassembly example is based on L2 forwarding example, it acts as reassembling Ethernet bridge.由于重组示例基于 L2 转发示例,因此它充当重组以太网桥。 So you have a right impression, this example does not route packets based on IP addresses.所以你有一个正确的印象,这个例子没有根据 IP 地址路由数据包。 It just uses IP addresses to reassemble IP fragments.它只是使用 IP 地址来重组 IP 片段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM