150 likes | 283 Views
GRAPES: a Generic Environment for P2P Streaming. Luca Abeni, Csaba Kiraly, Alessandro Russo, Marco Biazzini, Renato Lo Cigno. GRAPES. Generic Resource Aware P2P Environment for Streaming An open-source toolkit Simplifies implementation of P2P streaming solutions Does not impose
E N D
GRAPES: a Generic Environmentfor P2P Streaming Luca Abeni, Csaba Kiraly, Alessandro Russo, Marco Biazzini, Renato Lo Cigno
GRAPES • Generic Resource Aware P2P Environment for Streaming • An open-source toolkit • Simplifies implementation of P2P streaming solutions • Does not impose • Any approach • Any programming style
Requirements • Portability • Written in C • No dependencies on external libraries, …
Requirements • Neutrality • Should not impose any particular structure to the applications using it • No concurrency handling • No support for parallel activities • No code for receiving data from peers
Requirements • Modularity • GRAPES functionalities are grouped into modules • Each module • Has its own API • Can be used independently from the others
Communication • Applications based on GRAPES communicate through messages • Messages are sent sent by a network helper • Allows easy change of the protocol used for transmitting the messages
Communication • GRAPES modules can • Directly send messages by invoking the network helper) • Simply construct them, leaving to the application the responsibility of sending them
Overall Structure • GRAPES includes • A network helper • A Peer Set data type, to store information about peer’s neighbors • A Peer Sampling mechanism, providing each peer with continuously up- • to-date random samples of the entire population of peers; • A Chunk Trading module, allowing to send/receive pieces of a media • stream (called chunks); • A Chunk Buffer, used to store the received chunks so that they can be • forwarded to the other peers; • A Chunk ID Set data type, that can be used to send signalling informa- • tion about the received or needed chunks; • Scheduling functions
Overall Structure • GRAPES includes • A network helper • A Peer Set data type, to store information about peer’s neighbors • A Peer Sampling mechanism, providing each peer with random samples of the entire population of peers • A Chunk Trading module, allowing to send/receive pieces of a media stream
Overall Structure • A Chunk Buffer, used to store the received chunks so that they can be forwarded to the other peers • A Chunk ID Set data type, that can be used to send signaling information about the received or needed chunks; • Scheduling functions
Peer Sampling • Most important functions include • Init() to initialize the peer sampling service • ParseData() to handle peer sampling messages coming from another peer is received) • AddNeighbour() to provide the ID of known peers (mainly used for bootstrapping) • GetNeighbourhood() to return a list of the known peers
Signaling and chunk trading • GRAPES provides a chunk ID set • encodeChunkSignaling() allows the implementation of • buffermap messages • chunk offers (of one or more chunks) • chunk accepts (responses to an offer) • chunk requests (for one or more chunks) • chunk delivers (response to a request)
The chunk buffer • Stores chunks received by an application • Most important functions are: • cb init() (to initialize a chunk buffer), • cb add chunk() (to insert a new chunk) • cb get chunks() (returns an ordered list of the chunks in the buffer)
The chunk buffer • Different buffer management policies are possible: • Buffer discards chunks when a maximum size has been reached • Chunks are discarded when the difference between their playback time and the current time is too large • …
Scheduling • Involves decisions such as • Selecting the chunk to be sent and the target peer in applications that periodically send chunks neighbours • Selecting a set of chunks to be requested from a neighbour, and that neighbour