Personal tools
You are here: Home Teaching FS08 487 - P2P Challenge Task

Challenge Task


29.05.2008: The P2P Challenge Champions 2008 have now been determined! Congratulations to group 2 with Marco Kessler, Stefan Christiani, Roger Peyer, and Konstantin Benz! The detailed evaluations can be accessed from within the university network.

13.03.2008: The challenge task slides and the group list are available now (only from within UZH).


Task Description

The P2P Challenge Task for the FS08 semester is to design and prototypically implement time-shift functionality for a live video stream using P2P concepts. The time-shift functionality shall allow a live stream viewer to pause the reception of the stream and shall also allow the replay of particular parts of the stream.

The nodes in the P2P network represent individual users watching a particular TV Channel (video stream). Storing locally the whole data received by each peer individually is an inefficient way of designing a time-shift function, as each peer will have to store the whole content. Another disadvantage of a "local" solution for time-shift is that a user may only replay parts that were broadcast while his application was running (e.g. if a user would start the application just after a team scored during a football game he would not be able to replay the goal). A P2P-based approach addresses these issues by distributing the task of recording and storage of the video stream across multiple nodes. Each node is responsible of recording and storage for particular parts of the video stream. In this case a replay task consists of finding the peers responsible with the recording for the requested timeslots and getting the video stream from them.

The main goal of the challenge task is to design and implement a P2P-based recording, storage, and replay application for live video streams. Each node in the P2P network shall receive the video stream as UDP packets (the live stream transmission is provided). A VideoLan Client (VLC) shall be used as a video player on each node. Your time-shift application should be able to do the following:

  •  receive the incoming UDP stream from the video server
  •  buffer the live stream and send it to VLC via UDP
  •  store parts of the live stream for 7200 seconds (2 hours)
  •  request the P2P network for video replay for maximum 7200 seconds (2 hours)

Application Requirements

  • Live/Timeshift switch: The solution shall enable the user to switch dynamically from live streaming to time shifted streaming and back.
  • Realtime access: Stream buffering and access for time shifted streams shall happen in realtime.
  • Timeshift period: The solution shall allow for the storage of at least two continuous hours of time shifting.
  • Robustness: The solution shall be robust against node or link failure during timeshift.
  • Multiple Client Serving: The solution shall enable each peer to serve multiple clients at the same time, if it has sufficient bandwidth to do so.
  • P2P mechanisms: The solution shall be based on Peer-to-Peer mechanisms using a structured overlay network.
  • Decentralization: The solution shall not contain any central elements.
  • Compatibility: The solution shall be executable on the provided test setup machines (Linux, Java 1.6).
  • Library and tools: The solution shall be based on libraries and tools which allow for publishing under GPL or another comparable open software license.
  • Application report: The application report shall document the application. The report shall have 5-10 pages.
  • Note: Depending on the development of the challenge task, further requirements and/or tools may be added, if necessary.


  • The groups shall be balanced. Every group shall have at least one Java expert. During the challenge task, the group shall meet every week during exercise hours to work on the task and discuss the next steps.

  • Distribute the workload (P2P load balancing) so that each peer gets a fair load of work.

  • You can bring your own laptop and/or use computers in room BIN 1.D.12.


The challenge task includes three milestones on which specific deliverables have to be handed-in to the supervisors:

  • Milestone 1: Detailed workplan including task distribution among group members, ToC of the report, Meeting with the supervisor
  • Milestone 2: Draft code (Step 1 + 2, see below) and draft report
  • Milestone 3: Final code (Step 3, see below) and final report (5-10 pages, including design, structure of code, and installation requirements)

The following table shows the timeplan for the challenge task with the different milestones:

Challenge Task Milestones
Grouping, Task Presentation
Easter Holidays 27.03.2008
Milestone 1 03.04.2008
Work 17.04.2008
Milestone 2 24.04.2008
Milestone 3 22.05.2008
Presentations and Demos


During the challenge task each group will be able to ask questions and get support for the task from their supervisor:

Libraries and Tools

  • Use the Java as programming language. You can use the latest version, as this has usually more useful features than older versions. The J2SE Software Development Kit (SDK) can be downloaded under

  • The assistants do know Eclipse well and the use of Eclipse is highly recommended. The most recent release of Eclipse can be downloaded at Eclipse is available for Windows XP, Mac OSX, Linux and further platforms. If you prefer other IDEs (e.g., Netbeans) you may use them but without support from our side.

  • The use of FreePastry (Version 2.0_03) as P2P overlay technology is highly recommended. FreePastry is an open source implementation of Pastry. The most recent Binary (JAR) version of FreePastry can be downloaded under Alternatively, you may choose other overlay networks. Thomas Bocek has implemented TomP2P, a variant of the Kademlia protocol. The key benefit of using TomP2P is the support he can provide. For more information, do not hesitate to contact him if you plan to use this software.

  • Use of the Template which serves as a basis for the implementation of the P2P application.

  • The use of VLC as a media player is recommended due to its flexibility and availability for Linux and Windows (

  • Additionally, the example application shown in the lecture is available as well.


In order to successfully achieve your goal, the following steps are recommended.

  • Start by understanding how FreePastry works, what P2P methodology is used, how nodes are accessed, and how nodes can be found.
  • Implement a simple example. This example does not need to be part of the solution. The goal is to get used to the API and see how the Framework behaves.

  • Understand how VLC works and how you can use it in this particular case.
We recommend the following steps during the implementation task:

  • Step 1: Design your application: specify use case(s), functional requirements, modules. Plan how nodes will communicate. Draw sequence diagrams for communication among nodes and inside nodes, among components. Build GUI prototype.

  • Step 2: Handle video content. At a peer level, implement receiving of video stream from a fixed server, buffering of contents in memory or disk (if necessary). Design protocol(s) for communication between peers using the P2P Network - in order to find peers to download/upload data to/from and to establish connection for video.

  • Step 3: Deal with the network. Implement protocols designed in step 2. Test and debug your application.

The tools to be used are generally well documented. Find below a few links which provide a good overview:Java Tutorial, Java ist auch eine Insel, Java API, Eclipse Dokumentation, FreePastry Javadocs, FreePastry Readme, Pastry Overview, Overlay Weaver.

The following steps are necessary to setup the FreePastry application template in Eclipse:

  • Install Java SDK.

  • Extract Eclipse Installation-ZIP File and start the eclipse application.

  • Create a new Java project. In the Java settings click on the Libraries tab.

  • Select Add External JARs... and select the file FreePastry-2.0.jar.

  • Copy the application template into the project folder. Double-click the template to edit the Java file.

  • To run the main method, select “Run...” in the main menu. Select Java Application and click on New. Select the class ApplicationTemplate as the Main class and click on Run. Now the application should be executed in the console frame. To run another instance of the application click on Run once again.

Testbed Infrastructure

During the challenge task and for the final demo 10 Linux PCs (Pentium 4, 2.8 GHz, 500 MB RAM) will be available during exercise hours in BIN 1.D.12. The application itself shall be tested and demonstrated on the EmanicsLab testbed infrastructure. For this purpose an EmanicsLab account will be created for each group. The account details will be provided by the group supervisors.

Each EmanicsLab node participating in the Challenge Task receives the stream on the following ports:
5001 - for group 1
5002 - for group 2
5003 - for group 3
5004 - for group 4

The following EmanicsLab nodes participate in the Challenge Task:

Presentation and Evaluation

The challenge task will end on the 29.05.2008. On this date the different groups will present and demonstrate their results which will be evaluated by all participants.

  • Each group will have 25 minutes for presentation, setup, and demonstration of their solution. The P2P application shall be brought along as source code and binary (JAR) file on a USB memory stick or CD.
  • At least a minimal visualization mechanism shall be provided for viewing the participating nodes. (messages of the following form are considered enough: "Node A: received chunk X;  origin B; dest C; next hop D;"). This could be achieved using a log file.
  • After the demo each group will be evaluated by the other groups. The following criteria shall be taken into consideration:
    • Fulfillment of requirements
    • Clarity of design
    • Performance of the solution
  • Each group will have one vote per group. The lecturers and assistants together will also have one vote per group. The results of the votes will be collected and disclosed after the last presentation. In case that two groups achieve the same result, the winner group will be determined by the vote of the lecturers and assistants or by a quiz about topics of the lecture.
  • Finally, the winner group will receive a symbolic prize and the "P2P Challenge Champion 2008" award.
Document Actions