HOME

TheInfoList



OR:

Client-to-client protocol (CTCP) is a special type of communication between
Internet Relay Chat Internet Relay Chat (IRC) is a text-based chat system for instant messaging. IRC is designed for group communication in discussion forums, called ''channels'', but also allows one-on-one communication via private messages as well as chat and ...
(IRC) 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 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
newline Newline (frequently called line ending, end of line (EOL), next line (NEL) or line break) is a control character or sequence of control characters in character encoding specifications such as ASCII, EBCDIC, Unicode, etc. This character, or a ...
s or the
byte The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable unit ...
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).


History

ircII ircII (pronounced ''i-r-c-two'' or ''irk-two'', and sometimes referred to as ''IRC client, second edition'') 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 m ...
was the first IRC client to implement the CTCP and DCC protocols. The CTCP protocol was implemented by Michael Sandrof in 1990 for ircII version 2.1, while the DCC protocol was implemented by Troy Rollo in 1991 for version 2.1.2.See the 'UPDATES' and 'source/dcc.c' files included wit
ircii-2.1.4e.tar.gz
/ref>


Structure

A CTCP message is implemented as a PRIVMSG or NOTICE where the first and last characters of the message are
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because of ...
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   
Where '''' is the target nickname or channel, '''' is the CTCP command (e.g. VERSION), and '''' are additional information to be sent to the ''''.


Common CTCP commands

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 An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
,
clock rate In computing, the clock rate or clock speed typically refers to the frequency at which the clock generator of a processor can generate pulses, which are used to synchronize the operations of its components, and is used as an indicator of the pr ...
, CPU Manufacturer and
CPU architecture Processor design is a subfield of computer engineering and electronics engineering (fabrication) that deals with creating a processor, a key component of computer hardware. The design process involves choosing an instruction set and a certain ...
/
instruction set In computer science, an instruction set architecture (ISA), also called computer architecture, is an abstract model of a computer. A device that executes instructions described by that ISA, such as a central processing unit (CPU), is called an ' ...
. A sample reply for a CTCP VERSION request to a target that uses the HexChat client is:
VERSION HexChat 2.9.1  86/ Windows 8  .46GHz/pre>


TIME

A CTCP TIME request will return the
local time Local time is the time observed in a specific locality. There is no canonical definition. Originally it was mean solar time, but since the introduction of time zones it is generally the time as determined by the time zone in effect, with daylight s ...
of the target computer. Depending on the IRC client, the reply may consist of the
date Date or dates may refer to: *Date (fruit), the fruit of the date palm (''Phoenix dactylifera'') Social activity *Dating, a form of courtship involving social activity, with the aim of assessing a potential partner ** Group dating *Play date, a ...
, the
time Time is the continued sequence of existence and events that occurs in an apparently irreversible succession from the past, through the present, into the future. It is a component quantity of various measurements used to sequence events, to ...
(either in 12-hour format or
24-hour format The modern 24-hour clock, popularly referred to in the United States as military time, is the convention of timekeeping in which the day runs from midnight to midnight and is divided into 24 hours. This is indicated by the hours (and minutes) pa ...
), the
year A year or annus is the orbital period of a planetary body, for example, the Earth, moving in its orbit around the Sun. Due to the Earth's axial tilt, the course of a year sees the passing of the seasons, marked by change in weather, the hou ...
(e.g. 2012), and sometimes the
time zone A time zone is an area which observes a uniform standard time for legal, Commerce, commercial and social purposes. Time zones tend to follow the boundaries between Country, countries and their Administrative division, subdivisions instead of ...
(e.g. EST). A sample reply for a CTCP TIME request to a target that uses the
ChatZilla ChatZilla is an IRC client that is part of SeaMonkey. It was previously an extension for Mozilla-based browsers such as Firefox, introduced in 2000. It is cross-platform open source software which has been noted for its consistent appearance acr ...
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 An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign (−1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the language ...
argument An argument is a statement or group of statements called premises intended to determine the degree of truth or acceptability of another statement called conclusion. Arguments can be studied from three main perspectives: the logical, the dialectic ...
(a
timestamp A timestamp is a sequence of characters or encoded information identifying when a certain event occurred, usually giving date and time of day, sometimes accurate to a small fraction of a second. Timestamps do not have to be based on some absolut ...
) to a target client, the target client then responds by supplying exactly the same numerical parameter. The
difference Difference, The Difference, Differences or Differently may refer to: Music * ''Difference'' (album), by Dreamtale, 2005 * ''Differently'' (album), by Cassie Davis, 2009 ** "Differently" (song), by Cassie Davis, 2009 * ''The Difference'' (al ...
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 A millisecond (from ''milli-'' and second; symbol: ms) is a unit of time in the International System of Units (SI) equal to one thousandth (0.001 or 10−3 or 1/1000) of a second and to 1000 microseconds. A unit of 10 milliseconds may be called ...
is used due to the majority of users with
broadband In telecommunications, broadband is wide bandwidth data transmission which transports multiple signals at a wide range of frequencies and Internet traffic types, that enables messages to be sent simultaneously, used in fast internet connections. ...
Internet connections having a ping under 1 second. A sample CTCP PING request to target '''' from the XChat client is:
CTCP PING 23152511
Likewise, sample output generated from the difference (see above) is:
Ping reply from : 0.53 second(s)


See also

*
Internet Relay Chat Internet Relay Chat (IRC) is a text-based chat system for instant messaging. IRC is designed for group communication in discussion forums, called ''channels'', but also allows one-on-one communication via private messages as well as chat and ...
(IRC) *
IRC client Internet Relay Chat (IRC) is a text-based chat system for instant messaging. IRC is designed for group communication in discussion forums, called ''channels'', but also allows one-on-one communication via private messages as well as chat and ...
*
Comparison of Internet Relay Chat clients The following tables compare general and technical information between a number of notable IRC client programs which have been discussed in independent, reliable prior published sources. General Basic general information about the notablecl ...
* DCC (Direct Client-to-Client)


References


External links


CTCP Details

//--> {{IRC topics Internet Relay Chat Internet terminology Protocols related to Internet Relay Chat