Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 04-10-2013, 07:48 AM   #1
LQ Newbie
Registered: Apr 2013
Posts: 2

Rep: Reputation: Disabled
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!

Old 04-13-2013, 01:26 PM   #2
Registered: Dec 2012
Location: inside the matrix
Distribution: Debian, Xubuntu, Gentoo, Antergos
Posts: 90

Rep: Reputation: 27
You can use hosts.allow:
Old 04-22-2013, 01:32 PM   #3
LQ Newbie
Registered: Apr 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
TCP session establishment problem slonko Linux - Networking 1 06-04-2010 09:50 AM
monitoring tcp session sunlinux Linux - Security 4 03-23-2009 11:29 AM
Web Page Access and TCP Session shreks Linux - Networking 4 11-17-2008 09:58 AM
Reconstruction of TCP Session from Captured IP Packets shreks Linux - Networking 3 11-15-2008 09:08 AM
tcp session motinor/killer ? fcarli Linux - Software 1 12-04-2003 11:15 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:47 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration