edited by
14,992 views
28 votes
28 votes

Which of the following system calls results in the sending of SYN packets?

  1. $\textsf{socket}$

  2. $\textsf{bind}$

  3. $\textsf{listen}$

  4. $\textsf{connect}$

edited by

4 Answers

Best answer
60 votes
60 votes

Answer is (D).

  • $\textsf{socket()}$   creates a new socket of a certain socket type, identified by an integer number, and allocates system resources to it.
  • $\textsf{bind()}$  is typically used on the server side, and associates a socket with a socket address structure, i.e. a specified local port number and IP address.
  • $\textsf{listen()}$ is used on the server side, and causes a bound TCP socket to enter listening state.
  • $\textsf{connect()}$ is used on the client side, and assigns a free local port number to a socket. In case of a TCP socket, it causes an attempt to establish a new TCP connection.

When $\textsf{connect()}$ is called by client, following three way handshake happens to establish the connection in TCP.

  1. The client requests a connection by sending a SYN (synchronize) message to the server.
  2. The server acknowledges this request by sending SYN-ACK back to the client.
  3. The client responds with an ACK, and the connection is established.
edited by
0 votes
0 votes
Connect is used for connection establishment . In connection establishment, first sender will send  SYN flag-synchronization flag which is used to synchronize and tell the receiver that sender is interested in connection establishment.
Answer:

Related questions

26 votes
26 votes
4 answers
2
Kathleen asked Sep 12, 2014
10,003 views
In the slow start phase of the TCP congestion algorithm, the size of the congestion window:does not increaseincrease linearlyincreases quadraticallyincreases exponentiall...
27 votes
27 votes
4 answers
3
34 votes
34 votes
3 answers
4
go_editor asked Sep 28, 2014
11,137 views
Which of the following socket API functions converts an unconnected active TCP socket into a passive socket?$\textsf{connect}$$\textsf{bind}$$\textsf{listen}$$\textsf{acc...