To recieve packets any computer with NIC card, one needs only Layer-2 Mac destination address. Hence Is it actually possible to send some data to remote destination over tcp/ip without any socket?
[Answer] yes, send your packet with the destination MAC address as the desired Computer MAC address. The Packet will be received on the NIC without dropping. This is true if the remote destination is the same LAN or can be reached via the VLAN group or connected peer to peer.
Note: if the question was Is it actually possible to send some data to remote destination (not in the same LAN network) over tcp/ip without any socket?
[Answer] No, if the destination (remote target) is not in your network you can not reach the target machine with just MAC address and/or VLAN.
there are 2 options
- if the machines are connected via Layer-2 tunnels like MPLS, VxLAN, PPoP you can encapsulate the original packet (Ethernet MAC + Payload)
- You can use IP or IP encapsualtion, where a router will identify the IP address to MAC conversion and forward through right part making it reach the destination.
note: DPDK, PF_RING, Netmap, XDP are mechanism to bypass Kernel Stack. Using Kernel Bypass you receive or transmit packets from the NIC. But it will depend upon the actual value of L2/L3 where network switch or router will sent or forward packet in network