nomnombunty
nomnombunty

Reputation: 863

how to test user space tcp/ip stack?

I am working on a user space tcp stack (mostly just for fun) and I am having some trouble testing it against the unix tcp stack. Currently the only form of testing is done via unit tests. However, I want to test my tcp stack against a real kernel tcp stack. I tried the following setups without much success.

Note: I am using ubuntu 12.04.

Upvotes: 1

Views: 2248

Answers (1)

Dan
Dan

Reputation: 11

You can use the conntrack tool to try getting more information on why it's not working with using raw sockets. If for some reason the kernel gets confused about the state of the tcp connection, it may be deciding to reset it. You could try telling the kernel not to track connections to rule this out by setting a notrack rule in the raw table. Something like

iptables -t raw -A PREROUTING -p tcp --port 8080 -j NOTRACK

Try using tcpdump on the tun/tap device and iptables counts to see where the packet gets dropped. I would also try tun devices instead so you only have to worry about layer 3.

Upvotes: 1

Related Questions