Click here to load reader

Implementation of a Peer-to-Peer Real-time streaming media system

  • Upload
    risa

  • View
    62

  • Download
    0

Embed Size (px)

DESCRIPTION

Implementation of a Peer-to-Peer Real-time streaming media system. Presenter: Kuei -Yu Hsu Advisor: Dr. Kai-Wei Ke 2014/6/9. Outline. Introduction Background System Architecture Packet-Delivery Algorithm Push-based System (DMFT and CDMFT) Pull-based System (Revised BitTorrent ) - PowerPoint PPT Presentation

Citation preview

PowerPoint

Presenter: Kuei-Yu HsuAdvisor: Dr. Kai-Wei Ke2014/6/9 Implementation of a Peer-to-Peer Real-time streaming media systemOutlineIntroductionBackgroundSystem ArchitecturePacket-Delivery AlgorithmPush-based System (DMFT and CDMFT)Pull-based System (Revised BitTorrent)Test and ImplementationConclusion2IntroductionClient-Server NetworkContent Delivery NetworkPeer-to-Peer NetworkHybrid CDN & P2P Network33

Client-Server Network4With increasing network bandwidth, Network transport are not only text or static image, but also audio and video.

The traditional Client-Server architecture can't afford the number of growing users.ClientServeruserstreaming applicationvideoaudiocontentbandwidthANYONE can access the video/audio content freely from Internet ANYTIME and ANYWHERE.client-serveruseruserapplicationsserverconnectionperformance, scalabilitycost4Content Delivery Network5Server Side: Content Delivery Network (CDN)Replicate the content from the original content server at its local cache.Distribute the content to clients.

There are 2 ways to enhance the multimedia access.CDN ServersserverclientservercontentsCDNclientserverclientserverclientCDNserverproxy server

CDN Benefits:Maximizing bandwidth utilizationReducing the response time for the end-usersAchieving higher throughput through replicating content---

clientpeerserverpeerstoragebandwidth

5Peer-to-Peer Network6Client Side: Peer-to-Peer (P2P) NetworkClients become active associates by transmitting received content to other clients.

Peer-to-PeerHybrid CDN & P2P Network7Hybrid CDN and P2P Network

CDN ServersPeer-to-Peerp2pCDN-P2P7BackgroundP2P Streaming SystemALM TechniqueIPM versus ALM8P2P Streaming System9A system without a central server, where each participating node, act both as a server and a client.

Content to be shared is sourced in parts by each node peers.

Famous Application of P2P Streaming:PPStreamCoolStreaming

9ALM Technique10Multiple Connections:Multiple UnicastUnicast is the most common way to make connection in the network. Multiple unicast always produce duplicate paths.

IP Multicast (IPM)Failed due to concerns regarding scalability, deployment, and support for higher level functionality.

Application Layer Multicast (ALM)Dispatcher algorithm potentially avoids redundant communication in the network.

ALMP2PIP multicast

IPP2PIP10Overlay Network11

Conceptual Routing NetworkPhysical Routing Network(Overlay Network)11IPM versus ALM12IP MulticastApplication Layer Multicast

IPMrouterALM

ALM(1,A)(3,B)IP MulticastALM12System ArchitectureSystem Concept DiagramThree SubsystemsSystem Block Diagram

1313System Concept Diagram14

VLC SourceCamera SourceVLC ClientVLC ClientCamera ClientSystem Architecture (cont.)15Three Subsystems:

Streaming Transfer subsystemData BufferingOrdering

Algorithm subsystemSet routing information (i.e. Build tree structure)Determine where the streaming packets transport to

Network Management subsystemManage socket connection statusProcess multiple asynchronous I/O requestsSystem Architecture16System Block Diagram

Packet-Delivery AlgorithmPush-based System DMFTCDMFTPull-based SystemRevised BitTorrent1717Push-based System18Nodes are arranged in a tree structure.

Selected frame is pushed from a parent node to its child node.

Delay in the push system occurs when a node leaves subsequently leading to rediscovery of the parent -child relation - Tree is regenerated.

Moreover there can be redundancy when two nodes are pushing the same frame to a node.DMFT19DMFT: Distributed Multisource Forwarding Tree

A multi-source multicast algorithm in application layer for routing.

Every member can not only provide source contents but also can forward data to others.

Need to maintain some neighbor information.NIT (Neighbor Information Table)DFT (Data Forwarding Table)DMFTALMMemberSourceMember Forwarding TreeNITDFTTable19DMFT Tables20NIT: Neighbor Information TableRecord the distance of each member which is in the group

DFT: Data Forwarding TableMaintain the routing informationNITField nameMember IPHop CountDFTField nameSource IPNext Peers IPParent IPNITNeighbor AddressHop CountHop Countmembermember

DFTSourcenext-hop member(s)parentSourcenext-hop member(s)memberSourceParentmember

20DMFT Flow Chart21

(1) Member Join(2) Construct Routing Tree(3) Prune Duplicate Path(4) Recover Tree Structure(5) Inquire at regular timeCDMFT22CDMFT: Cluster Distributed Multisource Forwarding Tree

An enhanced DMFT algorithm for reducing control messages.

With cluster-based group management, all multicast group members are grouped into different clusters.

Each cluster has a cluster head which is responsible for managing cluster members and forwarding multicast data.CDMFT Hierarchical23

Cluster HeadersCluster MembersCluster HeadCluster HeadCluster HeadDMFTCluster MemberBackup Cluster Head23Pull-based System24Peers request neighboring peers for the next frame needed by them.

Each peer has a buffer-map of the frames currently held by it and its neighbors.

A Peer refers each of its neighbors buffer-map to decide from whom to pull data.

Disadvantage: Making requests of pull again and again and exchanging buffer maps can result in congestion.BitTorrent Network (cont.)25Common BitTorrent terms:

Tracker: A server that keeps track of which seeds and peers are in the swarm.

Seeder: Refers to a machine possessing some part of the data.

Swarm: Together, all peers (including seeds) sharing a torrent are called a swarm.

Leech: A peer or any client that does not have 100% of the data. Also, refers to a peer (or peers) that has a negative effect on the swarm by having a very poor share ratio.Tracker: Seeder: PeerSwarm: PeerLeech: Peer25BitTorrent Network26BitTorrent download Strategies:

Rarest FirstThe rarest pieces are transmitted with high priority.The strategy can use in the two cases.

Tit for tatThe strategy is used to optimize the download speedChoking Policy: Peers are uploaded to more cooperating peer.Optimistic Unchoking: A peer will upload to other peers randomly in a period.

Rarest First: Tit for tat: Peer In the multimedia streaming, it considers delay time, bandwidth, activation time, and etc.

26Test and ImplementationCode OrganizationSystem Test CasesTest Tools27 VLC media player28A free and open source cross-platform multimedia player and framework that plays most multimedia files as well as DVDs, Audio CDs, VCDs, and various streaming protocols.

Plays most codecs with no codec packs needed:MPEG-2, DivX, H.264, MKV, WebM, WMV, MP3...

Plays everything: Files, Discs, Webcams, Devices and Streams.28Implementation29Organize Codes:

Test Respectively:IOCP asynchronous transport: Sender, Receiver Buffering and OrderingThread Manager, Memory ManagerRouting AlgorithmOriginal UsedCurrent UsedIDEEclipse C++ Qt C++UIwxWidgetwxFormBuilderQt UI

http://projects.tano.si/vlc-qt

QTQTQTVLClibraryQTUIwxWidget29Code Organization (cont.)30

Original Used IDE:EclipseCode Organization31

Current Used IDE: QtSystem Test (cont.)32Test Case:Unicast versus Multicast systemDifferent bitrate video sources

Test Range:1 peer localhost (127.0.0.1) loopback2 peers connect directly2 peers connect through network3 peers, 4 peers

32System Test33Test Environment:LocalhostSelf-Contained NetworkRealistic Network

Test Packets loss tool:Wireshark (Telephony)

Test Transport Stream packets tool:TSReaderMPEG-2 Transport Stream packet analyserWireshark34

TSReader35

MPEG-2 Transport Stream packet analyser36

ConclusionsFuture works37Conclusions38For enhancing system performance, need to trace the whole project codes to find where the bug is.

Will update the prototype to an integrated system.

Integrate VLC media player into our system.

Compatible with other kind of media players.

Find more analysis tools to validate the system results.

Hope to use real Live sources (i.e.Camera) when system is stable.References (cont.)39J. Liu, S. Rao, B. Li, and H. Zhang,Opportunities and challenges of peer-to-peer internet video broadcast, Proc. of the IEEE, vol. 96, no.1, pp. 11-24, Jan. 2008.

W. Zhanga, Q. Zhenga, H. Lib and F. Tian,An overlay multicast protocol for live streaming and delay-guaranteed interactive media, Journal of Network and Computer Applications, vol. 35, Issue 1, pp. 20-28, Jan. 2012.39References40Chia-Hui Huang, Design and Analysis of Application Layer Multicast Routing Protocols, Unpublished doctoral dissertation, National Taipei University of Technology, April 2013.

Wen-Neng Tsai,Design of a live multimedia streaming system with pull-based P2P transport technology, Unpublished master dissertation, National Taipei University of Technology, July 2013.

Tzu-Tung Liao,Design of a multisource multimedia streaming system with fast recoverable application layer multicast algorithm, Unpublished master dissertation, National Taipei University of Technology, July 2013.Thanks for listening41Peer 2

Peer 2

Network Management subsystem

Control Messages

Streaming Transfer subsystem

Algorithm subsystem

Media Player (Optional)

Routing Informations

Data Transport

Play Stream

Stream Transport

Operating System Network Transfer (MAC)

Start System

Input the local ip

Input the one of The members' ip

As a Group Creator?

Stream Forward

Yes

No

Update NIT

Update DFT

Is parent duplicate?

Prune Message

Member leave

Recovery

Is new member join?

Yes

Yes

No

No

No

A

A

A