NTP请求报文 [英] NTP Request Packet

查看:376
本文介绍了NTP请求报文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找出需要在NTP请求程序包中发送(客户端)以从服务器检索NTP程序包的内容.我正在使用Cortex M3,Stellaris LM3S6965上的LWIP

我知道我将收到一个UDP标头,然后接收具有不同时间戳的NTP协议,以消除延迟.我可能需要制作UDP标头,但是我需要添加什么作为数据?

wireshark图片:

我希望你们能帮助我.

解决方案

客户端请求数据包与服务器回复数据包相同-只需将第一个单词中的MODE位设置为3(客户端)即可.

将整个48个字节的数据包发送到服务器,它将以相同的方式答复.

最简单的数据包将是0x1B,后跟47个零. (版本= 3,模式= 3)

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:

I hope you guys can help me.

解决方案

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)

这篇关于NTP请求报文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆