[dcc2] Reducing the size of the DCC2 negotiation message
codemastr
codemstr at ptd.net
Sun May 9 14:32:36 EDT 2004
After writing my previous post, I got to thinking about the length of the
initial DCC2 negotiation message. As I pointed out, this message can in some
instances exceed 300 characters. That's quite a bit compared to the current
DCC implementation.
This got me thinking about ways to reduce the size. I then thought of
machine convenience. Why does everything need to be text based? For example,
you specify "TLS1," why? A machine is reading it, not a person. Why not do a
simple mapping?
TransportSecurity
Protocol TokenValue
TLS1 1
SSL3 2
Blowfish 3
Then instead of having to do "TransportSecurity=TLS1,SSL3,Blowfish" you just
do "TransportSecurity=1,2,3" that clearly reduces the size of the message.
So it saves bandwidth, but it also makes processing faster. A machine can
compare the character "3" much faster than it can compare the string
"Blowfish"
Also, why must token names be so long? "TransportSecurity"??? Again, people
aren't reading it, machines are. "TransSec=1,2,3" we've now gone from 36
characters to specify security down to 14. 22 less bytes that need to be
sent, and 22 less bytes that need to be processed.
Same deal with the "Application"
Application
IRCFile 1
IRCChat 2
And call it "App" rather than "Application" now you've gone from
"Application=IRCChat" down to "App=2", from 19 chars down to 5.
Basically my suggestions for token renames would be:
Network -> Net
Transport -> Trans
TransportSecurity -> TransSec
Application -> App
ErrorTokens -> ErrToks
ErrorMessage -> ErrMsg
Offset -> Off
Filename -> Name
My reduced syntax still gets the point across, and it makes the message much
smaller. Since on of the goals of DCC2 is to make things faster, a good way
to do that is to make things smaller. Don't send information you don't need
to. Granted, it's not going to speed it up by any noticable amount of time,
but why send information that is unnecessary? If nothing else, think of it
in terms of helping the Internet. What need to we have to use up our ISP's
bandwidth and the IRC server's bandwidth (and the hops between) to send
"ErrorMessage" rather than "ErrMsg"? I can't see any.
Then about the numeric values. Again, it reduces things by a lot, and makes
processing faster.
For example, consider of of the examples right from the draft:
DCC2 Application=IRCFile Network=IPv6 TransportSecurity+=TLS1 SID=abde3
Filename="todo.txt" Size=98342
(102 characters)
With my syntax:
DCC2 App=2 Net=6 TransSec+=1 SID=abde3 Name="todo.txt" Size=98342
(65 characters)
It's 2/3 the length! And it still does exactly what it needs to do, it just
does it while saving 37 bytes.
Another:
DCC2 Application=IRCChat Network=IPv4,IPv6 TransportSecurity=SSL3,TLS1
SID=405
(78 characters)
With my syntax:
DCC2 App=1 Net=4,6 TransSec=2,1 SID=405
(39 characters)
This time the message length was cut in half!
Maybe you will disagree, but I think this is definately a better way to do
it. It uses less bandwidth, it frees up more space for things such as the
filename, and it is faster to process. The only down side that I can see is,
it's harder for people to read, but, people aren't supposed to be reading
it, the machine is!
-- codemastr
More information about the dcc2
mailing list