Forums

UDP -FPGA point to point

Started by Manav Nair October 18, 2021
Hello everyone, I have recently started working on a project using Ethernet in an FPGA and I am using the UDP protocol for communication between the PC and the FPGA.
The communication is happening point to point so I was wondering do I need ARP implementation in my stack or can I just broadcast the message.

I am building a UDP stack but was wondering is ARP a necessary requirement.
Also, the FPGA doesn't have MAC or UDP port so what value should I assign to them before sending. Thank you in advance

Mana
Un bel giorno Manav Nair digit�:

> Hello everyone, I have recently started working on a project using > Ethernet in an FPGA and I am using the UDP protocol for communication > between the PC and the FPGA. The communication is happening point to > point so I was wondering do I need ARP implementation in my stack or can > I just broadcast the message.
If your connection is really point-to-point, i.e. a physical cable that goes straight from a host to another, you should be ok without ARP. If you instead have any routing device in the middle (a switch, a wifi access point etc..), you should implement ARP or you might have problems.
> I am building a UDP stack but was wondering is ARP a necessary > requirement. Also, the FPGA doesn't have MAC or UDP port so what value > should I assign to them before sending. Thank you in advance
Again, if you are straight point-to-point you can assign any MAC address, as long as it is not all zeroes or FFs. Otherwise you should assign a "real" MAC address, that you can "steal" from any ethernet device that you are not going to connect on the same network. -- Fletto i muscoli e sono nel vuoto.
On Monday, October 18, 2021 at 4:11:46 PM UTC+2, dalai lamah wrote:
> Un bel giorno Manav Nair digit=C5=86: > > Hello everyone, I have recently started working on a project using=20 > > Ethernet in an FPGA and I am using the UDP protocol for communication=
=20
> > between the PC and the FPGA. The communication is happening point to=20 > > point so I was wondering do I need ARP implementation in my stack or ca=
n=20
> > I just broadcast the message. > If your connection is really point-to-point, i.e. a physical cable that=
=20
> goes straight from a host to another, you should be ok without ARP. If yo=
u=20
> instead have any routing device in the middle (a switch, a wifi access=20 > point etc..), you should implement ARP or you might have problems. > > I am building a UDP stack but was wondering is ARP a necessary=20 > > requirement. Also, the FPGA doesn't have MAC or UDP port so what value=
=20
> > should I assign to them before sending. Thank you in advance > Again, if you are straight point-to-point you can assign any MAC address,=
=20
> as long as it is not all zeroes or FFs. Otherwise you should assign a=20 > "real" MAC address, that you can "steal" from any ethernet device that yo=
u=20
> are not going to connect on the same network.=20 >=20 > --=20 > Fletto i muscoli e sono nel vuoto.
Ok, thanks for the response. I still had one question regarding the UDP. Since I don't know the UDP dest= ination port what should I do in that case? How should I send the UDP messa= ge from the PC to the FPGA? I am using scapy for sending data.
On 10/18/21 8:59 AM, Manav Nair wrote:
> Hello everyone, I have recently started working on a project using Ethernet in an FPGA and I am using the UDP protocol for communication between the PC and the FPGA. > The communication is happening point to point so I was wondering do I need ARP implementation in my stack or can I just broadcast the message. > > I am building a UDP stack but was wondering is ARP a necessary requirement. > Also, the FPGA doesn't have MAC or UDP port so what value should I assign to them before sending. Thank you in advance > > Mana >
One issue is you are mixing up details at different 'layers' of communication. UDP is a transport layer protocol while ARP is a link layer. WIth a direct connection between the PC and the FPGA, you don't really HAVE a link layer, which is where a MAC address would matter. The question comes how you will tell the PC stack how to 'address' the packet to tell it to send it to the FPGA. That might require some hard wiring in the stack to provide a routing to the FPGA. The FPGA likely doesn't need to generate anything there, as it can be just fixed in the driver to it. As to a UDP port number, that would determine what the FPGA will do with datagram. Are ALL datagrams interpreted the same? if so, then it doesn't matter what port you use. (maybe the datagram has enough details to define this). Possibly, you want to be able to send datagrams to different 'ports' in the FPGA to be processed for different purposes, and if you don't need it now, you may just want to be using a fixed port so you can add others in the future.