Raw socket limitations in Windows desktop OS versions

Posted: (EET/GMT+2)

 

Sometimes, you might find that the default TCP/IP stack within Windows isn't enough, or you need to implement your own protocol on top of the IP protocol. For these needs, Windows supports something called "raw sockets".

Raw sockets allow you to get low-level access to the networking protocol stack, and all the sockets created have the socket type of "SOCK_RAW".

Raw sockets can be very useful at times, but there are limitations to using them on desktop operating system editions. These limitations do not exists on the server editions, such as Windows Server 2012 R2, but they do exists on Windows 7, for example.

Limitations are listed here, and include:

  • TCP data cannot be sent over raw sockets
  • UDP datagrams with an invalid source address cannot be sent over raw sockets
  • A call to the bind function with a raw socket for the IPPROTO_TCP protocol is not allowed.

Happy hacking!