Main Site Documentation

G400 SSL performance


#1

Hi,
I am a new member of the community.
I am developing an interface https to a central alarm.
I currently use the mainboard Fez Cobra II, but SSL is very slow, a simple request / response that in http takes less than 1 second in https takes 5 seconds.
I would like to know how much performance would improve using a Fez Raptor.

thanks in advance
Luca


#2

G400 is about 20 to 30 times faster than EMX/G120. I am not sure how much faster is SSL but I am sure it is many times faster.

Welcome to the community.


#3

With what test? Probably small packets as it should be a lot faster.


#4

I suspect the throughput rate of the ENC28 will become the bottleneck before the processor on the G400.


#5

agree


#6

With Fez cobra 2 an http request that return json data takes 1 second, in https the sane request takes 5 seconds.
The bottleneck seems to be SSL hadshaking and crypt/decrypt.
Would be useful a ssl speed test between g120 e g400.


#7

ENC28


#8

I have implemented WebServer with Networking Toolkit Micro HttpServer (Michael Swartz).
When running the httpserver in SSL it works fine, but VS2012 output view displays several SocketException (probably during the SSL handshaking), is this normal? or would it be better to use HttpListener?


#9

Sorry for the delay, here is the list of exceptions with SSL.

The thread ‘’ (0x3) has exited with code 0 (0x0).
#### Exception System.Net.Sockets.SocketException - CLR_E_FAIL (9) ####
#### Message:
#### Microsoft.SPOT.Net.Security.SslNative::SecureAccept [IP: 0000] ####
#### Microsoft.SPOT.Net.Security.SslStream::Authenticate [IP: 0045] ####
#### Microsoft.SPOT.Net.Security.SslStream::AuthenticateAsServer [IP: 000d] ####
#### Microsoft.SPOT.Net.Security.SslStream::AuthenticateAsServer [IP: 0008] ####
#### MFToolkit.Net.Web.HttpProcessor::ProcessRequest [IP: 00be] ####
#### SocketException ErrorCode = 5
#### SocketException ErrorCode = 5
A first chance exception of type ‘System.Net.Sockets.SocketException’ occurred in Microsoft.SPOT.Net.Security.dll
#### Exception System.Net.Sockets.SocketException - CLR_E_FAIL (10) ####
#### Message:
#### Microsoft.SPOT.Net.Security.SslNative::SecureAccept [IP: 0000] ####
#### Microsoft.SPOT.Net.Security.SslStream::Authenticate [IP: 0045] ####
#### Microsoft.SPOT.Net.Security.SslStream::AuthenticateAsServer [IP: 000d] ####
#### Microsoft.SPOT.Net.Security.SslStream::AuthenticateAsServer [IP: 0008] ####
#### MFToolkit.Net.Web.HttpProcessor::ProcessRequest [IP: 00be] ####
#### SocketException ErrorCode = 5
#### SocketException ErrorCode = 5
A first chance exception of type ‘System.Net.Sockets.SocketException’ occurred in Microsoft.SPOT.Net.Security.dll
#### SocketException ErrorCode = 5
#### SocketException ErrorCode = 5
#### SocketException ErrorCode = 5
#### SocketException ErrorCode = 5
#### SocketException ErrorCode = 5
#### SocketException ErrorCode = 5
3 worker threads (0.0.0.0:81)
#### SocketException ErrorCode = 5
A first chance exception of type ‘System.Net.Sockets.SocketException’ occurred in System.Net.Security.dll
#### SocketException ErrorCode = 5
A first chance exception of type ‘System.Net.Sockets.SocketException’ occurred in System.Net.Security.dll
#### SocketException ErrorCode = 5
#### SocketException ErrorCode = 5
#### SocketException ErrorCode = 5
The thread ‘’ (0x9) has exited with code 0 (0x0).
2 worker threads (0.0.0.0:81)
#### SocketException ErrorCode = 5
The thread ‘’ (0xa) has exited with code 0 (0x0).
ProcessRequest: Request /
The thread ‘’ (0xb) has exited with code 0 (0x0).
1 worker threads (0.0.0.0:81)
ProcessRequest: Request /LoginPage
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
The thread ‘’ (0xc) has exited with code 0 (0x0).
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
#### Exception System.Net.Sockets.SocketException - CLR_E_FAIL (13) ####
#### Message:
#### Microsoft.SPOT.Net.Security.SslNative::SecureRead [IP: 0000] ####
#### Microsoft.SPOT.Net.Security.SslStream::Read [IP: 0040] ####
#### MFToolkit.Net.Web.HttpRequest::Read [IP: 0066] ####
#### MFToolkit.Net.Web.HttpProcessor::ProcessRequest [IP: 0107] ####
#### SocketException ErrorCode = 10060
#### SocketException ErrorCode = 10060
A first chance exception of type ‘System.Net.Sockets.SocketException’ occurred in Microsoft.SPOT.Net.Security.dll
#### SocketException ErrorCode = 10060
#### SocketException ErrorCode = 10060
1 worker threads (0.0.0.0:81)
The thread ‘’ (0xd) has exited with code 0 (0x0).
1 worker threads (0.0.0.0:81)
ProcessRequest: Request /LoginPage
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
The thread ‘’ (0xe) has exited with code 0 (0x0).
1 worker threads (0.0.0.0:81)
ProcessRequest: Request /Default
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
The thread ‘’ (0xf) has exited with code 0 (0x0).
1 worker threads (0.0.0.0:81)
2 worker threads (0.0.0.0:81)
ProcessRequest: Request /home.html
2 worker threads (0.0.0.0:81)
ProcessRequest: Request /js/menu-verticale.js
The thread ‘’ (0x10) has exited with code 0 (0x0).
The thread ‘’ (0x11) has exited with code 0 (0x0).
1 worker threads (0.0.0.0:81)
2 worker threads (0.0.0.0:81)
3 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
ProcessRequest: Request /services/GetAuxOutList.lsx
ProcessRequest: Request /services/GetBreakdownList.lsx
ProcessRequest: Request /services/GetAreaList.lsx
ProcessRequest: Request /services/GetSabotageList.lsx
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)
4 worker threads (0.0.0.0:81)


#10

I open a issue on mftoolkit website.


#11

Having received no response from MFToolkit developer, I modified the source code of the class httpserver and now seems to work better, no exception timeout.

Here’s the change:
_listenSocket.SendTimeout = 20000;
_listenSocket.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, 20000);
_listenSocket.SetSocketOption (SocketOptionLevel.Tcp, SocketOptionName.NoDelay, true);

The only exceptions that are thrown are
SocketException ErrorCode = 5
"The certificate revocation list signature could not be decrypted."
“the CRL signature could not be decrypted: this means That the actual signature value could not be determined rather than it not matching the expected value. Unused.”

It is not a fatal error because the application works fine, but I would like to fix it.

Here is the log:

Program Started
The thread ‘’ (0x3) has exited with code 0 (0x0).
#### Exception System.Net.Sockets.SocketException - CLR_E_FAIL (9) ####
#### Message:
#### Microsoft.SPOT.Net.Security.SslNative::SecureAccept [IP: 0000] ####
#### Microsoft.SPOT.Net.Security.SslStream::Authenticate [IP: 0045] ####
#### Microsoft.SPOT.Net.Security.SslStream::AuthenticateAsServer [IP: 000d] ####
#### Microsoft.SPOT.Net.Security.SslStream::AuthenticateAsServer [IP: 0008] ####
#### MFToolkit.Net.Web.HttpProcessor::ProcessRequest [IP: 00be] ####
#### SocketException ErrorCode = 5
#### SocketException ErrorCode = 5
A first chance exception of type ‘System.Net.Sockets.SocketException’ occurred in Microsoft.SPOT.Net.Security.dll
#### Exception System.Net.Sockets.SocketException - CLR_E_FAIL (10) ####
#### Message:
#### Microsoft.SPOT.Net.Security.SslNative::SecureAccept [IP: 0000] ####
#### Microsoft.SPOT.Net.Security.SslStream::Authenticate [IP: 0045] ####
#### Microsoft.SPOT.Net.Security.SslStream::AuthenticateAsServer [IP: 000d] ####
#### Microsoft.SPOT.Net.Security.SslStream::AuthenticateAsServer [IP: 0008] ####
#### MFToolkit.Net.Web.HttpProcessor::ProcessRequest [IP: 00be] ####
#### SocketException ErrorCode = 5
#### SocketException ErrorCode = 5
A first chance exception of type ‘System.Net.Sockets.SocketException’ occurred in Microsoft.SPOT.Net.Security.dll
#### SocketException ErrorCode = 5
#### SocketException ErrorCode = 5
#### SocketException ErrorCode = 5
#### SocketException ErrorCode = 5
#### SocketException ErrorCode = 5
#### SocketException ErrorCode = 5
3 worker threads (0.0.0.0:81)
#### SocketException ErrorCode = 5
A first chance exception of type ‘System.Net.Sockets.SocketException’ occurred in System.Net.Security.dll
#### SocketException ErrorCode = 5
A first chance exception of type ‘System.Net.Sockets.SocketException’ occurred in System.Net.Security.dll
#### SocketException ErrorCode = 5
3 worker threads (0.0.0.0:81)
#### SocketException ErrorCode = 5
#### SocketException ErrorCode = 5
The thread ‘’ (0x9) has exited with code 0 (0x0).
#### SocketException ErrorCode = 5
The thread ‘’ (0xa) has exited with code 0 (0x0).
1 worker threads (0.0.0.0:81)
ProcessRequest: Request /
The thread ‘’ (0xb) has exited with code 0 (0x0).
1 worker threads (0.0.0.0:81)
ProcessRequest: Request /LoginPage
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
1 worker threads (0.0.0.0:81)
The thread ‘’ (0xc) has exited with code 0 (0x0).
1 worker threads (0.0.0.0:81)
ProcessRequest: Request /js/jquery-1.10.2.min.js
1 worker threads (0.0.0.0:81)
The thread ‘’ (0xd) has exited with code 0 (0x0).


#12

I sent the change on the MFToolkit site