Client-to-client protocol

Short description: Type of communication between Internet Relay Chat (IRC) clients

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)

This article contains instructions, advice, or how-to content. The purpose of Wikipedia is to present facts, not to train. Please help improve this article either by rewriting the how-to content or by moving it to Wikiversity, Wikibooks or Wikivoyage. (June 2024)

|

(Learn how and when to remove this template message)

Client-to-client protocol (CTCP) is a special type of communication between Internet Relay Chat (IRC) clients.

CTCP is a common protocol implemented by most major IRC clients in use today.[1]CTCP extends the original IRC protocol by allowing users to query other clients or channels, this causes all the clients in the channel to reply the CTCP, for specific information. Additionally, CTCP can be used to encode messages that the raw IRC protocol would not allow to be sent over the link, such as messages containing newlines or the byte value 0 (NULL). CTCP does not establish a direct connection between clients; however, it is commonly used to negotiate DCC connections.

CTCP allows users to query a remote client about the version of the client they are using (via `CTCP VERSION`), or the time (via `CTCP TIME`), among other things. It is also used to implement the /me command (via `CTCP ACTION`).

## Contents

* 1 History
* 2 Structure
* 3 Common CTCP commands
* 3.1 VERSION
* 3.2 TIME
* 3.3 PING
* 4 See also
* 5 References
* 6 External links

## History

ircII was the first IRC client to implement the CTCP and DCC protocols.[2] The CTCP protocol was implemented by Michael Sandrof in 1990 for ircII version 2.1,[3] while the DCC protocol was implemented by Troy Rollo in 1991 for version 2.1.2.<ref>See the 'UPDATES' and 'source/dcc.c' files included with ircii-2.1.4e.tar.gz{{dead link|date=August 2017 |bot=InternetArchiveBot |fix-attempted=yes }

## Structure

A CTCP message is implemented as a `PRIVMSG` or `NOTICE` where the first and last characters of the message are ASCII value 0x01. Additionally, characters which would not be allowed in the IRC protocol are escaped. Since a `NOTICE` as the standard should not generate a reply, CTCP messages are sent as `PRIVMSG` and the reply is implemented with a `NOTICE` instead of a `PRIVMSG`.

A CTCP query is initiated on most clients as follows:

CTCP <target> <command> <arguments>

Where <target> is the target nickname or channel, <command> is the CTCP command (e.g. `VERSION`), and <arguments> are additional information to be sent to the <target>.

## Common CTCP commands

Part of this section is transcluded from Direct Client-to-Client. (edit | history)

CTCP commands and replies are client-specific; as such, depending on the IRC client, some of the following CTCP commands may not trigger a response, or will be formatted differently than what is shown here.

### VERSION

A `CTCP VERSION` request will return the name and version of the IRC client the target is using, and in some cases technical information such as the operating system, clock rate, CPU Manufacturer and CPU architecture/instruction set.

A sample reply for a `CTCP VERSION` request to a target that uses the HexChat client is:

VERSION HexChat 2.9.1 [x86] / Windows 8 [1.46GHz]

### TIME

A `CTCP TIME` request will return the local time of the target computer. Depending on the IRC client, the reply may consist of the date, the time (either in 12-hour format or 24-hour format), the year (e.g. 2012), and sometimes the time zone (e.g. EST).

A sample reply for a `CTCP TIME` request to a target that uses the ChatZilla client is:

TIME Fri 23 Nov 2012 19:26:42 EST

### PING

A `CTCP PING` request will determine the ping rate that directly exists between two clients (i.e. discounting the server). The `CTCP PING` command works by sending an (often) integer argument (a timestamp) to a target client, the target client then responds by supplying exactly the same numerical parameter. The difference between the original timestamp and the current timestamp is calculated, with the result being displayed to the user that initiated the CTCP PING. More often than not, a timestamp that utilises milliseconds is used due to the majority of users with broadband Internet connections having a ping under 1 second.

A sample `CTCP PING` request to target <nickname> from the XChat client is:

CTCP PING 23152511

Likewise, sample output generated from the difference (see above) is:

Ping reply from <nickname>: 0.53 second(s)

{{#section-h:Direct Client-to-Client|Common DCC applications}}

## See also

* Internet Relay Chat (IRC)
* IRC client
* Comparison of Internet Relay Chat clients
* DCC (Direct Client-to-Client)

## References

1. ↑ Mikulėnas, Mantas; Oakley, Daniel (2018-01-09). ﻿Internet Relay Chat: Client-to-Client Protocol (CTCP)﻿ (Report). Internet Engineering Task Force. https://datatracker.ietf.org/doc/draft-oakley-irc-ctcp/02/.
2. ↑ Piccard, Paul; Brian Baskin; George Spillman; Marcus Sachs (May 1, 2005). "IRC Networks and Security". Securing IM and P2P Applications for the Enterprise (1st ed.). Syngress. p. 386. ISBN 1-59749-017-2. "The authors of the ircII software package originally pioneered file transfers over IRC."
3. ↑ See the 'NOTES' and 'source/ctcp.c' files included with ircii-2.1.4e.tar.gz

## External links

* CTCP Details

* v
* t
* e

Internet Relay Chat (IRC)

General topics

Common terms|

* BNC
* Bot
* Channel
* DoS attack
* Channel Operator
* Client
* Flood
* Hostmask
* IRC
* Netsplit
* Network
* Operator
* Script
* Server
* Services
* Takeover
* vhost

Lists and comparisons|

* List of IRC commands
* Comparison of IRC bots
* Comparison of IRC clients
* Comparison of mobile IRC clients
* Comparison of IRC daemons

Related protocols|

* IRC
* IRCX
* MSN Chat
* P10
* CTCP
* DCC
* XDCC
* Ident

See also|

* IRC subculture
* Jarkko Oikarinen

Clients (comparison)

macOS|

* Colloquy
* Fire
* Homer (Mac OS)
* Ircle
* Linkinus
* MacIrssi
* Snak

Microsoft Windows|

* Bersirc
* mIRC
* Microsoft Comic Chat
* PIRCH
* Shareaza
* Visual IRC

Unix-like|

* ircII

Cross-platform|

* BitchX
* Irssi
* Konversation
* KVIrc
* LeafChat
* naim
* Smuxi
* WeeChat
* XChat
* PJIRC
* Quassel IRC
* IceChat

Multi-IM|

* Centericq
* Empathy
* Kopete
* Miranda IM
* Pidgin
* Trillian

Web-based|

* CGI
* PJIRC
* Mibbit

Web browser components|

* ChatZilla
* Mozilla Application Suite

Library and plug-ins|

* ERC
* rcirc

Bots (comparison)

* Eggdrop
* Infobot
* Robot9000

Bouncers, Gateways and Proxies

* BitlBee
* ZNC

Daemons (comparison)

* IRCd
* ircu
* UnrealIRCd

Networks

* DALnet
* EFnet
* Freenode
* GameSurge
* IRC@2ch
* IRCnet
* OFTC
* QuakeNet
* Rizon
* RusNet
* SlashNET
* Undernet

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Client-to-client protocol. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Client-to-client_protocol&oldid=4296300"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template