📜  服务原语

📅  最后修改于: 2021-08-27 17:47:54             🧑  作者: Mango

服务通常包括各种原语的集合。原语仅表示操作。

服务由一组可用的原语指定,并提供给用户或其他各种实体以访问该服务。所有这些原语仅告诉服务执行某些操作或报告对等实体采取的操作。在分层体系结构中通信的每个协议还以对等方式与其某些远程协议实体进行通信。

原语称为层之间的调用函数,用于管理相邻协议层之间(即同一通信节点之间)的通信。可用的原语集通常取决于所提供服务的性质。

服务原语分类:

Primitive Meaning
Request It represent entity that wants or request service to perform some action or do some work (requesting for connection to remote computer).
Indication It represent entity that is to be informed about event (receiver just have received request of connection).
Response It represents entity that is responding to event (receiver is simply sending the permission or allowing to connect).
Confirm It represent entity that acknowledges the response to earlier request that has come back (sender just acknowledge the permission to get connected to the remote host).

在上图中,这四个原语的工作方式如下:

  • 要求 –
    该原语逐层(N + 1)传输或发送到N层,仅用于服务请求。
  • 指示–
    该原语由第N层返回到第(N + 1)层,以仅建议激活正在请求的服务或由第N层的服务启动的操作。
  • 回复 –
    该原语简单地由层(N + 1)提供以响应指示原语。它可能会确认或完成先前由指示原语调用的操作。
  • 确认 –
    该原语是由N个返回层到请求(N + 1)层简单地确认或事先由请求原语调用完成动作。

服务原语的参数:
一些服务原语需要参数。这些在下面给出:

  • 连接。要求 –
    启动实体执行此Connect.Request。它仅指定并确定我们要连接的计算机,所需的服务类型以及在连接上使用的数据包或消息的最大大小。

  • 连接。指示–
    接收器获得此Connect.Indication。它仅指定我们要使用的呼叫者身份服务,例如FTP和Telnet等,以及交换的数据包的最大大小。
  • 连接。回复 –
    它只是指定是要接受还是简单地拒绝所请求的连接。
  • 连接。确认 –
    它只是使用发出初始Connect的实体找出或确定发生了什么。要求。

面向连接的服务的原语:

Primitive Meaning
Listen When server is ready to accept request of incoming connection, it simply put this primitive into action. Listen primitive simply waiting for incoming connection request.
Connect This primitive is used to connect the server simply by creating or establishing connection with waiting peer.
Accept This primitive simply accepts incoming connection form peer.
Receive These primitive afterwards block the server. Receive primitive simply waits for incoming message.
Send This primitive is put into action by the client to transmit its request that is followed by putting receive primitive into action to get the reply. Send primitive simply sends or transfer the message to the peer.
Disconnect This primitive is simply used to terminate or end the connection after which no one will be able to send any of the message.

无连接服务的原语:

Primitive Meaning
Unitdata Unitdata primitive is simply required to send packet of data or information.
Facility, Report This primitive is required for getting details about the performance and working of the network such as delivery statistics or report.