Official TCP Full speed benchmark

Dependencies:   PicoTCP lpc1768-picotcp-eth mbed-rtos mbed

This project represents a the official TCP Full speed Benchmark for the PicoTCP library.

The mbed board is sending and receiving one Megabyte from/to the other side and we measure how fast it does that.

The result:
TX+RX Throughput: 2097152 bytes in 1 seconds (12.410)Mbits/s

The python script used (which you should rename it to

import sys, socket
import random, string
import select
from time import time
N_PACKETS = 1024

TOT_BITS = (LEN_PACKET * N_PACKETS * 8) * 2. # TX bits + RX bits
PACKET = ''.join(random.choice(string.ascii_uppercase+string.digits) for _ in range(LEN_PACKET))
MEGA = 1024 * 1024.
UPDATE_STEP = (N_PACKETS/20) # Make the update step such as one step = 5%
UPDATE_R_STEP = (N_PACKETS/100) #Make the update step such as one step = 1%
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
start = time()
rx_total = 0
tx_total = 0
data = ''
i = 0
lp = []
p = select.poll()
while(True): # keeping this in for robustness testing, when the test will run for days
	print "Started echoing data...."
	for i in range(N_PACKETS):
		if (i % UPDATE_STEP) == 0: print "%.2f%%" % (float(i)/float(N_PACKETS) * 100.)
		data = s.recv(LEN_PACKET)
		if (len(data) != LEN_PACKET):
			print "Error echoing !"

	print "Test was finished!"

t = time() - start
print "TX+RX Throughput: %d bytes in %d seconds (%.3f)Mbits/s" % (TOT_BITS / 8, t, ((TOT_BITS / t) / MEGA))

This test is based on the following libraries

Import librarylpc1768-picotcp-eth

A PicoTCP driver for the lpc1768 mbed board

Import libraryPicoTCP

Free (GPLv2) TCP/IP stack developed by TASS Belgium

Import librarymbed-rtos

Official mbed Real Time Operating System based on the RTX implementation of the CMSIS-RTOS API open standard.

Revision graph

The revision graph only works with JavaScript-enabled browsers.