RTOS UDP Performance Issue

jhinkle
Posts: 32
Joined: Tue Apr 19, 2016 12:09 am

RTOS UDP Performance Issue

Postby jhinkle » Thu Apr 28, 2016 12:37 am

I was hoping the ESP8266 would be a good UDP server to host receiving ACN messages - both unicast and multicast.

SDK - RTOS 1.4.0 - Dated 2/28/2016

My hope is that Espressif will review the information below and take action to address the concerns I will note in this post.

I am using a ESP12 for this testing.

I implemented code using the non-os SDK and the performance was terrible -- I could not receive a block of 2 messages without msg drop issues.


My code runs two tasks -- one receives the message from the core and the second task strips the data from the message and sends it out the SPI port.

A ACN message (full universe) is 638 bytes in size containing 512 bytes of data.

My SPI code is interrupt driven and pumps out the complete 512 bytes (plus packet headers) in about 700 usec (I'm using a 10mhz spi clock).

Performance using Released RTOS SDK

I use software that sends out my ACN messages every 50 msec. A burst of messages in the following examples range from 6 messages to 12 messages per burst.

This is a Wire shark view of my ACN messages (bust of 6 every 50 msec)

Image

You can see the time between each ACN message is about 60usec.

I've hooked a logic probe to the SPI's SS (Slave Select / chip select line) so each spi burst can be seen and the transmission of the complete 512 byte message can be seen.

This is what a single spi message packet looks like -- each separate burst is 64 bytes of data with the complete packet moving 512 bytes of data

Image

This is what the spi stream looks like over multiple busts of ACN messages. Each bust shown is a spi bust of 6 spi packets carring 512 bytes each. This is 6 ACN messages every 50 msec

Image

The code running is using the latest released RTOS SDK.

The released RTOS sdk will allow a burst of 6 ACN messages - every 50 msec - to run all day long and not drop a message.

I changed the ACN sending software to now send 7 ACN messages every 50msec. The pic below will show the the ESP core is dropping messages and is not capable of delivering all the messages in the stream to my application code.

Image

I have noted how many ACN messages are contained in the SPI stream shown. You can see the ESP core can not process 7 ACN messages arriving about 60 usec apart. The applicate code receives 6 or 7 of the messages as noted.

I increased the ACN message count to 8 messages per 50 msec burst.

The pic below shows the core is loosing/dropping more of the incoming messages.

Image

Lastly I increase the ACN message burst to 12 messages. As you con see -- the core is performing poorly.

Image

All of the tests above were sending unicast UDP messages.

Multicast (IGMP) could not be tested as the released RTOS SDK has an issue and can not receive multicast messages.

I found the following post related to IGMP and RTOS: http://bbs.espressif.com/viewtopic.php?f=66&t=1058

Espressif released 4 development libs to address the missing IGMP capability (see the link above -- the libs can be downloaded).

I recompiled my application with the 4 supplied libs and some things got better and some worst.

First: The ESP core now emits debug data ... Please REMOVE from the libs.

Image

Besides addressing the IGMP issue, Espressif improved the core performance related to NOT dropping messages.

I changed my ACN sending software to send bursts of 12 unicast messages every 50 msec.

As shown below .. the upgraded core handles them without error (except for the debug messages).

Image

THAT is GREAT -- Thank you.

How about multicast (IGMP)???? You would think the IGMP performance would be just a good --- WRONG!!!!

The pic below shows my ACN sending software sending burst of 12 multicast UDP messages every 50 msec.

Image

The new libs DO allow IGMP messages to be received but the capability is useless. As you can see -- the performance is terrible.

Please leave any comments about my testing.

I'm hoping Espressif will readdress the 4 development libs and remove the debug message "maxtime" and relook and the IGMP implementation.

Thank you.
Last edited by jhinkle on Fri Apr 29, 2016 6:14 am, edited 1 time in total.

jhinkle
Posts: 32
Joined: Tue Apr 19, 2016 12:09 am

Re: RTOS UDP Performance Issue

Postby jhinkle » Fri Apr 29, 2016 6:14 am

Espressif ... since the 4 libs mentioned in this post were made available in late 2015 and the latest release of the RTOS SDK (1.4.0) was released in Feb 2016 and did NOT include the intent of them, .... Are you going to incorporate the changes implemented in the 4 libs in a future RTOS release????

Thanks.

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: RTOS UDP Performance Issue

Postby ESP_Faye » Mon May 09, 2016 5:33 pm

Hi,

Sorry that IGMP is not included in the latest ESP8266_RTOS_SDK.

But we will add it in the future.

Thanks for your interest in ESP8266 !

User avatar
raspberrypidmx
Posts: 15
Joined: Wed Apr 27, 2016 6:15 am
Contact:

Re: RTOS UDP Performance Issue

Postby raspberrypidmx » Thu Oct 06, 2016 11:13 pm

I have the following working code with RTOS SDK 1.4.2 :

Code: Select all

void ICACHE_FLASH_ATTR handle_udp_join_group(void) {
   printf("handle_udp_join_group\n");

   struct ip_addr ipgroup;
   struct ip_info local_ip;

   const WIFI_MODE mode = wifi_get_opmode();

   if (mode & STATION_MODE) {
      wifi_get_ip_info(STATION_IF, &local_ip);
   } else {
      wifi_get_ip_info(SOFTAP_IF, &local_ip);
   }

   ipaddr_aton("239.255.0.1", &ipgroup);

   const uint8_t iret = igmp_joingroup(&local_ip.ip,(struct ip_addr *)(&ipgroup));

   if (iret != ERR_OK) {
      printf("Could not join\n");
   }

}


The full code can be found here -> https://github.com/vanvught/rpidmx512/t ... os_sdk_rpi

Who is online

Users browsing this forum: No registered users and 54 guests