what is the connection-id for dtlssrtpenc?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

what is the connection-id for dtlssrtpenc?

Andres Gonzalez
Hi,

I currently have several Gstreamer regular RTP/RTCP streams working with my C++ application. I am now trying to migrate one of these streams to use DTLS/SRTP instead of RTP so I can feed a WebRTC web client. The webRTC client is not sending any media and is receive-only.  

The dltssrtpenc element is a bit confusing to me. The example in the source tree is using python (I can get the idea of what is going on but I am not experienced with python to know for sure). This example says that it requires "two pairs of TX/RX pipelines for a proper handshake."  

Question: Is that correct?   I have a single receiving WebRTC client that I want to handshake with the single sending Gstreamer pipeline, so are not these 2 endpoints sufficient to perform a DTLS handshake between them?

Question: what is the WebRTC SDP attribute/property that maps to the Gstreamer dltssrtpenc connection-id property?
Is it the WebRTC SDP ice-pwd or the fingerprint?

Thanks,
-Andres
Reply | Threaded
Open this post in threaded view
|

Re: what is the connection-id for dtlssrtpenc?

Sebastian Dröge-3
On Mo, 2016-05-30 at 17:52 -0700, Andres Gonzalez wrote:

> Hi,
>
> I currently have several Gstreamer regular RTP/RTCP streams working with my
> C++ application. I am now trying to migrate one of these streams to use
> DTLS/SRTP instead of RTP so I can feed a WebRTC web client. The webRTC
> client is not sending any media and is receive-only.  
>
> The dltssrtpenc element is a bit confusing to me. The example in the source
> tree is using python (I can get the idea of what is going on but I am not
> experienced with python to know for sure). This example says that it
> requires "two pairs of TX/RX pipelines for a proper handshake."  
>
> Question: Is that correct?   I have a single receiving WebRTC client that I
> want to handshake with the single sending Gstreamer pipeline, so are not
> these 2 endpoints sufficient to perform a DTLS handshake between them? 
>
> Question: what is the WebRTC SDP attribute/property that maps to the
> Gstreamer dltssrtpenc connection-id property? 
> Is it the WebRTC SDP ice-pwd or the fingerprint?
It's a string that should be the same on the encoder and decoder. It is
what allows both elements to know that they belong together and you can
set it to any value you want.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: what is the connection-id for dtlssrtpenc?

Andres Gonzalez
Thank you for your response Sebastian. However, your explanation is only applicable when GStreamer is both the sender and the receiver. In this case, it is easy to use any value for the connection-id as long as they are consistent at both GStreamer dtlssrtpenc and dtlssrtpdec.

But if GStreamer is only being used as the sender, I need to ensure the connection-id is consistent with what the other receiving endpoint is using so the DTLS handshake is successful.  I am trying to use GStreamer to connect to a WebRTC client. The WebRTC browser client is initiating a DTLS handshake with my server which is using GStreamer.  

I have looked at RFC6347 which defines DTLS, but I cannot find any reference to a "connection-id" the GStreamer dtlssrtpenc/dtlssrtpdec uses. So I am unsure of how to map the DTLS attributes/properties used in the WebRTC world to the DTLS attributes/properties used in the GStreamer DTLS world so the DTLS handshake is successful.

Thanks,
-Andres
Reply | Threaded
Open this post in threaded view
|

Re: what is the connection-id for dtlssrtpenc?

Sebastian Dröge-3
On Di, 2016-05-31 at 07:31 -0700, Andres Gonzalez wrote:

> Thank you for your response Sebastian. However, your explanation is only
> applicable when GStreamer is both the sender and the receiver. In this case,
> it is easy to use any value for the connection-id as long as they are
> consistent at both GStreamer dtlssrtpenc and dtlssrtpdec.
>
> But if GStreamer is only being used as the sender, I need to ensure the
> connection-id is consistent with what the other receiving endpoint is using
> so the DTLS handshake is successful.  I am trying to use GStreamer to
> connect to a WebRTC client. The WebRTC browser client is initiating a DTLS
> handshake with my server which is using GStreamer.  
You need to use encoder and decoder on the server side then, even if
you only send data. DTLS requires two-way communication.

The connection-id is only used for connecting the encoder and decoder
used in a single process.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: what is the connection-id for dtlssrtpenc?

Andres Gonzalez
Oh, I see.....I must have a very incorrect view of how DTLS works so I will go and do some homework.
Thanks for your help.

-Andres

On Tue, May 31, 2016 at 11:45 AM, Sebastian Dröge <[hidden email]> wrote:
On Di, 2016-05-31 at 07:31 -0700, Andres Gonzalez wrote:
> Thank you for your response Sebastian. However, your explanation is only
> applicable when GStreamer is both the sender and the receiver. In this case,
> it is easy to use any value for the connection-id as long as they are
> consistent at both GStreamer dtlssrtpenc and dtlssrtpdec.
>
> But if GStreamer is only being used as the sender, I need to ensure the
> connection-id is consistent with what the other receiving endpoint is using
> so the DTLS handshake is successful.  I am trying to use GStreamer to
> connect to a WebRTC client. The WebRTC browser client is initiating a DTLS
> handshake with my server which is using GStreamer.  

You need to use encoder and decoder on the server side then, even if
you only send data. DTLS requires two-way communication.

The connection-id is only used for connecting the encoder and decoder
used in a single process.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: what is the connection-id for dtlssrtpenc?

Nicolas Dufresne-4
In reply to this post by Andres Gonzalez
Le mardi 31 mai 2016 à 07:31 -0700, Andres Gonzalez a écrit :
> I have looked at RFC6347 which defines DTLS, but I cannot find any reference
> to a "connection-id" the GStreamer dtlssrtpenc/dtlssrtpdec uses. So I am
> unsure of how to map the DTLS attributes/properties used in the WebRTC world
> to the DTLS attributes/properties used in the GStreamer DTLS world so the
> DTLS handshake is successful.

The so called connection-id is internal to GStreamer and is application
defined. Your application should provide a unique ID to each matching
DTSL Encoder and Decoder. I agree the documentation need help, but
someone made an attempt to help out in the following link. Take note of
the creation order in that document, we should probably fix this:

  https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/ext/dtls/
README

Apparently, for DTLS to work, you need both TX and RX pipelines,
otherwise you are missing one half of the response. Afterward, you may
just send, or just receive.

Nicolas
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: what is the connection-id for dtlssrtpenc?

Andres Gonzalez
Thank you Nicolas.  Your comments are indeed very helpful.
-Andres
Reply | Threaded
Open this post in threaded view
|

Re: what is the connection-id for dtlssrtpenc?

john1422
Could you please provide an algorithm to just send and just receive for
DTLS-SRTP video stream. I want to stream video only one way and as I use
these pipelines a get bidirectional video stream even though in the Server
side I do not specify any video for streaming.

As I understand there must be dtlssrtpenc and dtlssrtpdec in both server and
client pipelines?

Client:
gst-launch-1.0 udpsrc port = 5002 ! .sink dtlssrtpdec connection-id=red
.rtp_src ! queue ! fakesink async=false -v filesrc
location=/home/user/Desktop/test.h264 ! h264parse ! avdec_h264 !
videoconvert ! x264enc ! rtph264pay ! "application/x-rtp, payload=(int)96,
ssrc=(uint)1356955624" ! .rtp_sink_0 dtlssrtpenc connection-id=red
is-client=True .src ! udpsink host=127.0.0.1 port=5000

Server:
gst-launch-1.0 udpsrc port = 5000 ! .sink dtlssrtpdec connection-id=blue
.rtp_src ! "application/x-rtp, payload=(int)96, ssrc=(uint)1356955624" !
.rtp_sink_0 dtlssrtpenc connection-id=blue is-client=False .src ! udpsink
host=127.0.0.1 port=5002

Thank you



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel