Skip navigation.

aleksanteri's blog

<insert a subtitle here>

Beyond IRC

So, you have been in IRC for a while, and now perhaps wondering that how is this working, how does the client interact?

Well.

The process of a normal IRC connection has basically 4 steps: connecting, logging in, interacting and quitting.

1.) Connecting
When a client connects, it first lets the server do a few things. Most servers I've been on look for a running identd by connecting to the client on a specific port (113?) and if an identd is found the server does.. something :smile: OperaNet doesn't have identd checking stuff so I don't really care about this.

Another thing the server does is that it looks up the hostname, since the server sees the IP of the client that connects in. If the DNS lookup fails, the server sets the IP as the host of the client.

Yet another thing that a server might do is that it pings the client in case if the connection dies immediatly, but I don't really know about this either.

2.) Logging in
While the server is looking up the host, or checking the ident, the client sends two commands to log in, the USER command and the NICK command.

Syntax:
USER <username> * * :<realname>
NICK <nick>


When this is done, the server sends some information and the MOTD.

3.) Interacting
OK, we have logged in and the server has accepted us in. The next thing to do is to join channels, send messages, set modes, etc..

Since you already know what everything is, I'll just give the raw commands p:

Ping/pong
Incoming:
PING :<server?>

Reply (mandatory):
PONG :<pingcode>


Join/part
JOIN <#channel>
PART <#channel>


Send a message/notice
PRIVMSG <nick/#channel> :<message>
NOTICE <nick/#channel> :<message>


Set a mode
MODE <nick/#channel> <mode> [args]


User-targeted actions
KICK <#channel> <nick> [reason]
INVITE <nick> <#channel>


IRC-Operator actions
OPER <username> <password>
KILL <nick> <reason>
GLINE <nick/uhost> [duration] :<reason>
KLINE <nick/uhost> [duration] :<reason>
ZLINE <nick/uhost> [duration] :<reason>
SHUN <nick/uhost> [duration] :<reason>
SPAMFILTER <add/del> <target> <action> <duration> <regexp>


NOTE: The Spamfilter is a bit tricky. More information in the UnrealIRCd Documentation.
NOTE: These commands are based on UnrealIRCd. I do not know do these work exactly alike in other ircds. To get the ircd name and version, use
VERSION


4.) Quitting
OK, we've chatted enough, kicked a few users out and glined one. Now let's get out of here.

Quit
QUIT [:<reason>]


The server will now show a quit message to the other clients and terminate your connection.

Tagged"Modern" CSS properties = havoc

Comments

zomg 3. September 2007, 05:12

Nice post.

When connecting, the server doesn't ping the client. It doesn't have to. If the TCP packets are reaching the client, it is still there. Some servers do actually send an actual PING and expect a PONG to that, but other than that they don't ping when connecting.

You actually forgot to mention that if you receive a PING from the server, you need to reply with a PONG that has the same number sequence, or otherwise the server will drop you.

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies

November 2009
M T W T F S S
October 2009December 2009
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30