Skip to content

Commit 6ce7cf4

Browse files
committed
gh-148 computer networks models and TCP/UDP protocols overview added
1 parent dcf98da commit 6ce7cf4

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed
Loading
178 KB
Loading

docs/wiki/EL/devp2p.md

+32-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,31 @@ First, we will provide some background on computer networks and then we will div
55
specifics of the EL's networking protocol.
66

77
## Computer networks background
8-
* Distributed network of nodes
9-
* OSI vs TCP/IP model
8+
This section covers a brief overview of the differences and similarities between the OSI (Open Systems Interconnection) and TCP/IP (Transmission Control Protocol/Internet Protocol) models,
9+
as well as the protocols involved in the transport layer used in DevP2P: TCP and UDP.
10+
11+
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:
13+
14+
![alt text](../../images/el-architecture/osi-tcpip-models.png)
15+
16+
In summary, the OSI model layers are:
17+
1. Physical layer: responsible for the transmission and reception of raw data between devices.
18+
2. Data link layer: responsible for the node-to-node delivery of the message.
19+
3. Network layer: responsible for the delivery of packets from the source to the destination.
20+
4. Transport layer: responsible for the delivery of data between the source and the destination.
21+
5. Session layer: responsible for the establishment, management, and termination of connections between applications.
22+
6. Presentation layer: responsible for the translation, compression, and encryption of data.
23+
7. Application layer: responsible for providing network services directly to the end-user.
24+
25+
Assuming the communication schema proposed by Claude Shannon (1948), every communication implies both a sender and a receiver, a message to be exchanged between them, a transmission medium, and a protocol to be followed.
26+
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.
27+
28+
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.
30+
31+
![img.png](../../images/el-architecture/tcpudp.png)
32+
1033
## EL's networking specs
1134
* peer-to-peer networking protocol
1235
* gossiping data (1:N) and request/response (1:1) communication
@@ -16,6 +39,8 @@ specifics of the EL's networking protocol.
1639
* UDP-based transport layer (discovery and finding peers)
1740
* TCP-based transport layer (devp2p, exchange information)
1841
* Discovery protocol
42+
43+
How nodes find each other
1944
* bootstrap nodes
2045
* Kademlia
2146
* Hash tables
@@ -25,14 +50,15 @@ specifics of the EL's networking protocol.
2550
start client --> connect to bootnode --> bond to bootnode --> find neighbours --> bond to neighbours
2651

2752
## ENR: Ethereum Node Records
53+
* Standard format for connectivity for nodes
2854
* Node's identity
2955
* Object
3056
* signature (hash)
3157
* sequence number
3258
* arbitrary key-value pairs
3359

3460
## DevP2P specs
35-
* RLPx: encrypted and authenticated transport protocol
61+
* RLPx: encrypted and authenticated transport protocol (TCP based transport system for nodes communication)
3662
* Handshake messaging
3763
* Encryption
3864
* Authentication
@@ -48,3 +74,6 @@ start client --> connect to bootnode --> bond to bootnode --> find neighbours --
4874
### Further Reading
4975
* [Geth devp2p docs](https://geth.ethereum.org/docs/tools/devp2p)
5076
* [Ethereum devp2p GitHub](https://github.com/ethereum/devp2p)
77+
* 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.
79+
* Clause E. Shannon (1948). "A Mathematical Theory of Communication". *Bell System Technical Journal*. Vol. 27.

0 commit comments

Comments
 (0)