WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2011-Mar-16 12:02:52

wj326_0
Member
Registered: 2010-Oct-14
Posts: 52

question about the Board-ID and IP-Address for WARP Board

hi murphpo,
i have three warp boards, and i have changed the code for csmamac.c, so now i can used them at the same time (for example: 2 boards to send packet to the third one at same time).

i have the following setup for the board-ID and the ip-address:
board-ID                  ip
      1                  10.0.0.1
      2                  10.0.0.2
      3                  10.0.0.3

i can ping them from each one board to another two boards. everything is ok.


but if i changed the ip address for one board, i will not able to ping this board from another two boards anymore:
board-ID                  ip
      1                  10.0.0.1
      2                  10.0.0.2
      3                  10.0.0.6 (from 10.0.0.3 to 10.0.0.6)

could you please tell me why?

because i think the board just use Board-ID (myID) to communicate with each ohter, they do not care the ip-address. the important thing is that these ip-address should on the same subnet, so i think i can set the ip-address for board-3 to 10.0.0.3 or to 10.0.0.6. or do i misunderstand anything about the Board-ID and IP-Address? must the board-id (1,2,3.....) match the last one number of the ip-address??
                  IP          Board-ID
              10.0.0.1-------1
              10.0.0.2-------2           
              10.0.0.3-------3
                 .............
                 .............
              10.0.0.9-------9

please help me out. thanks!

Offline

 

#2 2011-Mar-16 12:33:56

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

Re: question about the Board-ID and IP-Address for WARP Board

...i have changed the code for csmamac.c

It all depends on your changes. However you designed the mapping of IP address to node ID will determine whether your address changes will work. For example, if you used the last octet of the IP address as the node ID (we've done this for some experiments), then a node ID of 3 and IP address of x.x.x.6 won't work.

Offline

 

#3 2011-Mar-17 10:12:44

wj326_0
Member
Registered: 2010-Oct-14
Posts: 52

Re: question about the Board-ID and IP-Address for WARP Board

thanks for your tips!


could please tell me what is the return value for  u8* payloadData = (u8*)(warpphy_getBuffAddr(1)+NUM_HEADER_BYTES). i think the value 1 for function "warpphy_getBuffAddr(1)" means the "pktBuf_tx_DATA = 1" and the NUM_HEADER_BYTES = 24.

thanks

Last edited by wj326_0 (2011-Mar-23 07:21:14)

Offline

 

#4 2011-Mar-17 10:22:33

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

Re: question about the Board-ID and IP-Address for WARP Board

warpphy_getBuffAddr(N) will return the memory address of the PHY packet buffer at index N, for N=[0,31]. Your code configures which packets buffers are used for various PHY Tx and Rx events. In csmamac.c (as of refdes v16), for example, the PHY receives packets into buffer 1, transmits data packets from buffer 2 and ACK packets from buffer 3.

The code (u8*)(warpphy_getBuffAddr(1)+NUM_HEADER_BYTES) constructs a pointer to the first non-header byte of a packet in buffer 1. The rest of the code uses this pointer to access various bytes in the received packet. u8 is a datatype for unsigned 8-bit values (this is safer than 'unsigned char', which isn't guaranteed to be 8-bits on all architectures).

&payloadData[33] constructs a pointer to the byte at index 33 starting from payloadData. Dereferencing this pointer (*destNodePtr) reads this byte.

Offline

 

#5 2011-Mar-21 05:21:39

wj326_0
Member
Registered: 2010-Oct-14
Posts: 52

Re: question about the Board-ID and IP-Address for WARP Board

murphpo wrote:

warpphy_getBuffAddr(N) will return the memory address of the PHY packet buffer at index N, for N=[0,31]. Your code configures which packets buffers are used for various PHY Tx and Rx events. In csmamac.c (as of refdes v16), for example, the PHY receives packets into buffer 1, transmits data packets from buffer 2 and ACK packets from buffer 3.

The code (u8*)(warpphy_getBuffAddr(1)+NUM_HEADER_BYTES) constructs a pointer to the first non-header byte of a packet in buffer 1. The rest of the code uses this pointer to access various bytes in the received packet. u8 is a datatype for unsigned 8-bit values (this is safer than 'unsigned char', which isn't guaranteed to be 8-bits on all architectures).

&payloadData[33] constructs a pointer to the byte at index 33 starting from payloadData. Dereferencing this pointer (*destNodePtr) reads this byte.

hi murphpo,

many thanks for your kind help!! for now i always have a question about the right INDEX Number from received packet.
i got the right index number (12, 41, 33)  to access various bytes in the received packet from some example cod:
&payloadData[12] for packet type
&payloadData[41] for packet-type of ARP
&payloadData[33] for packset-type of IP
but how can i find the RIGHT INDEX to access various bytes in the received packet (from payloadDATA)? is there any paper about the byte-index from payloadDATA that i should read?  or what does the another byte-indexs from payloadDATA stand for?

Offline

 

#6 2011-Mar-21 05:50:57

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

Re: question about the Board-ID and IP-Address for WARP Board

Those indices are defined by the formats of the underlying packets. Everything on the wire has an Ethernet header, followed by some payload. If that payload is an IP or ARP packet, you can use the IP/ARP frame formats to figure out the offsets of particular fields in the payload.

Wikipedia has good articles on:
-Ethernet frame format
-IPv4 frame format
-ARP frame format

Offline

 

#7 2011-Mar-21 08:37:59

wj326_0
Member
Registered: 2010-Oct-14
Posts: 52

Re: question about the Board-ID and IP-Address for WARP Board

murphpo wrote:

Those indices are defined by the formats of the underlying packets. Everything on the wire has an Ethernet header, followed by some payload. If that payload is an IP or ARP packet, you can use the IP/ARP frame formats to figure out the offsets of particular fields in the payload.

Wikipedia has good articles on:
-Ethernet frame format
-IPv4 frame format
-ARP frame format

thanks, it is very helpful for me!

i have three boards (two as transmitters, ons as receiver). so if the medium is busy,  the third board should better wait for a NAV duration. i am using OFDM reference v15 and i have read something about the timing of DATA-ACK-DATA exchange for csmamac.c with following link:
http://warp.rice.edu/trac/wiki/OFDMRefe … tions/CSMA 

i think the NAV duration = period of DATA(QPSK:1048 us) + TAT (turnaround between data and ACK: 14us) +  period of ACK (QPSK: 64 us)
                                   = 1048 + 14 + 64
                                   = 1126 us

but i am not sure about the result, because the timing of DATA-ACK-DATA exchange in that link is for OFDM reference v14, are those timing still right for OFDM reference v15? or.........

i just want to know the period of DATA(QPSK), TAT (turnaround between data and ACK) and period of ACK (QPSK) to build the right NAV duration.

Offline

 

#8 2011-Mar-22 06:26:46

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

Re: question about the Board-ID and IP-Address for WARP Board

The timing of v14 and v15 are the same (at least, I think so; nothing major changed timing-wise between these designs, but I haven't measured them directly).

Offline

 

Board footer