discv5: NAT traversal via Rendezvous protocol [WIP]
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 20/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
Línea de trabajo
Comienza con el issue de portal-network-specs y el artículo de libp2p referenciados; después, revisa la detección de NAT propuesta, el campo nat de ENR y el flujo RELAYREQUEST/RELAYRESPONSE. Se considera terminado cuando la definición del protocolo esté completa, incluido el diagrama de flujo de mensajes, los timeouts y el comportamiento del nodo, y se haya convertido en un PR para su revisión línea por línea.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
This issue proposes a mechanism for NAT traversal via UDP hole punching.
This issue borrows from https://github.com/ethereum/portal-network-specs/issues/144 which in-turn borrows from https://blog.ipfs.io/2022-01-20-libp2p-hole-punching/
Participants
This mechanism involves communication between three nodes:
- Initiator: a node that is behind a NAT, trying to establish a session with the "receiver" node
- Receiver: a node that is behind a NAT
- Rendezvous: a node that is able to communicate with both "initiator" and "receiver"
Detecting whether you are behind a NAT
Borrowed from: https://twurst.com/articles/stun-without-trust.html#org92b7214
A node in the network should maintain a set E which contains all of the (ip_address, port) values for outbound packets that have been sent by this node.
When receiving a packet, a node should check whether the packet's (ip_address, port) are contained in the set E.
- If a node receives a packet such that the
(ip_address, port)are not inEthen the node is not behind a NAT - If a node does not receive any packets with
(ip_address, port)values that are not inEwithin a reasonable amount of time, then the node should assume that they are behind a NAT.
We suggest 2 minutes as a reasonable amount of time before determining that the node is behind a NAT.
For practical purposes, an LRU cache should be used to constrain the overall size of the set
E
Signalling whether you are behind a NAT
We define a new field in the ENR with the key "nat".
- If the node does not know whether it is behind a NAT, this key should be omitted from the ENR
- If the node is not behind a NAT, the value of this key should be set to
0 - If the node wishes to signal that it is behind a NAT, the value of this key should be set to
1
Traversing the NAT
We define two new message types:
- RELAYREQUEST
- RELAYRESPONSE
# RELAYREQUEST
relay_request := SSZContainer(from_node_id: uint256, to_node_id: uint256)
# RELAYRESPONSE
relay_response := SSZContainer(response: uint8)
The rendezvous protocol works as follows:
- The "initiator" node learns about the "receiver" node through a FINDNODES/FOUNDNODES interaction with the "rendezvous" node.
- The "initiator sends a RELAYREQUEST to the "rendevous" node with payload:
{from_node_enr: initiator_enr, to_node_id: receiver_node_id} - The "rendezvous" node, upon receiving the RELAYREQUEST from the "initiator" node, sends the same RELAYREQUEST message to the "receiver" node.
- The "receiver" node, upon receiving the RELAYREQUEST from the "rendezvous" node, responds with a RELAYRESPONSE with the payload
{response: 1}to signal that they have accepted this request. They may alternately respond with{response: 0}if they wish to reject the request. The "receiver" node will also send a PING message to the "initiator" node (this triggers the receiver's NAT to allow and route incoming packets from the initiator's ip/port). - The "rendezvous" node, upon receiving the RELAYRESPONSE from the "receiver" node, accepting the request, will then send the same RELAYRESPONSE message to the "initiator".
- The "initiator" node, upon receiving the RELAYRESPONSE accepting the connection, should then send a PING message to the "receiver" node. (this triggers the initiator's NAT to allow and route incoming pckets from the receiver's ip/port)
TODO: diagram message flow... define edge cases like timeouts and how nodes should behave.
TODO- finish definition of the protocol and convert this to a PR towards the spec so that people can comment on individual lines.
- Lenguaje dominante
- JavaScript
- Estrellas
- 1.1k
- Forks
- 301
- Merge medio
- 12 h 3 min
- PR fusionados (30 d)
- 2
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ethereum/devp2p
-
Dificultad 4/5 3-5 días Aptitud para principiantes 18/100
Los mantenedores suelen responder en 1 día
-
Post-quantum ENR/discv5Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
Specify the "snap" ENR entry and how it signals snap versionsPosiblemente ocupada @MysticRyuujin la tomó hace 47 días. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
ethereum/devp2p#286 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
ethereum/devp2p#282 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
ethereum/devp2p#279 · 2 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de ethereum/devp2p
Issues similares
-
[External Plugin]: zooopAbiertoexternal-plugin ready-for-review
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
github/awesome-copilot#6655 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 2 días
-
type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
c-w-z/commit-decision-record#32 ·
Los mantenedores suelen responder en 1 día
-
perf: the Evaluations leaderboard and the @ model menus download every model image at oncePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug confirmed issue
Dificultad 2/5 Medio día Aptitud para principiantes 78/100
open-webui/open-webui#35213 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
exa-studio/ApiVault#338 ·