[jitsi-dev] Jitsi Videobridge and XMPP domain different than XMPP hostname issue


#1

Hi,
I noticed that in an XMPP installation (openfire) where XMPP domain is
different than XMPP hostname, where DNS SRV records are used, all XMPP
addresses are xxx@domain

for example if XMPP domain is example.com and XMPP hostname is
xxx.example.com, addresses are like 200@example.com

When videobridge creates a connector stream it uses the XMPP domain for
connecting and fails with:

java.net.UnknownHostException: example.com
        at java.net.InetAddress.getAllByName0(InetAddress.java:1229)
        at java.net.InetAddress.getAllByName(InetAddress.java:1156)
        at java.net.InetAddress.getAllByName(InetAddress.java:1092)
        at java.net.InetAddress.getByName(InetAddress.java:1042)
        at
net.java.sip.communicator.util.NetworkUtils.getInetAddress(NetworkUtils.java:905)
        at
org.jitsi.videobridge.Channel.createStreamConnector(Channel.java:519)
        at org.jitsi.videobridge.Channel.<init>(Channel.java:164)
        at org.jitsi.videobridge.Content.createChannel(Content.java:126)
        at
org.jitsi.videobridge.ComponentImpl.handleColibriConferenceIQ(ComponentImpl.java:270)
        at
org.jitsi.videobridge.ComponentImpl.handleIQ(ComponentImpl.java:391)
        at
org.jitsi.videobridge.ComponentImpl.handleIQ(ComponentImpl.java:350)
        at
org.jitsi.videobridge.ComponentImpl.handleIQGet(ComponentImpl.java:421)
        at
org.xmpp.component.AbstractComponent.processIQRequest(AbstractComponent.java:511)
        at
org.xmpp.component.AbstractComponent.processIQ(AbstractComponent.java:289)
        at
org.xmpp.component.AbstractComponent.processQueuedPacket(AbstractComponent.java:239)
        at
org.xmpp.component.AbstractComponent.access$100(AbstractComponent.java:81)
        at
org.xmpp.component.AbstractComponent$PacketProcessor.run(AbstractComponent.java:1051)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:679)
SENT: <iq type="result" id="LLI24-93" from="jitsi-videobridge.example.com"
to="200@example.com/jitsi-4h21g7"><conference xmlns="
http://jitsi.org/protocol/colibri" id="17f3927604e77638"><content
name="audio"><channel id="9e7789eb8fc08951" host="192.168.7.102"
rtpport="10000" rtcpport="10001" expire="60"/><channel
id="d83709308db54d26" host="192.168.7.102" rtpport="10002" rtcpport="10003"
expire="60"/></content></conference></iq>
Jun 27, 2013 12:57:43 PM org.jitsi.util.Logger info

What we need to do here is to perform a DNS lookup and find out the true
xmpp hostname

I am attaching here a patch that fixes this issue

Thanks,
Mircea

0001-XMPP-domain-different-than-XMPP-hostname.patch (1.81 KB)


#2

Hey Mircea,

Hi,
I noticed that in an XMPP installation (openfire) where XMPP domain is
different than XMPP hostname, where DNS SRV records are used, all XMPP
addresses are xxx@domain

for example if XMPP domain is example.com <http://example.com> and XMPP
hostname is xxx.example.com <http://xxx.example.com>, addresses are like
200@example.com <mailto:200@example.com>

You may want to have a look at the "Installation" section in https://jitsi.org/videobridge

Jitsi videobridge supports the following two parameters:

--domain=DOMAIN sets the XMPP domain (default: host, if host is set, none otherwise)

--host=HOST sets the hostname of the XMPP server (default: localhost)

They should allow you to handle your use case. Or doesn't this work for you?

Cheers,
Emil

···

On 27.06.13, 12:55, Mircea Carasel wrote:

When videobridge creates a connector stream it uses the XMPP domain for
connecting and fails with:

java.net.UnknownHostException: example.com <http://example.com>
         at java.net.InetAddress.getAllByName0(InetAddress.java:1229)
         at java.net.InetAddress.getAllByName(InetAddress.java:1156)
         at java.net.InetAddress.getAllByName(InetAddress.java:1092)
         at java.net.InetAddress.getByName(InetAddress.java:1042)
         at
net.java.sip.communicator.util.NetworkUtils.getInetAddress(NetworkUtils.java:905)
         at
org.jitsi.videobridge.Channel.createStreamConnector(Channel.java:519)
         at org.jitsi.videobridge.Channel.<init>(Channel.java:164)
         at org.jitsi.videobridge.Content.createChannel(Content.java:126)
         at
org.jitsi.videobridge.ComponentImpl.handleColibriConferenceIQ(ComponentImpl.java:270)
         at
org.jitsi.videobridge.ComponentImpl.handleIQ(ComponentImpl.java:391)
         at
org.jitsi.videobridge.ComponentImpl.handleIQ(ComponentImpl.java:350)
         at
org.jitsi.videobridge.ComponentImpl.handleIQGet(ComponentImpl.java:421)
         at
org.xmpp.component.AbstractComponent.processIQRequest(AbstractComponent.java:511)
         at
org.xmpp.component.AbstractComponent.processIQ(AbstractComponent.java:289)
         at
org.xmpp.component.AbstractComponent.processQueuedPacket(AbstractComponent.java:239)
         at
org.xmpp.component.AbstractComponent.access$100(AbstractComponent.java:81)
         at
org.xmpp.component.AbstractComponent$PacketProcessor.run(AbstractComponent.java:1051)
         at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
         at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
         at java.lang.Thread.run(Thread.java:679)
SENT: <iq type="result" id="LLI24-93"
from="jitsi-videobridge.example.com
<http://jitsi-videobridge.example.com>" to="200@example.com/jitsi-4h21g7
<http://200@example.com/jitsi-4h21g7>"><conference
xmlns="http://jitsi.org/protocol/colibri" id="17f3927604e77638"><content
name="audio"><channel id="9e7789eb8fc08951" host="192.168.7.102"
rtpport="10000" rtcpport="10001" expire="60"/><channel
id="d83709308db54d26" host="192.168.7.102" rtpport="10002"
rtcpport="10003" expire="60"/></content></conference></iq>
Jun 27, 2013 12:57:43 PM org.jitsi.util.Logger info

What we need to do here is to perform a DNS lookup and find out the true
xmpp hostname

I am attaching here a patch that fixes this issue

Thanks,
Mircea

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

--
https://jitsi.org


#3

Hello, Mircea

Hi,
I noticed that in an XMPP installation (openfire) where XMPP domain is
different than XMPP hostname, where DNS SRV records are used, all XMPP
addresses are xxx@domain

for example if XMPP domain is example.com <http://example.com> and XMPP
hostname is xxx.example.com <http://xxx.example.com>, addresses are like
200@example.com <mailto:200@example.com>

When videobridge creates a connector stream it uses the XMPP domain for
connecting and fails with:

java.net.UnknownHostException: example.com <http://example.com>
         at java.net.InetAddress.getAllByName0(InetAddress.java:1229)
         at java.net.InetAddress.getAllByName(InetAddress.java:1156)
         at java.net.InetAddress.getAllByName(InetAddress.java:1092)
         at java.net.InetAddress.getByName(InetAddress.java:1042)
         at
net.java.sip.communicator.util.NetworkUtils.getInetAddress(NetworkUtils.java:905)
         at
org.jitsi.videobridge.Channel.createStreamConnector(Channel.java:519)
         at org.jitsi.videobridge.Channel.<init>(Channel.java:164)
         at org.jitsi.videobridge.Content.createChannel(Content.java:126)
         at
org.jitsi.videobridge.ComponentImpl.handleColibriConferenceIQ(ComponentImpl.java:270)
         at
org.jitsi.videobridge.ComponentImpl.handleIQ(ComponentImpl.java:391)
         at
org.jitsi.videobridge.ComponentImpl.handleIQ(ComponentImpl.java:350)
         at
org.jitsi.videobridge.ComponentImpl.handleIQGet(ComponentImpl.java:421)
         at
org.xmpp.component.AbstractComponent.processIQRequest(AbstractComponent.java:511)
         at
org.xmpp.component.AbstractComponent.processIQ(AbstractComponent.java:289)
         at
org.xmpp.component.AbstractComponent.processQueuedPacket(AbstractComponent.java:239)
         at
org.xmpp.component.AbstractComponent.access$100(AbstractComponent.java:81)
         at
org.xmpp.component.AbstractComponent$PacketProcessor.run(AbstractComponent.java:1051)
         at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
         at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
         at java.lang.Thread.run(Thread.java:679)
SENT: <iq type="result" id="LLI24-93"
from="jitsi-videobridge.example.com
<http://jitsi-videobridge.example.com>" to="200@example.com/jitsi-4h21g7
<http://200@example.com/jitsi-4h21g7>"><conference
xmlns="http://jitsi.org/protocol/colibri" id="17f3927604e77638"><content
name="audio"><channel id="9e7789eb8fc08951" host="192.168.7.102"
rtpport="10000" rtcpport="10001" expire="60"/><channel
id="d83709308db54d26" host="192.168.7.102" rtpport="10002"
rtcpport="10003" expire="60"/></content></conference></iq>
Jun 27, 2013 12:57:43 PM org.jitsi.util.Logger info

What we need to do here is to perform a DNS lookup and find out the true
xmpp hostname

I am attaching here a patch that fixes this issue

Thanks for tracing this and for providing a patch! However, I think we should look for a more general solution.

The way I understand the issue:

In order to find a local network address to bind to for RTP/RTCP we use
NetworkAddressManagerService#getLocalAddress(InetAddress intendedDestination). And we use the address of the XMPP domain for intendedDestination. Currently we look up the domain's address records, and you propose to use SRV.

I think we should do something like this:
1. Make the "local address to use" configurable
2. Default to the above, but use the actual address of the
XMPP server we are connected to (and not an address obtained via DNS) for intendedDestination (and log a warning if it happens to be a local link address, for example...)

Regards,
Boris

···

On 6/27/13 1:55 PM, Mircea Carasel wrote:


#4

Hi Emil,

You may want to have a look at the "Installation" section in
https://jitsi.org/videobridge

Jitsi videobridge supports the following two parameters:

--domain=DOMAIN sets the XMPP domain (default: host, if host is set, none
otherwise)

--host=HOST sets the hostname of the XMPP server (default: localhost)

They should allow you to handle your use case. Or doesn't this work for
you?

I tried and I get the same results, so it does not work for me.
I started the jitsi videobridge like this:
./jvb.sh --secret=1234 --domain=example.com --host=ezuce46.example.com
and I get the same results
Thanks,
Mircea

···

Cheers,
Emil


#5

Thanks for tracing this and for providing a patch! However, I think we
should look for a more general solution.

The way I understand the issue:

In order to find a local network address to bind to for RTP/RTCP we use
NetworkAddressManagerService#**getLocalAddress(InetAddress
intendedDestination). And we use the address of the XMPP domain for
intendedDestination. Currently we look up the domain's address records, and
you propose to use SRV.

I think we should do something like this:
1. Make the "local address to use" configurable

Boris, thanks for reviewing the patch
So if I understand correctly you propose to add a new parameter to the
jvb.sh script - --local_address for example. but we already have --host
parameter, but using it it proves not effective, same error occurs. So
maybe we should use this parameter instead of adding a new one.

2. Default to the above, but use the actual address of the
XMPP server we are connected to (and not an address obtained via DNS) for
intendedDestination (and log a warning if it happens to be a local link
address, for example...)

Currently in video bridge it is called:
                        bindAddr
                            = nams.getLocalHost(
                                    NetworkUtils.getInetAddress(domain));
and domain = component.getDomain().
I don't know how to find out the actual address of the XMPP server we are
connected, other way than doing DNS lookup based on the domain. I looked
into ComponentImpl.java and only the domain is available there. Is there
other place to look for the true address of the XMPP server?
Also, for example when an XMPPConnection instance is created in SMACK, the
same procedure is used. The user specifies the XMPP domain when logging in
the chat client, and based on that SMACK performs DNS lookup to find the
true address of the XMPP server and creates the connection
Thanks,
Mircea

···

Regards,
Boris


#6

Thanks for tracing this and for providing a patch! However, I think we

should look for a more general solution.

The way I understand the issue:

In order to find a local network address to bind to for RTP/RTCP we use
NetworkAddressManagerService#getLocalAddress(InetAddress

intendedDestination). And we use the address of the XMPP domain for
intendedDestination. Currently we look up the domain's address records, and
you propose to use SRV.

I think we should do something like this:
1. Make the "local address to use" configurable

Boris, thanks for reviewing the patch
So if I understand correctly you propose to add a new parameter to the

jvb.sh script - --local_address for example. but we already have --host
parameter, but using it it proves not effective, same error occurs. So
maybe we should use this parameter instead of adding a new one.

The --host parameter is used to specify a hostname of the xmpp server to
connect to. We do not use SRV records, because we connect as a server
component and as far as I know there is no defined way to obtain the
address (IP and port number) with SRV. We thought of using the
_xmpp-client._TCP record, but it doesn't make much sense because we can
only use the IP address (since the port is definitely different).
I was suggesting to be able to specify the _local_ IP address to use for
media, either with arguments to jvb.sh or with a property. This way we
don't need to look anything up in DNS (unless the configuration is missing,
in which case we can fallback to some way of obtaining a local address that
makes sense -- for example what we do now)

2. Default to the above, but use the actual address of the
XMPP server we are connected to (and not an address obtained via DNS)

for intendedDestination (and log a warning if it happens to be a local link
address, for example...)

Currently in video bridge it is called:
                        bindAddr
                            = nams.getLocalHost(
                                    NetworkUtils.getInetAddress(domain));
and domain = component.getDomain().
I don't know how to find out the actual address of the XMPP server we are

connected

I think we can reuse the address specified via --host here

Sorry for the brevity/typos, sent from a mobile.

Regards,
Boris

···

On 28 Jun 2013 11:11, "Mircea Carasel" <mirceac@ezuce.com> wrote:


#7

The --host parameter is used to specify a hostname of the xmpp server to
connect to. We do not use SRV records, because we connect as a server
component and as far as I know there is no defined way to obtain the
address (IP and port number) with SRV. We thought of using the
_xmpp-client._TCP record, but it doesn't make much sense because we can
only use the IP address (since the port is definitely different).

I was suggesting to be able to specify the _local_ IP address to use for
media, either with arguments to jvb.sh or with a property. This way we
don't need to look anything up in DNS (unless the configuration is missing,
in which case we can fallback to some way of obtaining a local address that
makes sense -- for example what we do now)

Actually I think I got the things wrong - I think there are two addresses
involved here:
1. the address of the XMPP server (which is specified by --host parameter)
2. the address of the host where the videobridge is running (can be
different than the XMPP server address, in case videobridge is running on a
different host)
the --host parameter I think is used by the videobridge to connect to the
XMPP server and to be able to communicate XMPP signaling packets with it.
If videobridge runs on XMPP host --host parameter is not needed as it
defaults to localhost

the _local_ IP would be the IP address of the host where videobridge runs
- and I think it cannot be just 'localhost' or internal ip address - it has
to be the external IP address, the one exposed to the world.

>>
>> 2. Default to the above, but use the actual address of the
>> XMPP server we are connected to (and not an address obtained via DNS)
for intendedDestination (and log a warning if it happens to be a local link
address, for example...)
>
> Currently in video bridge it is called:
> bindAddr
> = nams.getLocalHost(
> NetworkUtils.getInetAddress(domain));
> and domain = component.getDomain().
> I don't know how to find out the actual address of the XMPP server we
are connected

I think we can reuse the address specified via --host here

I think that we cannot use --host here, because the StreamConnector that is
created here (Channel.createStreamConnector) is used to
create the videobridge media stream associated to a particular channel.
This is a RECVONLY stream first, and after is able to relay the stream to
the xmpp user that uses this channel it is transformed in a SENDRECV stream
So we need to use here the videobridge external IP address (the value of
the new _local_IP variable) or if not present - to put
InetAddress.getLocalAddress

Please let me know if my understanding is correct - and I will create
another patch

Thanks
Mircea

···

Sorry for the brevity/typos, sent from a mobile.

Regards,
Boris