Project

General

Profile

Bug #8503

snoop seems to delay packets doing DNS resolution

Added by Robert Mustacchi over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Category:
cmd - userland programs
Start date:
2017-07-18
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

When running snoop without the "-r" option (which disables DNS lookups), it appears to do synchronous DNS lookups for many of the packets it's displaying. When DNS is busted (say DNS lookups are timing out), that can result in really confusing behavior: the program appears to emit, say, a packet per second, with timestamps that are only a few milliseconds apart. The delay builds up over time, so if the program has been running for a full minute, it may be continuing to emit packets that are 59 seconds old.

It would be nice if snoop got treatment similar to what ping(1M) got under 6211.

#1

Updated by Robert Mustacchi over 3 years ago

To test this I went through tand then tested this against a system that had name services blocked. We saw the following:

^C[root@haswell ~]# snoop -d igb0 icmp
Using device igb0 (promiscuous mode)
snoop: warning: packets captured, but name service lookups are timing out. Use snoop -r to disable name service lookups
  172.24.2.7 -> haswell      ICMP Echo request (ID: 16261 Sequence number: 0)
     haswell -> 172.24.2.7   ICMP Echo reply (ID: 16261 Sequence number: 0)
  172.24.2.7 -> haswell      ICMP Echo request (ID: 16261 Sequence number: 1)
     haswell -> 172.24.2.7   ICMP Echo reply (ID: 16261 Sequence number: 1)
  172.24.2.7 -> haswell      ICMP Echo request (ID: 16261 Sequence number: 2)
     haswell -> 172.24.2.7   ICMP Echo reply (ID: 16261 Sequence number: 2)
  172.24.2.7 -> haswell      ICMP Echo request (ID: 16261 Sequence number: 3)
     haswell -> 172.24.2.7   ICMP Echo reply (ID: 16261 Sequence number: 3)
  172.24.2.7 -> haswell      ICMP Echo request (ID: 16261 Sequence number: 4)
     haswell -> 172.24.2.7   ICMP Echo reply (ID: 16261 Sequence number: 4)

I also tested with the -r flag and verified that we saw results effectively instantly.

#2

Updated by Electric Monk over 3 years ago

  • Status changed from New to Closed

git commit afee3dc66d7b1fb4aaedced0814360f4334bc2c0

commit  afee3dc66d7b1fb4aaedced0814360f4334bc2c0
Author: Robert Mustacchi <rm@joyent.com>
Date:   2017-08-08T19:21:49.000Z

    8503 snoop seems to delay packets doing DNS resolution
    8504 traceroute should warn when name services are slow
    8505 netstat should warn when name services are slow
    8506 ping name service warnings should only happen once
    Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
    Reviewed by: Dan McDonald <danmcd@joyent.com>
    Reviewed by: Yuri Pankov <yuripv@gmx.com>
    Approved by: Gordon Ross <gwr@nexenta.com>

Also available in: Atom PDF