Search This Blog

Wednesday, May 30, 2018

Life Lessons from a course on Computer Networks

I have been teaching for 25 years. The course that I have taught the maximum number of times in this period is "Computer Network." I try to ensure that at the end of the course, students have understood how data moves from one place to the other in Internet, be it an email, or a webpage, or a file download. They should also be able to design a network for their home/office/building/campus, etc. They should be able to write a network application, or design a protocol, and so on.

But I hope they learn more than that.I like to teach this course because this has so many important lessons on how to lead our own lives. On the other hand, we some times design protocols based on what works in our own life, in human interactions.

We start with a lesson that one hopes everyone had learnt as a kid. In any group, if someone else is speaking, you should wait for him to stop before speaking. This is nothing but Carrier Sense Multiple Access (CSMA) protocol. We then improve upon it by saying that as you begin speaking, listen if someone else is starting too. If two persons happen to start around the same time, then they should both stop and one of them then restart speaking. Well that is how your good old Ethernet works. We call it CSMA/CD. CD for Collision Detection.

When you have to communicate with someone, would you call them up and start speaking non-stop even before you hear a "Hello" from the other side. Or would you first say, "Hello," and ask if they are free to talk (Connection Establishment). If they give the go ahead, speak only a little and wait for some response, which could just be that they have understood what you have just said. If they ask you to wait for a few seconds, you stop speaking for that much time (Sliding Window Protocol). Well, that is the difference between UDP (User Datagram Protocol) and TCP (Transmission Control Protocol). No wonder, as in real life, even in computer communication, most applications use TCP. No one wants to communicate with people who don't listen.

When I was reading about protocol design and implementation, I came across this guideline. (This was one of the RFCs. If someone knows which one, please let me know. I will add the reference.) The packets that you send must follow the protocol strictly. But when you receive a packet, accept packets even if the sender has not followed the protocol strictly. This is, perhaps, the most important life lesson from the Computer Networks course. Always say the right things, speak the truth. But when someone else is speaking, don't cutoff communication because the other person has said something which shouldn't have been said. Be tolerant of other people's mistakes.

While discussing congestion control, we talk about reducing our own demand as long as there is congestion. An aggressive behavior will result in prolonging of congestion. It might help that particular sender, but it does not improve network throughput. The idea that we must optimize for social good and not for individual good. Of course, given that some persons will always be aggressive, we also want to study systems in which behaviors favoring social good are rewarded (or anti-social behavior is punished) so that it also becomes a behavior for individual good.

While discussing different queuing strategies, we explain that there is no unique definition of fairness. The max-min fairness appears to be a reasonable choice in this particular context, but change the context and something else could be fair. So in any negotiation, don't assume what you think is fair is necessarily fair and if they are not agreeing on what you are asking, it is not because they are selfish or stupid. Try to understand fairness from their perspective.

As I think of more examples, I will add some more. But studying networks has been a fascinating journey because it is so closely linked to how you communicate in real life.

6 comments:

Unknown said...

https://tools.ietf.org/html/rfc761:

2.10. Robustness Principle

TCP implementations should follow a general principle of robustness:
be conservative in what you do, be liberal in what you accept from
others.

Vamshi Krishna G said...

Dear Sir,

Not just between humans, communication between several computers themselves too...
I've been working on distributed systems since graduating (2013) and the concepts from computer networks course laid an intuitive foundation for understanding how large clusters / data centers work.

-Vamshi
(Y8 Dual batch)

Unknown said...

What an analogy!

prasun said...

https://tools.ietf.org/html/rfc793#section-2.10

TCP implementations will follow a general principle of robustness: be
conservative in what you do, be liberal in what you accept from
others.

Kartik said...

I think the RFC(s) you are referring to are related to Postel's Law: https://en.wikipedia.org/wiki/Jon_Postel#Postel's_law

Dheeraj Sanghi said...

Thanks everyone. For some reason, blogger wasn't informing me of new comments for the last one month. Hence the delay in publishing all of these.