Skip to content

Documentation: Transport Layer

Gioacchino edited this page Jan 3, 2016 · 3 revisions

RetroShare IP Networking and Transport layers

Right now on RetroShare there is no clear distinction between IP Networking layer and Transport layer.

Local IP addresses are collected by getLocalAddresses(...), eventual natted IP addresses are reported by other peers via p3discovery2 and/or discovered via web services like checkip.dyndns.org.

IP addresses plus other connectivity information are stored as peerState class, p3PeerMgrIMPL holds connectivity informations about the RetroShare instance itself and the other peers as you can see in the following code snippet.

	peerState mOwnState;

	std::map<RsPeerId, peerState> mFriendList;	// <SSLid , peerState>
	std::map<RsPeerId, peerState> mOthersList;

	std::map<RsPeerId,sockaddr_storage> mReportedOwnAddresses;

Each RetroShare service has a 16bit id, every item starts with 8bit version 16bit service and 8bit subitem, this makes 32bit item id, p3ServiceServer::recvItem(RsRawItem *item) filters and dispatch received items to the appropriate service.