Topic: DTLS under Windows

Hi guys,
I'm trying to write a client-server application under Windows 8, using DTLS protocol.
The server has to support multiple clients connecting to the same UDP port. I have set AES-128 encryption.
My starting point was the example provided in the two file server-dtls-threaded.c and client-dtls.c under the repository. I've just modified those file in order to make them compatible with Winsock32 and the Windows API for thread management. You can find attached both file modified by me.
Notice that the line with:

                    res = setsockopt(args->activefd, SOL_SOCKET, SO_REUSEPORT, &on, len);

has been removed on the server because Winsock32 doesn't support the  SO_REUSEPORT option.
With these file, the clients are not able to complete the connection, beacuse the related threads on the server are created but they remains blocked in the function:

wolfssl_accept

I'm not able to understand why. Please, could you help me?

Post's attachments

DTLS.zip 4.71 kb, 3 downloads since 2015-07-09 

You don't have the permssions to download the attachments of this post.

Share

Re: DTLS under Windows

Hi ciruzzo,

I am currently exploring what the issue might be here. If windows does not support SO_REUSEPORT have you considered using the client-dtls-nonblocking in conjunction with the normal server-dtls?

The reason I ask is the non-blocking client will continue to attempt to write until it succeeds and the normal server-dtls runs in an infinite loop just watching for messages on the open socket. Due to the nature of DTLS potentially infinite clients could connect to the server-dtls and send a message/get a response from the server. The server would eventually get the Datagrams out of the file descriptor when it looped back around and handle each request in turn.

Kind Regards,

Kaleb

Re: DTLS under Windows

Hi again ciruzzo,

Just as a follow up we are curious what your project entails. We ask because DTLS is a beast in and of it's own. Furthermore multi-threading in DTLS is a problem not easily solved. It has peaked both mine, and others interests here at wolfSSL and we'd enjoy further information regarding your project motivation.

Kind Regards,

Kaleb

Re: DTLS under Windows

Kaleb wrote:

Hi ciruzzo,
I am currently exploring what the issue might be here. If windows does not support SO_REUSEPORT have you considered using the client-dtls-nonblocking in conjunction with the normal server-dtls?
The reason I ask is the non-blocking client will continue to attempt to write until it succeeds and the normal server-dtls runs in an infinite loop just watching for messages on the open socket. Due to the nature of DTLS potentially infinite clients could connect to the server-dtls and send a message/get a response from the server. The server would eventually get the Datagrams out of the file descriptor when it looped back around and handle each request in turn.
Kind Regards,
Kaleb

Hi Kaleb,
Thank you for your answer.
I'm going to modifiy the server-dtls example in order to hadle multiple clients.
I will let you know if it works.

Kaleb J. Himes wrote:

Hi again ciruzzo,

Just as a follow up we are curious what your project entails. We ask because DTLS is a beast in and of it's own. Furthermore multi-threading in DTLS is a problem not easily solved. It has peaked both mine, and others interests here at wolfSSL and we'd enjoy further information regarding your project motivation.

Kind Regards,

Kaleb

Ok, my objective a is to provide an encrypted connection under Windows OS among a server and several clients, over a mobile network. At the beginning I choosed TLS protocol, but the bandwith for each client is very poor (4 kbit/s) and the rate of lost packets is significant. I'm not satisfied of the packet retransmission performed by TCP, because sometimes it takes a very long time to recover. Moreover I don't need retransmission, because it is already performed at application layer. Therefore I switched to DTLS, in order to achieve better performance avoiding useless retransmissions. Before WolfSSL, I tried OpenSSL, but I was not able to make it working with DTLS.

Regards

Ciruzzo

Share

5 (edited by Kaleb J. Himes 2015-07-21 10:20:15)

Re: DTLS under Windows

Hi ciruzzo,

Thank you so much for your feedback on the project we'll be discussing it today in our team meeting. If we think of anything that might help you solve your problem someone will be in touch!

Kind Regards,

Kaleb