From mboxrd@z Thu Jan 1 00:00:00 1970 From: michi1@michaelblizek.twilightparadox.com (michi1 at michaelblizek.twilightparadox.com) Date: Wed, 25 Nov 2015 17:25:16 +0100 Subject: Raw Sockets + Userland TCP Kernel Resetting Packet In-Reply-To: References: Message-ID: <20151125162516.GA4235@grml> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hi! On 10:57 Wed 25 Nov , Bradley Falzon wrote: > Hi, > > I'm writing a program to assist in learning/debugging tcp stacks, it > creates a raw socket and replicates an exceedingly simple tcp stack. By > which I mean, it sends and receives packets, setting correct flags, > payloads etc. > > One difficulty I've come across, after I've created a raw socket and sent > my syn packet, when the syn+ack packet arrives from the peer, my program > receives it fine - but the kernel also resets the connection. You might be able to use the tun/tap device. It basically creates a network interface with a file descriptor of your program being the other side of it. See Documentation/networking/tuntap.txt (in the kernel source) for more details. Is this an option for you? -Michi -- programing a layer 3+4 network protocol for mesh networks see http://michaelblizek.twilightparadox.com