WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2010-Apr-30 06:32:40

jitin.bajaj
Member
Registered: 2009-May-01
Posts: 17

Dest Addr Extraction at PHY

Hi,

I need to extract Destination IP address at MAC level on WARP. For this I added the following code in phyRx_goodHeader_handler()

Code:

unsigned int buffAddr, dAddr, dhostAddr =0;
buffAddr = warpphy_getBuffAddr(controlStruct.pktBuf_phyRx);
dAddr = XIo_In32(buffAddr+54);
dhostAddr = (dAddr & 0x000000FF);
xil_printf("The dest addr is : %d\r\n", dhostAddr);

This code works fine and prints the destination IP whenever we ping the other node. But whenever we are not pinging it is printing some random values
like
37
155
255
0

Can you please tell why such values are printed when we are not sending any data?

Offline

 

#2 2010-Apr-30 09:00:53

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

Re: Dest Addr Extraction at PHY

That code will print the 54th byte of every received packet. That byte is only part of an IP address when the packet is an IP packet. Run Wireshark on the attached PC and you'll see lots of non-IP traffic being generated by the OS and other apps. One solution would be to check the EtherType field of each packet in your code to filter out non-IP packets.

Offline

 

Board footer