Which of the following system calls results in the sending of SYN packets?
(A) socket
(B) bind
(C) listen
(D) connect
Answer: (D)
Explanation: socket() creates a new socket of a certain socket type, identified by an integer number, and allocates system resources to it.
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.
listen() is used on the server side, and causes a bound TCP socket to enter listening state.
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 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.
Sources: Berkeley sockets, TCP Connection Establishment and Termination
Quiz of this Question
Recommended Posts:
- GATE | GATE CS 2008 | Question 1
- GATE | GATE CS 2008 | Question 2
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 4
- GATE | GATE CS 2008 | Question 5
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 8
- GATE | GATE CS 2008 | Question 9
- GATE | GATE CS 2008 | Question 10
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 12
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 14
- GATE | GATE CS 2008 | Question 15
- GATE | GATE CS 2008 | Question 17
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 20
- GATE | GATE CS 2008 | Question 21

