通信协议是半双工还是全双工? [英] Are communication protocol Half-duplex or Full-duplex?

查看:77
本文介绍了通信协议是半双工还是全双工?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有很多不同的通讯协议,例如: http,tcp,ssh,socks5,SMTP,POP等.

I know there are a lot of different comminucation protocals like: http, tcp, ssh, socks5, SMTP, POP,etc.

我也知道要实现通信,我们需要将 localhost:localport 连接到 remotehost:remoteport .例如,如果我们用Google搜索,则可以将随机的本地 port 连接到 www.google.com:80 .如果我们 ssh 是远程主机,则可以将随机的本地 port 连接到 remotehost:22 .

I also know that to achieve a comminication, we need to connect localhost:localport to remotehost:remoteport. For example, if we google something, we would connect a random local port to www.google.com: 80. If we ssh a remote host, we would connect a random local port to remotehost: 22.

我的问题是:通信协议是半双工还是全双工?

My question is: Are communication protocol Half-duplex or Full-duplex?

我猜答案是半双工.因为我认为在 http 连接中,首先我们将请求从 localhost:localport 发送到 remotehost:80 ,然后远程服务器将其发送从 remotehost:80 localhost:localport 的响应.同样,在 ssh 连接中,首先我们将 ssh 命令发送到远程主机,在收到命令后,远程主机会做一些事情并将结果发送回本地主机

I guess the answer is Half-duplex. Because I think in http connection, at first we send the request from localhost:localport to remotehost:80, and then the remote server send its response from remotehost:80 to localhost:localport. Similarly, in ssh connection, at first we sent the ssh commands to remote host, after receiving the commands, the remote host do something and send the results back to the local host.

所以我认为在 localhost:localport remotehost:remoteport 之间的一种连接中,消息是从 localhost:localport 发送到 remotehost:remoteport ,或从 remotehost:remoteport localhost:localport .

So I think in one connection between localhost:localport and remotehost:remoteport, the message is sent either from localhost:localport to remotehost:remoteport, or from remotehost:remoteport to localhost:localport.

我说得对吗?

推荐答案

中所述这篇文章:

SSH是双向全双工协议,这意味着它不像HTTP那样同步,在HTTP中,您需要发送消息以进行响应.
使用SSH,即使您保持沉默,远程主机也可能希望告诉您一些信息.该连接器使用回调流程方法将发送"操作与接收"操作分离.

SSH is a bidirectional full duplex protocol, which means that it’s not synchronous like HTTP where you need to send a message for a response to happen.
With SSH the remote host might want to tell you something even if you have remained silent. This connector uses a callback flow approach to decouple the "sending" operation from the "receiving" operation.

在此IETF草案中, 中所述,大多数实现确实允许全双工HTTP(用于2xx响应).

As documented in this IETF draft, most implementations do allow full-duplex HTTP (for 2xx responses).

全双工HTTP遵循基本的HTTP请求-响应语义,但也允许服务器在客户端将请求主体发送到服务器的同时,将响应主体发送到客户端.

Full-duplex HTTP follows the basic HTTP request-response semantics but also allows the server to send response body to the client at the same time when the client is transmitting request body to the server.

全双工HTTP的要求在现有的HTTP(超文本传输​​协议-HTTP/1.1)规范中没有得到充分说明,并且本备忘录旨在在基本HTTP协议语义的基础上阐明全双工HTTP的要求.

Requirements for full-duplex HTTP are under-specified in the existing HTTP (Hypertext Transfer Protocol -- HTTP/1.1) specification, and this memo intends to clarify the requirements of full-duplex HTTP on top of the basic HTTP protocol semantics.

这篇关于通信协议是半双工还是全双工?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆