Protocol chat

A key element in DC is the ability to chat. Basic chat is very easily implemented in a client.

As is noted by the previous ADC and NMDC run downs, commands are sent differently, which is why we need to know about each.

Let me create two categories; NMDC chat and ADC chat.

Both categories have chat in the main window. Further, NMDC has “private” messaging, which is essentially that chat is sent to a particular user. ADC has also “private” messaging. However, while the chat functionality in ADC allows a single user to receive the message, the private message is intended for a ‘group’ of users. This group can be anything, really. It could be only those who us DC++, or those who natively support user commands. What is interesting is that sending a message in ADC to a user is the same as sending to a group, just a replacement of some info, but the length will be the same.

Let us continue, and start with a basic main chat message.

Main chat is rather simple in NMDC, and it require no real difficult parsing it. In this example, my nick is going to be “ullner” and the message being “hello everybody”. This is how that will look;
<ullner> hello everybody|
Which is pretty straight forward. The nick in brackets, followed by the message and an ending pipe. This amounts to 25 characters or bytes.

Moving on to main chat in ADC… The difficulty to parse is raised, although not very much. I’m going to use the same message. However, due to ADC’s user -> SID mapping, I won’t be using a nick, but a SID. The SID is “MD3Z”. This is how that will look;
BMSG MD3Z hello\severybody\n
Which is also pretty straightforward, although not as much as the NMDC example. The \s replaces the space and the last \n is one character (ending the command). This amounts to 27 characters. Not that much difference, really. At least not in our example.

Note that changing nick won’t change the SID. So, NMDC will consume slightly less bandwidth if the nick is 7 or less characters, 8 characters and we’re dead on and above 8 mean that ADC will scale a better.

Let us continue to “private” messaging.

I’m going to now use the same message, and with the other user being “arne”. arne’s SID is in this case “6DKN”.

Starting with NMDC; $To: arne From: ullner $<ullner> hello everybody|
So, essentially it is the same as for a normal main chat message except the beginning. This amounts up to 49 characters or bytes.

In ADC, we will have the following; DMSG MD3Z 6DKN hello\severybody PMMD3Z\n
In this, we changed the initial letter from a B to a D (works with E, too), added arne’s SID before the message and our own SID after (in the PM parameter). This amounts up to 39 characters or bytes.

If the two users’ nicks were only one character long, we’d end up with 36 characters. (Though, most users don’t have that, naturally.)

In conclusion; main chat messages are somewhat better in NMDC, but up to a point where ADC will be better and; ADC will in almost every case out-weigh NMDC in private messaging.

One Response to Protocol chat

  1. Pingback: Command and bandwidth estimations in NMDC « DC++: Just These Guys, Ya Know?

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: