1/1

|
regarding udp/ip
by umairsiddiqui on Jul 5, 2010 |
umairsiddiqui
Posts: 21 Joined: Aug 13, 2005 Last seen: Oct 1, 2011 |
||
|
Hi,
i'm trying to use udp/ip core in my application. in this particular application i'm using udp core as fast link for downloading data into the external RAM, so the transmission is only from PC to FPGA. I don't need to transmit any thing from FPGA. For transmission from PC i'm using winsock (PC is running windows XP), the main packet sending logic is following:
char pkt[] = {11, 22, 33, 44, 55};
size_t pkt_length = sizeof(pkt)/sizeof(pkt[0]);
sockaddr_in dest;
sockaddr_in local;
WSAData data;
WSAStartup( MAKEWORD( 2, 2 ), &data );
local.sin_family = AF_INET;
local.sin_addr.s_addr = inet_addr( "192.168.0.12" );
local.sin_port = 8088; // choose any
dest.sin_family = AF_INET;
dest.sin_addr.s_addr = inet_addr( "192.168.0.11" );
dest.sin_port = htons( 8080 );
// create the socket
SOCKET s = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
// bind to the local address
bind( s, (sockaddr *)&local, sizeof(local) );
// send the pkt
int ret = sendto( s, pkt, pkt_length, 0, (sockaddr *)&dest, sizeof(dest) );
In FPGA, the receiving logic simply checks the dst-ip address, picks the data from UDP datagram. I also set the ARP cache as mentioned in paper: arp -s 192.168.0.11 00-18-1D-27-12-98 However there is no transmission from PC at all, I checked this from Wireshark. When i use the same program to send packets to another PC, i don't have any issue (Wireshark show that packets were transmitted). Please help! |
|||
|
RE: regarding udp/ip
by vanepp on Jul 6, 2010 |
vanepp
Posts: 4 Joined: Sep 4, 2009 Last seen: Jul 6, 2010 |
||
|
local.sin_addr.s_addr = inet_addr( "192.168.0.12" );
In FPGA, the receiving logic simply checks the dst-ip address, picks the data from UDP datagram. I also set the ARP cache as mentioned in paper: arp -s 192.168.0.11 00-18-1D-27-12-98The arp should be 192.168.0.12 (not 192.168.0.11) as that is the IP you are trying to get to and presumably the MAC 00-18-1D-27-12-98 is the FPGA board (if it isn't you need to replace it with the MAC of the FPGA board). The PC has no route to 192.168.0.12 as it isn't in the arp table which is why it doesn't transmit anything. Since the FPGA presumably doesn't respond to arp you need to manually add its IP and MAC address to the arp table of any machine that wants to get there. |
|||
1/1

