7 Lab 3: Scaling with P2PSP

Getting P2PSP

wget https://github.com/P2PSP/p2psp/archive/master.zip # Download P2PSP  
unzip master.zip                                       # Extract P2PSP into "p2psp-master".  
rm master.zip                                          # Delete the .zip file (optional).

Running a splitter

  1. Install Python 3 (only in Windows, and for XP, use version 3.3.2) from: https://www.python.org/downloads.
  2. Select a mount-point (the channel in the P2PSP’s jargon) in any of the available Icecast servers (yours or external). Lets suppose that you have chose a mount-point named test.ogg at your local server, which is listening to the port 8000. Therefore, the channel you are going to stream in your P2PSP team is:
  3. Check if the splitter has been correctly installed by checking the default values for the input (command line) parameters:
     
    cd p2psp-master/src  
    python3 splitter.py -h

  4. Notice that, in order to connect the splitter as a listener to the icecast server, both, the source_addr and the source_port could need to be specified. In our case, we are using a server running in our host and listening to the port 8000, which are the default vaules of the splitter. So, run:
     
    python3 -O splitter.py --IMS  
     
     
    # Note, if the splitter fails, check that your /etc/hosts contains a line such as:  
    #  
    # "127.0.0.1 localhost.localdomain localhost       <your hostname here without <>>"

    You should see something like:

    10:54:49 Running in debug mode  
    10:54:49 My IP address is = 127.0.0.1  
    10:54:49 Buffer size = 256  
    10:54:49 Channel = "test.ogg"  
    10:54:49 Chunk size = 1024  
    10:54:49 Header size = 10  
    10:54:49 Listening port = 4552  
    10:54:49 Source address =  127.0.0.1  
    10:54:49 Source port = 8000  
    10:54:49 IP unicast mode selected  
    10:54:49 Maximun chunk loss = 32  
    10:54:49 Maximun number of monitor peers = 1

    10:54:49 IMS: Buffer size (in chunks) = 256  
    10:54:49 IMS: Chunk size (in bytes) = 1024  
    10:54:49 IMS: Channel =" test.ogg "  
    10:54:49 IMS: Header size (in chunks) = 10  
    10:54:49 IMS: Listening (and multicast) port = 4552  
    10:54:49 IMS: Source IP address = 127.0.0.1  
    10:54:49 IMS: Source port = 8000  
    10:54:49 IMS: Multicast address = 0.0.0.0  
    10:54:49 IMS: Initialized

    10:54:49 DBS: max_chunk_loss = 32  
    10:54:49 DBS: mcast_addr = 0.0.0.0  
    10:54:49 DBS: Initialized

    10:54:49 IMS: Requesting the stream header ...

             | Received  | Sent      | Number       losses/ losses  
        Time | (kbps)    | (kbps)    | peers (peer) sents   threshold period kbps  
    ---------+-----------+-----------+-----------------------------------...

    10:54:49 IMS: (’0.0.0.0’, 0) connecting to the source (’127.0.0.1’, 8000) ...  
    10:54:49 IMS: (’127.0.0.1’, 60576) connected to (’127.0.0.1’, 8000)  
    10:54:49 IMS: (’127.0.0.1’, 60576) IMS: GET_message = GET /test.ogg HTTP/1.1  
     
     
    10:54:49 IMS: Stream header received!

    10:54:49 DBS: (’0.0.0.0’, 4552): waiting for the monitor peers ...

    10:54:50 |         0 |         0 | 0  
    10:54:51 |         0 |         0 | 0  
    10:54:52 |         0 |         0 | 0

    Now the splitter is waiting for the monitor peer, and the rest of “normal” peers.

Running a peer

  1. The peer:
     
    python3 -O peer.py

    2:38:13 Running in debug mode  
    22:38:13 Splitter address = 127.0.0.1  
    22:38:13 Splitter port = 8001  
    22:38:13 (Peer) PORT = 0  
    22:38:13 Listening port (player) = 9999  
    22:38:13 Maximun chunk debt = 128

  2. The player:
     
    firefox http://localhost:9999 &

  3. ... and the rest of the output of the peer:
     
      2:45:26 Using IP Multicast address = 224.0.0.1  
    Created new peer of type Peer_IMS  
     
    22:45:26 99.22%  
    +-----------------------------------------------------+  
    | Received = Received kbps, including retransmissions |  
    |     Sent = Sent kbps                                |  
    |       (Expected values are between parenthesis)     |  
    ------------------------------------------------------+  
     
             |     Received (kbps) |          Sent (kbps) |  
        Time |      Real  Expected |       Real  Expected | Team description  
    ---------+---------------------+----------------------+-----------------------------------...  
    22:45:27 |       548       548 |          0         0 | 0  
    22:45:28 |       294       294 |          0         0 | 0  
    22:45:29 |       270       270 |          0         0 | 0  
    22:45:30 |       311       311 |          0         0 | 0  
        :    :        :         :  :          :         : : :