Network connections between processes within a machine

Asked

Viewed 206 times

0

when giving the command netstat -na in the cmd of windows appear the network connections that are in progress on the machine.

In my appeared several connections having as source and destination IP the "127.0.0.1" which is the address "internal", ie communication of the machine itself with itself.

Does anyone know why Windows does this? Rather than simply (and only) using inter-process communication? (Pipes, fifos, messages, signals...)

inserir a descrição da imagem aqui

  • For your question not to be vague, it would be interesting to add print of this command that you say present internal connections.

  • I put the image...

2 answers

0


Imagine that you need to test your client-server or peer-to-peer application with yourself, your machine is not connected on the Internet, nor does it have a real IP, and the network protocol is TCP/IP. What address would you use to connect to yourself?

Well, the IETF wrote long ago RFC 5735, which, among other things, defines special IP addresses, like this, the 127.0.0.1, called loopback. It is a fixed address that always points to the machine itself. Using the domain localhost results in the same, because in the hosts of the operating system localhostis mapped to 127.0.0.1.

The application never takes care of the network. It makes no difference whether you are running the client and the server on the same machine or on different machines. It will only get the IP and port configuration that is passed to it and ask the operating system to send the communication. But when you send something to 127.0.0.1, the operating system does not even bother to send beyond the network card. The TCP/IP network driver passes directly to the application port.

There are other minor utilities at this address. Such as testing if the installed network communication protocol is the TCP/IP version Ipv4, with the command $ ping 127.0.0.1. The operating system needs to understand this address.

  • Ok, I also use loop back to test programming exercises that use sockets, but that doesn’t explain why my windows has so many open connections like this know.

  • Try running netstat like this: netstat --program. This will show which program left the port open. Sometimes it is Firefox itself...

  • @C.Bohok netstat -b , requires high level

  • Then you will need to ask the Network Admin for help to execute the command as su. I don’t know any other way to know which program is opening the doors, beyond the mentioned form netstat --program. If anyone knows, please comment here, I would also like to know.

0

Does anyone know why Windows does this? Rather than simply (and only) using inter-process communication? (Pipes, fifos, messages, signals...)

It is not quite windows that does this, there are yes some services in it that do this, but most are from other programs that should have installed on your computer.

Imagine a database server, all communication is done by TCP/IP, because it should work via network. And for local communication, it continues to use TCP/IP, but with the loopback address.

Imagine the complication to develop a network communication and a location (between processes, messages, Pipes, etc.) just not to generate these connections in loopback. Totally unnecessary.

Utilize netstat -a -b to see which executables are listening to or communicating with these ports, or software tcpview.exe Sysinternals that shows detailed all OS communications.

Download tcpview: https://docs.microsoft.com/en-us/sysinternals/downloads/tcpview

  • I get it. But when creating a local connection instead of simple communication between processes, it doesn’t end up being more expensive for the machine?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.