Skip to content

Commit 72c426d

Browse files
committed
gh-148 EL networking specs and discovery process overview added | wordlist updated
1 parent b2928d1 commit 72c426d

File tree

2 files changed

+30
-20
lines changed

2 files changed

+30
-20
lines changed

docs/wiki/EL/devp2p.md

+28-20
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ This section covers a brief overview of the differences and similarities between
99
as well as the protocols involved in the transport layer used in DevP2P: TCP and UDP.
1010

1111
In terms of networking, both models refer to the same process of communication between layers.
12-
Just as Kurose and Ross explain (2020), the computer networks are divided into different layers, and each one of them has a specific responsibility. The OSI model has seven layers, while the TCP/IP model has four layers. The OSI model is more theoretical and the TCP/IP model is more practical. The OSI model is a reference model created by the International Organization for Standardization (ISO) to provide a framework for understanding networks. The TCP/IP model was created by the Department of Defense (DoD) to ensure that messages could be transmitted between computers regardless of the types of computers involved. The TCP/IP model is a concise version of the OSI model:
12+
Just as Kurose and Ross explain (2020), the computer networks are divided into different layers, and each one of them has a specific responsibility. The OSI model has seven layers, while the TCP/IP model has four layers. The OSI model is more theoretical and the TCP/IP model is more practical.
13+
The OSI model is a reference model created by the International Organization for Standardization (ISO) to provide a framework for understanding networks. The TCP/IP model was created by the Department of Defense (DoD) to ensure that messages could be transmitted between computers regardless of the types of computers involved.
14+
The TCP/IP model is a concise version of the OSI model:
1315

1416
![alt text](../../images/el-architecture/osi-tcpip-models.png)
1517

@@ -26,28 +28,33 @@ Assuming the communication schema proposed by Claude Shannon (1948), every commu
2628
This is important to mention because regardless of the computer architecture, it could be part of a network if it follows the communication and protocol specifications of the models mentioned above.
2729

2830
Focusing on the transport layer, the two protocols used by DevP2P are TCP (Transmission Control Protocol) and UDP (User Datagram Protocol).
29-
Both protocols are used to send data over the internet, but they have different characteristics. Just as Tanenbaum points it out (2021),TCP is a connection-oriented protocol, which means that it establishes a connection between the sender and the receiver before sending data. It is reliable because it ensures that the data is delivered in the correct order and without errors. UDP is a connectionless protocol, which means that it does not establish a connection before sending data. It is faster than TCP because it does not have to establish a connection before sending data, but it is less reliable because it does not ensure that the data is delivered in the correct order or without errors.
31+
Both protocols are used to send data over the internet, but they have different characteristics. Just as Tanenbaum points it out (2021),TCP is a connection-oriented protocol, which means that it establishes a connection between the sender and the receiver before sending data.
32+
It is reliable because it ensures that the data is delivered in the correct order and without errors. UDP is a connectionless protocol, which means that it does not establish a connection before sending data.
33+
It is faster than TCP because it does not have to establish a connection before sending data, but it is less reliable because it does not ensure that the data is delivered in the correct order or without errors.
3034

3135
![img.png](../../images/el-architecture/tcpudp.png)
3236

3337
## EL's networking specs
34-
* peer-to-peer networking protocol
35-
* gossiping data (1:N) and request/response (1:1) communication
36-
* Client software divided into Execution and Consensus (each one have its own p2p network)
37-
* Execution network propagates transactions
38-
* Two network stacks:
39-
* UDP-based transport layer (discovery and finding peers)
40-
* TCP-based transport layer (devp2p, exchange information)
41-
* Discovery protocol
42-
43-
How nodes find each other
44-
* bootstrap nodes
45-
* Kademlia
46-
* Hash tables
47-
* PING/PONG hashed messages
48-
* Find neighbours: list of peers
49-
50-
start client --> connect to bootnode --> bond to bootnode --> find neighbours --> bond to neighbours
38+
As a peer-to-peer network Ethereum implies a series of rules to enable communication between its participant nodes. This section cover an explanation of which are those rules and how they are implemented in the EL.
39+
Considering each Ethereum node is built upon two different components: the execution client and the consensus client, each one of them has its own peer-to-peer network with its own purpose.
40+
The execution client is responsible for gossiping transactions, while the consensus client is responsible for gossiping the blocks.
41+
42+
Keeping this in mind, the scope of the EL network covers two different stacks working in parallel: the discovery one, and the information transport itself.
43+
The discovery stack is responsible for finding the node peers, while the transport stack is responsible for sending and receiving messages between them.
44+
Taking the computer networks background into account, then we can infer that the discovery stack relies on the UDP protocol, while the information exchange stack relies on the TCP protocol.
45+
The reason behind this is that the information exchange requires a reliable connection between the nodes,
46+
so they can be able to both confirm the connection before sending the data and have a way to ensure that the data is delivered in the correct order and without errors (or at least to have a way to detect and correct them),
47+
while the discovery process does not require the reliable connection, since it is enough to let other knows that the node is available to communicate.
48+
49+
### Discovery
50+
The process of how the nodes find each other in the network starts with [the hardcoded bootnodes listed in the specification](https://github.com/ethereum/go-ethereum/blob/master/params/bootnodes.go).
51+
The bootnodes are nodes that are known by all the other nodes in the networks (both Mainnet and testnets), and they are used to bootstrap the discovery peers process.
52+
Using the Kademlia DHT (Distributed Hash Table) algorithm, the nodes are able to find each other in the network by referring to a routing table where the bootnodes are listed.
53+
The TLDR of the Kademlia is that it is a peer-to-peer protocol that enables nodes to find each other in the network by using a distributed hash table, as Leffew mentioned in his article (2019).
54+
55+
That is to say, the connection process starts with a PING-PONG game where the new node send a PING message to the bootnode, and the bootnode responds with a PONG hashed message.
56+
If both messages match, then the new node is able to bond with the bootnode. In addition to this, the new node sends a FIND-NEIGHBOURS request to the bootnode, so it can receive a list of neighbours that able to connect with,
57+
so it can repeat the PING-PONG game with them and bond with them as well.
5158

5259
## ENR: Ethereum Node Records
5360
* Standard format for connectivity for nodes
@@ -75,5 +82,6 @@ start client --> connect to bootnode --> bond to bootnode --> find neighbours --
7582
* [Geth devp2p docs](https://geth.ethereum.org/docs/tools/devp2p)
7683
* [Ethereum devp2p GitHub](https://github.com/ethereum/devp2p)
7784
* Andrew S. Tanenbaum, Nick Feamster, David J. Wetherall (2021). *Computer Networks*. 6th edition. Pearson. London.
78-
* Jim Kurose and Keith Ross (2020). *Computer Networking: A Top-Down Approach*. 8th edition. Pearson.
7985
* Clause E. Shannon (1948). "A Mathematical Theory of Communication". *Bell System Technical Journal*. Vol. 27.
86+
* Jim Kurose and Keith Ross (2020). *Computer Networking: A Top-Down Approach*. 8th edition. Pearson.
87+
* Kevin Leffew (2019). "Kademlia usage in the Ethereum protocol". [*A brief overview of Kademlia, and its use in various decentralized platforms*](https://medium.com/coinmonks/a-brief-overview-of-kademlia-and-its-use-in-various-decentralized-platforms-da08a7f72b8f). Medium.

wordlist.txt

+2
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ Devops
208208
devp
209209
Devs
210210
DEX
211+
DHT
211212
Diffie
212213
DILITHIUM
213214
Dimitar
@@ -452,6 +453,7 @@ lceil
452453
ldots
453454
learnings
454455
Ledgerwatch
456+
Leffew
455457
Lefteris
456458
leftarrow
457459
leq

0 commit comments

Comments
 (0)