I am currently having a look into the RLPx protocol and trying to understand on how two nodes exchange their capabilities.
Each subprotocol has a number of defined messages.
eth has 12 messages (ids are
0x00 - 0x07, 0x0D - 0x10) and
les has 23 messages (ids are
0x00 - 0x17). There is also
RLPx is used to establish a connection between peers and after that, they are able to exchange messages from the subprotocols using the established connection.
Let's say we have two nodes who want to use the
les subprotocol. Both subprotocols have the status message with the id
0x00. I am wondering how a peer knows know to with subprotocol a received status message belongs to.
I tried to read the RLPx docs but I don't understand on how this is done.