Sending data between two TCP applications through a physical loop. Will it pass through the network adapter?

What is the actual data path if I run 2 applications sending / receiving data using sockets through a TCP loop? Will this data pass through a Windows network driver and / or network equipment?

EDIT. Please think that this is not a "loopback" of Windows, but a physical loop made on a network adapter with two ports connected by a cable to each other, which makes it a physical circuit.

+4
source share
1 answer

Loopback is a virtual interface, there is no equipment corresponding to it. Data copying occurs inside the kernel even above the driver level.

Change 0:

You mix two different things: loopback in TCP / IP is a virtual network interface with a special address in the subnet 127/8 , usually 127.0.0.1 , which is created for you by default, and an ethernet crossover cable loop between two cards on the same computer.

I addressed the first case in my original answer.

The behavior of the TCP / IP stack in the second case depends on the implementation and transport settings. For a TCP connection and for unicast UDP, the kernel can simply understand that both the source and destination addresses are local to the machine and transmit data via a short circuit through memory. You will find that most modern network stacks behave this way. For broadcast or multicast UDP, there is no other option than to send packets through a physical card, as there may be other listeners on the network.

+4
source

All Articles