[jitsi-dev] Questions on ICE sockets


#1

Hi all,

I started to dive into the source code of jvb/libjitsi, and have some 100
feet view questions.

1. Where is the code to allocate a local UDP/TCP socket for ICE?

2. What is the socket layer multiplex mechanism used in jitsi, something
like select in C?

Thanks for help,

/Kaiduan


#2

Hi Kaiduan,

Hi all,

I started to dive into the source code of jvb/libjitsi, and have some
100 feet view questions.

1. Where is the code to allocate a local UDP/TCP socket for ICE?

The allocation happens in ice4j, and there are a few different places. The most commonly used one is SinglePortHarvester/AbstractUdpListener.

2. What is the socket layer multiplex mechanism used in jitsi, something
like select in C?

No, ice4j uses java's synchronous I/O (with minor exceptions where we use selectors). The (de)multiplexing is somewhat complex, it happens in various places throughout ice4j. See MultiplexingDatagramSocket, MultiplexedDatagramSocket, MergingDatagramSocket. Unfortunately the documentation there is lacking (I was just talking with Brian yesterday that I need to add a description of this somewhere). Let us know if you have question about it.

Regards,
Boris

···

On 02/03/2017 15:51, Kaiduan Xie wrote:


#3

Boris,

Thanks for the explanation.

I was wondering what is the exact meaning of "SinglePort" in
SinglePortHarvester. At the first I thought it means the the single port
used in webrtc for RTCP mux.

After started two conferences, and checked the webrtc-internal, I found
that all the ports were same in remote SDP. So JVB uses ONE port for ALL
conferences in the system, that is very cool!. And there is a thread to
keep reading packets from this port, and JVB uses remote address to
dispatch the packets to different conferences.

Is my premature understanding right? I have not spend much time to dive
deep into the code yet.

So the question comes, if there are many conferences in JVB, will JVB
allocate different local port for different conference? How JVB decide to
start using a new port for new conferences?

Thanks,

/Kaiduan

···

On Thu, Mar 2, 2017 at 6:25 PM, Boris Grozev <boris@jitsi.org> wrote:

Hi Kaiduan,

On 02/03/2017 15:51, Kaiduan Xie wrote:

Hi all,

I started to dive into the source code of jvb/libjitsi, and have some
100 feet view questions.

1. Where is the code to allocate a local UDP/TCP socket for ICE?

The allocation happens in ice4j, and there are a few different places. The
most commonly used one is SinglePortHarvester/AbstractUdpListener.

2. What is the socket layer multiplex mechanism used in jitsi, something
like select in C?

No, ice4j uses java's synchronous I/O (with minor exceptions where we use
selectors). The (de)multiplexing is somewhat complex, it happens in various
places throughout ice4j. See MultiplexingDatagramSocket,
MultiplexedDatagramSocket, MergingDatagramSocket. Unfortunately the
documentation there is lacking (I was just talking with Brian yesterday
that I need to add a description of this somewhere). Let us know if you
have question about it.

Regards,
Boris

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev


#4

Yep, you've got it. In the single port mode, only a single port is used,
total; even across multiple conferences.

···

On Fri, Mar 3, 2017 at 12:20 PM, Kaiduan Xie <kaiduanx@gmail.com> wrote:

Boris,

Thanks for the explanation.

I was wondering what is the exact meaning of "SinglePort" in
SinglePortHarvester. At the first I thought it means the the single port
used in webrtc for RTCP mux.

After started two conferences, and checked the webrtc-internal, I found
that all the ports were same in remote SDP. So JVB uses ONE port for ALL
conferences in the system, that is very cool!. And there is a thread to
keep reading packets from this port, and JVB uses remote address to
dispatch the packets to different conferences.

Is my premature understanding right? I have not spend much time to dive
deep into the code yet.

So the question comes, if there are many conferences in JVB, will JVB
allocate different local port for different conference? How JVB decide to
start using a new port for new conferences?

Thanks,

/Kaiduan

On Thu, Mar 2, 2017 at 6:25 PM, Boris Grozev <boris@jitsi.org> wrote:

Hi Kaiduan,

On 02/03/2017 15:51, Kaiduan Xie wrote:

Hi all,

I started to dive into the source code of jvb/libjitsi, and have some
100 feet view questions.

1. Where is the code to allocate a local UDP/TCP socket for ICE?

The allocation happens in ice4j, and there are a few different places.
The most commonly used one is SinglePortHarvester/AbstractUdpListener.

2. What is the socket layer multiplex mechanism used in jitsi, something
like select in C?

No, ice4j uses java's synchronous I/O (with minor exceptions where we use
selectors). The (de)multiplexing is somewhat complex, it happens in various
places throughout ice4j. See MultiplexingDatagramSocket,
MultiplexedDatagramSocket, MergingDatagramSocket. Unfortunately the
documentation there is lacking (I was just talking with Brian yesterday
that I need to add a description of this somewhere). Let us know if you
have question about it.

Regards,
Boris

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev