linux - FPGA与PC以太网连接

标签 linux tcp udp fpga ethernet

我想将fpga板的以太网直接连接到PC的以太网并进行双向数据传输。我对如何设置这个感到困惑。

  • Should I use Raw ethernet frames between FPGA and PC? But I could not find any windows application to send/capture raw frames. Can I do this in linux or something?
  • What would be the IP addresses and MAC addresses of PC and FPGA board in such a direct connection? How to find it? As there is no LAN or something involved here, I don't know how IP addresses get assigned to them.
  • Should I use TCP/IP or UDP in direct connection instead of raw frames? It seems to complicate FPGA side. I am not sure.
  • Is it better to have FPGA board and PC on same LAN, instead of direct connection. Again can I use raw frames or should I go for TCP/IP or UDP?
  • Is it necessary to implement ARP on FPGA, if I go for TCP/IP or UDP?

最佳答案

简短回答:

最好选择网络层协议(protocol)而不是原始帧。我认为最好的方法是UDP。与 TCP/IP 相比,它具有简单的 header 和较低的复杂性。它广泛用于 FPGA 和主机 PC 之间的通信。例子可以在互联网上找到。将 FPGA 连接到与 PC 相同的网络,以便 DHCP Server 为 FPGA 分配 IP 地址。如果您知道 FPGA 板的 MAC 地址,则不需要 ARP。通常它写在黑板上。还有一个例子:在Xilinx中,我们可以在代码本身中配置MAC。只要网络中没有其他设备使用相同的 MAC,它就是安全的。

关于linux - FPGA与PC以太网连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48024745/

相关文章:

linux - 如何在内核 Linux 中进行乘法运算?

linux - 如何让 supervisord 无法被杀死

linux - 有没有办法指定包含创建 zip 时要包含的文件的输入文件?

linux - 有什么方法可以减少 linux 作业中的 I/O 等待时间?

c - 回复 udp 数据包被阻止

udp - 在 Pixel 2 和 Pixel 2 XL 接收 UDP 广播数据包

c++ - C TCP 客户端 sockaddr_in 指针

c# - 你能有一个没有线程的 TCP 客户端吗

java - Netty中可以压缩请求吗?

http - 如何将udp mpeg ts流转换为http流?