switchboard decision making

90 views
Skip to first unread message

Benny Frishberg

unread,
Dec 13, 2014, 2:10:22 PM12/13/14
to be...@googlegroups.com
I wanted to know if it is possible to control the decision making of the switchboard.
 
I want to be able to connect peers from one country only to peers from their own country and if possible replace peers not from their country with new ones.
 
Is that possible?

Flávio Ribeiro

unread,
Dec 13, 2014, 5:14:41 PM12/13/14
to be...@googlegroups.com
Hello Benny,

You have two different paths to accomplish what you want:

- (easier, imho) make the player discover its city (by hitting http://api.globo.com/geo, for example) and then concatenate the city on room name[1], isolating peers of the same city in the same room;

- Look at rtc-signaller [2] (which is the core of rtc-switchboard) and find a way to redirect peers according to their IPs (you can get they by looking at the SDP).

I've used the first approach on a initial implementation of BemTV but I realized that people in the same city doesn't imply the smallest path between them. There's a lot of router magic on IXP's [3] and even on telecom carrier backbones which I preferred not try to figure out. Instead, I've implemented a "reputation algorithm" where peers elect their partners and try to converge for a better use of the entire peer-to-peer overlay while they play the video. It should be working fine, but I'm still making tests with larger audiences.



Flávio Ribeiro 

--
You received this message because you are subscribed to the Google Groups "BemTV: Hybrid CDN/P2P Architecture for HLS Broadcasts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bemtv+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/bemtv.
For more options, visit https://groups.google.com/d/optout.

Benny Frishberg

unread,
Dec 14, 2014, 1:18:46 PM12/14/14
to be...@googlegroups.com
Can you elaborate on how the "reputation algorithm" actually works?
I see it pings the peers but what happens when there are 5000 peers and a new one joins?
who will ping him and who will he ping to make the choise?


בתאריך יום ראשון, 14 בדצמבר 2014 00:14:41 UTC+2, מאת Flávio Ribeiro:

Flávio Ribeiro

unread,
Dec 15, 2014, 10:43:24 AM12/15/14
to be...@googlegroups.com
Actually, each peer will connect with a subset of the entire swarm. When a given peer reaches maximum swarm size[1] it will ignore future connections. 

Inside the swarm, a peer will select contributors[2] according to their score[3]:

- When connect with other peer, you calculate the RTT [4] between you and the other and decreases the score according to it
- When you receive `contain` instruction from a peer, you add 1 to the score
- When you receive `satisfy` instruction from a peer, you add 1 to the score
- When you receive `choke` instruction, you decrease 1

This way, your swarm array is ordered according to this algorithm. Peers with small RTT and sending contain (have the chunks you want) will have higher scores and will stay on the head of the ordered array, being promoted as partner and contributing to the overlay.
Reply all
Reply to author
Forward
0 new messages