I am trying to "join the dots" around the networking aspect of Ethereum. From the documents, it seems, the underlying protocol is RLPx that powers the ÐΞVp2p Wire Protocol.
Though TCP provides a connection-oriented medium, ÐΞVp2p nodes communicate in terms of packets. RLPx provides facilities to send and receive packets.
There is a tangential remark in the RLPx documents that it uses RLP.
Packets are dynamically framed, prefixed with an RLP encoded header, encrypted, and authenticated. Multiplexing is achieved via the frame header which specifies the destination protocol of a packet.
The ÐΞVp2p Wire Protocol in turn supports sub-protocols of which Ethereum Wire Protocol is one.
From ÐΞVp2p docs:
ÐΞVp2p is designed to support arbitrary sub-protocols (aka capabilities) over the basic wire protocol.
From Ethereum docs:
Peer-to-peer communications between nodes running Ethereum clients run using the underlying ÐΞVp2p Wire Protocol.
Questions:
- Can you please explain, where/how is the Ethereum sub-protocol plugged in ÐΞVp2p protocol?
- Can APIs of an SDK (say, Javascript) be mapped to Ethereum sub-protocol message IDs?
- Or, is the mapping to message IDs limited to clients such as Geth?