V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
LPeJuN6lLsS9
V2EX  ›  问与答

SSH 协议的握手谁先谁后

  •  
  •   LPeJuN6lLsS9 · Jan 22, 2017 · 1964 views
    This topic created in 3383 days ago, the information mentioned may be changed or developed.

    客户端和服务端通知对方版本的那个包到底是谁先发谁后发呢?我自己观察到的是客户端先发,但是看别人抓包则相反( https://www.youtube.com/watch?v=XfWQ-jXPd8g)

    服务端等客户端先发有什么好处?,为何不惜增大连接建立所用时间这样做呢

    Supplement 1  ·  Jan 22, 2017
    最后一句说错,应为“(像视频里一样)客户端等服务端……”

    补图: https://stackoverflow.com/questions/16205240/which-side-will-initiate-the-version-negotiation-in-the-ssh-transport-layer-prot
    2 replies    2017-01-22 23:19:51 +08:00
    bearice
        1
    bearice  
       Jan 22, 2017
    “ When the connection has been established, both sides MUST send an identification string.” --rfc4253
    其实就是谁先发都无所谓,反正 TCP 是全双工通信的
    LPeJuN6lLsS9
        2
    LPeJuN6lLsS9  
    OP
       Jan 22, 2017
    @bearice 题目起错了, tcp 是全双工所以两边一起发可节约时间,但是图和视频里客户端明显在等服务端
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5963 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 80ms · UTC 02:18 · PVG 10:18 · LAX 19:18 · JFK 22:18
    ♥ Do have faith in what you're doing.