Cannot find device "tun0"

140 views
Skip to first unread message

Robert Raszuk

unread,
Aug 6, 2021, 5:49:46 PM8/6/21
to packe...@googlegroups.com
Hi,

I am continuing my adventure with packetdrill. After new git build it runs fine. However I am still not able to run it over LAN. 

Currently i am using the below cli for server and client: 

server


# strace -ttt ./packetdrill -v --wire_server --wire_server_dev=ztwfuo5474 --local_ip=10.244.10.101


client


strace -ttt ../../packetdrill/packetdrill -v --wire_client --wire_server_ip=10.244.10.101 --wire_client_dev=ztwfuo5474 --local_ip=10.244.10.136 *.pkt


Without specifying xxxxxx_dev on both server and client the code defaults to eth0. With explicit device cfg it all seems to work. Of course I need to force local_ip as otherwise packetdrill is trying to inject tons of 192.168/16 under the interface.

Note that to run it I needed to comment out this line in ../common/defaults.sh 
# tc qdisc add dev tun0 root pfifo

as otherwise it exits with error not being able to find tun0

1628286442.619034 write(4, "// Verify that setsockopt calls "..., 1290) = 1290
1628286442.619133 write(4, "\0\0\0\16\0\0\0\4", 8) = 8
1628286442.619231 write(4, "N^\346\250\254\37", 6) = 6
1628286442.619329 read(4, "\0\0\0\10\0\0\0\5", 8) = 8
1628286442.708813 rt_sigaction(SIGINT, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x435380}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x435380}, 8) = 0
1628286442.708948 rt_sigaction(SIGQUIT, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x435380}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x435380}, 8) = 0
1628286442.709065 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
1628286442.709172 mmap(NULL, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f2e51bc0000
1628286442.709335 rt_sigprocmask(SIG_BLOCK, ~[], [CHLD], 8) = 0
1628286442.709449 clone(child_stack=0x7f2e51bc8ff0, flags=CLONE_VM|CLONE_VFORK|SIGCHLD) = 8719
1628286442.709890 munmap(0x7f2e51bc0000, 36864) = 0
1628286442.710015 rt_sigprocmask(SIG_SETMASK, [CHLD], NULL, 8) = 0
1628286442.710110 wait4(8719, Cannot find device "tun0"
[{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 8719

1628286442.731415 rt_sigaction(SIGINT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x435380}, NULL, 8) = 0
1628286442.731454 rt_sigaction(SIGQUIT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x435380}, NULL, 8) = 0
1628286442.731677 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
1628286442.731768 exit_group(1)         = ?
1628286442.732579 +++ exited with 1 +++

Main Problem: 
============

Every time it runs client hangs in the same place: 

client: 

1628286153.291254 times(NULL)           = 1718118749
1628286153.291276 times(NULL)           = 1718118749
1628286153.291298 times(NULL)           = 1718118749
1628286153.291319 times(NULL)           = 1718118749
1628286153.291341 times(NULL)           = 1718118749
1628286153.291363 times(NULL)           = 1718118749
1628286153.291385 times(NULL)           = 1718118749
1628286153.291407 times(NULL)           = 1718118749
1628286153.291433 times(NULL)           = 1718118750
1628286153.291459 write(4, "\0\0\0\10\0\0\0\6", 8) = 8
1628286153.291713 socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) = 5
1628286153.291800 fstat(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(0x88, 0), ...}) = 0
1628286153.291841 write(1, "socket syscall: 1628286153.29178"..., 34socket syscall: 1628286153.291789
) = 34
1628286153.291882 setsockopt(5, SOL_IP, IP_MTU_DISCOVER, "\0", 1) = 0
1628286153.291912 write(1, "setsockopt syscall: 1628286153.2"..., 38setsockopt syscall: 1628286153.291904
) = 38
1628286153.291942 futex(0x21242a0, FUTEX_WAKE_PRIVATE, 1) = 1
1628286153.291971 futex(0x2124420, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
1628286153.292461 futex(0x21242a0, FUTEX_WAKE_PRIVATE, 1) = 0
1628286153.292484 sched_yield()         = 0
1628286153.292507 getpid()              = 7792
1628286153.292529 openat(AT_FDCWD, "/proc/7792/task/7796/stat", O_RDONLY) = 6
1628286153.292571 read(6, "7796 (packetdrill) S 7789 7789 2"..., 1022) = 285
1628286153.292601 close(6)              = 0
1628286153.292626 write(4, "\0\0\0\f\0\0\0\7", 8) = 8
1628286153.292663 write(4, "\0\0\0\3", 4) = 4
1628286153.292696 read(4,


server:

1628286153.055727 accept(3, NULL, NULL
) = 17
1628286349.098320 setsockopt(17, SOL_TCP, TCP_NODELAY, [1], 4) = 0
1628286349.098651 setsockopt(17, SOL_SOCKET, SO_RCVBUF, [131072], 4) = 0
1628286349.098918 setsockopt(17, SOL_SOCKET, SO_SNDBUF, [131072], 4) = 0
1628286349.099068 socket(AF_INET, SOCK_DGRAM, IPPROTO_IP) = 20
1628286349.099227 ioctl(20, SIOCGIFINDEX, {ifr_name="ztwfuo5474", }) = 0
1628286349.099344 ioctl(20, SIOCGIFHWADDR, {ifr_name="ztwfuo5474", ifr_hwaddr={sa_family=ARPHRD_ETHER, sa_data=4e:0f:cc:7d:b5:46}}) = 0
1628286349.099467 close(20)             = 0
1628286349.099573 mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7fdffb7ff000
1628286349.099692 mprotect(0x7fdffb800000, 8388608, PROT_READ|PROT_WRITE) = 0
1628286349.104055 clone(child_stack=0x7fdffbffee70, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[150370], tls=0x7fdffbfff700, child_tidptr=0x7fdffbfff9d0) = 150370
1628286349.104189 accept(3, NULL, NULL

Kind regards,
Robert

Robert Raszuk

unread,
Aug 6, 2021, 7:45:04 PM8/6/21
to packe...@googlegroups.com
On this problem it looks like client hangs on those system calls: 

   +0 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0

or 

   +0 ioctl(4, SIOCINQ, [0]) = 0

Any idea how to debug  this further appreciated. 

Many thx,
R.

Neal Cardwell

unread,
Aug 6, 2021, 11:44:47 PM8/6/21
to Robert Raszuk, packe...@googlegroups.com
Hi,

Thanks for the post.

Generally you will not want to be using the same IP for  --local_ip= and --wire_server_ip= arguments, as seems to be the case here. The --wire_server_ip= argument should be the normal IP address of the server machine. The --local_ip=, --remote_ip=, and --gateway_ip= arguments should generally be some IP addresses in some RFC 1918 private space that is not actually used by your normal network, to avoid conflicts between normal/real traffic and packetdrill test traffic.

If those guidelines do not sufficiently help, can you please run the following command on client and server machines after booting and before running packetdrill, and share the output:

  ip addr list

That should help us get a sense of what IP ranges are used by your normal network, to give us a sense of what command line arguments might work in your environment.

thanks,
neal


--
You received this message because you are subscribed to the Google Groups "packetdrill" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packetdrill...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packetdrill/CA%2Bb%2BERmSvTpcrRDPEkYZYDpRRuUvHAVfwoeYsaOwxTBSzOed1w%40mail.gmail.com.

Robert Raszuk

unread,
Aug 7, 2021, 6:08:35 AM8/7/21
to Neal Cardwell, packe...@googlegroups.com
Hi,

Many thx for the help. 

I am attaching ip a and ip route below. 

For me the interface of ZeroTier (ztwfuo5474) can be assumed to be dedicated to packetdrill testing for now - with one exception of ssh session to remote box.

If I do not set --local_ip I see bunch of 192.168/16 popping up under ztwfuo5474 which obviously will not work as ZeroTier is an emulated LAN and arp resolution happens for a given subnet (limited to only configured IP addresses) via controller.

Server:


robert@nuc2-eo:~$ ip a li
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:1f:c6:9b:c5:a5 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.30/24 brd 192.168.1.255 scope global noprefixroute eno1
       valid_lft forever preferred_lft forever
    inet6 fe80::9857:c47d:a45e:e79/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:c2:c6:c4:7c:73 brd ff:ff:ff:ff:ff:ff
    inet 192.168.5.157/24 brd 192.168.5.255 scope global dynamic noprefixroute wlp3s0
       valid_lft 3151sec preferred_lft 3151sec
    inet6 fe80::338b:d50e:6caa:b1c3/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
4: enx0050b617e3f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:50:b6:17:e3:f1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.5.181/24 brd 192.168.5.255 scope global dynamic noprefixroute enx0050b617e3f1
       valid_lft 2999sec preferred_lft 2999sec
    inet6 fe80::6682:9e3d:1b50:fdb9/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
5: enxd8eb97b72d1e: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether d8:eb:97:b7:2d:1e brd ff:ff:ff:ff:ff:ff
    inet 10.1.5.10/24 brd 10.1.5.255 scope global noprefixroute enxd8eb97b72d1e
       valid_lft forever preferred_lft forever
    inet6 fe80::6933:3c0:1ef:187b/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
6: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:9d:fb:a0 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
7: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:9d:fb:a0 brd ff:ff:ff:ff:ff:ff
9: ztwfuo5474: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 2800 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether 4e:0f:cc:7d:b5:46 brd ff:ff:ff:ff:ff:ff
    inet 10.244.10.101/16 brd 10.244.255.255 scope global ztwfuo5474
       valid_lft forever preferred_lft forever
    inet 192.168.0.1/16 scope global ztwfuo5474
       valid_lft forever preferred_lft forever
    inet6 fe80::1469:94ff:fe96:8da5/64 scope link
       valid_lft forever preferred_lft forever
10: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:0e:c0:2a:b4 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:eff:fec0:2ab4/64 scope link
       valid_lft forever preferred_lft forever
11: docker_gwbridge: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether 02:42:86:d1:b3:90 brd ff:ff:ff:ff:ff:ff
    inet 172.18.0.1/16 brd 172.18.255.255 scope global docker_gwbridge
       valid_lft forever preferred_lft forever
37: vethc484e38@if36: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default
    link/ether 1a:1e:01:b3:49:08 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::181e:1ff:feb3:4908/64 scope link
       valid_lft forever preferred_lft forever
41: vethbd916ca@if40: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default
    link/ether 8e:2c:84:16:cb:b4 brd ff:ff:ff:ff:ff:ff link-netnsid 4
    inet6 fe80::8c2c:84ff:fe16:cbb4/64 scope link
       valid_lft forever preferred_lft forever
43: veth530d3d0@if42: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default
    link/ether fe:e2:e1:61:86:ec brd ff:ff:ff:ff:ff:ff link-netnsid 5
    inet6 fe80::fce2:e1ff:fe61:86ec/64 scope link
       valid_lft forever preferred_lft forever
robert@nuc2-eo:~$ ip rou
default via 192.168.5.1 dev enx0050b617e3f1 proto dhcp metric 100
default via 192.168.1.1 dev eno1 proto static metric 102
default via 192.168.5.1 dev wlp3s0 proto dhcp metric 600
10.1.5.0/24 dev enxd8eb97b72d1e proto kernel scope link src 10.1.5.10 metric 101
10.244.0.0/16 dev ztwfuo5474 proto kernel scope link src 10.244.10.101
169.254.0.0/16 dev virbr0 scope link metric 1000 linkdown
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
172.18.0.0/16 dev docker_gwbridge proto kernel scope link src 172.18.0.1 linkdown
192.168.0.0/16 dev ztwfuo5474 proto kernel scope link src 192.168.0.1
192.168.1.0/24 dev eno1 proto kernel scope link src 192.168.1.30 metric 102
192.168.5.0/24 dev enx0050b617e3f1 proto kernel scope link src 192.168.5.181 metric 100
192.168.5.0/24 dev wlp3s0 proto kernel scope link src 192.168.5.157 metric 600
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown
robert@nuc2-eo:~$

client: 

robert@nuc2-kom:~$ ip a li
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:1f:c6:9b:cb:3d brd ff:ff:ff:ff:ff:ff
    altname enp0s31f6
    inet 192.168.1.190/24 brd 192.168.1.255 scope global noprefixroute eno1
       valid_lft forever preferred_lft forever
    inet6 fe80::bb14:c762:6dfc:fb5c/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
3: wlp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:c2:c6:dc:65:bd brd ff:ff:ff:ff:ff:ff
4: enx00249b114071: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:24:9b:11:40:71 brd ff:ff:ff:ff:ff:ff
    inet 100.72.223.78/16 brd 100.72.255.255 scope global dynamic noprefixroute enx00249b114071
       valid_lft 126877sec preferred_lft 126877sec
    inet6 fe80::a9e4:e80:bd65:7715/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
6: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:e7:97:6b:f5 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:e7ff:fe97:6bf5/64 scope link
       valid_lft forever preferred_lft forever
8: vetha20c8ad@if7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default
    link/ether 52:62:96:8f:2a:80 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::5062:96ff:fe8f:2a80/64 scope link
       valid_lft forever preferred_lft forever
10: vethd7a1d59@if9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default
    link/ether 1e:d4:1e:d5:3a:ca brd ff:ff:ff:ff:ff:ff link-netnsid 1
    inet6 fe80::1cd4:1eff:fed5:3aca/64 scope link
       valid_lft forever preferred_lft forever
12: ztwfuo5474: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 2800 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether 4e:5e:e6:a8:ac:1f brd ff:ff:ff:ff:ff:ff
    inet 10.244.10.136/16 brd 10.244.255.255 scope global ztwfuo5474
       valid_lft forever preferred_lft forever
    inet6 fe80::1820:68ff:feae:cfc8/64 scope link
       valid_lft forever preferred_lft forever
robert@nuc2-kom:~$ ip route
default via 100.72.0.1 dev enx00249b114071 proto dhcp metric 100
default via 192.168.1.1 dev eno1 proto static metric 101
10.244.0.0/16 dev ztwfuo5474 proto kernel scope link src 10.244.10.136
100.72.0.0/16 dev enx00249b114071 proto kernel scope link src 100.72.223.78 metric 100
169.254.0.0/16 dev enx00249b114071 scope link metric 1000
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
192.168.1.0/24 dev eno1 proto kernel scope link src 192.168.1.190 metric 101
robert@nuc2-kom:~$

Many thx,
R.







Neal Cardwell

unread,
Aug 7, 2021, 10:51:18 AM8/7/21
to Robert Raszuk, packe...@googlegroups.com
Thanks for the details.

Your scenario is a bit complex, since you seem to have several devices and seem to be using IP address ranges from all of the RFC 1918 IPv4 prefixes. However, it looks like IPs in the range 172.16.0.0/16 should be usable for your packetdrill testing.

So can you please try something like the following:

# on server:
./packetdrill -v --wire_server --wire_server_dev=ztwfuo5474

# on client:
../../packetdrill/packetdrill -v --wire_client --wire_client_dev=ztwfuo5474 --wire_server_ip=10.244.10.101 \
  --local_ip=172.16.0.1 --gateway_ip=172.16.0.2 --netmask_ip=255.255.255.0 --remote_ip=172.16.1.1/24 \
  *.pkt

I'm still not sure if packetdrill remote mode (wire_client/wire_server) will work with something like ZeroTier, since it is really just designed and tested to work with things that behave like plain Ethernet devices. But you can try something like the above approach and see what happens.

best,
neal

Robert Raszuk

unread,
Aug 7, 2021, 11:04:31 AM8/7/21
to Neal Cardwell, packe...@googlegroups.com
Hi,

Thank you so much ... We are making progress. Tests do run and complete in each test case. However in each test case I see the same error "bad value outbound TCP option 2" 

total 24
drwxrwxr-x  2 robert robert 4096 Aug  6 16:57 ./
drwxrwxr-x 30 robert robert 4096 Aug  6 16:57 ../
-rw-rw-r--  1 robert robert  472 Aug  6 16:57 blocking-accept.pkt
-rw-rw-r--  1 robert robert  332 Aug  6 16:57 blocking-connect.pkt
-rw-rw-r--  1 robert robert  783 Aug  6 16:57 blocking-read.pkt
-rw-rw-r--  1 robert robert 1024 Aug  6 16:57 blocking-write.pkt
root@nuc2-kom:/home/robert/TCP/git/packetdrill/gtests/net/tcp/blocking# ../../packetdrill/packetdrill -v --wire_client --wire_client_dev=ztwfuo5474 --wire_server_ip=10.244.10.101   --local_ip=172.16.0.1 --gateway_ip=172.16.0.2 --netmask_ip=255.255.255.0 --remote_ip=172.16.1.1/24 blocking-accept.pkt
socket syscall: 1628348361.751701
setsockopt syscall: 1628348361.751721
bind syscall: 1628348361.751747
listen syscall: 1628348361.751752
blocking-accept.pkt:13: error handling packet: bad value outbound TCP option 2
script packet:  0.100047 S. 0:0(0) ack 1 <mss 1460,nop,wscale 8>
actual packet:  0.144408 S. 0:0(0) ack 1 win 65535 <mss 2760,nop,wscale 8>
root@nuc2-kom:/home/robert/TCP/git/packetdrill/gtests/net/tcp/blocking#
root@nuc2-kom:/home/robert/TCP/git/packetdrill/gtests/net/tcp/blocking#
root@nuc2-kom:/home/robert/TCP/git/packetdrill/gtests/net/tcp/blocking#
root@nuc2-kom:/home/robert/TCP/git/packetdrill/gtests/net/tcp/blocking#
root@nuc2-kom:/home/robert/TCP/git/packetdrill/gtests/net/tcp/blocking# ../../packetdrill/packetdrill -v --wire_client --wire_client_dev=ztwfuo5474 --wire_server_ip=10.244.10.101   --local_ip=172.16.0.1 --gateway_ip=172.16.0.2 --netmask_ip=255.255.255.0 --remote_ip=172.16.1.1/24 blocking-connect.pkt
socket syscall: 1628348374.451687
blocking-connect.pkt:10: error handling packet: bad value outbound TCP option 2
script packet:  0.101497 S 0:0(0) <mss 1460,sackOK,TS val 100 ecr 0,nop,wscale 8>
actual packet:  0.135214 S 0:0(0) win 65535 <mss 2760,sackOK,TS val 100 ecr 0,nop,wscale 8>
root@nuc2-kom:/home/robert/TCP/git/packetdrill/gtests/net/tcp/blocking#
root@nuc2-kom:/home/robert/TCP/git/packetdrill/gtests/net/tcp/blocking#
root@nuc2-kom:/home/robert/TCP/git/packetdrill/gtests/net/tcp/blocking#
root@nuc2-kom:/home/robert/TCP/git/packetdrill/gtests/net/tcp/blocking# ../../packetdrill/packetdrill -v --wire_client --wire_client_dev=ztwfuo5474 --wire_server_ip=10.244.10.101   --local_ip=172.16.0.1 --gateway_ip=172.16.0.2 --netmask_ip=255.255.255.0 --remote_ip=172.16.1.1/24 blocking-read.pkt
socket syscall: 1628348387.131685
setsockopt syscall: 1628348387.131704
bind syscall: 1628348387.131726
listen syscall: 1628348387.131731
blocking-read.pkt:13: error handling packet: bad value outbound TCP option 2
script packet:  0.105321 S. 0:0(0) ack 1 <mss 1460,nop,wscale 8>
actual packet:  0.125330 S. 0:0(0) ack 1 win 65535 <mss 2760,nop,wscale 8>
root@nuc2-kom:/home/robert/TCP/git/packetdrill/gtests/net/tcp/blocking#
root@nuc2-kom:/home/robert/TCP/git/packetdrill/gtests/net/tcp/blocking#
root@nuc2-kom:/home/robert/TCP/git/packetdrill/gtests/net/tcp/blocking# ../../packetdrill/packetdrill -v --wire_client --wire_client_dev=ztwfuo5474 --wire_server_ip=10.244.10.101   --local_ip=172.16.0.1 --gateway_ip=172.16.0.2 --netmask_ip=255.255.255.0 --remote_ip=172.16.1.1/24 blocking-write.pkt
socket syscall: 1628348395.551686
setsockopt syscall: 1628348395.551706
bind syscall: 1628348395.551714
listen syscall: 1628348395.551738
blocking-write.pkt:15: error handling packet: bad value outbound TCP option 2
script packet:  0.100047 S. 0:0(0) ack 1 <mss 1460,nop,wscale 8>
actual packet:  0.113893 S. 0:0(0) ack 1 win 65535 <mss 2760,nop,wscale 8>
root@nuc2-kom:/home/robert/TCP/git/packetdrill/gtests/net/tcp/blocking#

Zoom on the client: 
==============

1628348493.391353 times(NULL)           = 1724352759
1628348493.391389 times(NULL)           = 1724352759
1628348493.391424 times(NULL)           = 1724352760
1628348493.391473 write(4, "\0\0\0\10\0\0\0\6", 8) = 8
1628348493.391729 socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) = 5
1628348493.391784 fstat(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(0x88, 0), ...}) = 0
1628348493.391845 write(1, "socket syscall: 1628348493.39177"..., 34socket syscall: 1628348493.391771
) = 34
1628348493.391905 setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
1628348493.391954 write(1, "setsockopt syscall: 1628348493.3"..., 38setsockopt syscall: 1628348493.391940
) = 38
1628348493.392003 bind(5, {sa_family=AF_INET, sin_port=htons(8080), sin_addr=inet_addr("172.16.0.1")}, 16) = 0
1628348493.392058 write(1, "bind syscall: 1628348493.392045\n", 32bind syscall: 1628348493.392045
) = 32
1628348493.392105 listen(5, 1)          = 0
1628348493.392148 write(1, "listen syscall: 1628348493.39213"..., 34listen syscall: 1628348493.392135
) = 34
1628348493.392192 write(4, "\0\0\0\f\0\0\0\7", 8) = 8
1628348493.392256 write(4, "\0\0\0\4", 4) = 4
1628348493.392323 read(4, "\0\0\0\353\0\0\0\t", 8) = 8
1628348493.554949 read(4, "\377\377\377\377\0\0\0\6blocking-write.pkt:15: e"..., 227) = 227
1628348493.555073 write(2, "blocking-write.pkt:15: error han"..., 218blocking-write.pkt:15: error handling packet: bad value outbound TCP option 2
script packet:  0.114950 S. 0:0(0) ack 1 <mss 1460,nop,wscale 8>
actual packet:  0.140085 S. 0:0(0) ack 1 win 65535 <mss 2760,nop,wscale 8>
) = 218
1628348493.555208 rt_sigaction(SIGINT, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x435380}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x435380}, 8) = 0
1628348493.555318 rt_sigaction(SIGQUIT, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x435380}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x435380}, 8) = 0
1628348493.555413 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
1628348493.555529 mmap(NULL, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f129d7b8000
1628348493.555671 rt_sigprocmask(SIG_BLOCK, ~[], [CHLD], 8) = 0
1628348493.555768 clone(child_stack=0x7f129d7c0ff0, flags=CLONE_VM|CLONE_VFORK|SIGCHLD) = 194079
1628348493.556268 munmap(0x7f129d7b8000, 36864) = 0
1628348493.556374 rt_sigprocmask(SIG_SETMASK, [CHLD], NULL, 8) = 0
1628348493.556475 wait4(194079, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 194079
1628348493.560309 rt_sigaction(SIGINT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x435380}, NULL, 8) = 0
1628348493.560490 rt_sigaction(SIGQUIT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x435380}, NULL, 8) = 0
1628348493.560620 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
1628348493.560708 exit_group(1)         = ?
1628348493.563162 +++ exited with 1 +++
root@nuc2-kom:/home/robert/TCP/git/packetdrill/gtests/net/tcp/blocking#

I the same time on the server: 

inbound injected packet:  0.114921 S 0:0(0) win 50000 <mss 1000,nop,wscale 0>
outbound sniffed packet:  0.140085 S. 1665275920:1665275920(0) ack 1 win 65535 <mss 2760,nop,wscale 8>
blocking-write.pkt:15: error handling packet: bad value outbound TCP option 2
script packet:  0.114950 S. 0:0(0) ack 1 <mss 1460,nop,wscale 8>
actual packet:  0.140085 S. 0:0(0) ack 1 win 65535 <mss 2760,nop,wscale 8>

or with strace on the server: 

1628348589.020924 listen(3, 100)        = 0
1628348589.021001 accept(3, NULL, NULL

) = 4
1628348595.797921 setsockopt(4, SOL_TCP, TCP_NODELAY, [1], 4) = 0
1628348595.798177 setsockopt(4, SOL_SOCKET, SO_RCVBUF, [131072], 4) = 0
1628348595.798412 setsockopt(4, SOL_SOCKET, SO_SNDBUF, [131072], 4) = 0
1628348595.798665 socket(AF_INET, SOCK_DGRAM, IPPROTO_IP) = 5
1628348595.798768 ioctl(5, SIOCGIFINDEX, {ifr_name="ztwfuo5474", }) = 0
1628348595.798868 ioctl(5, SIOCGIFHWADDR, {ifr_name="ztwfuo5474", ifr_hwaddr={sa_family=ARPHRD_ETHER, sa_data=4e:0f:cc:7d:b5:46}}) = 0
1628348595.798968 close(5)              = 0
1628348595.799104 mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f7f97658000
1628348595.799202 mprotect(0x7f7f97659000, 8388608, PROT_READ|PROT_WRITE) = 0
1628348595.799302 clone(child_stack=0x7f7f97e57e70, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[158966], tls=0x7f7f97e58700, child_tidptr=0x7f7f97e589d0) = 158966
1628348595.799452 accept(3, NULL, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
1628348595.806585 accept(3, NULL, NULLinbound injected packet:  0.107355 S 0:0(0) win 50000 <mss 1000,nop,wscale 0>
outbound sniffed packet:  0.142045 S. 3117200949:3117200949(0) ack 1 win 65535 <mss 2760,nop,wscale 8>
blocking-write.pkt:15: error handling packet: bad value outbound TCP option 2
script packet:  0.107383 S. 0:0(0) ack 1 <mss 1460,nop,wscale 8>
actual packet:  0.142045 S. 0:0(0) ack 1 win 65535 <mss 2760,nop,wscale 8>

) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
1628348596.279929 accept(3, NULL, NULL


Many thx,
R.

Neal Cardwell

unread,
Aug 7, 2021, 11:21:18 AM8/7/21
to Robert Raszuk, packe...@googlegroups.com
Yes, the error you are getting is:

blocking-connect.pkt:10: error handling packet: bad value outbound TCP option 2
script packet:  0.101497 S 0:0(0) <mss 1460,sackOK,TS val 100 ecr 0,nop,wscale 8>
actual packet:  0.135214 S 0:0(0) win 65535 <mss 2760,sackOK,TS val 100 ecr 0,nop,wscale 8>

Note that the difference here is that the script is expecting "mss 1460" and the actual TCP stack behavior was "mss 2760"; that is, your network device is using a non-standard MTU and MSS size.

So packetdrill is correctly noting that your TCP stack is behaving differently than what the script expects.

Please note that the packetdrill scripts included with the distribution are presuming a standard MTU and MSS sizes. If you want the tests to pass on a real network device with a non-standard MTU you will need to change the MTU of the device to match the MTU expected in the packetdrill scripts.

best,
neal

Reply all
Reply to author
Forward
0 new messages