ADC hub referrer

In my Denying distributed attacks post, I described that users can be redirected to hubs. What I didn’t describe was whether there was a way for another hub to see if a user has been redirected or not. That is, something similar to the HTML referrer.

At the time, neither ADC nor NMDC had this type of functionality. However, before the official ADC 1.0 specification, a hub referral field was added to the INF.

What this means is that if a hub redirects a user, the client will automagically tell the hub so, when it successfully connects.

(NMDC still do not have this functionality.)

[If you’re not a hub (but eg a HTTP server) that’s being targeted, yes, you will need to do some communicating to find out from which address the user came from.]

Don’t forget that you can make topic suggestions for blog posts in our “Blog Topic Suggestion Box!”

Scamming passive users in ADC

Being in passive mode in ADC sure its disadvantages; less search results and less download sources. However, this also works the other way; you have to respond to less searches and have fewer potential uploads (because other people are in passive mode, too).

Why would anyone consider being passive as advantagious? Well, if you’re intentionally passive when you want to and intentionally active when you want to.

Consider the case of a download in active mode; You log in, broadcast to everyone your IP and port so they can connect to you (and you’ll be able to download) (“CTM = connect to me”).
Consider the case of a download in passive mode; You log in, ask whoever you want to download from what their “connect to me” is, and you connect to them.

Now what if I did a little scam? What if I logged in, not publicly but privately sent a user my IP and port, and did a “connect to me”? And afterwards I’ve sent the CTM, I’d just (privately again) send “I’m passive again, so I’m resetting my IP and port”. But your ongoing client-client connection would still be active.

What this will do is that only the active users in the hub will be able to download from you, and you won’t be relayed download requests by users who aren’t active. (Or if you are relayed, you can just ignore them “as you won’t be able to download from them”.)

This also works in searches. When you want to search, simply broadcast your info so people can relay the proper amount of search results to you. When you’re satisfied, just reset your information.

Note: This all could also be used as a way of saying “hey, I publicly said my port was this, but it’s shaped, so if you want to use one that’s not, use this port.”

(Note: I’m not sure if this all is possible in NMDC, because there’s no notion of “send only to a specific user”.)

Don’t forget that you can make topic suggestions for blog posts in our “Blog Topic Suggestion Box!”

Bloom filters

Currently, to ensure that a search query reaches all clients that might have files in their share matching it, DC hubs must broadcast that search query to all connected clients. This works, but scales poorly bandwidthwise with the number of distinct clients in a hub. DC++ 0.704 adds support for Bloom filters to ameliorate this bandwidth issue.

A Bloom filter, as used by a DC client or hub, concisely summarizes the contents of a share by constructing a bit vector which allows for probabalistic queries as to the presence of a file with a specified hash in that share. A motivating advantage of such a construction that whereas even filelists which contain only hashes will grow linearly with the number of files in the share. Further, such a fully accurate representation should not be compressible, because cryptographic hashes aim for each output bit to be independently 50% likely enabled and thus maximize apparent entropy. Instead, Bloom filters sacrifice losslessness in favour of an output that has a small size which need not grow with that of the share.

However, to remain useful in this filesharing context, such lossiness must remain limited. In particular, a Bloom filter produces false positives but not false negatives: it can state that an object exists when it does not, but it will never state conversely that an object does not exist if it does. A hub, given a Bloom filter representation of a share can thus safely refrain from sending a hash search query to a connected client the Bloom filter of the share of which has no record of a hash. This can save considerable bandwidth and allow a combination of more clients within the same bandwidth or a similar number of clients using less bandwidth.

A Bloom filter is determined by the hash keys in use and the table size. The smaller the ratio between the number of objects in the table and size of the table, the lower the false positive rate. Further, an optimal table does not utilize just one key but multiple keys simultaneously, such that the presence of an object in the table implies that the bits corresponding to each keys as applied to the input object are all enabled. Thus, when inserting an object for which hash functions used as keys map to bits 58, 1093, and 9865, then those bits are all enabled. Then to check whether that object might exist in the table, then one checks whether any one of bits 58, 1093, and 9865 are enabled. If all of them are, then it is possible that the object is in the table. However, if any of them are not, then the object is not in the table.

Bloom filters, then, allow for a scalable, efficiently constructed, efficiently queried, and efficiently communicated summary of the contents of a share which allows for hubs to spend less bandwidth wastefully broadcasting search queries.

Don’t forget that you can make topic suggestions for blog posts in our “Blog Topic Suggestion Box!”

ADCH++ First Release

After more than a year, here it comes, ADCH++ 2.1 , the first release. You can find it here.

Contains an installer and a zip for win32 users ( precompiled and ready to go ). Note that win32 testing has not been completed throughly ( may still have some problems ). If you have anything to report, you can visit the public development hub adc://devpublic.myhub.org:16591 or reply to this post.

The release also contains a source package ready to be compiled by linux or windows users. More information about compiling can be found in the readme.txt file supplied in the package, or in some previous blog posts :

Compiling ADCH++ under windows and
Compiling ADCH++ under POSIX

ADCH++ is compatible with ADC 1.0 ( but like DC++, supports older versions of protocol for easening the transition ).

This release does not include the Bloom filter (not fully completed ) , although it can be created by compiling the source . ( The bloom filter creates a hashmap of all users’ share, and searches that don’t have any possible result are ignored , hence reducing bandwidth and resource usage )

2.1 is marked unstable for obvious reasons, but hopefully in the future there will be a more stable release.

Beware of the PM flag

The action MSG in ADC for protocol chat have a PM flag to be used as a way to signal that the chat message is for “private” use. Most likely, clients will use this flag in combination with a D or E type message.

However, one should be aware of this. A client is not forced to use the PM flag, even if they intend for it to be a private message. Eg, if you send a message with the D-type and without the PM flag, the remote client should interpret the message as it was a “main chat message” (yet the message shall only appear in that client, per the type). The client don’t care whether that flag is present.

Also, the PM flag can be used in combination of the broadcast type, B. This leaves some room for spammers; send a broadcast message with the PM flag and all of the users in the hub will receive a “private message”.

The reason this all is confusing is most likely because NMDC only have a sense of “main chat” or “private” message, and not a sense of “message directed to someone [or a group of people]”, as ADC have.

Don’t forget that you can make topic suggestions for blog posts in our “Blog Topic Suggestion Box!”

Context and message types in ADC

Two things are similar, but not the same in ADC. It is the context and type of messages.

The message types are stated in section 3.3. in the spec, and “specifies how messages should be routed and thus which additional fields can be found in the message header”.

Context, stated in section 5., are an abstraction of how messages should be sent.

Usually, action are stated to be used in context rather than by their message type to allow the client and hub decide for themselves what type should be used. (This can also be future proof.)

For example, the action MSG allow contexts F and T, which are “F – From hub (hub-client TCP)” and “T – To hub (hub-client TCP)”. What the F type mean is that a MSG message will originate from a hub and the T type will originate from a client (“and go to the hub”). That is, a client may want to send a message as a broadcast message to all users in the hub, or send them a direct (or echo) message. So instead of having the action MSG allow “B, D, E type for clients”, the context (abstraction) T is used instead.

The wording “hub-client TCP” does not mean the message always originates from the hub. It’s simply a choice of words to denote that it’s a hub and client TCP session, not who initiated the session or message.

Don’t forget that you can make topic suggestions for blog posts in our “Blog Topic Suggestion Box!”

The ADC Project

With the official 1.0 version of ADC, it was decided that a new project for managing ADC would be best. So, we’ve set up The ADC Project, designed to help developers see the documentation and let the community form the future ADC specifications.

(It’s also good to seperate ADC from DC++, as it was previously a “DC++” thing, seeing as the protocol resided on the DC++ space.)

Don’t forget that you can make topic suggestions for blog posts in our “Blog Topic Suggestion Box!”

0.704 released

The new version of DC++ is out ( probably the last one in 2007 ). You can find it here .

As in a previous blog post, this new version adds the Coral distributed network hublists, which will make sure you have a working hublist in your client.

Also, this version brings ( more or less ) the compatibility with ADC 1.0 . This means that the protocol BASE feature is advertised ( instead of the BAS0 revision ). UCMDs ( the ADC’s User commands extension ) is also advertised in the initial SUP string protocol,  so DC++ users can now use the commands given by ADC hubowners ( hubsofts should start implementing ) .  This also means that 0.704 will use the protocol string ADC/1.0 when trying to download. Don’t worry, you can still download from older versions because the 0.10 protocol string is still kept ( same goes about the INF flags OP, RG… ). The only compatibility that is really breaked is the password sending because the hash the client must send in 1.0 is slightly different ( see differences between ADC 1.0 and 0.10 ).

0.704 includes more fixes that everybody wanted to have as soon as possible, these include : closing tabs with mid-mouse button,  chat focusing all the time, hub name printed to main window title.

The segmented downloading crashes are now fixed .

On top of all, enjoy your new version.

ADC 1.0

After years of more or less active deliberation, it is finally time for 1.0. You’ll find it in the usual place, and differences from 0.14 can be seen here. Some of the extensions have been moved here since they either didn’t have any working implementations (that I know of) or were not finished. The long term plan is to set up a separate sf.net project for the ADC spec were people will be able to propose new extensions in an ordered manner (so that they don’t clash, are well documented and actually exist). Extensions will be added to the main spec as they become mature enough, subject to some procedure that I still have to think about (setting up a voting system would be nice, but it would require N active participants…). With a separate project, I also hope that more non-dc++ people will be interested to contribute…

Oh well, enough rambling, enjoy!

Restricting $ in file names

As of version 0.703, DC++ is able to share files containing “$” in their name. This is (obviously) because that restriction was removed. It was removed because it’s completely irrelevant at this time; DC++ will only use TTHs to request files. As such, it doesn’t matter if the file name is written in a special way (except maybe how it should be stored on the end computer, but that’s a different matter) when it comes to downloading.

All of this is now fine, but why wasn’t it previusly fine to share those types of files? Actually, this isn’t a restriction that has been set because the NMDC protocol didn’t support it; This is an artificial restriction in DC++. (Most likely because of its initial coding.)

You see, the NMDC GET command do require a $ in the command (besides in the beginning), but it’s not something a client couldn’t work around.

The command NMDC use is “$Get $|”. If the client start to search from the beginning (after “$Get”) after the $ to find the offset, a file name containing a $ will obviously break/behave unexpectadly. However, if the client would search backwards from the first |, it would be able to catch the correct offset and file name, even if the file name contain a $.

(Yes, of course, we still have a restriction for “|” in the GET and a file’s name.)

Note: I don’t know if DC++ has fixed this kind of behaviour for other commands still in operation in DC++.

Don’t forget that you can make topic suggestions for blog posts in our “Blog Topic Suggestion Box!”

Design a site like this with WordPress.com
Get started