I heard that for TCP connection, server will listen on 1 port, and use another port for sending data.
For example, web server listen on port 80. Whenever client connects to it, this server will use another port (say 9999) to send data (web content) to client. If multiple clients connect to it, does this server create multiple "another ports" to send data back ?
And does the client uses 2 ports (listening port and sending-data port) as the server does ?
Am I right? I heard many people said that and I can't find any good books or articles about this
Please explain
TCP Ports 80 and 443 Arguably the single most famous port on the Internet, TCP port 80 is the default that HyperText Transfer Protocol Web servers listen on for Web browser requests. Port 443 is the default for secure HTTP.
A TCP connection has two ends and permits communication in both directions. Each end's sending port is the other end's receiving port. That is always the case. If you're asking if each end's sending port can be the same as the other end's receiving port, the answer is yes.
TCP and UDP ports are not related to each other. TCP ports are interpreted by the TCP stack, while the UDP stack interprets UDP ports. Ports are a way of multiplexing the connection so that multiple devices can connect to a node.
The TCP Open Connection node opens a connection to the server at the port and address you specify. The address must match the IP address of the server, and the port you specify on the client must match the port you specify on the server. TCP Write nodes write data to the specified port and send commands to the server.
I heard that for TCP connection, server will listen on 1 port, and use another port for sending data.
No. The same port is used for both listening and for accepted connections, and the same connection is normally used for both sending and receiving. TCP connections are bidirectional. FTP is an exception to this, as it uses two connections: one for commands and one for data.
For example, web server listen on port 80. Whenever client connects to it, this server will use another port (say 9999) to send data (web content) to client.
No.
If multiple clients connect to it, does this server create multiple "another ports" to send data back ?
No.
And does the client uses 2 ports (listening port and sending-data port) as the server does ?
No.
Am I right?
No.
I heard many people said that
They were all wrong.
and I can't find any good books or articles about this
There aren't any. Only a very bad book or article would say any such thing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With