Moving!

It's been a long time, since I published anything here, but that doesn't mean I stop writing, I kept writing everyday, just didn't publish anything so far since October 2018. This post is the announcement of moving my blog from here to somewhere else.

I know, I should have published my writings but the reason I didn't is, blogger doesn't support markdown, and for the same reason, I will be moving my blog from blogger to self hosted blog at https://blog.mohitbansal.me and will be using hugo, a golang based static site generator.

So, please expect zero to nil posts here, cause I am moving from this platform. From now on, I will keep, two blogs, one will be my personal blog, keeping all irrelevant articles off from the professional channel. And, other, for professional purpose related to my technical learning. My professional blog will be available either on medium or I will host one myself, not decided yet. Till I setup my professional blog elsewhere, I will publish the relevant articles here and my Personal blog is up and running on blog.mohitbansal.me! You will find my latest blog posts there, though older posts from here will be moved later.

To subscribe the rss feed, use https://blog.mohitbansal.me/index.xml.

Till then, 
To infinity and Beyond!

Internet Relay Chat!


This blog post will cover the basics of IRC (Internet Relay Chat) and who should use it. It's been a long time since I first used IRC and it was not very pleasing experience at first. And now, I use IRC as my primary mode of communication.

I won't be suprised if you haven't heard of IRC yet and even if you heard of it, never tried it. I know what are you thinking right now, "IRC, stupid, eh!". I will try to change your thoughts towards IRC by this blog post.

Warning! This blog post contains all the answers to your curiosity and will destroy the fun of finding the answer yourself. Also it tend to be lengthy post, so grab your popcorn.

Prologue

I was introduced to IRC last year when I found about #dgplug on internet. I found the website and their summer training page very interesting and thus joined the channel instantly using the web portal of freenode at Webchat. It was my first experience on such a trivial messaging platform. The Interface was so simple which I was not used to. All text and no graphics, which can afraid many new comers to IRC but it is also the reason why IRC is preferred at #dgplug (later).

If you want to join summer training at #dgplug, you have to use IRC to attend and I insist you on doing so.

IRC?

IRC is an abbreviation for the term Internet Relay Chat. If I had to tell someone on what IRC is, I say, "It's is a primitive whatsapp" i.e. predecessor of all modern messaging platform which uses client/server model (later). IRC was created in 1988, and as they say, "Old is Gold". Let's find out what wikipedia knows about IRC?
Internet Relay Chat (IRC) is an application layer protocol that facilitates communication in the form of text. The chat process works on a client/server networking model.

We got this cryptic definition of IRC on wikipedia. Let me help you with this. In a broad sense, IRC is a protocol that is used by IRC clients to communicate with each other and is based on client/server model. If you are familiar with basics of computer networking, IRC is one of many protocols used on the internet, and if you don't, don't worry.

Protocol!

What is a protocol? At first I didn't understand the term quite well and if you are the same, I will be explaining, what it means.

Protocol are the set of rules or agreement between two parties or clients or country or machine, they will use to communicate each other.

Let me simplify in my own words. Let say there are two person A and B, how would they communicate each other? Using any of their common language, either English, Spanish etc. These languages use a common set of rules a.k.a protocol that both person know and will be able to understand each other. But both A and B have to use same language or protocol (rules) to communicate, else the communication will surely fail. Any other person C cannot understand what A and B is talking about unless he uses the same protocol as well.

Similarly, in computing, there are many protocols (communication rules) used. FTP, TCP, HTTP are few of them and IRC is one of them as well.


How does it work?

 The following illustration describes how the communication process actually work on the IRC network (set of two or more computers connected together, wired or wireless using IRC protocol).
There are various IRC servers available for you to join such as Freenode, OFTC, GimpNet et cetera. Each server has various channels (analogous to groups in modern messaging platform). When we are connected to IRC network via any of its server, say Freenode, we can communicate to every other client connected on the same server. Clients send their message to the central server which in turn broadcast to all presently connected clients. Similarly, they can send their message to the server and that's how we communicate using IRC. As simple as that!

Note: You cannot read message sent to the server when you are disconnected from the server. We will learn later on how to overcome this problem.

Server!

 In the illustration above, you might have noticed, servers. So what are the servers? I have found that many people still don't understand the true meaning of server. When I asked someone on what a server is? He replied, "A kind of database". He is wrong, and there is nothing wrong in being wrong. Just right your wrong.

I would suggest you to find the answer yourself first and if you don't understand it, come back.

"Server are computer programs that serve your or another program request and returns a response."  That's it and that is how client server model works in reality. HTTP protocol (use client server model) is the best example used on web servers. When you go to any website, you make a request on the web server hosting the website and returns a response of the web page for that website.



In IRC, there are many servers available to join and since IRC is an open protocol, you can even make your own server. How?(Another blog post, maybe!)

Ping - Pong!

As explained above, there are server running IRC protocol, waiting for client request to response. But there is more!

To remain connected to the server, client needs to send request at periodic time intervals to make certain whether client is connected to server or not. To achieve this, IRC use a lightweight packet with no data (to save bandwidth, because IRC is a low bandwidth protocol) called PING and server responds with packet called PONG. You can verify this by using any packet analyzer tool like wireshark and tcpdump.

So, if you want to call someone over IRC, you can say, "ping " and he will respond as "pong ".

PS: Ping is an utility used in linux operating systems to verify the internet connectivity between two remote computers, in our case, client and server.

Still Not interested? You should be because of there are various features that will be useful.

Why do we care?

Why should we waste our time reading about something we don't care? We shouldn't. Here are the reasons, you should be familiar with IRC and its usage. Here I will try to list few advantages and problems of IRC protocol.

Advantages:

  • Because Everyone is here using IRC as their primary mode of communication. Many upstream project discussion like debian, fedora are done on IRC and Mailing List. You can suggest features and contact project mentors directly on their project channel on IRC. They are always eager to help. (Don't know what a mailing list? Check later with my blog)
  • IRC works almost in real time even in low bandwidth internet where most of the modern messaging clients will fail.
  • IRC looks boring and everything is textual form and commands. So you have to read a lot of boring unformatted text to communicate via IRC. But they will help you make habit of reading boring text of documentation. (This can be a problem to few but an advantage for most)
  • Low bandwidth? No issue, IRC got you covered. IRC works flawlessly on low-bandwidth internet and it's a bliss.

Problems:

"Nothing is perfect! And same goes with IRC"
There are few problem or disadvantages of IRC, but you can overcome those problems yourself as described in the solutions thereafter.

  1. Habit of not using it. People who are used to modern chatting clients with graphics, does not want to switch to IRC.
  2. Aesthetics, The text formatting of IRC clients is not very beautiful and thus people see it as a problem.
  3. You can read messages only when you are connected. That is, it does not store the messages for you when you are not connected to the server. 
  4. Privacy! "Be careful! Internet is a harsh place to live in!" On IRC your IP address is visible to everyone and if you are security conscious, you might not like it.
  5. Lack of Features! If you used Slack or Gitter, you might say IRC doesn't have many features to praise about.

Solutions:

We read about many problems that one might face with IRC but don't get disheartened just yet. We can always overcome these problem whenever we want. Just follow the solutions described below in the same order.
  1. Try it and then decide for yourself. Once you get the hang of it, you won't have any difficulty using it.
  2.  Yes, IRC uses plain text, but all IRC clients allow us to modify and configure using plugins. So, you can add features, change its looks and what not. (Plugins are programming scripts that adds to the functionality. You can find various plugins here.)
  3. To read the chats when you are offline, you need to setup a bouncer server. To setup the bouncer, read this guide by bhavin192.
  4. Since your IP is publicly visible, I would suggest you to read next section to be safe.
  5. Thousands of available plugins can make your life easier.

 

Let's start with it!

Here are some tutorials that might be helpful:
- https://en.wikipedia.org/wiki/Wikipedia:IRC/Tutorial

Which Client to Select?

 

Communication Guidelines and etiquette

- https://freenode.net/changuide

Channels to join?

Make your own channel: https://freenode.net/groupreg
Register your nick: https://freenode.net/kb/answer/registration

Be safe! Internet is harsh place to live in.

Use cloaks, bouncers, Ssl connection.
Use Tor to connect to IRC networks. Here is a blog post on, how to set up the same.

More Features to it!

Bouncer
IRC chatbot
Totally configurable to your needs

Alternatives to IRC

There are tonnes of alternative to IRC in modern world like Gitter, Slack et. al, there is one that is worth mentioning, Matrix Protocol. Matrix like IRC is also another open communication protocol that works on decentralized model rather than conventional client-server model.

There is also another advantage to matrix that it can be used to communicate on multiple platforms using single Matrix based client. You can link, Telegram, Gitter, Slack and IRC as well on your matrix client. So, no matter what different platform your team or friends use, you can connect to all of them using a single client. Matrix also helps to read message while you are offline, and it hides your IP to others as well.

Riot.im is one of the matrix based client that works on your desktop as well smartphone.

How do I know the above stuff? 

Freenode knowledge base (https://freenode.net/kb/all), gentoo wiki, #dgplug, weechat wiki

My talk on IRC and slides are here.

I have made a presentation which might be helpful on the topic here.

Further References

  1. IRC terminologies (Blog post, coming soon!)
  2. IRC clients and wikies
  3. IRC command cheatsheet (Blog post, coming soon!)
  4. IRC channel modes guide here
  5. IRC Bouncers
  6. Tor
  7. IRC chatbots 
  8. IRC plugins: https://hackernoon.com/my-weechat-plugins-9278fe4783c 
  9. https://trac.torproject.org/projects/tor/wiki/doc/TorifyHOWTO/XChat#Config_Files_Manually%20Configure%20All%20.conf%20Files%20Manually

If you find any inconsistency on the content, ping me over IRC. I am philomath over freenode server. You can also find me at #dgplug on freenode server.

Note: This post might be incomplete, please notify me if you find any discrepancies.


To Infinity and Beyond!

Setting up Tor to connect to IRC network!

Freenode to EliteBNC bouncer to Tor!

First time I connected to IRC using webchat.freenode.net web portal with no encryption and IP hiding. With time, I moved to EliteBNC bouncer to read all the messages even when I am offline.

Now, the time has demanded me to evolve a bit further. This is an instructable blog post on how to set up "Tor" proxy to connect to my #dgplug folks.

The Onion Routing Protocol!

What is Tor? Since this blog post is not about Tor, so I am going to answer it in one line.

Tor is just another protocol used to connect to internet, but anonymously!

Don't fall for my words, you should delve more deeper yourself. Don't know what I am talking about? Read the reference section at the end to know more about IRC and Tor.

Instructions

  1. Install IRC client and tor dependecies (torsocks).

    sudo dnf install tor

  2. Setup your IRC client, in my case weechat (An IRC client, that I use to connect to IRC).

    sudo dnf install weechat

  3. Start Tor daemon to set up proxy.

    sudo systemctl start tor 

     sudo systemctl status tor

  4. Open Weechat and add proxy to your IRC client. Run the following commands on the client itself.

    /proxy add tor socks5 127.0.0.1 9050

  5. Set up proxy to your Server.

    /set irc.server.elitebnc.proxy "tor"

  6. Enjoy bypassing firewall on IRC :)

Now, Your IRC client should be using tor proxy on port 9050 which is the default sock5 proxy port on Tor. Enjoy using Tor!

(You need to start the tor daemon using systemctl everytime you reboot your system. You might want to start the service automatically. If yes, follow this blog post here.)

Why I did this?

Now, most of you guys must be thinking on why I should add the overhead of Tor on my IRC network? True! But you must already know,
"Necessity is the mother of Invention"
 ~Plato
Similarly, at an event, the internet provided to us had a firewall that rejects all invalid certificates transaction on it and unfortunately, my EliteBNC delta server got it's certificate expired since April 2018.

And thus, I am unable to connect to my #dgplug folks over IRC on this firewall enabled network due to invalid certificates of my EliteBNC server.

I knew, I had to bypass firewall somehow and thus Tor came to my mind.

Reference

  1. https://buildthesys.wordpress.com/2013/09/15/how-tu-use-weechat-with-tor/ 
  2. https://tor.stackexchange.com/questions/6939/configure-tor-as-proxy
  3. https://www.torproject.org/about/overview.html.en

Moving!

It's been a long time, since I published anything here, but that doesn't mean I stop writing, I kept writing everyday, just didn...