1 / 38

RTP

RTP. Real Time Protocol LTN ZOELLER Cédric MAJ CONSTANTIN Jean-Yves Centre de Recherche Opérationnelle et de Simulation de l’Armée de Terre. PLAN. Présentation générale de RTP Présentation générale du projet Présentation détaillé de RTP Implémentation Ressources.

mason
Download Presentation

RTP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. RTP Real Time Protocol LTN ZOELLER Cédric MAJ CONSTANTIN Jean-Yves Centre de Recherche Opérationnelle et de Simulation de l’Armée de Terre

  2. PLAN • Présentation générale de RTP • Présentation générale du projet • Présentation détaillé de RTP • Implémentation • Ressources

  3. Présentation générale de RTP

  4. Présentation générale de RTP • Real Time Transport Protocol • Objectif:fourniture de bout en bout de services pour des données ayant des contraintes de temps réel • Composition: • Transport des données: RTP • Contrôle de la session: RTCP

  5. Place de RTP Application SAP/SDP RTP/RTCP TCP / UDP IP Niveau 2 Niveau 1

  6. Présentation générale du projet

  7. Acquisition RTP Multicast Stockage Affichage RTP RTP Multicast Multicast Affichage RTP Multicast Présentation générale du projet

  8. Présentation détaillé de RTP

  9. Présentation détaillé de RTP • RFC 1889 • RTP • Diffusion synchrone de flux temps réels • Pas de contrôle de qualité de la communication • RTCP • Contrôle de qualité de la communication • Partage bande passante

  10. Présentation détaillé de RTP En-tête Fixe12 Octets En-tête optionnelle Données

  11. Présentation détaillée de RTP • V: Version • P: Padding • X: Extension • CC: Nombre de CSRC • M: Marker • PT: Payload type • Sequence Number • Timestamp • SSRC: Identifiant source synchronisation • CSRC: Identifiants des sources

  12. Entête RTP 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |V=2|P|X| CC |M| PT | sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | timestamp | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | synchronization source (SSRC) identifier | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | contributing source (CSRC) identifiers | | .... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + extensions + + +

  13. RTCP • Feedback qualité distribution • Identification • Nombre de participant • Autres informations

  14. Présentation détaillée de RTCP • Rapport d’émission • Rapport de réception • SDES • Bye • Application

  15. RTCP / Sender Report . 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |V=2|P| RC | PT=SR=200 | length | header +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SSRC of sender | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | NTP timestamp, most significant word | sender +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ info | NTP timestamp, least significant word | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RTP timestamp | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | sender's packet count | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | sender's octet count | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | | report |...............................................................|

  16. RTCP / Sender Report .. |...............................................................| | | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | SSRC_1 (SSRC of first source) | report +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ block | fraction lost | cumulative number of packets lost | 1 -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | extended highest sequence number received | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | interarrival jitter | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | last SR (LSR) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | delay since last SR (DLSR) | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | SSRC_2 (SSRC of second source) | report +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ block : ... : 2 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | profile-specific extensions | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

  17. RTCP / Receiver Report 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |V=2|P| RC | PT=RR=201 | length | header +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SSRC of packet sender | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | SSRC_1 (SSRC of first source) | report +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ block | fraction lost | cumulative number of packets lost | 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | extended highest sequence number received | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | interarrival jitter | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | last SR (LSR) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | delay since last SR (DLSR) | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | SSRC_2 (SSRC of second source) | report +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ block : ... : 2 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | profile-specific extensions | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

  18. RTCP / SDES 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |V=2|P| SC | PT=SDES=202 | length | header +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | SSRC/CSRC_1 | chunk +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1 | SDES items | | ... | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | SSRC/CSRC_2 | chunk +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2 | SDES items | | ... | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

  19. RTCP / Bye 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |V=2|P| SC | PT=BYE=203 | length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SSRC/CSRC | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ : ... : +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | length | reason for leaving ... (opt) +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

  20. DEMO • Capture Ethereal depuis JMF

  21. Translators • Envoie les flux de différentes sources séparément • Transmet les paquets avec leurs identifiant SSRC intact. • Peut changer le codage des données. Il assigne alors de nouveaux numéros de séquences aux paquets • Un destinataire ne peut détecter la présence d’un Translator à moins de se procurer les caractéristiques de la source

  22. Mixers • Combine les flux de différentes sources pour former un nouveau flux • Il devient source de synchronisation: • Tous les paquets RTP émis sont marqués avec l’identificateur SSRC du mixer. • Pour préserver l’identité des sources principales il inclut la liste des différents identificateur SSRC derrière le header RTP (liste CSRC). • CSRC : Contributing source Identifiers

  23. Exemple Réseau RTP M1:48(1,17) E4:47 M1:48(1,17) M3:89(64,45) E6:15 M1:48(1,17) E4:47 M3:89(64,45) M2:12(64)

  24. Implémentation

  25. Implémentations • Classe RTP de bas niveau • RTP selon SUN: API JMF

  26. RTP bas niveau

  27. RTP bas niveau publicclass MulticastSocketRTP_RTCP extends MulticastSocket { privatebyte buf[]; private DatagramPacket packet; private RTPPacket2 rtp_packet; private RTCPPacket2 rtcp_packet; privateint type; public MulticastSocketRTP_RTCP(String adresse,int port,int t) throws IOException { super(port); type = t; buf = newbyte[1500]; InetAddress multicastadresse = InetAddress.getByName(adresse); packet = new DatagramPacket(buf,buf.length); joinGroup(multicastadresse); }

  28. RTP bas niveau publicvoid printOutHeader() { try{ receive(packet); System.out.println("Header "+getType()); switch (type) { case 0: rtp_packet = new RTPPacket2(packet.getData(),packet.getLength() ); System.out.print("|V :"+rtp_packet.getVersion() ); System.out.print("|P :"+rtp_packet.getPadding() ); System.out.print("|X :"+rtp_packet.getExtension() ); System.out.print("|CC :"+rtp_packet.getCC() ); System.out.print("|M :"+rtp_packet.getMarker() ); System.out.println("|PT :"+rtp_packet.getPayloadType() ); System.out.print("|Sequence Number :"+rtp_packet.getSequenceNumber() ); System.out.print("|TimeStamp :"+rtp_packet.getTimeStamp() ); System.out.print("|SSRC :"+rtp_packet.getSsrc() ); System.out.println(""); break;

  29. RTP bas niveau publicclass RTPPacket2{ //Taille de l'en-tête RTP: staticint HEADER_SIZE = 12; //Champ de l'en-tête privateint Version; privateint Padding; privateint Extension; privateint CC; privateint Marker; privateint PayloadType; privateint SequenceNumber; privateint TimeStamp; privateint Ssrc; publicbyte[] header; //Taille de la charge utile (payload) publicint payload_size; //Data de la charge utile publicbyte[] payload;

  30. RTP bas niveau if (packet_size >= HEADER_SIZE) { //Récupération de l'en-tête header = newbyte[HEADER_SIZE]; for (int i=0; i < HEADER_SIZE; i++) header[i] = packet[i]; //Récupération des data de la charge utils payload_size = packet_size - HEADER_SIZE; payload = newbyte[payload_size]; for (int i=HEADER_SIZE; i < packet_size; i++) payload[i-HEADER_SIZE] = packet[i]; //Récupération des valeurs des champs de l'en-tête Marker = header[1] & 128; if (Marker != 0) Marker=1; CC = header[0] & 64; Extension = header[0] & 16; if (Extension !=0) Extension = 1; Padding = header[0] & 32; if (Padding !=0) Padding = 1;

  31. RTP bas niveau • DEMO

  32. RTP selon SUN • RTPManager • Manager de connections RTP • RTPControl • Classe contenant le type de flux RTP (JPEG/MPEG…) • Player • Classe où l’on joue les flux RTP • RTPConnector • Classe permettant de s’adapter à différentes couches (réseau/transport différents TCP/UDP//IP) + de détails sur le site sun

  33. RTP selon SUN

  34. RTP selon SUN publicclass reception_rtp implements ReceiveStreamListener, SessionListener, ControllerListener { String sessions[] = null; RTPManager mgrs[] = null; Vector playerWindows = null; boolean dataReceived = false; Object dataSync = new Object(); public reception_rtp(String sessions[]) { //CONSTRUCTEUR this.sessions = sessions; //224.123.111.101/22222 224.123.111.102/22224 } protectedboolean initialize() { try { InetAddress ipAddr; SessionAddress localAddr = new SessionAddress(); SessionAddress destAddr; mgrs = new RTPManager[sessions.length]; //un MANAGER RTP par session playerWindows = new Vector();

  35. RTP selon SUN mgrs[i] = (RTPManager) RTPManager.newInstance(); mgrs[i].addSessionListener(this); mgrs[i].addReceiveStreamListener(this); ipAddr = InetAddress.getByName(session.addr); if( ipAddr.isMulticastAddress()) { // adresse locale et distante identique localAddr= new SessionAddress( ipAddr, session.port, session.ttl); destAddr = new SessionAddress( ipAddr, session.port, session.ttl); } else { localAddr= new SessionAddress( InetAddress.getLocalHost(), session.port); destAddr = new SessionAddress( ipAddr, session.port); } mgrs[i].initialize( localAddr); mgrs[i].addTarget(destAddr);

  36. RTP selon SUN if (evt instanceof NewReceiveStreamEvent) { try { stream = ((NewReceiveStreamEvent)evt).getReceiveStream(); DataSource ds = stream.getDataSource(); // Trouve le format reçu RTPControl ctl = (RTPControl)ds.getControl("javax.media.rtp.RTPControl"); if (participant == null) System.err.println(" L'emmetteur du stream est déjà identifié."); else { System.err.println(" Le stream vient de: " + participant.getCNAME()); } // creation d'un player en passant DataSource (ds) au constructeur Player p = javax.media.Manager.createPlayer(ds); if (p == null) return; p.addControllerListener(this); p.realize(); PlayerWindow pw = new PlayerWindow(p, stream); playerWindows.addElement(pw);

  37. Ressources

  38. Ressources • RFChttp://rfc.net/rfc1889.htmlRFC en « français » • JAVAhttp://java.sun.com/products/java-media/jmf/ • CExemples de code dans la RFC

More Related