The Gateway to Computer Science Excellence
+20 votes
3.5k views

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

  1. socket

  2. bind

  3. listen

  4. connect

in Computer Networks by Veteran (52.2k points) | 3.5k views
+1
+1
0

Very nicely explained here!

https://notes.shichao.io/unp/ch4/

3 Answers

+50 votes
Best answer

Answer is (D).

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.

by Boss (17k points)
edited by
+9

The typical set of system calls on both the machines in a connection-oriented setup is shown in given flowchart.

  • accept() is used on the server side. It accepts a received incoming attempt to create a new TCP connection from the remote client, and creates a new socket associated with the socket address pair of this connection.
  • write() and read(), are used for sending and receiving data to/from a remote socket.
  • close() causes the system to release resources allocated to a socket. In case of TCP, the connection is terminated..
  • source:https://www.cse.iitk.ac.in/users/dheeraj/cs425/lec18.html
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.
by (359 points)
–7 votes
ans b)
by Loyal (5.2k points)
+1
It is connect !

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,645 questions
56,563 answers
195,732 comments
101,646 users