WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#26 2013-Jul-08 15:26:10

truth
Member
Registered: 2013-May-29
Posts: 49

Re: OFDM reference design problem

Hi,

in warpnet.h i find a data structure: 
typedef struct {
    //Standard 14-byte Ethernet header (dest/src MAC addresses + EtherType)
    unsigned char dstAddr[6];
    unsigned char srcAddr[6];
    unsigned short ethType;
    //total number of bytes in pkt, including this header
    unsigned short pktLength;
    //number of warpnet structs that follow
    unsigned char numStructs;
    //Sequence number to match packets to ACKs
    unsigned char seqNum;
} warpnetEthernetPktHeader;

1) I think I can use this one to create ethernet frame but what is the numStructs(is it the payload)?   

2)you say I can create a valid  Ethernet frame(the information I am interest is regarded as payload) by modifying code but why you say I can`t when referring to custom payload ?

Offline

 

#27 2013-Jul-09 10:30:26

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

Re: OFDM reference design problem

1) That is the definition of the packet header for WARPnet, which contains more fields than a standard Ethernet header. You only need the first 14 bytes (dest MAC address, src MAC addres, EtherType) for plain Ethernet.

2) You can modify the ref design C code to create and send arbitrary Ethernet packets. The packets you create should start with a valid 14-byte Ethernet header, followed by whatever payload your application requires. The warpmac_prepPktToNetwork() and warpmac_startPktToNetwork() functions will be useful in sending the packet once you've prepared it in memory.

Offline

 

#28 2013-Jul-11 11:22:46

truth
Member
Registered: 2013-May-29
Posts: 49

Re: OFDM reference design problem

hi, thanks for your reply , this time I can successful transmit my packet via FPGA boards.
But I notice a strange phenomena, In wireShark,  the address for 10.0.0.5 appears to be d4:be:d9:70:88:99,  the address for 10.255.255.255(broadcasting) is ff:ff:ff:ff:ff:ff,   I do know these are in form of hex number,  but how do they related?  because d4 = 212,  it looks strange.

Offline

 

#29 2013-Jul-11 11:55:21

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

Re: OFDM reference design problem

One is an IP address, the other a MAC address. They are not supposed to represent the same value.

Offline

 

#30 2013-Jul-12 15:22:08

truth
Member
Registered: 2013-May-29
Posts: 49

Re: OFDM reference design problem

Hi murphpo,  some phenomena confuse me.

1)The packet I creat has the following structure,  the first six chars represent Mac address for the destination, then the next six represent Mac address for source, the next two representing ethernet type, and the remaining are for payload.  And it is also the way the Wireshark analyze it.

But it looks like the packets are generated from FPGA board and don`t transmit from one board to another via phy because the result is the same when just connecting one PC and one board via ethernet link instead of doing the bridge application.

2)What can I do with it in the function --datafromnetworklayer-callback?

3) As for Macframe,  if txFrame is defined as that tyoe,  I notice  txFrame.header.srcAddr is under type ---unsigned short int, I wonder will that be too short for mac address?

Offline

 

#31 2013-Jul-14 12:19:14

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

Re: OFDM reference design problem

Your post is very confusing.

Are you trying to generate a packet in the MicroBlaze C code and send it via Ethernet? Or are you trying to generate a packet in the C code and send it via the wireless MAC/PHY? These are entirely different processes.

I would urge you to study the flow of packets in the simplest example (nomac: Eth Rx -> MAC -> PHY Tx ----> PHY Rx -> MAC -> Eth Tx). Until you understand how this flow is implemented you will continue to have difficulty modifying the code for your application.

Offline

 

#32 2013-Jul-15 21:00:01

truth
Member
Registered: 2013-May-29
Posts: 49

Re: OFDM reference design problem

1)I a trying to generate a packet in C code and send it via wireless MAC/PHY,   and the bridge application involve two PCs and Ethernet links where I want to observe the packet via Wireshark.  I use the function prepPktToNetwork, and datafromnetworklayer and some others.  So the packet I creat will do the following flow :     Eth Rx -> MAC -> PHY Tx ----> PHY Rx -> MAC -> Eth Tx,  right?  If not,  so what does prepPktToNetwork use for?

2)Your code use a Macframe defined rxframe,  what is this for, how does it relate to txframe? I cant see.

Offline

 

#33 2013-Jul-15 21:57:41

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

Re: OFDM reference design problem

truth wrote:

1)I a trying to generate a packet in C code and send it via wireless MAC/PHY,   and the bridge application involve two PCs and Ethernet links where I want to observe the packet via Wireshark.  I use the function prepPktToNetwork, and datafromnetworklayer and some others.  So the packet I creat will do the following flow :     Eth Rx -> MAC -> PHY Tx ----> PHY Rx -> MAC -> Eth Tx,  right?  If not,  so what does prepPktToNetwork use for?

If you are creating a packet in the MicroBlaze C code, it will not flow through the Ethernet Rx path.

datafromnetworklayer_callback() deals with packets received from Ethernet.

prepPktToNetwork() is used to start a packet transfer to Ethernet.

This should be clear to you if you have followed my advice:

murphpo wrote:

I would urge you to study the flow of packets in the simplest example (nomac: Eth Rx -> MAC -> PHY Tx ----> PHY Rx -> MAC -> Eth Tx). Until you understand how this flow is implemented you will continue to have difficulty modifying the code for your application.

truth wrote:

2)Your code use a Macframe defined rxframe,  what is this for, how does it relate to txframe? I cant see.

Macframe is a struct used by the MAC code and WARPMAC framework to track information about Tx/Rx packets and their MAC headers. txframe is used to construct the header of an outgoing packet. rxframe is instantiated and passed to WARPMAC, which uses it when receiving frames and passing them back to user code for processing.

Offline

 

#34 2013-Jul-16 16:34:37

truth
Member
Registered: 2013-May-29
Posts: 49

Re: OFDM reference design problem

murphpo wrote:

Are you trying to generate a packet in the MicroBlaze C code and send it via Ethernet? Or are you trying to generate a packet in the C code and send it via the wireless MAC/PHY? These are entirely different processes.

Could you explain the difference between MicroBlaze C code for ethernet and the C code for wireless MAC/PHY ?

Offline

 

Board footer