Not logged in. · Lost password · Register
Forum: XMPP Protocol RSS
Avatar
cf0rum #1
Member since Aug 2010 · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: XMPP Packet size
Hi everyone,

I've been trying to find out how to define block size for XMPP Packet.

I've tried with Spark and Pidgin ( XMPP client ), both of them don't offer this feature.

I've tried to browse XMPP library as well ( like Smack ), but I couldn't find in the API, how to define block-size.
But I could see in XEP 0047  (In-Band Bytestreams) that it is possible to define block-size.
The problem is XEP-0047 is a client only protocol, and it's for transferring binary data.

Is there a way that I can define maximum block-size in XMPP protocol, and which client API can I use ?

Thanks in advance.
Avatar
Alex #2
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
there is no max. packet size. The RFC recommends one. But the maximum packet size normally is a server setting all will be different on different servers.
When you run your own server you can adjust it on your own. When your software must run on all XMPP servers then you have to find a setting which works well on all servers and split bigger packets in chunks.

Alex
Avatar
cf0rum #3
Member since Aug 2010 · 3 posts
Group memberships: Members
Show profile · Link to this post
Hi Alex,

Did you refer to packet size ( TCP/IP packet ) or message size ?  I've just checked with one of the XMPP Server, yes it is possible
to define maximum message size, which is the maximum data after the body tag.

But I didn't see anything about packet size. Probably this is on the lower level, network or transport layer, which is defined by TCP/IP protocol ?

Thanks, Alex.
Avatar
Alex #4
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
no, in XMPP this is the max. stanza size.

<message>.......</message>
or
<iq>......</iq>
or
<presence>...</presence>

servers count the complete stanza, not the body. Because the stanza could contain unlimited additional tags.

here is a snippet from my ejabberd config:
{5222, ejabberd_c2s, [
            {certfile, "D:\\var\\ejabberd\\certs\\ag-software.de.pem"}, starttls,
            {access, c2s},
            {shaper, c2s_shaper},
            {max_stanza_size, 65536}
               ]},

max. stanza size for client connections is here 65536 bytes.

Alex
Avatar
cf0rum #5
Member since Aug 2010 · 3 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #2
Quote by Alex on 2010-08-14, 12:04:
there is no max. packet size. The RFC recommends one. But the maximum packet size normally is a server setting all will be different on different servers.
When you run your own server you can adjust it on your own. When your software must run on all XMPP servers then you have to find a setting which works well on all servers and split bigger packets in chunks.

Alex


Hi Alex,

As you said, that there's no max. packet size on XMPP specification. Does that mean if I send a chat message with 1.024.000.000 character ( 1 MB ), it would be sent as 1 message ? Or will it be auto-split to several messages by the library ( i.e smack ) ?

If it would be sent as 1 big message, would it be possible to have 'auto-split' facility ?  Just like sms, where one sms is max 160 characters. Whenever someone write more than 160 characters, it would be splitted to more than 1 sms, and reconstructed again on the receiver side.

Thanks Alex.
Avatar
Alex #6
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
as I said before the max stanza size depends on the server configuration. agsXMPPand MatriX don't split stanzas automatically. There should be an extension for splitting stanzas at: http://xmpp.org/extensions/all.shtml

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters: