Skip to content

Commit 2cb93a0

Browse files
committed
README_P2P: ICE is enabled by default; update roadmap
1 parent dac290d commit 2cb93a0

1 file changed

Lines changed: 36 additions & 17 deletions

File tree

README_P2P.md

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@ is an internet standard protocol for discovering and sharing IP addresses,
1212
negotiating NAT, and establishing a direct connection or fallback to relaying
1313
the connection if necessary.
1414

15-
The opensource version of the code can compile with [google webrtc](https://webrtc.googlesource.com/src)'s ICE
16-
implementation. We interface with the WebRTC code at a reletaively low level
17-
and only use it for datagram transport. We don't use DTLS or WebRTC data
18-
channels. (In the future, we may offer alternate NAT traversal
19-
implementations. In particular, we'd like to have an implementation that
20-
uses [PCP](https://tools.ietf.org/html/rfc6887), which is not used by
21-
the current google WebRTC code.)
15+
The library includes an ICE client implementation with no external dependencies
16+
that is compiled in by default. (See the vcpkg feature `ice` or the cmake flag
17+
`ENABLE_ICE`).
18+
19+
Alternatively, the library can also be compiled to use
20+
[Google WebRTC](https://webrtc.googlesource.com/src)'s ICE implementation.
21+
We interface with the WebRTC code at a relatively low level and only use it
22+
for datagram transport. We don't use DTLS or WebRTC data channels.
23+
See also `k_ESteamNetworkingConfig_P2P_Transport_ICE_Implementation`.
24+
25+
The two candidates are compatible with one another. (A peer using the WebRTC
26+
ICE client can conneect to a peer using the native client.)
2227

2328
## Symmetric connect mode
2429

@@ -107,9 +112,10 @@ will need to run your own, or just fail connections that cannot pierce NAT.
107112
On Steam we use a custom relay service known as [Steam Datgaram Relay](https://partner.steamgames.com/doc/features/multiplayer/steamdatagramrelay)
108113
-- SDR for short -- carrying packets through our network of relays and
109114
on our backbone. (You may see this mentioned in the opensource code here,
110-
but the SDR support code is not opensource.) Also, on Steam we always
111-
relay traffic and do not share IP addresses between untrusted peers, so
112-
that malicious players cannot DoS attack.
115+
but the SDR support code is not opensource.) Also, on Steam we often
116+
do not share public IP addresses between untrusted peers, so that malicious
117+
players cannot DoS attack. In that case NAT punch is not possible and traffic
118+
would be relayed.
113119

114120
### Naming hosts and matchmaking
115121

@@ -123,13 +129,13 @@ also included with Steam, but outside the scope of a transport library like this
123129
Assuming you have all of those requirements, you can use SteamNetworkingSockets
124130
to make P2P connections!
125131

126-
To compile with ICE support, set USE_STEAMWEBRTC when building the project files:
127-
```
128-
cmake -DUSE_STEAMWEBRTC=ON (etc...)
129-
```
132+
To enable P2P/ICE support, just use the vcpkg feature `ice`, or build with the cmake
133+
flag `-DENABLE_ICE=ON`. Note that both of these are the default, so you just need
134+
to avoid explicitly turning it off.
130135

131-
You'll also need to activate two git submodules to pull down the google WebRTC code.
132-
(Just run ``cmake`` and follow the instructions.)
136+
If you want to use the Google WebRTC ICE implementation, set
137+
`-DUSE_STEAMWEBRTC=ON`. cmake will automatically activate two git submodules
138+
and pull down the Google WebRTC code.
133139

134140
Take a look at these files for more information:
135141

@@ -150,8 +156,21 @@ Take a look at these files for more information:
150156
Here are some things we have in mind to make P2P support better:
151157

152158
* Get plugins written for standard, opensource protocols that could be used for
153-
signaling, such as [XMPP](https://xmpp.org/). This would be a great project for
159+
signaling, such as [XMPP](https://xmpp.org/). This would be a great project for
154160
somebody else to do! We would welcome contributions to this repository, or
155161
happily link to your own project. (See issue #136)
156162
* LAN beacon support, so that P2P connections can be made even when signaling
157163
is down or the hosts do not have Internet connectivity. (See issue #82)
164+
* Support for [PCP](https://tools.ietf.org/html/rfc6887) as an additional
165+
NAT traversal mechanism.
166+
* Shared candidate pool across multiple P2P connections. Currently, each
167+
connection goes through a full ICE gathering process independently, including
168+
opening its own sockets and creating its own TURN allocation. A server forming
169+
connections with many peers (e.g. a full mesh) could instead gather candidates
170+
once per interface, share a single set of sockets, and reuse a single TURN
171+
allocation across all peers. This would be a significant efficiency improvement.
172+
* TURN channels, for more efficient relay of data packets once a relayed path
173+
is selected.
174+
* MTU probing: ICE connectivity checks should be sent at the full path MTU, so
175+
that MTU issues are discovered during negotiation rather than after the
176+
connection is established.

0 commit comments

Comments
 (0)