Direct Client-to-Client
Encyclopedia
Direct Client-to-Client is an IRC-related sub-protocol enabling peers
Peer-to-peer
Peer-to-peer computing or networking is a distributed application architecture that partitions tasks or workloads among peers. Peers are equally privileged, equipotent participants in the application...

 to interconnect using an IRC server for handshaking in order to exchange files or perform non-relayed chats. Once established, a typical DCC session runs independently from the IRC server. Originally designed to be used with ircII
IrcII
ircII is a free, open-source Unix IRC and ICB client written in C. Initially released in the late 1980s, it is the oldest IRC client still maintained. Several other UNIX IRC clients, including BitchX, EPIC, and ScrollZ, were originally forks of ircII...

 it is now supported by many IRC clients
Client (computing)
A client is an application or system that accesses a service made available by a server. The server is often on another computer system, in which case the client accesses the service by way of a network....

. A variation of the DCC protocol called SDCC (Secure Direct Client-to-Client), also known as DCC SCHAT supports encrypted connections. There exists no RFC specification
Request for Comments
In computer network engineering, a Request for Comments is a memorandum published by the Internet Engineering Task Force describing methods, behaviors, research, or innovations applicable to the working of the Internet and Internet-connected systems.Through the Internet Society, engineers and...

 on the use of DCC.

DCC connections can be initiated in two different ways:
  • The most common way is to use CTCP
    Client-To-Client Protocol
    Client-To-Client Protocol is a special type of communication between Internet Relay Chat clients.CTCP is a common protocol implemented by most major IRC clients in use today. CTCP extends the original IRC protocol by allowing users to query other clients or channels, this causes all the clients...

     to initiate a DCC session. The CTCP is sent from one user, over the IRC network, to another user.
  • Another way to initiate a DCC session is for the client to connect directly to the DCC server. Using this method, no traffic will go across the IRC network (the parties involved do not need to be connected to an IRC network in order to initiate the DCC connection).

DCC CHAT

The CHAT service enables users to chat with each other over a DCC connection. The traffic will go directly between the users, and not over the IRC network. When compared to sending messages normally, this reduces IRC network load, allows sending of larger amounts of text at once, due to the lack of flood control, and makes the communication more secure by not exposing the message to the IRC servers (however, the message is still in plaintext
Plaintext
In cryptography, plaintext is information a sender wishes to transmit to a receiver. Cleartext is often used as a synonym. Before the computer era, plaintext most commonly meant message text in the language of the communicating parties....

).

DCC CHAT is normally initiated using a CTCP
Client-To-Client Protocol
Client-To-Client Protocol is a special type of communication between Internet Relay Chat clients.CTCP is a common protocol implemented by most major IRC clients in use today. CTCP extends the original IRC protocol by allowing users to query other clients or channels, this causes all the clients...

 handshake. The user wishing to establish the connection sends the following CTCP to the target:
DCC CHAT

and are those of the sender, and are expressed as integers. is "chat" for standard DCC CHAT. The receiving party can then connect to the given port and address.

Once a connection is established, the protocol used for DCC CHAT is very simple: users exchange CRLF-terminated messages. Messages that begin with an ASCII
ASCII
The American Standard Code for Information Interchange is a character-encoding scheme based on the ordering of the English alphabet. ASCII codes represent text in computers, communications equipment, and other devices that use text...

 001 (control-A, represented below by ^A) and the word "ACTION", and are terminated by another ASCII 001, are interpreted as emotes:
^AACTION waves goodbye^A

DCC Whiteboard

This is an extension to DCC CHAT, allowing simple drawing commands to be sent as well as lines of text. DCC Whiteboard is initiated with a handshake similar to DCC CHAT, with the protocol "chat" replaced by "wboard":
DCC CHAT wboard


Once the connection is established, the two clients exchange CRLF-terminated messages. Messages that begin (and optionally end) with ASCII 001 are interpreted as special commands; the command ACTION represents an emote, while others cause lines to be drawn on the user's whiteboard surface, or allow the two clients to negotiate a set of features.

DCC SEND

The SEND service allows users to send files to one another. The original specification for the handshake did not allow the receiver to know the total file size nor to resume a transfer. This has made clients introduce their own extensions to the handshake, many of which have become widely supported.

The original handshake consisted of the sender sending the following CTCP to the receiver:
DCC SEND


As with DCC CHAT, and are the ip address and port where the sending machine will be listening for an incoming connection. Some clients enclose filenames with spaces in double quotes. It is common practice to add the file size as a last argument:
DCC SEND


At this point, the original specification had the receiver either connect to the given address and port and wait for data, or ignore the request, but for clients supporting the DCC RESUME extension, a third alternative is to ask the sender to skip part of the file by sending the CTCP reply:
DCC RESUME


If the sending client supports DCC RESUME, it will reply with:
DCC ACCEPT


and the receiver can connect to the given address and port and listen for data to append to an already existing file.

Data is sent in blocks, which the client must acknowledge by sending sizes of incoming data blocks as 32-bit
32-bit
The range of integer values that can be stored in 32 bits is 0 through 4,294,967,295. Hence, a processor with 32-bit memory addresses can directly access 4 GB of byte-addressable memory....

 network byte order integers. This slows down connections, and is redundant because such behavior is already implemented by TCP
Transmission Control Protocol
The Transmission Control Protocol is one of the core protocols of the Internet Protocol Suite. TCP is one of the two original components of the suite, complementing the Internet Protocol , and therefore the entire suite is commonly referred to as TCP/IP...

. The send-ahead extension relieves this problem somewhat by not waiting for the acknowledgements, but since the receiver still has to send them for every block it receives, in case the sender expects them, it is not solved completely.

Another extension, TDCC, or turbo DCC, removes the acknowledgements, but requires a slightly modified handshake and is not widely supported. Older versions of TDCC replaced the word SEND in the handshake with TSEND; later versions use the word SEND but append a "T" after the handshake, making this version of TSEND compatible with other clients (as long as they can parse the modified handshake).

DCC SEND exploit

The DCC send exploit can refer to two bugs, a variant buffer overflow
Buffer overflow
In computer security and programming, a buffer overflow, or buffer overrun, is an anomaly where a program, while writing data to a buffer, overruns the buffer's boundary and overwrites adjacent memory. This is a special case of violation of memory safety....

 error in mIRC
MIRC
mIRC is an Internet Relay Chat client for Microsoft Windows, created in 1995 and developed by Khaled Mardam-Bey. Although it is a fully functional chat utility, its integrated scripting language makes it extensible and versatile....

 triggered by filenames longer than 14 characters and an input validation error in some routers manufactured by Netgear
Netgear
Netgear is a U.S. manufacturer of computer networking equipment and other computer hardware....

, D-Link
D-Link
D-Link Corporation was founded in June 1986 in Taipei as Datex Systems Inc. It began as a network adapter vendor and has gone on to become a designer, developer, and manufacturer of networking solutions for both the consumer and business markets.In 2007, it was the leading networking company in...

 and Linksys
Linksys
Linksys by Cisco, commonly known as Linksys, is a brand of home and small office networking products now produced by Cisco Systems, though once a separate company founded in 1995 before being acquired by Cisco in 2003...

, triggered by the use of port 0. The router exploit, in particular, may be triggered when the phrase 'DCC SEND ' followed by at least 6 characters without spaces or newlines appears anywhere in a TCP
Transmission Control Protocol
The Transmission Control Protocol is one of the core protocols of the Internet Protocol Suite. TCP is one of the two original components of the suite, complementing the Internet Protocol , and therefore the entire suite is commonly referred to as TCP/IP...

 stream on port 6667, not just when an actual DCC SEND request has been made.

DCC XMIT

The XMIT service is a modified version of DCC SEND that allows for resuming files and cuts down on wasteful traffic from the ACK longs. XMIT is not widely supported.

The XMIT handshake differs somewhat from the SEND handshake. The sender sends a CTCP
Client-To-Client Protocol
Client-To-Client Protocol is a special type of communication between Internet Relay Chat clients.CTCP is a common protocol implemented by most major IRC clients in use today. CTCP extends the original IRC protocol by allowing users to query other clients or channels, this causes all the clients...

 offering a file to the receiver:
DCC XMIT [ [ []]]


Square brackets here enclose optional parts. is the protocol to use for the transfer; only "clear" is defined presently. Unlike standard DCC SEND, can be in the additional forms of standard dotted notation for IPv4, or either hexadecimal or mixed notation for IPv6. To leave an early parameter empty, but still supply a later one, the earlier one can be specified as "-". If the receiver does not implement the protocol used, it will send back a CTCP reply of the format:
ERRMSG DCC CHAT unavailable


CHAT is used here to maintain compatibility with the error messages sent by the extended DCC CHAT. If the receiver declines the transfer, it sends the following CTCP reply:
ERRMSG DCC CHAT declined


Other errors are reported in the same fashion. If the receiver is willing and capable of receiving the file, it will connect to the given address and port. What happens then depends on the protocol used.

In the case of the "clear" protocol, the XMIT server will, upon receiving a connection, send a 32-bit time t in network byte order, representing the file's modification time. Presumably based on the modification time of the local file, the client will then send another network byte order long, an offset
Offset
The term offset may refer to:* Carbon offset, a financial instrument aimed at a reduction in greenhouse gas emissions* Offset agreement, trade practice in Aerospace and Defense Industry...

 which the server should seek to when sending the file. This should be set to zero if the whole file is wanted, or the size of the local file if the client wishes to resume a previous download.

While faster than SEND, XMIT carries one of the same limitations in that it is impossible to tell how big the file is, unless its size is specified in the CTCP
Client-To-Client Protocol
Client-To-Client Protocol is a special type of communication between Internet Relay Chat clients.CTCP is a common protocol implemented by most major IRC clients in use today. CTCP extends the original IRC protocol by allowing users to query other clients or channels, this causes all the clients...

 negotiation or known beforehand. Furthermore, you can not resume a file past the two gigabyte mark due to the 32-bit offset.

Passive DCC

In a normal DCC connection the initiator acts as the server
Server (computing)
In the context of client-server architecture, a server is a computer program running to serve the requests of other programs, the "clients". Thus, the "server" performs some computational task on behalf of "clients"...

, and the target is the client
Client (computing)
A client is an application or system that accesses a service made available by a server. The server is often on another computer system, in which case the client accesses the service by way of a network....

. Because of widespread firewalling and reduction of end-to-end transparency because of NAT
Network address translation
In computer networking, network address translation is the process of modifying IP address information in IP packet headers while in transit across a traffic routing device....

, the initiator might not be able to act as a server. Various ways of asking the target to act as the server have been devised:

DCC Server

This extension to normal DCC SEND and CHAT was introduced by the IRC client mIRC
MIRC
mIRC is an Internet Relay Chat client for Microsoft Windows, created in 1995 and developed by Khaled Mardam-Bey. Although it is a fully functional chat utility, its integrated scripting language makes it extensible and versatile....

. DCC Server has moderate support, but is not standard on all clients (see comparison of IRC clients
Comparison of IRC clients
The following tables compare general and technical information between a number of IRC client programs. Please see the individual products articles for further information.- General :...

).

It allows the initiation of a DCC connection by IP address, without the need of an IRC server. This is accomplished by the receiving client acting as a server (hence the name) listening (usually on port 59) for a handshake from the sender.

For a CHAT, the initiator sends:
100


The target then replies with:
101

and the rest proceeds according to standard DCC CHAT protocol.

For a SEND, the initiator sends:
120


The target replies with:
121

where is the offset in the file from which to start. From here the transfer proceeds as a normal DCC SEND.

DCC Server also supports mIRC-style file servers and DCC GET.

RDCC

DCC Server provides no way specifying the port to use, so this has to be negotiated manually, which is not always possible, as one of the sides may not be a human. RDCC is a handshake mechanism for DCC Server, which in addition to the port also provides the IP address of the server, which the client might not be able to find otherwise because of host masking. It is not widely supported.

The initiator requests the port the target is listening on by sending the CTCP query:
RDCC

where is 'c' for chat, 's' for send and 'f' for file server.

The target may then CTCP reply with:
RDCC 0

where and have the same meanings as for normal DCC SEND and CHAT. After this the initiator connects to the ip and port, and a DCC Server handshake follows.

DCC REVERSE

Unlike DCC Server, where the handshake is handled over a direct IP connection, DCC REVERSE has a normal CTCP handshake, similar to the one used by DCC SEND. This is not widely implemented. The sender offers a file to the receiver by sending the CTCP message:
DCC REVERSE

is a 1 to 50 characters long string of ASCII
ASCII
The American Standard Code for Information Interchange is a character-encoding scheme based on the ordering of the English alphabet. ASCII codes represent text in computers, communications equipment, and other devices that use text...

 characters in the range 33 to 126, and acts as an identifier for the transfer.

If the receiver accepts, it sends the CTCP reply:
DCC REVERSE


Here is the position in the file from which to start sending, is the IP address
IP address
An Internet Protocol address is a numerical label assigned to each device participating in a computer network that uses the Internet Protocol for communication. An IP address serves two principal functions: host or network interface identification and location addressing...

 of the receiver in standard dotted notation
Dot-decimal notation
Dot-decimal notation is a presentation format for numerical data. It consists of a string of decimal numbers, each pair separated by a full stop ....

 for IPv4
IPv4
Internet Protocol version 4 is the fourth revision in the development of the Internet Protocol and the first version of the protocol to be widely deployed. Together with IPv6, it is at the core of standards-based internetworking methods of the Internet...

, or hexadecimal
Hexadecimal
In mathematics and computer science, hexadecimal is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen...

 notation for IPv6
IPv6
Internet Protocol version 6 is a version of the Internet Protocol . It is designed to succeed the Internet Protocol version 4...

. The sender then connects to the ip address and port indicated by the receiver, and a normal DCC SEND follows. Both the sender and receiver can cancel the handshake by sending the CTCP reply:
DCC REJECT REVERSE

DCC RSEND

This is the KVIrc client's alternative to DCC REVERSE. The sender offers a file by sending the CTCP:
DCC RSEND


The receiver can then accept by CTCP replying with:
DCC RECV

and the sender connects to the receiver and sends as during a normal DCC SEND.

Reverse / Firewall DCC

This passive DCC mechanism is supported by at least mIRC
MIRC
mIRC is an Internet Relay Chat client for Microsoft Windows, created in 1995 and developed by Khaled Mardam-Bey. Although it is a fully functional chat utility, its integrated scripting language makes it extensible and versatile....

, Visual IRC
Visual IRC
Visual IRC is an open source Internet Relay Chat client for the Windows operating system. Unlike many other IRC clients, nearly all of the functionality in ViRC is driven by the included script, with the result that the program's behavior can be extended or changed without altering the source...

, XChat, KVIrc, DMDirc, Klient, Konversation
Konversation
Konversation is an Internet Relay Chat client built on the KDE Platform and is free software released under the terms of the GNU General Public License. Konversation is currently maintained in the KDE Extragear module, which means that it has its own release cycle which is independent from KDE...

, and PhibianIRC. The sender offers a file by sending the CTCP message:
DCC SEND 0

is the IP address
IP address
An Internet Protocol address is a numerical label assigned to each device participating in a computer network that uses the Internet Protocol for communication. An IP address serves two principal functions: host or network interface identification and location addressing...

 of the sender in network byte order, expressed as a single integer (as in standard DCC). The number 0 is sent instead of a valid port, signaling that this is a Reverse DCC request. is a unique integer; if TSEND is being used (by a client that supports it), the letter "T" is appended to the token, letting the receiver know it doesn't need to send acknowledgements.

The receiver can accept the file by opening a listening socket and responding with the CTCP message:
DCC SEND

This is identical to the original Reverse DCC message, except the and identify the socket where the receiver is listening. is the same as in the original request, letting the sender know which request is being accepted. (Since this message follows the same format as a regular DCC send request, some servers which filter DCC requests may require the sender to add the receiver to his or her "DCC allow" list.)

The sender then connects to the receiver's socket, sends the content of the file, and waits for the receiver to close the socket when the file is finished.

When the RESUME extension to the SEND protocol is used, the sequence of commands becomes (with '>>' indicating an outgoing message on the initiating side and '<<' response by its peer):
>> DCC SEND 0
<< DCC RESUME 0
>> DCC ACCEPT 0
<< DCC SEND


After which the protocol proceeds as normal (i.e. the sender connects to the receiver's socket).

File servers (FSERVs)

A DCC fserve, or file server, lets a user browse, read and download files located on a DCC server.

Typically, this is implemented with a DCC CHAT session (which presents the user with a command prompt) or special CTCP
Client-To-Client Protocol
Client-To-Client Protocol is a special type of communication between Internet Relay Chat clients.CTCP is a common protocol implemented by most major IRC clients in use today. CTCP extends the original IRC protocol by allowing users to query other clients or channels, this causes all the clients...

 commands to request a file. The files are sent over DCC SEND or DCC XMIT. There are many implementations of DCC file servers, among them is the FSERV command in the popular mIRC
MIRC
mIRC is an Internet Relay Chat client for Microsoft Windows, created in 1995 and developed by Khaled Mardam-Bey. Although it is a fully functional chat utility, its integrated scripting language makes it extensible and versatile....

 client.

See also

  • CTCP
    Client-To-Client Protocol
    Client-To-Client Protocol is a special type of communication between Internet Relay Chat clients.CTCP is a common protocol implemented by most major IRC clients in use today. CTCP extends the original IRC protocol by allowing users to query other clients or channels, this causes all the clients...

     (Client-to-client protocol)
  • XDCC
    XDCC
    XDCC was initially a script written in 1994 for ircII by . This script extends the ircII DCC command.Now XDCC refers to IRC bots running file sharing programs in general. XDCC bots serve one or more usually large files for download using the DCC protocol...

    (eXtended DCC)

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK