Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NTP Request Packet

I'm trying to figure out what I need to send (client) in the NTP request package to retrieve a NTP package from the server. I'm working with the LWIP on Cortex M3, Stellaris LM3S6965

I understand that I will recieve a UDP header and then the NTP protocol with the different timestamps the remove the latency. I probable need to make an UDP header but what do I need to add as data?

wireshark image: enter image description here

I hope you guys can help me.

like image 866
Sharpless512 Avatar asked Jan 05 '13 11:01

Sharpless512


People also ask

What is an NTP packet?

The NTP packet header follows the UDP and IP headers and the physical header specific to the underlying transport network. It consists of a number of 32-bit (four-octet) words, although some fields use multiple words, and others are packed in smaller fields within a word.

How often are NTP packets sent?

After a client is synchronized, it will typically send an NTP request packet to the Server once every 1024 seconds.

Is NTP traffic UDP or TCP?

NTP is a built-on UDP, where port 123 is used for NTP server communication and NTP clients use port 1023 (for example, a desktop).

How big is an NTP packet?

NTP packets are relatively small, and without any optional extensions the incoming and outgoing packets are 76 octets in length. This implies that while NTP is a packet reflector, its not normally an amplifier as well, so attackers have preferred to use DNS instead.


1 Answers

The client request packet is the same as the server reply packet - just set the MODE bits in the first word to 3 (Client) to be sure.

Send the whole 48 byte packet to the server, it will reply with the same.

The simplest packet would be 0x1B followed by 47 zeroes. (Version = 3, mode = 3)

like image 52
Tomuo Avatar answered Sep 23 '22 14:09

Tomuo