TCP/IP Protocols: Internet Relay Chat (IRC)

Discussion in 'Linux Networking' started by Jarret W. Buse, Dec 3, 2013.

  1. Jarret W. Buse

    Jarret W. Buse Active Member Staff Writer

    Messages:
    106
    Likes Received:
    120
    Trophy Points:
    43
    TCP/IP Protocols: Internet Relay Chat (IRC)

    Internet Relay Chat (IRC) is a part of the Transmission Control Protocol/Internet Protocol (TCP/IP) Protocol Suite. IRC is the protocol which handles chat and synchronous conferencing. The Internet chats can be in large groups, one-to-one users and even allow for file sharing between users.

    NOTE: File sharing capabilities are usually implemented by the IRC Client software.


    IRC was designed by Jarkko Oikarinen in August 1988. IRC uses the TCP protocol for handling messages. TCP is a guaranteed delivery protocol allowing that no messages within the chat are lost. It also guarantees file transfers between users.

    IRC can implement Transport Layer Security (TLS) or Secure Sockets Layer (SSL) for encrypting data between users. Most messages sent between an IRC client and the IRC Server is sent in plain text.

    IRC Servers are used to allow the clients to log into a “channel” and begin chatting. Each IRC Server can connect to other IRC Servers to expand the “channel”.

    NOTE: A Channel is a specific group topic that users join to discuss or share files. For example, a channel exists for help for Linux (#linuxhelp).

    When multiple IRC Servers join, they create a network or IRC network. The four largest IRC networks are:
    • EFnet
    • IRCnet
    • Undernet
    • DALnet
    Within the IRC networks, there are three Uniform Resource Identifiers (URI) Schemes used:

    • irc – standard IRC connection
    irc://<host>[:<port>]/[<channel>[?<password>]]
    • irc6 – IRC connection using IPv6 only
    irc6://<host>[:<port>]/[<channel>[?<password>]]
    • ircs – Secured IRC
    ircs://<host>[:<port>]/[<channel>[?<password>]]
    NOTE: The Uniform Resource Identifier (URI) is the same as Universal Resource Locater (URL). The URL is the well-known address for a website, such as http://www.linux.org.


    IRC Figure 1.jpg
    FIGURE 1

    The IRC network is made up of IRC Servers which are connected together to form a network, such as EFnet. Clients then log into an IRC Server and “join” a channel or multiple channels. Messages sent from one client to its IRC Server will be sent to the other connected IRC Servers which are then sent to the clients which have joined the same channel. The distribution of messages allows for all channel members to view a complete discussion. As I previously mentioned, IRC uses TCP so all messages are guaranteed to be delivered. It is possible for an IRC Server to lose contact with the network. In this case, the clients might see a loss of members within the channel if the other IRC Servers maintain the main bulk of the members.

    It is possible that if a specific channel does not exist, then one can be created. Within the IRC client software, you can usually specify a channel name that does not exist and one will be created. Unless IRC clients remain within the channel, the channel will disappear until created again.

    One main term used for channels is Chat Room. A Chat Room allows multiple clients to communicate with each other in a channel. Clients can then “talk” privately by going to one-to-one mode.

    NOTE: Be aware that a Chat Room is an IRC channel.

    The default IRC ports are:

    • 194 – IRC
    • 529 – IRC-Serv
    • 994 – IRCS
    Since these are ports within the privileged range (0-1024), for UNIX type systems, the IRC daemon (IRCd) would require superuser rights.

    NOTE: An IRC daemon is any server application using the IRC Protocol.

    Because of the security risk of the privileged ports, IRC is 6665-6669 but 6667 is considered the default.

    To set up an IRC Server on a Linux system, type the following in a command prompt: sudo apt-get install ircd-irc2.
    The configuration files are stored in the folder /etc/ircd. More specifically, the file is /etc/ircd/ircd.conf

    To configure the server’s host name, edit the following line: “M:irc.localhost::Debian ircd default configuration::000A” and change “localhost” to your IRC hostname. Do not make the IRC hostname the same as the DNS hostname. Be sure the IRC hostname is in your DNS Server table.

    When a client first connects to your IRC Server they see a banner. The banner can be edited in the file “/etc/ircd/ircd.motd”.

    An example of a Linux IRC client is Konversation. Konversation can be downloaded from http://konversation.kde.org website. Once the client is installed, you can join channels as well as send/receive messages.

    IRC clients usually have the ability to allow commands to be entered into the channel or application. The IRC commands are as follows:
    ADMIN – retruns information about the administrator of the specified server (admin [servername])
    • AWAY – sends a message to anyone sending a private message (away [message])
    • CNOTICE – sends a message to a user on a server in a specified channel (CNOTICE [nickname] [channel] :[message])
    • CPRIVMSG – sends a private message to a user within the same channel (CPRIVMSG [nickname] [channel] :[message])
    • CONNECT – connects to the specified server (connect [target server] [port])
    • DIE – shuts down the server
    • ENCAP – used to encapsulate commands among all servers in network :)[source] ENCAP [destination] [subcommand] [parameters])
    • ERROR – used by a server to report errors to other severs (error [error_message])
    • HELP – accesses server help file
    • INFO – returns information about the specified server (info [server])
    • INVITE – allows non-members to join a channel if it is a closed channel (invite [nickname] [channel])
    • ISON – determines if user is on a channel (ison [nickname])
    • JOIN – joins channels in list (join [channel] [password])
    • KICK – removes client from channel, can only be used by channel operator (kick [channel] [nickname] [message])
    • KILL – removes client from IRC network, can only be used by IRC operator (kill [nickname] [comment])
    • KNOCK – sends a message to an invitation only channel to request an invite (knock [channel] [message])
    • LINKS – lists server links for specific server (links [server] [server mask])
    • LIST – lists available channels on specified server (list [channel] [server])
    • LUSERS – returns statistics for network (luser [mask] [server])
    • MODE – set user and channel modes (mode [nickname] [flags] [user]) or mode [channel] [flags] [args])
    • MOTD – shows message of the day for specified server (motd [server])
    • NAMES – lists users on specified channel (names [channels])
    • NICK – allows a user to change their nickname (nick [nickname])
    • NOTICE – sends a private message, but does not allow replies (notice [msgtarget] [message])
    • OPER – authenticates a user as an operator (oper [username] [password])
    • PART – removes a user fro the specified channels (part [channels] [message])
    • PASS – sets a connection password (pass [password])
    • PING – tests connection to server (ping [server1] [server2])
    • PONG – reply to a ping command (pong [server1] [server2])
    • PRIVMSG – sends a message to a target (privmsg [target] [message])
    • QUIT – disconnects the user from the IRC Server sending out the specified message (quit [message])
    • REHASH – causes the server to check and reload configuration files, only used by IRC Operator (rehash)
    • RESTART - causes the server to restart, only used by IRC Operator (restart)
    • RULES – requests the server rules (rules)
    • SERVER – specifies that the new connection is another IRC server (server [server] [hopcount] [info])
    • SERVICE – registers a new service on the network (service [nickname] [reserved] [distribution] [type] [reserved] [info])
    • SERVLIST – lists current network services (servlist)
    • SQUERY – same as privmsg, but the target must be a service (SQUERY <servicename> <text>)
    • SQUIT - specified server quits the network (squit [server] [comment])
    • SETNAME – changes real name for registered client connection (setname [real_name])
    • SILENCE – adds or removes host mask to prevent users from sending matched users messages (silence [+/-[host_mask])
    • STATS – lists statistics about specified server (stats [query] [server])
    • SUMMON – sends message to host users to join IRC (summon [user] [server])
    • TIME – shows time on specified server (time [server])
    • TOPIC – allows the topic to be shown or set for a channel (topic [channel] [topic])
    • TRACE – traces the path from local host to a server or user across the IRC network (trace [target])
    • USER – used to set up a connection to the IRC server (user [username] [hostname] [servername] [real_name])
    • USERHOST – shows information about host (userhost [nickname])
    • USERIP –shows IP address of user (userip [nickname])
    • USERS – lists users and information for specified server (users [server])
    • VERSION – shows current IRC Server version (version [server])
    • WALLOPS – sends message to all local operators (wallops [message])
    • WATCH – add or remove a client from friends list (watch +/-[nickname])
    • WHO – shows list of users matching nickname (who [nickname]) or of operators (who [nickname] “o”)
    • WHOIS – shows information about specified client on specified server (whois [server] [nickname])
    • WHOWAS – shows information about a user not online, the time (count) they were online on the specified server (whowas [nickname] count] [server])

    Attached Files:

    • slide.jpg
      slide.jpg
      File size:
      56.3 KB
      Views:
      223,379
    Harikrishnan R and DevynCJohnson like this.

Share This Page