SRS NP Compete
SRS NP Compete
Specification
for
p2pcast
Version 1.10
Prepared by
Date: 2/11/14
Software Requirements Specification for <Project> Page ii
Contents
REVISIONS ................................................................................................................................................................. II
1 INTRODUCTION ................................................................................................................................................ 1
1.1 DOCUMENT PURPOSE................................................................................................................................. 1
1.2 PRODUCT SCOPE ........................................................................................................................................ 1
1.3 INTENDED AUDIENCE AND DOCUMENT OVERVIEW .................................................................................... 1
1.4 DEFINITIONS, ACRONYMS AND ABBREVIATIONS ........................................................................................ 1
1.5 DOCUMENT CONVENTIONS ......................................................................................................................... 5
1.6 REFERENCES AND ACKNOWLEDGMENTS ................................................................................................... 5
2 OVERALL DESCRIPTION ............................................................................................................................... 6
2.1 PRODUCT PERSPECTIVE............................................................................................................................. 6
2.2 PRODUCT FUNCTIONALITY.......................................................................................................................... 6
2.3 USERS AND CHARACTERISTICS .................................................................................................................. 7
2.4 OPERATING ENVIRONMENT ........................................................................................................................ 7
2.5 DESIGN AND IMPLEMENTATION CONSTRAINTS .......................................................................................... 8
2.6 USER DOCUMENTATION ............................................................................................................................. 8
2.7 ASSUMPTIONS AND DEPENDENCIES........................................................................................................... 9
3 SPECIFIC REQUIREMENTS......................................................................................................................... 10
3.1 EXTERNAL INTERFACE REQUIREMENTS ................................................................................................... 10
3.2 FUNCTIONAL REQUIREMENTS................................................................................................................... 12
3.3 BEHAVIOUR REQUIREMENTS .................................................................................................................... 12
4 OTHER NON-FUNCTIONAL REQUIREMENTS ........................................................................................ 14
4.1 PERFORMANCE REQUIREMENTS .............................................................................................................. 14
4.2 SAFETY AND SECURITY REQUIREMENTS ................................................................................................. 14
4.3 SOFTWARE QUALITY ATTRIBUTES ........................................................................................................... 14
5 OTHER REQUIREMENTS .............................................................. ERROR! BOOKMARK NOT DEFINED.
APPENDIX A – DATA DICTIONARY .................................................................................................................... 17
APPENDIX B - GROUP LOG ................................................................................................................................. 18
Revisions
Version Primary Author(s) Description of Version Date Completed
1.10 Daniel Vicory, Omar Formatting improvements, modifications to user 03/04/14
Masri, Jerry Medina, interface, more possible use cases added
Nicole Theokari,
Justin Liang
Software Requirements Specification for <Project> Page iii
1 Introduction
This section gives a scope description and overview of everything included in this SRS document.
Also the purpose for this document is described and a list of abbreviations and definitions is
provided.
The purpose of this document is to present a detailed description of the peer-to-peer broadcast
platform known as p2pcast. It will explain the purpose and features of the system, the interfaces of
the system, what the system will do, and the constraints under which the system must operate. This
document is intended to be used as a reference for developing the initial version of the p2pcast
platform for the development team.
Current services that provide a similar functionality include Skype and Twitch.tv. Skype uses an
external program for its peer-to-peer streaming video. Twitch.tv is a streaming website which uses
dedicated centralized servers to support its massive audience. p2pcast proposes to create a simpler
de-centralized service to use used with no additional installments and with the propose of being
multiplatform. Multiplatform will rapidly grow as support in existing browser and subversion for
mobile continue to extend their support of WebRTC.
This document is primarily intended for the development team, our mentors at Citrix Online,
professors of CS189A and CS189B, and UCSB Capstone faculty. The SRS will discuss the details
and implementation of the project. It is recommended for those without computer science
experience to begin with section 1.4 for important acronyms and abbreviations that appear in this
document.
Term Definition
Software Requirements Specification for p2pcast Page 2
2 Overall Description
2.1 Product Perspective
There are currently no easy or decentralized way to do video broadcasting. Existing solutions to
video broadcasting require Operating System centric programs or browser plugins. Additionally,
they require the use of significant centralized server resources. This means that offering video
broadcasting services is neither cheap nor convenient for users to decide to live stream a broadcast.
Two popular approaches to live streaming video are Skype and twitch.tv. however, Skype is a
program which a user and all viewers must install. Additionally it is not particularly suited for
broadcast, though it is peer-to-peer. The second example Twitch.tv is centralized and requires their
a third party program to stream. Both are proprietary formats and users are not in control of their
own broadcast streams.
The uses of video broadcasting for the world are limitless. For example a user could want to share
their professor’s lecture. Another interesting use case would be sharing a local event, such as a
concert, with multiple peers. Directly streaming to all the viewers would be impossible in these
couple of scenarios. The average user would likely not have the CPU or bandwidth resources to
support more than a few viewers. If a user wanted to support more than a few viewers then said user
would have to make use of a service to rebroadcast their stream to all their viewers. Such a service
will have restrictions: what a user is allowed to stream, how many viewers are allowed to view the
stream, and it would have associated with the service.
• A broadcaster can go to go to a website and stream video to other users via a broadcaster-
created channel
• A user can go to a channel on the website and watch a broadcaster's stream
• A user-friendly experience
• Each stream has its individual channel
• Each user will have a unique alias
Software Requirements Specification for p2pcast Page 7
• HTML5
• JavaScript/ECMAScript 5
• Node.js v0.10.25
• Windows 7+ and Mac OS X 10.8+
• Browser(s)
o Google Chrome v32+
• WebRTC API
o MediaStream API (getUserMedia)
o RTCPeerConnection API
o RTCDataChannel API
o ICE Framework
• Servers
o STUN
o TURN
o Any 3rd party server capable of running Node.js
The biggest constraint to the system and users will come across includes incompatibility of
WebRTC with their preferred browser.
Our application will be primarily designed with user-friendliness in mind. The application will have
a lightweight and simplistic GUI that will attempt to hide application and network complexities. In
addition a video tutorial will be made to show basic functionality of p2pcast for incoming users.
Software Requirements Specification for p2pcast Page 9
3 Specific Requirements
3.1 External Interface Requirements
3.1.1 User Interfaces
The user interface will be designed with simplicity and functionality in mind. More features will be
added later such as a channel list and descriptions for each channel.
Figure 3.1.1: Mockup of the view page from the broadcast’s point of view.
Figure 3.1.2: Mockup of the view page on the viewer’s side with automatic connection to a
broadcaster.
Software Requirements Specification for p2pcast Page 11
Figure 3.3.3: Mockup of homepage for p2pcast where user can select channel name and begin
broadcasting.
P2pcast will be using the WebRTC API, specifically MediaStream(), to receive data from a user's
webcam and/or microphone. MediaStream() abstracts the webcam and/or microphone complexities
from the user. Hardware interfaces include desktops, laptops, and mobile devices, which will be
abstracted by the user's browser and operating system.
WebRTC JavaScript framework, tools for UI (bootstrap), websockets, and other special tools used
for databases.
P2Pcast also focuses on the ICE framework for connecting two peers directly. The ICE framework
will first try to connect the peers using UDP with the most minimal latency. If UDP fails the ICE
framework will try TCP with HTTP, and later TCP with HTTPS. Finally when a direct connection
Software Requirements Specification for p2pcast Page 12
does not work, ICE will try to use TURN servers to connect peers by adopting a method that
requires a third party.
Safety
• Use of the broadcast service should be done ethically and morally
• Broadcasters shall know when their camera is broadcasting live
• Assume any broadcast may potentially be recorded by any viewer
Security
• Broadcasters should assume their video stream is not private to anyone that has the channel
name
• Communications between peers is encrypted with DTLS-SRTP as defined in WebRTC
• Naïve denial of service attacks should not be possible
• For instance, peers could degrade stream quality or take on peers and then later
purposefully drop their connections to them
• Some denial of service attacks can be avoided by avoiding new peers or those that
drop packets
• Peers rebroadcasting a different stream than what is from the broadcaster will not be
addressed initially
Software Requirements Specification for p2pcast Page 15
• Peers will attempt to modify bandwidth requirements in the face of changing network
conditions, or for low-bandwidth connections such as mobile
• Channel concept will be an overlay over p2pcast's peer-to-peer network allowing for the
core signaling functions to be separate
4.3.2 Availability
• Any user may access the service to broadcast or view broadcasts via the website
• Server-side software will not have any unusual requirements allowing for deployment in
many environments
4.3.3 Correctness
4.3.4 Flexibility
• The service will work over various operating systems such as Linux, Window, and Mac OS
X, with the only requirement being the latest version of Google Chrome
• The user experience will be identical across operating systems
4.3.5 Interoperability
• Users will be able to communicate with each other even if their systems consist of different
platforms, as long as they are running the latest version of Google Chrome
• System differences between the two peers should be hidden from the user
4.3.6 Maintenance
• End-user shall not need to take any unordinary measures to use p2pcast
• The host shall be competent in the administration of common web application software and
techniques
• The host must make sure the p2pcast web application is accessible to end-users
• The end-user will not need to download or install any software to make use of p2pcast
Software Requirements Specification for p2pcast Page 16
4.3.7 Portability
• The service should be able to run on any latest version of Google Chrome browser with no
additional plugins or software on a desktop or laptop.
• (talk about client-side and server-side portability)
4.3.8 Reliability
• The p2pcast server will attempt to make sure a peer always has a connection to another peer
in the network
• Lower quality connections will be attempted to be detected and resolved automatically with
a different peer connection
• Navigation between different channels should be a normal operation and not cause undue
interruption to peers you are rebroadcasting to
4.3.9 Reusability
• The WebRTC API was designed in mind to be re-usable, which is the core of this
application
4.3.10 Robustness
• Disconnected connection between two peers will be remedied with minimal down time
• Software will try to reconnect the disconnected peer with another healthy
4.3.11 Testability
• The WebRTC API handles many of the network and application complexities
• Bugs and other network issues will be noticeable and caught right away if video connection
disconnects or video quality deteriorates
• Entry and exit points to our application will be clearly defined and easy to navigate to
4.3.12 Usability
<Data dictionary is used to track all the different variables, states and functional requirements that
you described in your document. Make sure to include the complete list of all constants, state
variables (and their possible states), inputs and outputs in a table. In the table, include the
description of these items as well as all related operations and requirements.>
Software Requirements Specification for p2pcast Page 18
1/28/14
• Diagram Design: Web Sequence Diagrams
• UI Mockups: balsamiq, write HTML and then just take snapshots
• Use cases are very broad:
o Play or pause the broadcast
o Filters over the video
o Leaving the broadcast
• User stories are broken up use cases or epics:
o Can be things that address errors, i.e. what if a node leaves?
o What if you are in the wrong browser?
o What if there is no network connection?
• Ask Chandra:
o Where do the user stories go in the SRS?
Software Requirements Specification for p2pcast Page 19
o Picture markups?
o Clarification on what the “complete slice is”
2/4/14
• Ignore the lag, don't need to worry about the real time.
• SRS Comments:
• 2.4
o Server side
o What is node.js running on?
o Platforms
o To deploy it what do I need? Hardware platform and what needs to be installed
• 2.5
o Browser crashing
o Dropping out not cleanly
o Peers dropping out
• 2.6
o Do a video tutorial
o No manual
• 2.7
o Computer is powerful enough to broadcast
o Microphone and webcam is only required for the broadcaster
• 3.1.2
o How will you deploy as a company?
o Browser APIs
• 3.1.3
o node.js
o Database, tools, libraries
o Bootstrap
o Browser to server and vice versa
o Too much? It should go in the design doc
• 3.1.4
o HTTP
• 3.2
o server and client (things they send to each other)
o User and client interactions
• 4.1
o Add hard numbers, 30 seconds for example
o Only the first one is a performance requirement
• 4.2
o ddos attacks
Software Requirements Specification for p2pcast Page 20
o People injecting themselves
o Hijacking the stream, sending frames back to the broadcaster but probably don't
worry about it
o Full control of nodes that join through the server
o Broadcaster should know that the camera is on and broadcasting (status “We are on
the air”)
o What do we want to do?
• 4.3
o Maintainability, look in blue
o Portability, client and server side
o Reliability, server really reliable, client not so much
o Address each of them
2/11/14
• Get interaction design where the user can touch all of the functionality without
making it look nice. From this you will see what objects you are using then do the
formal design.
• Focus on the core server and worry about the database later.
• Someone should see if audio can be rebroadcasts
• Things to finish for the next sprint:
o User can join without specifying a peer
o Finish the design specification
• Web Stats API
• Balanced binary tree initially for p2pcast
2/18/14
• Sequence diagrams that connect the state diagrams
• It does not need to be broadcaster in sequence diagram
• Notify disconnection to disconnect()
• Set up WebRTC stuff or put a box around it (Need to make modifications to state-
diagram and abstract away WebRTC details from sequence diagrams?)
• Worst case scenario closing window (connection) vs. the one where we wait for
permissions from the server
• Don't need to add tree specifications, don't commit to a tree algorithm
Software Requirements Specification for p2pcast Page 21
• Need a sequence for a creation of a channel, release of a channel, broadcaster
disconnecting, pause/play
• Components are the ones from the picture
2/25/14
• Add ice candidates to Connection Handshake and take out final answer from initial
peer
• Look into what happens when disconnection occurs. How long will it take for the
server to reissue a new connection.
• Screen sharing and video discussion. Example of this is webinar
• url channel name suggestions - easy to read URL for users
Midterm Week
Monday, Feb 17, 2014
• Worked in Visio for UML and state diagram for Design Specification
Sprint 3
Friday, Feb 28, 2014
• Rain Rain go away ~
• Cancelled in person meet up for facebook planning/discussion