I spent this week measuring the TCP performance of the CORS program. We wanted to know how fast can the board actually perform from a network perspective. I collected data on multiple parameters that I’ve determined to have a considerable impact on speed. I was appalled to find out that the PIC32 was reading data from the network at around 560 Kbit/sec, and after testing, I managed to improve it to 30 Mbit/sec.

For my trials I used iperf and curl:

iperf -c <IP> -i 2 -m

This will run the test for 10 seconds, showing the average bandwidth. This allowed me to test the performance of a non-CORS server for the sake of comparison, but for CORS I had to use curl:

curl -vki -X <CORS Operation> -o /dev/null  -s -w "%{time_total}\n\r" <IP> | tee -a <output file>

This will allow you to see the exact time taken for the command. The result will be saved in the specified file.

Curl actually shows you a progress bar with various network information. However if curl detects an output on the terminal, the progress bar won’t show. If you curl without the -v option and save the output to a file you should be able to see it.

Since we now know how the graph trend looks like for each parameter, we can optimize memory usage while maintaining desirable speed. E.g. RX socket read buffer is up to a maximum of 512 bytes at a time. However, after testing I noticed that the parameter can be halved to 256 bytes while maintaining the same performance, but any less and performance is traded off.

End of my internship

I honestly feel as if I’ve started last week. I still remember my first week vividly, meeting and saying farewell to my senior Sina, who was in his last week at the time and from whom I’ve taken over this project. These past 3 months went by so quickly, but you really can’t blame my sense of time. Every single day there is something to learn and/or attempt plus the occasional event with Dr. Shawn. I consider myself very lucky. I got to meet many great people, and I’d like to thank them all for making this internship very memorable.

  • To new interns, grab a pen and paper when Dr. Shawn is talking to you. That shit you won’t find online fam.
  • To the current interns at the office, you’re all pussies, except Soo Yee.
  • To Dr. Shawn, thank you for repeating yourself however many times I needed, and for teaching me the right way to do things. You’re genuinely one of the coolest people I’ve met.

Best of luck to all of you.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.