Components/Ethernet/IPs/UDP FIFO
|
UDP FIFO
The Ethernet UDP FIFO core connects to the MII to dual port RAM interface on one side and provides a FIFO port on the other one.
On the receiver side, it:
- checks the MAC address (supports multicast) and trims the Ethernet header away
- checks the IP address (supports multicast --> 229.0.16.x, and broadcast) and trims the IP header away
- trims the UDP header
- writes the payload data into a FIFO
On the sender side side, it:
- reads the payload data from a FIFO
- adds an UDP header
- adds an IP header
- adds an Ethernet header
As ports to the core, MAC and IP addresses come in 3 flavours:
- the FPGA's address
- the incoming frame's address
- the outgoing frame's address
UDP components
On the application side, a basic development system provides the following UDP blocks:
- echo on port 07
- discard on port 09
- quote of the day on port 17
- bonjour on port 5353
Additionally:
- a kind of demultiplexer transmits the input FIFO controls to the block selected by the UDP port number
- a kind of multiplexer sends data from any given block to the output FIFO
The blocks have to register their port number to the demultiplexer. If no block corresponds to the incoming UDP frame, the demultiplexer empties the input FIFO. The blocks have to ask for write access to the output FIFO. Access is granted on a priority based on the component indexes.
Testing
IP address
With Linux, set the IP address in the same domain as the FPGA board's:
ifconfig eth0:0 192.168.111.12 netmask 255.255.255.0 up
Check the connection:
while sleep 1; do ethtool eth0; done
Bonjour
Each FPGA board has a unique MAC address, as specified by UIT.
The bonjour name of the board is fpgann
,
where nn
is the FPGA board id.
Open Wireshark and filter bonjour protocol:
ip.version==4 and udp.port==5353
Find the board's IP address:
ping fpga30.local
The board won't answer the ping
,
but the terminal will show the board's IP address as found with the help of bonjour
.
Echo
In Wireshark, trigger on the echo protocol:
udp.port==7
Open an UDP session with the board:
nc -4u fpga01.local 7
Type any line and it should be echoed back immediately.
If the FPGA board is not in the same IP subnet, one can send a single echo packet to a multicast address:
echo -n 'Hello world' | nc -4u -w 1 -p 1031 224.0.0.251 7
Discard
In Wireshark, trigger on the discard protocol:
udp.port==9
The discard message will be sent to the IP address of the last device having accessed the card.
On the FPGA board, press on the button connected to the discard protocol block. In Wireshark, check for the frame being sent.
Quote Of The Day
In Wireshark, trigger on the QOTD protocol:
udp.port==17
The Quote Of The Day message will be sent to the IP address of the last device having accessed the card.
Open an UDP session with the board:
nc -4u fpga01.local 17
Type any line and you should immediately receive the quote.