I already know that it is not possible to send raw TCP packet on windows desktops witch mentioned on Microsoft Web Site, But is it possible on new Windows Servers like Windows Server 2019. I don't want to use Pcap or third-party drivers.
Something like this?
var sendSocket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);
sendSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastTimeToLive, 8);
sendSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
var s = new IPv4Header
{
SrcIpAddress = IPAddress.Parse("127.0.0.99"),
DesIpAddress = IPAddress.Parse("127.0.0.90"),
Protocol = 6,
Length = (ushort)Marshal.SizeOf(typeof(IPv4Header))
};
data = s.ToBytes();