# How handshake works

Rings Network has chosen to use WebRTC as the transport layer, which facilitates the implementation of a purely peer-to-peer (P2P) network. This means that with the help of the WebRTC protocol and WebAssembly (Wasm), Rings nodes can run fully functional within web browsers.

The WebRTC protocol is platform-agnostic and leverages Interactive Connectivity Establishment (ICE) for network traversal. It enables peers to establish direct connections by exchanging Session Description Protocol (SDP) for the purpose of handshake and negotiation.

Rings Network supports two ways for establishing connections: Relay and Direct.

* Relay: This involves establishing connections through a third-party node, such as a Rings node that has an endpoint service enabled. Using a relay offers convenience in establishing connections.
* Direct: This refers to establishing peer-to-peer connections by directly exchanging SDP information. Direct connections are more decentralized in nature.

Both approaches have their advantages. Relay connections are more convenient, while direct connections provide a more decentralized approach.

To understand more about how handshake works, you may like to read:

[exchange-sdp](https://rings.gitbook.io/rings-network/advanced-topic/exchange-sdp "mention")


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rings.gitbook.io/rings-network/advanced-topic/handshake.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
