Linux ping 명령은 ID 카운터를 어디서 얻나요?

Linux ping 명령은 ID 카운터를 어디서 얻나요?

나는 눈치챘다 ping(아이틸스) id는 실행될 때마다 ICMP 카운터를 증가시킵니다. 나는 보려고 노력한다플랫 소스 코드주위를 둘러보았지만 카운터를 찾을 수 없었습니다. AFAIK ping은 데몬이나 기타 시스템 전역 상태를 실행하지 않으므로 Linux 커널 자체가 이 카운터에 대한 기록을 유지합니까?

% ping -c 3 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.039 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.039 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.033 ms

Tshark(ID=0x0043):

14267 196372.989831489    127.0.0.1 → 127.0.0.1    ICMP 98 Echo (ping) request  id=0x0043, seq=1/256, ttl=64
14268 196372.989843064    127.0.0.1 → 127.0.0.1    ICMP 98 Echo (ping) reply    id=0x0043, seq=1/256, ttl=64 (request in 14267)
14269 196374.001333266    127.0.0.1 → 127.0.0.1    ICMP 98 Echo (ping) request  id=0x0043, seq=2/512, ttl=64
14270 196374.001345051    127.0.0.1 → 127.0.0.1    ICMP 98 Echo (ping) reply    id=0x0043, seq=2/512, ttl=64 (request in 14269)
14271 196375.014707417    127.0.0.1 → 127.0.0.1    ICMP 98 Echo (ping) request  id=0x0043, seq=3/768, ttl=64
14272 196375.014717838    127.0.0.1 → 127.0.0.1    ICMP 98 Echo (ping) reply    id=0x0043, seq=3/768, ttl=64 (request in 14271)

다시 평평해짐:

% ping -c 3 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.047 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.062 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.037 ms

Tshark(ID=0x0044):

14273 196381.959906106    127.0.0.1 → 127.0.0.1    ICMP 98 Echo (ping) request  id=0x0044, seq=1/256, ttl=64
14274 196381.959921324    127.0.0.1 → 127.0.0.1    ICMP 98 Echo (ping) reply    id=0x0044, seq=1/256, ttl=64 (request in 14273)
14275 196382.961393309    127.0.0.1 → 127.0.0.1    ICMP 98 Echo (ping) request  id=0x0044, seq=2/512, ttl=64
14276 196382.961404803    127.0.0.1 → 127.0.0.1    ICMP 98 Echo (ping) reply    id=0x0044, seq=2/512, ttl=64 (request in 14275)
14277 196383.974709944    127.0.0.1 → 127.0.0.1    ICMP 98 Echo (ping) request  id=0x0044, seq=3/768, ttl=64
14278 196383.974722217    127.0.0.1 → 127.0.0.1    ICMP 98 Echo (ping) reply    id=0x0044, seq=3/768, ttl=64 (request in 14277)

관련 정보