28 votes 28 votes Which of the following system calls results in the sending of SYN packets? $\textsf{socket}$ $\textsf{bind}$ $\textsf{listen}$ $\textsf{connect}$ Computer Networks gatecse-2008 normal computer-networks sockets + – Kathleen asked Sep 11, 2014 edited Jun 20, 2021 by Lakshman Bhaiya Kathleen 15.0k views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Chhotu commented Dec 20, 2017 reply Follow Share https://en.wikipedia.org/wiki/Berkeley_sockets Why is Bind() system call execution is not required on client side ? Ans -https://stackoverflow.com/questions/21645970/in-socket-programming-why-a-client-is-not-bind-to-an-address 2 votes 2 votes vijay_jr commented Jan 3, 2018 reply Follow Share References : 1) http://soft.vub.ac.be/~tvcutsem/distsys/sockets.pdf 2) http://www.csd.uoc.gr/~hy556/material/tutorials/cs556-3rd-tutorial.pdf 1 votes 1 votes Utkarsh Joshi commented Jan 27, 2019 reply Follow Share Very nicely explained here! https://notes.shichao.io/unp/ch4/ 0 votes 0 votes Please log in or register to add a comment.
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. The client requests a connection by sending a SYN (synchronize) message to the server. The server acknowledges this request by sending SYN-ACK back to the client. The client responds with an ACK, and the connection is established. minal answered Aug 8, 2015 edited Jun 20, 2021 by Lakshman Bhaiya minal comment Share Follow See all 2 Comments See all 2 2 Comments reply meghna commented Aug 29, 2018 i edited by meghna Aug 29, 2018 reply Follow Share 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 27 votes 27 votes slow_but_detemined commented Dec 16, 2019 reply Follow Share Nice Thank you ! 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes To form a new TCP connection, we use CONNECT system call. shashankrustagi answered Jul 31, 2020 shashankrustagi comment Share Follow See all 0 reply Please log in or register to add a comment.
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. Akash Ghosh answered Sep 20, 2019 Akash Ghosh comment Share Follow See all 0 reply Please log in or register to add a comment.
–7 votes –7 votes ans b) Aditi Dan answered Dec 23, 2014 Aditi Dan comment Share Follow See 1 comment See all 1 1 comment reply Akash Kanase commented Dec 12, 2015 reply Follow Share It is connect ! 3 votes 3 votes Please log in or register to add a comment.