AnsweredAssumed Answered

A file transfer problem!

Question asked by michaelpan on May 8, 2011
Latest reply on Sep 7, 2015 by 张俊瑞

I built a LAN IM platform using Openfire 3.7.0 and Spark 2.6.0 RC2. It works great but with a file transfer problem. It can't transfer files between two Spark clients. I'm confused. So I start Spark again using debug mode to test the file transferring. Finally, I find that the file transfer error occured because of the incorrect IP bound by Openfire and Spark. Here is the test result.

 

First,

 

here is the hierarchy of my IM platform.

 

Server: domain name (tellu.ncrl.3322.org), LAN IP (172.17.14.69), VPN for Internet access IP (12.1.3.57)

Client1: user name (test1@tellu.ncrl.3322.org), LAN IP (172.18.8.54), VPN for Internet access IP (58.192.124.132)

Client2: user name (test2@tellu.ncrl.3322.org), LAN IP (172.17.14.78), No Internet access

 

Second,

 

now I want to transfer a file Test.pdf from Client1 to Client2. When I transmit the file, I get the debug message in Client1 listed below:

************************************************************************

Packets 1

 

Message: IQ Sent (class=org.jivesoftware.smackx.packet.StreamInitiation)

Id: HI323-72

Type: set

To: test2@tellu.ncrl.3322.org/spark

From: (blank)

 

<iq id="Hl323-72" to="test2@tellu.ncrl.3322.org/spark" from="test1@tellu.ncrl.3322.org/spark" type="set">

  <si xmlns="http://jabber.org/protocol/si" id="jsi_6574442567508982783" mime-type="application/pdf" profile="http://jabber.org/protocol/si/profile/file-transfer">

    <file xmlns="http://jabber.org/protocol/si/profile/file-transfer" name="Test.pdf" size="496221">

      <desc>Sending file</desc>

    </file>

    <feature xmlns="http://jabber.org/protocol/feature-neg">

      <x xmlns="jabber:x:data" type="form">

        <field var="stream-method" type="list-single">

          <option>

            <value>http://jabber.org/protocol/bytestreams</value>

          </option>

          <option>

            <value>http://jabber.org/protocol/ibb</value>

          </option>

        </field>

      </x>

    </feature>

  </si>

</iq>

************************************************************************

Packet 2

 

Message: IQ Received (class=org.jivesoftware.smackx.packet.StreamInitiation)

Id: HI323-72

Type: result

To: (blank)

From: test2@tellu.ncrl.3322.org/spark

 

<iq id="Hl323-72" to="test1@tellu.ncrl.3322.org/spark" from="test2@tellu.ncrl.3322.org/spark" type="result">

  <si xmlns="http://jabber.org/protocol/si">

    <feature xmlns="http://jabber.org/protocol/feature-neg">

      <x xmlns="jabber:x:data" type="submit">

        <field var="stream-method">

          <value>http://jabber.org/protocol/bytestreams</value>

        </field>

      </x>

    </feature>

  </si>

</iq>

************************************************************************

Packet 3

 

Message: IQ Sent (class=org.jivesoftware.smackx.packet.DiscoverInfo)

Id: HI323-73

Type: get

To: test2@tellu.ncrl.3322.org/spark

From: (blank)

 

<iq id="Hl323-73" to="test2@tellu.ncrl.3322.org/spark" type="get">

  <query xmlns="http://jabber.org/protocol/disco#info"/>

</iq>

************************************************************************

Packet 4

 

Message: IQ Received (class=org.jivesoftware.smackx.packet.DiscoverInfo)

Id: HI323-73

Type: result

To: (blank)

From: test2@tellu.ncrl.3322.org/spark

 

<iq id="Hl323-73" to="test1@tellu.ncrl.3322.org/spark" from="test2@tellu.ncrl.3322.org/spark" type="result">

  <query xmlns="http://jabber.org/protocol/disco#info">

    <identity category="client" name="Smack" type="pc"/>

    <feature var="http://jabber.org/protocol/xhtml-im"/>

    <feature var="http://jabber.org/protocol/muc"/>

    <feature var="http://jabber.org/protocol/bytestreams"/>

    <feature var="http://jabber.org/protocol/commands"/>

    <feature var="http://jabber.org/protocol/si/profile/file-transfer"/>

    <feature var="http://jabber.org/protocol/si"/>

    <feature var="http://jabber.org/protocol/ibb"/>

    <feature var="http://www.xmpp.org/extensions/xep-0166.html#ns"/>

    <feature var="urn:xmpp:tmp:jingle"/>

  </query>

 

</iq>

************************************************************************

Packet 5

 

Message: IQ Sent (class=org.jivesoftware.smackx.packet.DiscoverItems)

Id: HI323-74

Type: get

To: test2@tellu.ncrl.3322.org/spark

From: (blank)

 

<iq id="Hl323-74" to="tellu.ncrl.3322.org" type="get">

  <query xmlns="http://jabber.org/protocol/disco#items"/>

</iq>

************************************************************************

Packet 6


Message: IQ Received(class=org.jivesoftware.smackx.packet.DiscoverItems)

Id: HI323-74

Type: result

To: (blank)

From: test2@tellu.ncrl.3322.org/spark

 

<iq id="Hl323-74" to="test1@tellu.ncrl.3322.org/spark" from="tellu.ncrl.3322.org" type="result">

  <query xmlns="http://jabber.org/protocol/disco#items">

    <item jid="conference.tellu.ncrl.3322.org" name="公共房间"/>

    <item jid="search.tellu.ncrl.3322.org" name="User Search"/>

    <item jid="pubsub.tellu.ncrl.3322.org" name="Publish-Subscribe service"/>

    <item jid="proxy.tellu.ncrl.3322.org" name="Socks 5 Bytestreams Proxy"/>

  </query>

</iq>

************************************************************************

Packet 7

 

Message: IQ Sent (class=org.jivesoftware.smackx.packet.DiscoverInfo)

Id: HI323-75

Type: get

To: proxy.tellu.ncrl.3322.org

From: (blank)

 

<iq id="Hl323-75" to="proxy.tellu.ncrl.3322.org" type="get">

 

  <query xmlns="http://jabber.org/protocol/disco#info"/>

 

</iq>

************************************************************************

Packet 8

 

Message: IQ Received (class=org.jivesoftware.smackx.packet.DiscoverInfo)

Id: HI323-75

Type: result

To: (blank)

From: proxy.tellu.ncrl.3322.org

 

<iq id="Hl323-75" to="test1@tellu.ncrl.3322.org/spark" from="proxy.tellu.ncrl.3322.org" type="result">

  <query xmlns="http://jabber.org/protocol/disco#info">

    <identity category="proxy" name="SOCKS5 Bytestreams Service" type="bytestreams"/>

    <feature var="http://jabber.org/protocol/bytestreams"/>

    <feature var="http://jabber.org/protocol/disco#info"/>

  </query>

</iq>

************************************************************************

Packet 9

 

Message: IQ Sent (class=org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream)

Id: HI323-76

Type: get

To: proxy.tellu.ncrl.3322.org

From: (blank)

 

<iq id="Hl323-76" to="proxy.tellu.ncrl.3322.org" type="get">

  <query xmlns="http://jabber.org/protocol/bytestreams"/>

</iq>

************************************************************************

Packet 10

 

Message: IQ Received (class=org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream)

Id: HI323-76

Type: result

To: (blank)

From: proxy.tellu.ncrl.3322.org

 

<iq id="Hl323-76" to="test1@tellu.ncrl.3322.org/spark" from="proxy.tellu.ncrl.3322.org" type="result">

  <query xmlns="http://jabber.org/protocol/bytestreams">

    <streamhost jid="proxy.tellu.ncrl.3322.org" host="12.1.3.57" port="7777"/>

  </query>

</iq>

************************************************************************

Packet 11

 

Message: IQ Sent (class=org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream)

Id: HI323-77

Type: set

To: test2@tellu.ncrl.3322.org/spark

From: (blank)

 

<iq id="Hl323-77" to="test2@tellu.ncrl.3322.org/spark" type="set">

  <query xmlns="http://jabber.org/protocol/bytestreams" sid="jsi_6574442567508982783" mode="tcp">

    <streamhost jid="test1@tellu.ncrl.3322.org/spark" host="58.192.124.132" port="7777"/>

    <streamhost jid="proxy.tellu.ncrl.3322.org" host="12.1.3.57" port="7777"/>

  </query>

</iq>

************************************************************************

Packet 12

 

Message: IQ Received (class=org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream)

Id: HI323-77

Type: error

To: (blank)

From: test2@tellu.ncrl.3322.org/spark

 

<iq id="Hl323-77" to="test1@tellu.ncrl.3322.org/spark" from="test2@tellu.ncrl.3322.org/spark" type="error">

  <error code="404" type="CANCEL">

    <item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>

    <text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" xml:lang="en">Could not establish socket with any provided host</text>

  </error>

</iq>

************************************************************************

 

In the above results, I find that the IP address (with red color above) the Client1 listening should be 172.18.8.54, not 58.192.124.132. And the IP address (with blue color) the Openfire Server listening should be 172.17.14.69, not 12.1.3.57. I think this is the cause of my file transfer problem.

Anyone know how to tell spark and openfire which IP address should be listening at? Is this a bug?

 

PS:

1. If I disconnect the VPN connection in Client1, that means it has only one IP address 172.18.8.54 in Client1, the file transfer problem does not occured, and the transferring speed is high (about 10M/s in LAN).

 

2. English is not my mother tongue, so I do not know if I describe the problem clearly enough to understand. Any question is welcomed!

Outcomes