WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2018-Aug-13 08:30:43

5g3
Member
Registered: 2018-Jun-14
Posts: 13

implementing tftp on the reference design

I'm interested in using the reference design as a tftp client to load a .bin file from a network. Would something like this be implementable on the microblaze? I understand that there is a previous warplab design that implements something similar using matlab commands, but I am just wondering if tftp is a feasible alternative.

https://github.com/labcoder/simple-tftp … r/client.c

Thanks for any help!

Offline

 

#2 2018-Aug-13 10:08:32

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: implementing tftp on the reference design

I think adding TFTP support to the 802.11 Reference Design for WARP v3 is probably feasible. You could use the existing wlan_exp_ip_udp stack as the IP/UDP interface. By default the wlan_exp_ip_udp stack is configured to listen for wlan_exp traffic, but supports listening on multiple ports. We've used this stack to build custom UDP-based network communication for (non-public) projects using the 802.11 design.

Offline

 

#3 2018-Aug-13 13:38:28

5g3
Member
Registered: 2018-Jun-14
Posts: 13

Re: implementing tftp on the reference design

Thank you @murphpo I will give it a try.

Also, does the 802.11 reference design offer any functions presently that can be modified for a singular unicast send message over ethernet?

For instance, one that if I had a socat UDP-LISTEN:PORT# open on a host machine, I would be able to send a message and have it received on the other end.

Looking through the functions already available, my intention was to modify an existing one such as void transport_send_async(u32 eth_dev_num, u8* payload, u32 length) , or int socket_sendto_raw(int socket_index, wlan_exp_ip_udp_buffer ** buffers, u32 num_buffers), but I wasn't exactly sure how. Perhaps even transport_send if that is all that is needed.

Would you have any advice on how to do this?

Last edited by 5g3 (2018-Aug-13 13:39:39)

Offline

 

#4 2018-Aug-14 10:11:02

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: implementing tftp on the reference design

The wlan_exp_ip_udp library implements a generic interface for sending UDP traffic to arbitrary ports/addresses. The interface isn't exactly compliant to POSIX sockets; it's more "inspired" by the standard. You can use the socket_sendto() function to send arbitrary payloads to the destination port/address specified in the sockaddr argument.  We have used this functionality for transmitting UDP streams in customized versions of the 802.11 design.

Offline

 

#5 2018-Aug-15 11:05:52

5g3
Member
Registered: 2018-Jun-14
Posts: 13

Re: implementing tftp on the reference design

Thank you, maybe I can be a little more specific, as I am still having some trouble with this.

I am interested in sending a simple UDP packet with just a “hello” string. This is to be done as an initial send without any packets received from the destination linux machine I am attempting to communicate with.

Specifically, to send “hello” as a udp packet to ip address: 192.168.0.158, port number 24002.

If possible, could you provide an example that does this?

When looking through the 802.11 reference design, I could not seem to find an example of sending an initial UDP packet without any receive packet information obtained first. What I would want to do is just send a simple message to a particular unicast port number, on a particular IP to my linux machine destination.

I am currently attempting the following:

1.     I configure the asynchronous socket like so: status = transport_config_socket(eth_dev_num, &(eth_devices[eth_dev_num].socket_async), unicast_port);
2.     I also update the sin_port and sin_addr as follows:
    ((struct sockaddr_in *)&eth_devices[eth_dev_num].async_sockaddr)->sin_port = Xil_Htons(24002);
    ((struct sockaddr_in *)&eth_devices[eth_dev_num].async_sockaddr)->sin_addr.s_addr = 0x9E00A8C0;
     memset(((struct sockaddr_in *)&eth_devices[eth_dev_num].async_sockaddr)->sin_zero, '\0',sizeof(((struct sockaddr_in *)&eth_devices[eth_dev_num].async_sockaddr)->sin_zero));
3.    I create a wlan_exp_ip_udp_buffer* send_buffer variable and call the socket_alloc_send_buffer() function.
4.    I populate send_buffer->offset[i] with hello characters with just a for loop for now.
5.    I call transport_send, passing for the socket index: eth_devices[eth_dev_num].socket_async, the sockaddr* to as the eth_device containing the sin_family, sin_port, and sin_addr.s_addr desired, and &send_buffer and 1 as the last two parameters.
6.    I  call socket_free_send_buffer upon completion

Last edited by 5g3 (2018-Aug-15 11:06:28)

Offline

 

#6 2018-Aug-16 09:23:11

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: implementing tftp on the reference design

We'll followup by email.

Offline

 

Board footer