Is it Possible to work with IP Layer with IOCP/RIO?

For certain reasons, I need to handle TCP packets myself in the application code i.e. SYN/ACK etc. I was thinking of using Raw sockets in IOCP/RIO, but msdn documentation says that raw sockets are not good for high performance scenarios to use Winsock kernel instead. Has anyone done any work with Raw sockets in high performance applications, Are they slower than a Tcp socket in terms of handling packets?

Other option was going the DPDK route, but its beta on Windows and I can’t seem to get any response from developers at MS regarding dpdk. DPDK on linux seems like the next best option if IOCP/Raw sockets don’t work.

IIRC, raw sockets don’t allow you to use IP protocol number 6, i.e., TCP. You’ll have to do something in kernel mode if you want to circumvent the host IP stack.

Oh sorry for the double post, but I eventually found the exact code in the OS. The block is limited to Client editions of Windows. So you can bind a raw socket using Windows Server, but not Windows 10 client. (The rationale: a compromised process could use raw TCP sockets to muck with other sockets on the same machine. However we assume that Servers are less likely to get infected with malware, and more likely to want to run a serious network workload.)

I will be using raw sockets in Windows Server. I currently have two questions that I can’t figure out, so was hoping someone experienced can provide their input.

  1. How does raw socket performance compare to a udp socket in RIO? assuming raw socket is bound to a specific IP.

The reason I ask is because of this on msdn: “There are further limitations for applications that use a socket of type SOCK_RAW. For example, all applications listening for a specific protocol will receive all packets received for this protocol. This may not be what is desired for multiple applications using a protocol. This is also not suitable for high-performance applications. To get around these issues, it may be required to write a Windows network protocol driver (device driver) for the specific network protocol.”

  1. If I generate tcp ip packets using raw sockets, would windows tcp/ip stack kick in as well? e.g. I send out a SYN and client responds with SYN/ACK, would windows automatically send back RST (because according to it the connection doesn’t exist) OR does it silently ignore - allowing me the chance to continue communication?
  1. If I generate tcp ip packets using raw sockets, would windows tcp/ip stack kick in as well? e.g. I send out a SYN and client responds with SYN/ACK, would windows automatically send back RST (because according to it the connection doesn’t exist) OR does it silently ignore - allowing me the chance to continue communication?

Figured out the answer to this. The solution is to remove TCP/IP protocol from network connection settings this will disable windows/winsock from intercepting any tcp packets, however, it will stop other applications on the machine from communicating as well - unless you have multiple NICs.