[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 458
  • Last Modified:

How tcp/ip client server listening sockets work...

I know that in the client server pardigm of tcpip-based sockets, the server app listens at a specific IP address and port number....

The server app then spawns? a connection such that any subsequent socket communication between the client and the server is done via another port number? My understnading is that this is necessary so as to enable the server to keep listening on the listening port and to be able to handle multiple requests....

In terms of enabling this communication when using a firewall, do port numbers other than the one being used as a listening socket need to be freed up to permit the "after the listen socket answers the call" connection establishment to take place?

  • 2
2 Solutions
Yes the server app does usually spawn or at least there is a new thread started within the main process in order for the software to be able to handle multiple simultaneous connections.

However the port number does not change. When the client makes a connection to a server it does so from its IP address and a high numbered port (1024 - 65535) and it is the operating system at the servers end which keeps record of all the open connections and passes the data from the client to the correct server process bases upon the source IP address and port.
Therefore as far as the firewall is concerned you just permit traffic to the servers port (port 80 for standard web traffic for example).
There are a few awkward protocols such as FTP where a separate connection is used to transfer the data so the firewall needs to open these up aswell. Most firewalls inspect the commands issued on a FTP connection to see what ports are going to be used for the data connection and automatically open these for that single session.
Good idea to go through this video hands-on; simple + small + good



Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now