1.往返时间(RTT) :
数据包要发送到目的地所花费的时间长度,包括确认数据包在原始位置被接收所花费的时间。
2.生存时间(TTL):
正在发送的数据的寿命或寿命。在指定的时间结束或经过之后,数据将被丢弃。
或者也可以将数据包设置为在网络中存在的跃点数,之后将该数据包丢弃。 TTL字段的目的是避免无法传递的数据报在网络中不断流通的情况。
往返时间和生存时间之间的差异:
S.No |
Round trip time |
Time to live |
1 | Also known as ping time. | Also known as hop limit. |
2 | Gives the total time taken to send data packet and to get an acknowledgment back from the destination. | Gives the hop limit to travel in the network path. after that limit the packet will be discarded. |
3 | It is an important for determining the connection on a local network or the larger Internet network, and used to diagnose the speed and reliability of network connections. | Helps us to prevent the data packet from circulating indefinitely in the routers path. |
4 | The round trip time is not stored anywhere, it will be calculated when the acknowledgement comes from destination. | It is an 8-bit field stored in IP header. |
5 | It can be any value, because it depends on many factors. | Maximum value that can be set to TTL is 255 since its the maximum value that we can produce with 8-bits. |
6 | It depends on many factors like distance, no. of hops, server response time etc. | It depends on system, It is set initially by the system which is sending the packet. |
7 | RTT is measured in milliseconds. | TTL is measured in seconds. |
如何找到RTT和TTL?
例子1. ping amazon.com
我们可以使用ping命令找到RTT和TTL。打开您的终端或命令提示符,然后键入以下命令以查看RTT和TTL到amazon.com
ping amazon.com
您将看到与此类似的屏幕。
每行以单词Reply开头的行是服务器对客户端发送的数据包的答复。在上面的示例中,我们收到4个答复,这意味着我们发送了4个数据包。
用红色框标记的值是RTT(往返时间) ,以毫秒为单位显示,因为它以毫秒为单位
蓝色框标记的值为TTL(生存时间),以秒为单位。
因此,以上ping的平均RTT为(230 + 231 + 236 + 230)/ 4 = 231.75毫秒
ping以上的TTL为235秒或235跳
例子2. ping google.com
在以下命令的帮助下ping google.com
ping google.com
运行上述命令后,您将看到类似于此的屏幕
因此,以上ping的平均RTT为(48 + 62 + 56 + 44)/ 4 = 52.5 ms
ping以上的TTL为114秒或114跳。