Not able to send a valid ntp request

Hello There,

I’m using a Spider with an Ethernet_J11D module.
My project use netmf 4.2 and my board says EMX

I try to send a ntp request with the following lines of code.

IPAddress[] addressList = Dns.GetHostEntry( "" ).AddressList;
IPEndPoint ipEndPoint = new IPEndPoint( addressList[0], 123 );

Socket s = new Socket( AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp );
s.ReceiveTimeout = 1000;
s.SendTimeout = 1000;

byte[] ntpData = new byte[48];
Array.Clear( ntpData, 0, 48 );

// Set protocol version
ntpData[0] = 0x1B;

if ( s.Poll( 1000, SelectMode.SelectWrite ) )
	s.Connect( ipEndPoint );
	s.Send( ntpData )

s.SendTo( ntpData, ipEndPoint );

The wireshark analyze of the sended ntp data shows that the first byte is not set to 0x1B. This behaviour is independent whether
I use the Send or the SendTo method.

The attached images show the wireshark output.

The first image is the output generated from a “normal” .net c# program doing a ntp request.
The second image shows the data caused by the Send method.
The third image shows the data caused by the SendTo method (please pay attention to the “” inside of the 48 byte of ntp data)

I also have already tried a lot of the possible SendTo overloads with different options without any success.


Thanks alot.
I have already spend some time into this issue.