在WIRESHARK里面看到了有的显示UDP,有的显示ECHO。好像是有端口7的是ECHO。那么ECHO是怎么回事?在百度上查了半天,感觉没找到了所以然,或者说让人感觉都是些不靠谱的说法。直到查到了维基百科的这个网页https://en.wikipedia.org/wiki/Echo_Protocol,里面内容如下:
Echo Protocol
The Echo Protocol is a service in the Internet Protocol Suite defined in RFC 862. It was originally proposed for testing and measurement of round-trip times[citation needed] in IP networks.
A host may connect to a server that supports the Echo Protocol using the Transmission Control Protocol (TCP) or the User Datagram Protocol (UDP) on the well-known port number 7. The server sends back an identical copy of the data it received.
netd implementation[edit]
On UNIX-like operating systems an echo server is built into the inetd daemon. The echo service is usually not enabled by default. It may be enabled by adding the following lines to the file /etc/inetd.conf and telling inetd to reload its configuration:
echo stream tcp nowait root internal
echo dgram udp wait root internal
On various routers, this TCP or UDP port 7 for the Echo Protocol for relaying ICMP datagrams (or port 9 for theDiscard Protocol) is also configured by default as a proxy to relay Wake-on-LAN (WOL) magic packets from the Internet to hosts on the local network in order to wake up them remotely (these hosts must also have their network adapter configured to accept WOL datagrams and the router must have this proxy setting enabled, and possibly also a configuration of forwarding rules in its embedded firewall to open these ports on the Internet side).
可以看出这个ECHO是为了测试round-trip times的,汉语翻译为往返时延。
Round-trip delay time
In telecommunications, the round-trip delay time (RTD) or round-trip time (RTT) is the length of time it takes for a signal to be sent plus the length of time it takes for an acknowledgment of that signal to be received. This time delay therefore consists of the propagation times between the two points of a signal.
“往返时延”成为一种计算机性能指标,具体含义如下:
=======================================
那么RFC862是什么内容呢?
[Docs] [txt|pdf]
INTERNET STANDARD
Network Working Group J. Postel
Request for Comments: 862 ISI
May 1983
Echo Protocol
This RFC specifies a standard for the ARPA Internet community. Hosts on the ARPA Internet that choose to implement an Echo Protocol are expected to adopt and implement this standard. A very useful debugging and measurement tool is an echo service. An echo service simply sends back to the originating source any data it receives. TCP Based Echo Service One echo service is defined as a connection based application on TCP. A server listens for TCP connections on TCP port 7. Once a connection is established any data received is sent back. This continues until the calling user terminates the connection. UDP Based Echo Service Another echo service is defined as a datagram based application on UDP. A server listens for UDP datagrams on UDP port 7. When a datagram is received, the data from it is sent back in an answering datagram.
这也就是为什么STM32的官网给的例子的题目是udp_echo_server/udp_echo_CLIENT/TCp_echo_server/TCp_echo_CLIENT