Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

For example, postgres does the following as shown with lsof -i:

COMMAND    PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
postgres 29200 postgres    8u  IPv6 470362      0t0  UDP localhost.localdomain:53152->localhost.localdomain:53152 
postgres 29202 postgres    8u  IPv6 470362      0t0  UDP localhost.localdomain:53152->localhost.localdomain:53152 
postgres 29203 postgres    8u  IPv6 470362      0t0  UDP localhost.localdomain:53152->localhost.localdomain:53152 
postgres 29204 postgres    8u  IPv6 470362      0t0  UDP localhost.localdomain:53152->localhost.localdomain:53152 
postgres 29205 postgres    8u  IPv6 470362      0t0  UDP localhost.localdomain:53152->localhost.localdomain:53152 
postgres 29206 postgres    8u  IPv6 470362      0t0  UDP localhost.localdomain:53152->localhost.localdomain:53152

First of all, is this even multicast (how can I tell)? If so, can some other app also connect to the UDP port and subscribe to the data passing through the port? I'm new to networking, and not entirely sure if this is even possible, but I'm just curious, with security on my mind.

EDIT 8/30/13: Can some process anywhere on the network or same machine observe the data going in and out of a port (e.g. 53152 in the above case), and with which privileges? How?

share|improve this question

2 Answers 2

The fact that it says localhost.localdomain connects to localhost.localdomain means that this can't be multicast. Here is a description of multicast in IPv6: http://en.wikipedia.org/wiki/IPv6#Multicasting

It would be easier to help you if you describe what you are trying to achieve. Do you want to use multicast, if so for what exactly? Or is your goal to make sure it isn't multicasting?

share|improve this answer
    
It's my goal to make sure everything on the network is secure. Ultimately, my server runs a few LAMP, Node.js, and Ruby apps on a few ports, and things like postgresql and mysql are services on other ports needed by those apps, so I'm just trying to make sure those services are secure (e.g. not running as root). I'm new to security, so I'm just wondering if there's any possible security implications of the setup you see in my question. THanks! –  trusktr Aug 30 '13 at 19:37

can some other app also connect to the UDP port and subscribe to the data passing through the port?

Port numbers are unique -- e.g. you can't have more than one process open a specific port for listening. However, there's no such limit to the number of connections that can be made to the port. It is up to the one process controlling the port to accept such connections.

So in a sense there is a just a single stream of data, but it can be composed of multiple connections, and only the process controlling the port sees all of it. However, ports are just addresses used to route (essentially: sort) the flow of information: they are not truly secure and private. The nature of networking is such that in fact all the traffic on a network (including the "local loopback") is visible to all the machines on that network (although for loopback, there is only one, the local machine), and, on *nix at least, there are means by which a process with the right privileges can observe all of that. However, this is not used as a technique for communication since a watcher in that sense is not a participant (it doesn't involve making a connection with anything).

share|improve this answer
    
Thanks for that answer (specifically about observing the data. That's what I'm interested in, in order to prevent that sort of thing and make my server more secure. What type of privileges would a process need in order to "observe" data from any port in the network? –  trusktr Aug 30 '13 at 19:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.