IRC, Internet Relay Chat Protocol

Description Glossary RFCs Publications Obsolete RFCs

Description:

Protocol suite: TCP/IP.
Protocol type:Application layer, text based chat protocol.
Port:6667 (TCP) default; 6665 - 6669 (TCP)
MIME subtype:
SNMP MIBs:
Working groups:
Links: IRCHelp.org

IRC was developed as a means for users on a BBS to chat amongst themselves.

RFC 1459:

IRC has been designed over a number of years for use with text based conferencing.

The IRC protocol has been developed on systems using the TCP/IP network protocol, although there is no requirement that this remain the only sphere in which it operates.

IRC itself is a teleconferencing system, which (through the use of the client-server model) is well-suited to running on many machines in a distributed fashion. A typical setup involves a single process (the server) forming a central point for clients (or other servers) to connect to, performing the required message delivery/multiplexing and other functions.

Servers and clients send each other messages which may or may not generate a reply. If the message contains a valid command, as described in later sections, the client should expect a reply as specified but it is not advised to wait forever for the reply; client to server and server to server communication is essentially asynchronous in nature.


MAC header IP header TCP header IRC message

RFC 2812:

Servers and clients send each other messages, which may or may not generate a reply. If the message contains a valid command, as described in later sections, the client should expect a reply as specified but it is not advised to wait forever for the reply; client to server and server to server communication is essentially asynchronous by nature.

Each IRC message may consist of up to three main parts: an optional prefix, the command, and upto 15 command parameters. The prefix, command, and all parameters are separated by one ASCII space character (0x20) each.

The presence of a prefix is indicated with a single leading ASCII colon character (':', 0x3b), which MUST be the first character of the message itself. There MUST be NO gap (whitespace) between the colon and the prefix. The prefix is used by servers to indicate the true origin of the message. If the prefix is missing from the message, it is assumed to have originated from the connection from which it was received from. Clients SHOULD NOT use a prefix when sending a message; if they use one, the only valid prefix is the registered nickname associated with the client.

The command MUST either be a valid IRC command or a three digit number represented in ASCII text. IRC messages are always lines of characters terminated with a CR-LF pair, and these messages SHALL NOT exceed 512 characters in length, counting all characters including the trailing CR-LF. Thus, there are 510 characters maximum allowed for the command and its parameters. There is no provision for continuation of message lines.

Message syntax:

message = [ ":" prefix SPACE ] command [ params ] crlf
prefix = servername / ( nickname [ [ "!" user ] "@" host ])
command =1*letter / 3digit
params = *14( SPACE middle ) [ SPACE ":" trailing ]
=/14( SPACE middle ) [ SPACE [ ":" ] trailing ]
nospcrlfcl = %x01-09 / %x0B-0C / %x0E-1F / %x21-39 / %x3B-FF  ; Any byte except NUL, CR, LF, " " and ":".
middle = nospcrlfcl *( ":" / nospcrlfcl )
trailing = *( ":" / " " / nospcrlfcl )
SPACE =%x20; Whitespace.
crlf =%x0D %x0A; Carriage return/linefeed.

Commands:

CommandDescriptionReferences
ADMIN Get information about the administrator of a server. RFC 2812
AWAY Set an automatic reply string for any PRIVMSG commands. RFC 2812
CONNECT Request a new connection to another server immediately. RFC 2812
DIEShutdown the server. RFC 2812
ERRORReport a serious or fatal error to a peer. RFC 2812
INFOGet information describing a server. RFC 2812
INVITE Invite a user to a channel. RFC 2812
ISON Determine if a nickname is currently on IRC. RFC 2812
JOIN Join a channel. RFC 2812, RFC 2813
KICK Request the forced removal of a user from a channel. RFC 2812
KILL Close a client-server connection by the server which has the actual connection. RFC 2812
LINKS List all servernames which are known by the server answering the query. RFC 2812
LIST List channels and their topics. RFC 2812
LUSERS Get statistics about the size of the IRC network. RFC 2812
MODE User mode. RFC 2812
MOTD Get the Message of the Day. RFC 2812
NAMES List all visible nicknames. RFC 2812
NICK Define a nickname. RFC 2812, RFC 2813
NJOIN Exchange the list of channel members for each channel between servers. RFC 2813
NOTICE   RFC 2812
OPER Obtain operator privileges. RFC 2812
PART Leave a channel. RFC 2812
PASS Set a connection password. RFC 2812, RFC 2813
PING Test for the presence of an active client or server. RFC 2812
PONG Reply to a PING message. RFC 2812
PRIVMSG Send private messages between users, as well as to send messages to channels. RFC 2812
QUIT Terminate the client session. RFC 2812, RFC 2813
REHASH Force the server to re-read and process its configuration file. RFC 2812
RESTART Force the server to restart itself. RFC 2812
SERVER Register a new server. RFC 2813
SERVICE Register a new service. RFC 2812, RFC 2813
SERVLIST List services currently connected to the network. RFC 2812
SQUERY   RFC 2812
SQUIRT Disconnect a server link. RFC 2812
SQUIT Break a local or remote server link. RFC 2813
STATS Get server statistics. RFC 2812
SUMMON Ask a user to join IRC. RFC 2812
TIME Get the local time from the specified server. RFC 2812
TOPIC Change or view the topic of a channel. RFC 2812
TRACE Find the route to a server and information about it's peers. RFC 2812
USER Specify the username, hostname and realname of a new user. RFC 2812
USERHOST Get a list of information about upto 5 nicknames. RFC 2812
USERS Get a list of users logged into the server. RFC 2812
VERSION Get the version of the server program. RFC 2812
WALLOPS Send a message to all currently connected users who have set the 'w' user mode. RFC 2812
WHO List a set of users. RFC 2812
WHOIS Get information about a specific user. RFC 2812
WHOWASGet information about a nickname which no longer exists. RFC 2812

Reply codes:

Replies in the range from 001 to 099 are used for client-server connections only and should never travel between servers.

CodeReplyFormat
1RPL_WELCOME"Welcome to the Internet Relay Network <nick>!<user>@<host>"
2RPL_YOURHOST"Your host is <servername>, running version <ver>"
3RPL_CREATED"This server was created <date>"
4RPL_MYINFO"<servername> <version> <available user modes> <available channel modes>"
5RPL_BOUNCE"Try server <server name>, port <port number>"

Replies generated in the response to commands are found in the range from 200 to 399.

CodeReplyFormat
200RPL_TRACELINK "Link <version & debug level> <destination> <next server> V<protocol version> <link uptime in seconds> <backstream sendq> <upstream sendq>"
201RPL_TRACECONNECTING "Try. <class> <server>"
202RPL_TRACEHANDSHAKE "H.S. <class> <server>"
203RPL_TRACEUNKNOWN "???? <class> [<client IP address in dot form>]"
204 RPL_TRACEOPERATOR "Oper <class> <nick>"
205 RPL_TRACEUSER "User <class> <nick>"
206 RPL_TRACESERVER "Serv <class> <int>S <int>C <server> <nick!user|*!*>@<host|server> V<protocol version>"
207 RPL_TRACESERVICE "Service <class> <name> <type> <active type>"
208 RPL_TRACENEWTYPE "<newtype> 0 <client name>"
209 RPL_TRACECLASS "Class <class> <count>"
210 RPL_TRACERECONNECT Unused.
211 RPL_STATSLINKINFO "<linkname> <sendq> <sent messages> <sent Kbytes> <received messages> <received Kbytes> <time open>"
212 RPL_STATSCOMMANDS "<command> <count> <byte count> <remote count>"
219 RPL_ENDOFSTATS "<stats letter> :End of STATS report"
221 RPL_UMODEIS "<user mode string>"
234 RPL_SERVLIST "<name> <server> <mask> <type> <hopcount> <info>"
235 RPL_SERVLISTEND "<mask> <type> :End of service listing"
242 RPL_STATSUPTIME ":Server Up %d days %d:%02d:%02d"
243 RPL_STATSOLINE "O <hostmask> * <name>"
251 RPL_LUSERCLIENT ":There are <integer> users and <integer> services on <integer> servers"
252 RPL_LUSEROP "<integer> :operator(s) online"
253 RPL_LUSERUNKNOWN "<integer> :unknown connection(s)"
254 RPL_LUSERCHANNELS "<integer> :channels formed"
255 RPL_LUSERME ":I have <integer> clients and <integer> servers"
256 RPL_ADMINME "<server> :Administrative info"
257 RPL_ADMINLOC1 ":<admin info>"
258 RPL_ADMINLOC2 ":<admin info>"
259 RPL_ADMINEMAIL ":<admin info>"
261 RPL_TRACELOG "File <logfile> <debug level>"
262 RPL_TRACEEND "<server name> <version & debug level> :End of TRACE"
263 RPL_TRYAGAIN "<command> :Please wait a while and try again."
301 RPL_AWAY "<nick> :<away message>"
302 RPL_USERHOST ":*1<reply> *( " " <reply> )"
303 RPL_ISON ":*1<nick> *( " " <nick> )"
305 RPL_UNAWAY ":You are no longer marked as being away"
306 RPL_NOWAWAY ":You have been marked as being away"
311 RPL_WHOISUSER "<nick> <user> <host> * :<real name>"
312 RPL_WHOISSERVER "<nick> <server> :<server info>"
313 RPL_WHOISOPERATOR "<nick> :is an IRC operator"
314 RPL_WHOWASUSER "<nick> <user> <host> * :<real name>"
315 RPL_ENDOFWHO "<name> :End of WHO list"
317 RPL_WHOISIDLE "<nick> <integer> :seconds idle"
318 RPL_ENDOFWHOIS "<nick> :End of WHOIS list"
319 RPL_WHOISCHANNELS "<nick> :*( ( "@" / "+" ) <channel> " " )"
321 RPL_LISTSTART Obsolete.
322 RPL_LIST "<channel> <# visible> :<topic>"
323 RPL_LISTEND ":End of LIST"
324 RPL_CHANNELMODEIS "<channel> <mode> <mode params>"
325 RPL_UNIQOPIS "<channel> <nickname>"
331 RPL_NOTOPIC "<channel> :No topic is set"
332 RPL_TOPIC "<channel> :<topic>"
341 RPL_INVITING "<channel> <nick>"
342 RPL_SUMMONING "<user> :Summoning user to IRC"
346 RPL_INVITELIST "<channel> <invitemask>"
347 RPL_ENDOFINVITELIST "<channel> :End of channel invite list"
348 RPL_EXCEPTLIST "<channel> <exceptionmask>"
349 RPL_ENDOFEXCEPTLIST "<channel> :End of channel exception list"
351 RPL_VERSION "<version>.<debuglevel> <server> :<comments>"
352 RPL_WHOREPLY "<channel> <user> <host> <server> <nick> ( "H" / "G" > ["*"] [ ( "@" / "+" ) ] :<hopcount> <real name>"
353 RPL_NAMREPLY "( "=" / "*" / "@" ) <channel> :[ "@" / "+" ] <nick> *( " " [ "@" / "+" ] <nick> )"
364 RPL_LINKS "<mask> <server> :<hopcount> <server info>"
365 RPL_ENDOFLINKS "<mask> :End of LINKS list"
366 RPL_ENDOFNAMES "<channel> :End of NAMES list"
367 RPL_BANLIST "<channel> <banmask>"
368 RPL_ENDOFBANLIST "<channel> :End of channel ban list"
369 RPL_ENDOFWHOWAS "<nick> :End of WHOWAS"
371 RPL_INFO ":<string>"
372 RPL_MOTD ":- <text>"
374 RPL_ENDOFINFO ":End of INFO list"
375 RPL_MOTDSTART ":- <server> Message of the day - "
376 RPL_ENDOFMOTD ":End of MOTD command"
381 RPL_YOUREOPER ":You are now an IRC operator"
382 RPL_REHASHING "<config file> :Rehashing"
383 RPL_YOURESERVICE "You are service <servicename>"
391 RPL_TIME "<server> :<string showing server's local time>"
392 RPL_USERSSTART ":UserID Terminal Host"
393RPL_USERS":<username> <ttyline> <hostname>"
394RPL_ENDOFUSERS":End of users"
395RPL_NOUSERS":Nobody logged in"

Error replies are found in the range from 400 to 599.

CodeReplyFormat
401ERR_NOSUCHNICK "<nickname> :No such nick/channel"
402ERR_NOSUCHSERVER "<server name> :No such server"
403ERR_NOSUCHCHANNEL "<channel name> :No such channel"
404ERR_CANNOTSENDTOCHAN"<channel name> :Cannot send to channel"
405 ERR_TOOMANYCHANNELS "<channel name> :You have joined too many channels"
406 ERR_WASNOSUCHNICK "<nickname> :There was no such nickname"
407 ERR_TOOMANYTARGETS "<target> :<error code> recipients. <abort message>"
408 ERR_NOSUCHSERVICE "<service name> :No such service"
409 ERR_NOORIGIN ":No origin specified"
411 ERR_NORECIPIENT ":No recipient given (<command>)"
412 ERR_NOTEXTTOSEND ":No text to send"
413 ERR_NOTOPLEVEL "<mask> :No toplevel domain specified"
414 ERR_WILDTOPLEVEL "<mask> :Wildcard in toplevel domain"
415 ERR_BADMASK "<mask> :Bad Server/host mask"
421 ERR_UNKNOWNCOMMAND "<command> :Unknown command"
422 ERR_NOMOTD ":MOTD File is missing"
423 ERR_NOADMININFO "<server> :No administrative info available"
424 ERR_FILEERROR ":File error doing <file op> on <file>"
431 ERR_NONICKNAMEGIVEN ":No nickname given"
432 ERR_ERRONEUSNICKNAME "<nick> :Erroneous nickname"
433 ERR_NICKNAMEINUSE "<nick> :Nickname is already in use"
436 ERR_NICKCOLLISION "<nick> :Nickname collision KILL from <user>@<host>"
437 ERR_UNAVAILRESOURCE "<nick/channel> :Nick/channel is temporarily unavailable"
441 ERR_USERNOTINCHANNEL "<nick> <channel> :They aren't on that channel"
442 ERR_NOTONCHANNEL "<channel> :You're not on that channel"
443 ERR_USERONCHANNEL "<user> <channel> :is already on channel"
444 ERR_NOLOGIN "<user> :User not logged in"
445 ERR_SUMMONDISABLED ":SUMMON has been disabled"
446 ERR_USERSDISABLED ":USERS has been disabled"
451 ERR_NOTREGISTERED ":You have not registered"
461 ERR_NEEDMOREPARAMS "<command> :Not enough parameters"
462 ERR_ALREADYREGISTRED ":Unauthorized command (already registered)"
463 ERR_NOPERMFORHOST ":Your host isn't among the privileged"
464 ERR_PASSWDMISMATCH ":Password incorrect"
465 ERR_YOUREBANNEDCREEP ":You are banned from this server"
466 ERR_YOUWILLBEBANNED  
467 ERR_KEYSET "<channel> :Channel key already set"
471 ERR_CHANNELISFULL "<channel> :Cannot join channel (+l)"
472 ERR_UNKNOWNMODE "<char> :is unknown mode char to me for <channel>"
473 ERR_INVITEONLYCHAN "<channel> :Cannot join channel (+i)"
474 ERR_BANNEDFROMCHAN "<channel> :Cannot join channel (+b)"
475 ERR_BADCHANNELKEY "<channel> :Cannot join channel (+k)"
476 ERR_BADCHANMASK "<channel> :Bad Channel Mask"
477 ERR_NOCHANMODES "<channel> :Channel doesn't support modes"
478 ERR_BANLISTFULL "<channel> <char> :Channel list is full"
481 ERR_NOPRIVILEGES ":Permission Denied- You're not an IRC operator"
482 ERR_CHANOPRIVSNEEDED "<channel> :You're not channel operator"
483 ERR_CANTKILLSERVER ":You can't kill a server!"
484 ERR_RESTRICTED ":Your connection is restricted!"
485 ERR_UNIQOPPRIVSNEEDED ":You're not the original channel operator"
491ERR_NOOPERHOST":No O-lines for your host"
501ERR_UMODEUNKNOWNFLAG":Unknown MODE flag"
502ERR_USERSDONTMATCH":Cannot change mode for other users"

Glossary:

BBS, Bulletin Board System.
A computer bulletin board message center.

Channel.
(RFC 2811) A named group of one or more users which will all receive messages addressed to that channel. A channel is characterized by its name, properties and current members. Channels names are strings (beginning with a '&', '#', '+' or '!' character) of length up to 50 characters. Channel names are case insensitive. The only restriction on a channel name is that it SHALL NOT contain any spaces, a control G (ASCII 7) or a comma (',' which is used as a list item separator by the protocol). A colon (':') is used as a delimiter for the channel mask. Channels with '&' as prefix are local to the server where they are created.


RFCs:

[RFC 1459] Internet Relay Chat Protocol.

[RFC 2810] Internet Relay Chat: Architecture.

[RFC 2811] Internet Relay Chat: Channel Management.

[RFC 2812] Internet Relay Chat: Client Protocol.

[RFC 2813] Internet Relay Chat: Server Protocol.

[RFC 3675] .sex Considered Dangerous.


Publications:


Obsolete RFCs:


Description Glossary RFCs Publications Obsolete RFCs