Maximum data throughput on a link in the WiSense LPWMN

WiSense CC1101 based nodes are configured to operate at a physical data rate of 38383 bps (bits per second). How many MAC PDUs per second does this translate to assuming each MAC PDU needs to be acknowledged by the receiver ?

Let us calculate the time taken to transmit one maximum sized PHY PDU. The CC1101 transmit and receive FIFOs are 64 bytes each. The maximum MAC PDU which can be sent/received is only 61 bytes. The CC1101 is configured to send a 4 byte preamble and 4 byte SYNC word. This is followed by the MAC PDU. The last 2 bytes contain the CRC calculated over the MAC PDU.

data_phy_pdu

.

.

.

.

.

At 38383 bps, this PHY PDU of total length 71 bytes (containing the data frame) will take 14.798 milli-seconds to transmit.

Now let us look at the PHY PDU containing the acknowledgment frame sent by the data frame’s recepient.

ack_phy_pdu

.

.

.

.

.

At 38383 bps, the PHY PDU (of length 22 bytes) containing the MAC acknowledgment packet will take  4.585 milli-seconds to transmit.

CSMA/CA backoffs can randomly vary between 0 to a maximum of 133  milli-seconds (at 38383 bps). Let us ignore CSMA/CA delay in our calculation.

Ignoring the CC1101 turn around (tx -> rx and rx -> tx) time, the max throughput (in packets) should be 1000 / (14.798 + 4.585). This comes out to 51.6 packets per second. Data throughput (in bps) is then 51.6 * 51 * 8 -> 21052 bps.

I then got some actual numbers by configuring an FFD to continuously send data packets to the coordinator. FFD will send one data packet, get the acknowledgment and then send the next data packet. I disabled CSMA/CA on the FFD before running the test.  I got 15 packets per seconds which is far less than the theoretical max of 51.6 packets/second. My calculation of 51.6 packets/second assumed that the time by the MSP430 to run all the code involved in the test would be negligible (in microseconds) and the UART on the LPWMN coordinator would be able to send all the packets (received from the FFD) to the application running on the laptop (to which the coordinator was connected). One simple mistake was that the UART was configured to operate at just 9600 bps while the data traffic rate in this test is 21052 bps. I increased the UART baud rate to 38400 bps.

Then I did some profiling using a logic analyzer (to get the time taken for the involved code sections to execute using couple of GPIOs on the MSP43) which turned up some surprising results. Code execution was taking a significant time. I made some more changes.

  • One change was to increase the MSP430 operating frequency from 8 MHz to 16 MHz.
  • The second change was to change the SPI bus operating frequency from 0.5 MHz to 8 MHz. Note that the MSP430 communicates with the radio chip (CC1101) over the SPI bus. when the SPI bus is operated at 0.5 MHz, it will take almost 1 millisecond to transfer a packet of (max allowed) size 61 bytes from the MSP430 to the CC1101 or vice versa. When operated at 8 MHz, the same packet will take 62 micro-seconds.

I repeated the traffic test.  This time I got 35 packets per second.  There is more work to be done. I see some inefficiency in the function which reads received data packets from the CC1101’s receive FIFO. I will have another post (or more) on my way to the target (51 packets per second).

I have a pic of the gateway app (running on a laptop under Cygwin) receiving data packets (sent by the FFD via the LPWMN coordinator).

traff_pic

Posted on December 30, 2014, in Uncategorized. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: