What are Service Primitives?
A service is formally specified by a set of primitives (operations) available to a user process to access the service. These primitives tell the service to perform some action or report on an action taken by a peer entity. If the protocol stack is located in the operating system, as it often is, the primitives are normally system calls. These calls cause a trap to kernel mode, which then turns control of the machine over to the operating system to send the necessary packets. The set of primitives available depends on the nature of the service being provided. The primitives for connection-oriented service are different from those of connection-less service. There are five types of service primitives :
LISTEN : When a server is ready to accept an incoming connection it executes the LISTEN primitive. It blocks waiting for an incoming connection.
CONNECT : It connects the server by establishing a connection. Response is awaited.
RECIEVE: Then the RECIEVE call blocks the server.
SEND : Then the client executes SEND primitive to transmit its request followed by the execution of RECIEVE to get the reply. Send the message.
DISCONNECT : This primitive is used for terminating the connection. After this primitive one can't send any message. When the client sends DISCONNECT packet then the server also sends the DISCONNECT packet to acknowledge the client. When the server package is received by client then the process is terminated.
Connection Oriented Service Primitives
There are 5 types of primitives for Connection Oriented Service :
Connectionless Service Primitives
There are 2 types of primitives for Connectionless Oriented Service:
A service is formally specified by a set of primitives (operations) available to a user process to access the service. These primitives tell the service to perform some action or report on an action taken by a peer entity. If the protocol stack is located in the operating system, as it often is, the primitives are normally system calls. These calls cause a trap to kernel mode, which then turns control of the machine over to the operating system to send the necessary packets. The set of primitives available depends on the nature of the service being provided. The primitives for connection-oriented service are different from those of connection-less service. There are five types of service primitives :
LISTEN : When a server is ready to accept an incoming connection it executes the LISTEN primitive. It blocks waiting for an incoming connection.
CONNECT : It connects the server by establishing a connection. Response is awaited.
RECIEVE: Then the RECIEVE call blocks the server.
SEND : Then the client executes SEND primitive to transmit its request followed by the execution of RECIEVE to get the reply. Send the message.
DISCONNECT : This primitive is used for terminating the connection. After this primitive one can't send any message. When the client sends DISCONNECT packet then the server also sends the DISCONNECT packet to acknowledge the client. When the server package is received by client then the process is terminated.
Connection Oriented Service Primitives
There are 5 types of primitives for Connection Oriented Service :
LISTEN - Block waiting for an incoming connection
CONNECTION - Establish a connection with a waiting peer
RECEIVE - Block waiting for an incoming message
SEND - Sending a message to the peer
DISCONNECT - Terminate a connection
CONNECTION - Establish a connection with a waiting peer
RECEIVE - Block waiting for an incoming message
SEND - Sending a message to the peer
DISCONNECT - Terminate a connection
Connectionless Service Primitives
There are 2 types of primitives for Connectionless Oriented Service:
UNIDATA - This primitive sends a packet of data
FACILITY, REPORT - Primitive for enquiring about the performance of the network, like delivery statistics.
FACILITY, REPORT - Primitive for enquiring about the performance of the network, like delivery statistics.