-
The
server program
first creates
a TCP socket and
binds it to
a fixed TCP port#:
(We have learned this step before in
UDP programming)
-
Then the server program
change
the socket to
listen socket
that is used to receive
connection requests:
The listen socket is
a special type of
socekt that
execute the
"3-way handshake" algorithm
to establish a
reliable connection
- A
client program
first
create a
TCP socket:
Bind the
socket
to an arbitrary TCP port # and
use the
socket to
make a connection request
to the server program
(at the listen socket):
The client program use
the connect( ) system call
to do this
(The TCP connection process will
establish a pair of
send/ACK sequence numbers for
the
sliding window algorithm)
- When the processing of
the connection request
is complete,
the TCP module at the
server program will
create a
new TCP socket
for the
TCP connection:
- Result:
- The client program and the
server program can
communicate with each other
through the
TCP connection
(IP1, port1, IP2, port2):
- And, the server can
still accept
other connection requests
using the
listen TCP socket:
The listen socket remains
free to
receive new connection requests
from other clients !!!
- This is how a
web server or
SSH server, and so on... operates
|
|
|