NTP请求报文

编程入门 行业动态 更新时间:2024-10-11 11:21:36
本文介绍了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请求报文

本文发布于:2023-11-27 22:19:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639818.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:报文   NTP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!