I'm trying to understand the algorithms underlying the ethereum overlay network and how do the peers communicate between each other. By looking around I arrived finally to the RLPx and devp2p protocols' specification. In the former the "encrypted handshake" is explained, while in the latter the Hello message is explained. I cannot understand if they are the same thing with different names, or if they are different things.
According to the go ethereum (geth) source code (subdirectory p2p) the devp2p Hello message, is named handshakeMsg (the devp2p packet codes are defined in the file p2p/peer.go
). In the file p2p/rlpx.go
the function doProtoHandshake is defined and corresponds exactly to what is described as Hello in devp2p protocols specification. Therefore I can conclude that the whole RLPx handshake is performed in two phases: firstly, the "Encoding Handshake" and secondly the protohandshake which contains the exchange of the capabilities and is already "part" of the devp2p protocol. I'm wrong?