LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   TCP Session Management (https://www.linuxquestions.org/questions/linux-networking-3/tcp-session-management-4175457643/)

jason.young 04-10-2013 07:48 AM

TCP Session Management
 
I need to know how the Linux implementation of TCP performs it's session management.

I would like to see some documentation, or perhaps the source code for scenarios like this:

An application Listens on: Local IP = A, Local Port = P, Remote IP = *, Remote Port = *. Effectively the local server scenario where you know nothing about whom will attempt to connect.

What would happen if another application (or the same one with more information about its peers) Listens on: Local IP = A, Local Port = P, Remote IP = B, Remote Port = *. Basically, expecting a connection from B, but do not know the remote ephemeral port.

I can imagine a scenario where it would be desirable to have multiple listens like this, but I don't know how Linux would behave in this scenario.

It would be very easy to actual code up an example of this particular scenario to validate behavior, but I'm really interested in how tcp session management in general works under Linux, the above is just an example.

Thanks in advance!

Jason

jnihil 04-13-2013 01:26 PM

You can use hosts.allow:

http://static.closedsrc.org/articles...sts_allow.html

jason.young 04-22-2013 01:32 PM

Not quite what I'm looking for, but thanks for trying.
 
Thanks for the response, but that's not quite what I'm looking for I'm afraid.

I found the man page for Listen, which implies that TCP will only be able to listen on a single port a single time. I'm not convinced that is a necessary restriction, since a system can have many local addresses - but I think it answers my question.

In my case, I am using an implementation of TCP that is still a work in progress (not the Linux TCP service), and cannot use linux services to hack my way around this.

I'm considering implementing an alternative session manager that sits between TCP and the application that will allow it to manage multiple listens on the same port using different mixtures of local and remote addresses. It might be overkill, but provides an interesting abstraction that I can exploit in my application.

Thanks for the views and the response.


All times are GMT -5. The time now is 01:56 AM.