Which of the following system calls results in the sending of SYN packets?
2008
Which of the following system calls results in the sending of SYN packets?
- A.
socket
- B.
bind
- C.
listen
- D.
connect
Attempted by 346 students.
Show answer & explanation
Correct answer: D
Answer: connect
Why: The connect system call performs an active TCP open. When connect is called on a TCP socket, the kernel sends a TCP SYN packet to the remote endpoint to start the three-way handshake.
socket: creates a local endpoint (socket descriptor); it does not transmit packets.
bind: assigns a local IP address and port to a socket; it does not initiate a TCP connection.
listen: places a socket into passive mode so it can accept incoming connections; it does not send SYN packets.
connect: performs an active open and causes the kernel to send a TCP SYN to initiate the three-way handshake.
A video solution is available for this question — log in and enroll to watch it.