Socket characteristics Sockets are characterized by their domain, type and transport protocol. Common domains are: AF_UNIX: address format is UNIX pathname AF_INET: address format is host and port number Common types are: received in order transmitted and reliably virtual circuit: arbitrary order, unreliable datagram: Each socket type has one or more protocols. Ex: TCP/IP (virtual circuits) UDP (datagram) Use of sockets: sockets communicate client-server: the server waits for a connection from the client Connectionless sockets are peer-to-peer: each process is symmetric. Socket APIs creates a socket of a given domain, type, protocol (buy a phone) socket: assigns a name to the socket (get a telephone number) bind: specifies the number of pending connections that can be queued for a server socket. (call waiting listen: allowance) server accepts a connection request from a client (answer phone) accept: client requests a connection request to a server (call) connect: write to connection (speak) send, sendto: Dept of ISE, CIT, Gubbi Page no44 Networks Lab 2015-16 read from connection (listen) recv, recvfrom: end the call shutdown: Connection-based communication Server performs the following actions create the socket socket:
Socket characteristics Sockets are characterized by their domain, type and transport protocol. Common domains are: AF_UNIX: address format is UNIX pathname AF_INET: address format is host and port number Common types are: virtual circuit: received in order transmitted and reliably datagram: arbitrary order, unreliable Each socket type has one or more protocols. Ex: TCP/IP (virtual circuits) UDP (datagram) Use of sockets: sockets communicate client-server: the server waits for a connection from the client Connectionless sockets are peer-to-peer: each process is symmetric. Socket APIs socket: creates a socket of a given domain, type, protocol (buy a phone) bind: assigns a name to the socket (get a telephone number) listen: specifies the number of pending connections that can be queued for a server socket. (call waiting allowance) accept: server accepts a connection request from a client (answer phone) connect: client requests a connection request to a server (call) send, sendto: write to connection (speak) Dept of ISE, CIT, Gubbi Page no44 Networks Lab 2015-16 recv, recvfrom: read from connection (listen) shutdown: end the call Connection-based communication Server performs the following actions socket: create the socket
ISE-VINAY-NET.docx