On Wed, Apr 16, 2014 at 2:58 AM, Wei Sun <
sunwe...@gmail.com> wrote:
>
> Hi all,
>
> I am a beginner for Packetdrill and want to know the details about inserting
> and sniffing packet by Packdrill. I used a lot of command such as tcpdump,
> netstat, ss to figure out it.
> I only could figure out below information when there is a detection error
> for Packdrill otherwise nothing:
> State Recv-Q Send-Q Local Address:Port Peer
> Address:Port
> FIN-WAIT-1 0 4001 192.168.0.1:http-alt
>
192.0.2.1:59157
>
> Could you please tell me how the Packetdrill to insert and sniff the
> packet(i.e. which network interface, which port, etc) ?
packetdrill uses a tun device in local mode, or your NIC device in
remote mode (whatever NIC you specify in --wire_client_dev or
--wire_server_dev; the default is "eth0".
packetdrill uses a TCP port given by --bind_port or --connect_port -
depending on whether your script is using bind() or connect(). The
default is port 8080. You can also set the remote and local IPs with
--remote_ip or --local_ip.
You can run ./packetdrill without any parameters to get help, or read
config.c to get a sense of the parameters that are available.
> Or how to observer
> the packet flow by tcpdump or other tool (i.e or just the packet flow inside
> kernel, which cannot be observed by such tcpdump tool)?
On Linux you can watch the traffic with:
tcpdump -n -i any port 8080 &
> From the paper, I know it uses the tun device to insert the packet and sniff
> packet by socket.
Yes.
> but one of my linux systems without tun device also could run packetdrill
> successfully. Does Packetdrill implicitly runs a tun device only for the
> time when script is executed?
Yes.
> Is it too fast to observe the appearance and behavior of the tun device?
If you add a sleep in your script you can watch it:
+0 `sleep 300`
Or you can dump the interface yourself in your script:
+0 `ifconfig -a`
> Any comment is appreciated.
Hope that helps!
neal