-f를 사용할 때 핑이 훨씬 빠른 이유

-f를 사용할 때 핑이 훨씬 빠른 이유

같은 컴퓨터에서 같은 호스트에 동시에 ping을 보내고 있습니다. 그리고 를 사용하면 -f결과가 거의 두 배나 좋아집니다.

[root@localhost Desktop]# ping 196.1.6.16
PING 196.1.6.16 (196.1.6.16) 56(84) bytes of data.
64 bytes from 196.1.6.16: icmp_seq=1 ttl=62 time=0.744 ms
64 bytes from 196.1.6.16: icmp_seq=2 ttl=62 time=0.166 ms
64 bytes from 196.1.6.16: icmp_seq=3 ttl=62 time=0.164 ms
64 bytes from 196.1.6.16: icmp_seq=4 ttl=62 time=0.164 ms
64 bytes from 196.1.6.16: icmp_seq=5 ttl=62 time=0.167 ms

[root@localhost Desktop]# ping -f 196.1.6.16
PING 196.1.6.16 (196.1.6.16) 56(84) bytes of data.
.^C
--- 196.1.6.16 ping statistics ---
84226 packets transmitted, 84225 received, 0% packet loss, time 9782ms
rtt min/avg/max/mdev = 0.083/0.091/0.191/0.012 ms, ipg/ewma 0.116/0.090 ms

왜인지 궁금합니다. 내가 이해하는 바에 따르면, 패킷을 얼마나 자주 보내는지는 중요하지 않으며 시간은 동일해야 합니다.

결과가 너무 다르기 때문에 둘 중 어느 것이 "공정"합니까?

업데이트 #1

그 자체로 흥미로울 때 제가 이것을 요청하는 또 다른 이유는 더 나은 대기 시간을 갖고 싶기 때문입니다(저는 HFT 거래를 수행합니다). 따라서 "플러드" 핑이 어떻게든 대기 시간을 개선한다면 그 방법과 이유를 알고 싶습니다. 일부 버퍼를 0으로 설정하는 경우 지속적인 방식으로 이 버퍼를 0으로 설정하는 것이 적합한지 평가해야 합니다.

업데이트 #2

127.0.0.1을 핑할 때 차이가 훨씬 더 큽니다.

[root@localhost Desktop]# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
....
64 bytes from 127.0.0.1: icmp_seq=17 ttl=64 time=0.067 ms
64 bytes from 127.0.0.1: icmp_seq=18 ttl=64 time=0.058 ms
64 bytes from 127.0.0.1: icmp_seq=19 ttl=64 time=0.064 ms
64 bytes from 127.0.0.1: icmp_seq=20 ttl=64 time=0.067 ms
^C
--- 127.0.0.1 ping statistics ---
20 packets transmitted, 20 received, 0% packet loss, time 18999ms
rtt min/avg/max/mdev = 0.058/0.065/0.069/0.006 ms


[root@localhost Desktop]# ping -f 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
^C 
--- 127.0.0.1 ping statistics ---
92267 packets transmitted, 92267 received, 0% packet loss, time 1273ms
rtt min/avg/max/mdev = 0.005/0.005/0.065/0.003 ms, ipg/ewma 0.013/0.006 ms

업데이트 #3

나는 내 시스템을 약간 조정했는데, tuned-adm특히 network-latency. 이제 숫자는 더 낮아졌지만 여전히 같은 문제가 있습니다. 플러딩 핑이 훨씬 더 나은데 왜 그렇습니까?

[root@localhost]# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.011 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.010 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.009 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.011 ms
64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.011 ms
64 bytes from 127.0.0.1: icmp_seq=6 ttl=64 time=0.011 ms
64 bytes from 127.0.0.1: icmp_seq=7 ttl=64 time=0.011 ms
^C
--- 127.0.0.1 ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 5999ms
rtt min/avg/max/mdev = 0.009/0.010/0.011/0.003 ms

[root@localhost]# ping -f 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.

^C--- 127.0.0.1 ping statistics ---
42294 packets transmitted, 42294 received, 0% packet loss, time 837ms
rtt min/avg/max/mdev = 0.003/0.003/0.025/0.002 ms, ipg/ewma 0.019/0.003 ms

저는 RHEL 7, 최신 커널, 모든 업데이트를 사용하고 있습니다.

답변1

귀하의 업데이트에 대한 답변: 저는 HFT 거래에 대해 아무것도 모릅니다. 하지만 실제로는 HFT 거래가 다시 발생하지 않는다고 보장할 수 있습니다.ICMP(핑에 사용되는 프로토콜). ICMP 메시지는 실제 데이터를 전달하는 트래픽(TCP 또는 UDP를 사용하는 경우가 많음)과는 다르게 버퍼링되고 우선 순위가 지정될 가능성이 높으므로 핑 결과는 수행하려는 작업과 직접적인 관련이 없습니다.

답변2

ping매뉴얼 페이지 에 따르면 f플래그는 다음과 같습니다.

  • -f: 홍수 핑. ECHO_REQUEST가 전송될 때마다 마침표 ''.''가 인쇄되고, ECHO_REPLY가 수신되면 백스페이스가 인쇄됩니다. 이를 통해 삭제되는 패킷 수를 빠르게 표시할 수 있습니다. 간격을 지정하지 않으면 간격을 0으로 설정하고 패킷이 돌아올 때마다 빠르게 또는 초당 100회 중 더 많은 속도로 패킷을 출력합니다. 슈퍼유저만이 간격 없이 이 옵션을 사용할 수 있습니다.

그래서 플래그를 사용하면 f다음과 같은 결과를 얻을 수 있습니다.

[support@cloudHA1 exporttool]$ sudo ping -f www.google.com
[sudo] password for support:
PING www.google.com (74.125.228.51) 56(84) bytes of data.
..^C
--- www.google.com ping statistics ---
12502 packets transmitted, 12500 received, 0% packet loss, time 29394ms
rtt min/avg/max/mdev = 1.335/2.194/191.342/6.182 ms, pipe 2, ipg/ewma 2.351/1.524 ms
[support@cloudHA1 exporttool]$

깃발이 없으면 다음을 얻습니다.

[support@cloudHA1 ~]$ ping www.google.com
PING www.google.com (74.125.228.50) 56(84) bytes of data.
64 bytes from iad23s06-in-f18.1e100.net (74.125.228.50): icmp_seq=1 ttl=49 time=1.53 ms
64 bytes from iad23s06-in-f18.1e100.net (74.125.228.50): icmp_seq=2 ttl=49 time=1.51 ms
64 bytes from iad23s06-in-f18.1e100.net (74.125.228.50): icmp_seq=3 ttl=49 time=1.72 ms
64 bytes from iad23s06-in-f18.1e100.net (74.125.228.50): icmp_seq=4 ttl=49 time=1.62 ms
64 bytes from iad23s06-in-f18.1e100.net (74.125.228.50): icmp_seq=5 ttl=49 time=1.78 ms
64 bytes from iad23s06-in-f18.1e100.net (74.125.228.50): icmp_seq=6 ttl=49 time=1.66 ms
64 bytes from iad23s06-in-f18.1e100.net (74.125.228.50): icmp_seq=7 ttl=49 time=1.59 ms
64 bytes from iad23s06-in-f18.1e100.net (74.125.228.50): icmp_seq=8 ttl=49 time=1.66 ms
64 bytes from iad23s06-in-f18.1e100.net (74.125.228.50): icmp_seq=9 ttl=49 time=1.43 ms
64 bytes from iad23s06-in-f18.1e100.net (74.125.228.50): icmp_seq=10 ttl=49 time=1.72 ms
64 bytes from iad23s06-in-f18.1e100.net (74.125.228.50): icmp_seq=11 ttl=49 time=1.84 ms
64 bytes from iad23s06-in-f18.1e100.net (74.125.228.50): icmp_seq=12 ttl=49 time=1.80 ms
64 bytes from iad23s06-in-f18.1e100.net (74.125.228.50): icmp_seq=13 ttl=49 time=1.69 ms
64 bytes from iad23s06-in-f18.1e100.net (74.125.228.50): icmp_seq=14 ttl=49 time=1.87 ms
64 bytes from iad23s06-in-f18.1e100.net (74.125.228.50): icmp_seq=15 ttl=49 time=1.84 ms

^C
--- www.google.com ping statistics ---
61 packets transmitted, 61 received, 0% packet loss, time 60530ms
rtt min/avg/max/mdev = 1.438/2.026/12.749/1.548 ms

i다음 예제에서도 플래그를 추가하겠습니다 . ping 매뉴얼 페이지에 따르면 다음과 같습니다.

  • -i 간격 각 패킷을 보내는 사이의 대기 간격(초)입니다. 기본값은 정상적으로 각 패킷 사이에 1초를 기다리거나 플러드 모드에서 기다리지 않는 것입니다. 수퍼유저만 간격을 0.2초 미만의 값으로 설정할 수 있습니다.

    [support@cloudHA1 ~]$ ping -fi 4 www.google.com PING www.google.com (74.125.29.106) 56(84) bytes of data. ^C --- www.google.com ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 13875ms rtt min/avg/max/mdev = 9.381/9.531/9.749/0.153 ms, ipg/ewma 4625.308/9.495 ms [support@cloudHA1 ~]$

관련 정보