-
Notifications
You must be signed in to change notification settings - Fork 233
[help] testing userspace TCP #97
Description
As I was implementing TCP on top of TUN in user-space I remembered that there is a thing called tests and that you should kinda write them. So I decided to find some tools that could help me with this and I came across packetdrill. That looked like a perfect tool for my case so I decided to try it out, which did not really work out, because I don't really know how to test user-space TCP implementations with this and would like some help.
Basically, my TCP implementation creates a TUN interface (called tun1) and traffic must go through this TUN to get to the TCP. I decided to use wire server and wire client to make this happen and this "kinda" works. My TCP implementation is able to receive SYNs, for example, but when it sends a SYNACK, packetdrill does not receive this and times out. I have no idea how to fix it.
.pkt is this:
0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+.1...0.200 connect(3, ..., ...) = 0
+0 > S 0:0(0) <...>
+.1 < S. 0:0(0) ack 1 win 4380 <mss 1460>
+0 > . 1:1(0) ack 1
Also, I used these commands:
sudo ./packetdrill/packetdrill --wire_server &
sudo ./packetdrill/packetdrill --ip_version=ipv4 --local_ip=10.0.0.1 --remote_ip=10.0.0.2 --connect_port=8090 --wire_client_dev=tun1 tcp/blocking/blocking-connect.pkt