WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#26 2013-Jun-20 22:46:32

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

Re: new cognitive MAC protocol

CSMAMAC would be the natural starting point for adding RTS/CTS. You would need to define extra header fields for the duration value so other nodes overhearing the RTS could update their NAVs. But the underlying carrier sensing / deferring behaviors would be the same as in CSMAMAC.

Offline

 

#27 2013-Jun-21 10:39:51

taherchan
Member
Registered: 2013-Apr-01
Posts: 31

Re: new cognitive MAC protocol

thank you for answering.

When you say  " they could update their NAV", which fuction handles the NAV. And to calculate the transmission period that other nodes have to wait we need the length of packets  and i think it is the "Xuint32 length" and we need the bit rate. So how many bits are we sending per TIMERCLK_CYCLES_PER_USEC using QAM16 or QPSK (or is there other solution to calculate the NAV).  Also i want to make some changes to cogmac, like to ask to change channel when there is a transmission in that one, so is there any function to notice  SNR changes .
I am using  reference design 18.

Thank you

Offline

 

#28 2013-Jun-21 13:51:03

taherchan
Member
Registered: 2013-Apr-01
Posts: 31

Re: new cognitive MAC protocol

Hi,

Also can i do sensing for a specific time that i choose.

Thank you for help

Offline

 

#29 2013-Jun-21 15:56:15

chunter
Administrator
From: Mango Communications
Registered: 2006-Aug-24
Posts: 1212

Re: new cognitive MAC protocol

There is no NAV in the OFDM Reference Design. You'll have to build your own mechanism for holding the warp_timer in an effective "busy" period following the reception of RTS and CTS packets. Modifying the warp_timer system generator core is probably the best way to do this. You could build some simple logic that would prevent an "idle for DIFS" event as long as a counter is running. You could then start that counter from C-code after receiving an RTS or CTS.

Offline

 

#30 2013-Jun-25 09:08:06

taherchan
Member
Registered: 2013-Apr-01
Posts: 31

Re: new cognitive MAC protocol

Thank you for answering.

So, this is the best way to create the counter. but for the duration of the counter: I want to know the data rate (in RF design 18), to know how longer a node will wait for others to finish their transmission.
And concerning the sensing for specific duration, is it possible? because in csmaca when we have a packet to send we sense the carrier in that moment. And what i want to do is sensing for a specific duration and after that sending packets.

Thank you

Offline

 

#31 2013-Jun-25 16:29:44

chunter
Administrator
From: Mango Communications
Registered: 2006-Aug-24
Posts: 1212

Re: new cognitive MAC protocol

The rates are

{BPSK 1/2, BPSK 2/3, BPSK 3/4, BPSK Full} = {3Mbps, 4Mbps, 4.5Mbps, 6Mbps}

{QPSK 1/2, QPSK 2/3, QPSK 3/4, QPSK Full} = {6Mbps, 8Mbps, 9Mbps, 12Mbps}

{16-QAM 1/2, 16-QAM 2/3, 16-QAM 3/4, 16-QAM Full} = {12Mbps, 16Mbps, 18Mbps, 24Mbps}

(These are basically half of the equivalent rates in Wi-Fi since the OFDM Reference Design runs at 10MHz instead of 20MHz)

As far as sensing for a duration, yes, this is possible and this is how CSMAMAC currently works. The code for warpmac_carrierSense() is not for an instantaneous measurement of the channel -- it asks the PHY core running in the FPGA if the medium has been continuously idle for a DIFS period. That core is responsible for monitoring the state of the medium at all times. The code just checks the state of that core at certain points.

Offline

 

#32 2013-Jun-26 11:01:47

taherchan
Member
Registered: 2013-Apr-01
Posts: 31

Re: new cognitive MAC protocol

Thank you for your help.

After looking to warpproject.org/trac/wiki/OFDM/MIMO/Docs/PHYDetails/FrameFormat , if i want to calculate the transmission time that a packet will take over the air, it is equal to  transmission time of fixed preamble + transmission time of training symbol + transmission time of header(The 2 byte header and 4 byte packet checksums) at base rate + transmission time of payload at full rate. With the informations above we can calculate transmission time of header at base rate + transmission time of payload at full rate right? So concerning the other two times how do we calculate them?
And for the sensing, for example if I want to do sensing for 100 µs , what do I have to change? Do I have to change the DIFS  period only, or something else?

Thank you

Offline

 

#33 2013-Jun-26 14:35:27

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

Re: new cognitive MAC protocol

You can calculate the duration of any transmission as:
T_preamble + T_sym * (N_train + N_base + N_full)

T_preamble = 32usec (160 samples of STS, 160 samples of LTS)
T_sym = 8usec (64 subcarriers + 16 cyclic prefix samples)

N_train = 2 by default
N_base = 4 by default (assuming 24-byte header at mod/code of QPSK 1/2)

N_full depends on the payload size:
  N_full = ceil( (N_payloadBytes + N_crcBytes) / N_DBPS)
  N_crcBytes = 4, for the auto-appended 32-bit checksum
  N_DBPS number of data (pre-coding) bytes per OFDM symbol:

Code:

Mod    Code  N_DBPS
BPSK   1/2   3
BPSK   2/3   4
BPSK   3/4   4.5
BPSK   1     6

QPSK   1/2   6
QPSK   2/3   8
QPSK   3/4   9
QPSK   1     12

16QAM  1/2   12
16QAM  2/3   16
16QAM  3/4   18
16QAM  1     24

Offline

 

#34 2013-Jun-26 15:09:17

taherchan
Member
Registered: 2013-Apr-01
Posts: 31

Re: new cognitive MAC protocol

Thank you for these clarifications.

And about my question "And for the sensing, for example if I want to do sensing for 100 µs , what do I have to change? Do I have to change the DIFS  period only, or something else?"

Thank for your help

Offline

 

#35 2013-Jun-26 17:06:28

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

Re: new cognitive MAC protocol

What do you mean by sensing? The carrier sensing logic is continuously measuring the RSSI and uses this to start/reset the DIFS timer.
CSMAMAC requires the medium be idle for a full DIFS + random number of slots before starting a new transmission.

Offline

 

#36 2013-Jun-26 21:39:41

taherchan
Member
Registered: 2013-Apr-01
Posts: 31

Re: new cognitive MAC protocol

Thank your for answering

What i want to do for example is making a node to do sensing on a channel for 100 µs, and if  there is a transmission from another node in that channel, the node will detected and hop to another one.

Thank you

Offline

 

#37 2013-Jun-27 09:18:57

chunter
Administrator
From: Mango Communications
Registered: 2006-Aug-24
Posts: 1212

Re: new cognitive MAC protocol

There are many ways to accomplish this behavior. One such way would be to build the sensing apparatus in System Generator so that a C software project and simply read a register that would tell it if the System Generator core saw any energy in the last 100µs. This is basically how the PHY works now when it is sensing for a DIFS period. I'd suggest pulling up the PHY model and understanding how the DIFS system works, since what you want to build is very similar.

Offline

 

#38 2013-Jun-27 21:43:16

taherchan
Member
Registered: 2013-Apr-01
Posts: 31

Re: new cognitive MAC protocol

Thank you for answering.

I want to stay a little bit away from the System Generator because i don't know a lot about it, so i want, if it is possible, only coding in c.
So I will look deeper in the DIFS system.
I have another question. For example after the NAV timer, how can I set the node to idle mode, what function can i use?

Offline

 

#39 2013-Jul-04 16:43:44

taherchan
Member
Registered: 2013-Apr-01
Posts: 31

Re: new cognitive MAC protocol

Hi everyone

What function can i use to put a node in a idle node, can I use warpmac_disableDataFromNetwork() (This will stop the node from taking data form ethernet Am I right)?
Also, I want to display the ack packets and the packets that i create with  wireshark. Packets that i create are like ack and contain only a header (lenght= NUM_HEADER_BYTES), So what i have done is: when receiving these packets I added this :
                               
if(shouldSend) warpmac_prepPktToNetwork((void *)warpphy_getBuffAddr(pktBuf_rx), NUM_HEADER_BYTES);
warpmac_finishPhyXmit();
if(shouldSend) warpmac_startPktToNetwork(NUM_HEADER_BYTES);

But it did not work. Do I have something wrong?

Thank you for help

Offline

 

#40 2013-Jul-04 22:59:59

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

Re: new cognitive MAC protocol

can I use warpmac_disableDataFromNetwork() (This will stop the node from taking data form ethernet Am I right)?

Yes.

Also, I want to display the ack packets and the packets that i create with  wireshark. Packets that i create are like ack and contain only a header (lenght= NUM_HEADER_BYTES), So what i have done is: when receiving these packets I added this :
                               
if(shouldSend) warpmac_prepPktToNetwork((void *)warpphy_getBuffAddr(pktBuf_rx), NUM_HEADER_BYTES);
warpmac_finishPhyXmit();
if(shouldSend) warpmac_startPktToNetwork(NUM_HEADER_BYTES);

But it did not work. Do I have something wrong?

What does "did not work" mean? Did you observe an Ethernet packet in Wireshark after that code runs? That code will put the first 24 bytes from buffer pktBuf_rx on the wire. These bytes do not form a valid Ethernet header. You may be able to see this (invalid) Ethernet packet in Wireshark if you capture in promiscuous mode. If you want to create Ethernet frames with arbitrary payloads you need to pre-pend the standard 14-byte Ethernet header.

Offline

 

#41 2013-Jul-05 11:17:51

taherchan
Member
Registered: 2013-Apr-01
Posts: 31

Re: new cognitive MAC protocol

Thank you for answering.

NUM_HEADER_BYTES which is 24 bytes represents the length of the header added to the packets right? So if I want to observe ACK packets(which have only a header), my portion of code is correct right?
I am working with wireshark on windows and as I said i did not observe these packets. I am not sure if  I am in promiscuous mode (and i don't know if i am able to do it on windows). But with the NoMAC i was able to observe the dummy packets.
I will try to set that and I will let you know.

Thank you for help

Offline

 

#42 2013-Jul-05 12:53:57

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

Re: new cognitive MAC protocol

Any packet you send to Ethernet should have an Ethernet header. The code you posted above will send a 24 byte Ethernet packet with no header.

Offline

 

#43 2013-Jul-05 15:17:01

taherchan
Member
Registered: 2013-Apr-01
Posts: 31

Re: new cognitive MAC protocol

Thank you for answering
ack packets are created like that:

//Create a template ACK packet
    templatePkt.header.fullRate = pktFullRate;
    templatePkt.header.codeRate = pktCodeRate;
    templatePkt.header.length = 0;
    templatePkt.header.srcAddr = (unsigned short)(NODEID_TO_ADDR(myID));
    templatePkt.header.pktType = PKTTYPE_ACK;

So there is no payload, only a header. I added This portion of code after receiving the ack paquet

if(shouldSend) warpmac_prepPktToNetwork((void *)warpphy_getBuffAddr(pktBuf_rx), NUM_HEADER_BYTES);
warpmac_finishPhyXmit();
if(shouldSend) warpmac_startPktToNetwork(NUM_HEADER_BYTES);


So with this, will it be possible to send the whole ack over ethernet and to observe it in wireshark

Offline

 

#44 2013-Jul-05 16:19:22

chunter
Administrator
From: Mango Communications
Registered: 2006-Aug-24
Posts: 1212

Re: new cognitive MAC protocol

We are going in circles-- No, that will not send a valid Ethernet frame to your computer because the bytes at pktBuf_rx do not have a valid Ethernet header. They might show up in wireshark, but as malformed Ethernet frames. You may need to manually construct an Ethernet header into a separate area of memory, then copy your ACK packet after that header and then do the prepPktToNetwork.

Offline

 

#45 2013-Jul-08 10:48:35

taherchan
Member
Registered: 2013-Apr-01
Posts: 31

Re: new cognitive MAC protocol

Thank yo for answering.

I understood the fact that is not a valid ethernet frame. As a first step, what i wanted to do is only to observe that the PC is receiving ACK packet created in the code.

Thank you again for your help

Offline

 

Board footer