Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the difference between an active open and a passive open in a TCP socket?

Tags:

networking

I am studying basics of networking and get confused about it. Can any one explain difference between the two in simple words.

like image 314
Adarsh Jayakumar Avatar asked Mar 29 '15 21:03

Adarsh Jayakumar


People also ask

What is active open and passive open in TCP?

Active: the client is responsible for the active opening of a TCP connection. It means that the client must pro-actively send a connection request (SYN) to an already known server (IP and port) using the connect operation. Passive: the server is in charge of the passive opening of TCP connections.

What are the differences between active and passive sockets?

Active sockets are used by clients who initiate connection requests with CONNECT. By default, SOCKET creates active sockets. Passive sockets are used by servers to accept connection requests with the CONNECT macro.

What is active close and passive close in TCP?

The program that initiates the closedown process by issuing the first close() call is said to initiate an active close. The program that closes in response to the initiation is said to initiate a passive close.

What does a passive socket do?

A passive socket or acceptor socket is a type of socket that is used to wait for connection establishment requests from remote applications that communicate over the TCP protocol.


2 Answers

  • A passive open is the creation of a listening socket, to accept incoming connections. It uses socket(), bind(), listen(), followed by an accept() loop.
  • An active open is the creation of a connection to a listening port by a client. It uses socket() and connect().
like image 114
user207421 Avatar answered Sep 17 '22 13:09

user207421


at least in simple terms: passive open is on the SERVICE (server or listener) side active is the CLIENT (source or initiat

like image 43
Jim Stock Avatar answered Sep 19 '22 13:09

Jim Stock