15 May

Do connected interface ping?

And an interesting day full of bit frustrating drama. Today was “External viva” for Major Project at college. It went good with external teacher but “internal ones” tend to cause un-necessary issues. Quite a few people put personal egos and frustration on top priority to an extent that they violate their own points for which they are arguing. They go completely unethical in way they deal with world.

 

 

I am saying this with full responsibility for couple of teachers from my college who have completely lost some “fundamentals of life” as taught in childhood to most of us. Some key principles like staying cool & calm, being humble, making best possible use of time and just being good with everyone. In last 4 years they haven’t learn how to give respect & talk with sense and they expect students to be learning “technology” from them? What an absurd!

 

Anyways not much I can do about it. My own external viva went fine and that’s good enough to stay happy. 🙂
All this reminds of an old amazing poem by Former Prime Minister of India (find it embedded below):

 

 

 

Today’s post…

Personal frustration aside – An interesting topic for today. One of my friend came up with an interesting question. Are all connected routers supposed to be pinging?

It’s simply about two routers – say router A and router B which whose interfaces are connected by a cable. Should they ping? If yes then under what circumstances?

 

Answer is …..mmm…let’s first dive in a little before I gave plain answer.

 

 

Ping/ICMP

Ping works on ICMP protocol and that comes on layer 3 on OSI model.

ICMP simply sends a packet (in a form of “Hello there!”) to destination host machine and if everything is OK then host machine is expected to be replying back with “Hi!” to the source. Time taken in this is counted in round trips (because a non-round trip based counting is logically not possible). This provides with connectivity confirmation + roundtrip latency in the connection.

 

So what are conditions required for ICMP to work?

 

Going into fundamentals of TCP/IP networking, a packet can route only when it knows answer to three simple questions:

  1. Who I am?
  2. Where I need to go?
  3. How I will get there?

 

 

Answer to “Who I am?” comes from the unique IP address (on broadcast domain), “Where I need to go” comes from the user himself who is pinging destination machine IP and “How I will get there?” comes from routing table.

 

So #1 and #3 are important here.  There’s not really BGP, or any IGP protocol when two routers are connected directing on same broadcast (layer 2) and this is where other low level protocol ARP comes into picture. ARP is used in creating a simple table which keeps a reference between Mac address, IP address and interface.

 

How does ARP work?

ARP simply works using “broadcast address” we use while configuring IP address on a interface. E.g if I am putting IP as 10.0.0.1 coming from /29 subnet (or call it 255.255.255.248), it assumes last IP to be “broadcast IP”. A /29 here means 2^32-29 = 8 IPs. Starting from 10.0.0.1, it goes till 10.0.0.7. So last IP = 10.0.0.7 is broadcast IP. This is used by all machines under same broadcast domain to “announce/advertise” their IP address from their Mac address.

 

Let’s play around and connect three routers to a switch (same layer 2 broadcast, single VLAN).

We have router A, router B and router C.

I am putting A and B on 10.0.0.1 and 10.0.0.2 under same subnet (a /29) while router C will be on 10.0.0.100 coming from /24 subnet (for fun!).

 

Screen Shot 2013-05-15 at 6.51.34 PM

 

 

Router>
Router>en
Router>enable
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host
Router(config)#hostname A
A(config)#in
A(config)#interface F
A(config)#interface FastEthernet0/0

A(config-if)#ip add 10.0.0.1 255.255.255.248
A(config-if)#no shut
A(config-if)#no shutdown
A(config-if)#end
A#
00:11:44: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
00:11:45: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
00:11:46: %SYS-5-CONFIG_I: Configured from console by console
Building configuration…
[OK]
A#
A#

 

OK – let’s go on B:

 

Router>en
Router>enable
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host
Router(config)#hostname B
B(config)#int
B(config)#interface F
B(config)#interface FastEthernet0/0
B(config-if)#ip add 10.0.0.2 255.255.255.248
B(config-if)#no shutdown
B(config-if)#end
B#
00:16:06: %SYS-5-CONFIG_I: Configured from console by console
B#
B#
00:16:06: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
00:16:07: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
B#
B#write
Building configuration…
[OK]
B#

 

Now comes the “different one” i.e router C:

Router>
Router>en
Router>enable
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#rou
Router(config)#host
Router(config)#hostname C
C(config)#int
C(config)#interface F
C(config)#interface FastEthernet0/0
C(config-if)#ip add 10.0.0.100 255.255.255.0
C(config-if)#no shu
C(config-if)#no shutdown
C(config-if)#write
00:01:38: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
00:01:39: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state
C(config-if)#
C(config-if)#end
C#wr
00:01:44: %SYS-5-CONFIG_I: Configured from console by consoleite
Building configuration…
[OK]
C#

 

 

OK – now we have three routers with two on same /29 subnet and third one on a /24 subnet. Let’s try to ping:

A#ping 10.0.0.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/21/24 ms

 

Worked. OK – let’s try C now:

 

A#ping 10.0.0.100

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.100, timeout is 2 seconds:
…..
Success rate is 0 percent (0/5)
A#

 

Failed.

 

Let’s look at routing table on A:

A#sh ip route connected
10.0.0.0/29 is subnetted, 1 subnets
C 10.0.0.0 is directly connected, FastEthernet0/0
A#

 

OK – so only one entry for 10.0.0.0/29 which is connected directly to Ethernet interface 0/0.

 

If we look at ARP table, we get:

A#
A#sh ip arp
A#sh ip arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 10.0.0.2 12 ca03.35dc.0008 ARPA FastEthernet0/0
Internet 10.0.0.1 – ca02.35dc.0008 ARPA FastEthernet0/0
A#

 

This answers the question completely. 🙂

We have only A and B it ARP table of A. Both B and C are connected to same switch, same VLAN but C is not “visible” to A because C is on /24 subnet and that means last IP of 10.0.0.0/24 i.e 10.0.0.255 is acting as broadcast. C is sending it’s live updates for ARP on 10.0.0.255 while A and B are doing that on broadcast IP 10.0.0.7 (last IP from 10.0.0.0/29) and are not “hearing” on 10.0.0.255. Hence A and B are “hearing” on same broadcast and are updating ARP table while C even connected on same switch, same layer 2 is not connected on layer 3 and thus ICMP ping does not work.

 

It pretty much about those three fundamental questions. Again, third question was “How I will get there?” needs an answer from routing table. So let’s go ahead and tell A about lonely router C. 🙂

 

A(config)#ip route 10.0.0.0 255.255.255.0 F
A(config)#ip route 10.0.0.0 255.255.255.0 FastEthernet0/0
A(config)#end
A#writ
00:38:50: %SYS-5-CONFIG_I: Configured from console by consolee
Building configuration…
[OK]
A#
A#

 

Now there’s a static route entry on A which tells where it for subnet 10.0.0.0/24 and IP 10.0.0.100 belongs to that.

Let’s try pinging again:

A#ping 10.0.0.100

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.100, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/21/24 ms
A#

 

And A can now ping C.  What about C?

C#ping 10.0.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/21/24 ms

 

C#ping 10.0.0.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:
…..
Success rate is 0 percent (0/5)
C#

 

So now C is able to reach A but not B because again B doesn’t knows where is C. If we look at ARP table of C now:

C#
C#sh ip arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 10.0.0.1 3 ca02.35dc.0008 ARPA FastEthernet0/0
Internet 10.0.0.100 – ca06.35dc.0008 ARPA FastEthernet0/0
C#

 

So 10.0.0.2 i.e B is still missing. Let’s tell B to “default” all traffic via A.

 

B>
B>en
B>enable
B#conf t
Enter configuration commands, one per line. End with CNTL/Z.
B(config)#ip ro
B(config)#ip route
B(config)#ip route 0.0.0.0 0.0.0.0 10.0.0.1
B(config)#end
B#write
Building configuration…
[OK]
B#

 

Checking again on B now:

 

C#ping 10.0.0.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/21/24 ms
C#

 

 

So that’s about it.

 

Summary

Ping works on ICMP and it is on layer 3. For it to work, layer 2 should be connected along with working logical layer 3 with entries in routing table. Unless two directly connected machines are on same subnet they won’t ping because different subnet will get them on different broadcast IP and thus different ARP tables all together.

And don’t miss that lot of firewalls block ICMP partially as well as completely because it tends to overload routers in processing those packets rather then doing normal switching operation.

 

Time for me to get back to work!

 

Note: My comments on college teachers are specifically for two teachers (and everyone around me knows whom I am referring too) and one should not make a general impression out from those. There are some very good teachers in dept. as well. 

21 Feb

The useless lie…

And finally 8th semester started at college.

I am here for just a week and then will be out of country for sometime.

Last week  I had an interesting case. My mother’s cell phone rang in her absence and I saw it was an unknown number with Radaur’s STD code. Without thinking much I picked phone and discussion was something like:

 

Someone: Are you Mr K.L. Bhatia?
Me: Mmm…..(thinking why someone is asking for my father on my mother’s number!)
Someone: You are Mr K.L. Bhatia? 
Me: (without thinking much) – Yes, what’s up?
Someone: (hard voice this time) – ARE YOU M.R. K.L. BHATIA? 
Me: Yes. What can I do for you?
Someone: (Angry and familier voice of my college teacher)No, you are not. You are Anurag!

 

Next thing was that I panicked and disconnected the call. 

As soon as my mother came up, I told her entire event and requested her to call back.
Now thanks to awful college phone system which has interncomm setup, it showed the outbound caller ID of admin block, and thus phone call rang in admin block. They transferred it to IT block, which further transferred it to some teacher (someone other then the one who called). Teacher said usual words about students not attending college and asked my mother to send me as soon as possible to attend classes. 

That’s all so far. And oh yes, one of senior teachers in IT dept. believes that I gave wrong phone number in college records and passed my number rather then of my parents and “he will take my class about it“. He told entire this story twice to class when I was absent (wow!).

 

Learning from event so far:

  1. Never lie when it is not really required. Basically I should have told person on phone that I am Anurag and not my father!
  2. As soon as you are caught lying – do not panic and just apologize.
  3. Most of State college teachers have plenty of time to spend on things which do not matter at all. 

 

Time to visit college tomorrow and meet that teacher to directly apologize and end this drama. This is so awkward because likely I am one of few students who have passed real phone numbers of both mother & father and still it caused all this confusion. Usually these state college teachers have mind full of frustration & hatred for students. And as a part of that they never bothered to contact my parents again on their phone numbers or directly talk to me for  clarification. All this for a bulk call to parents of almost all students. (wow! again)

And on top of that they now know about my involvements with other projects, my summer work experience, etc. So clearly most of people around don’t care for things that matter but waste enough time on things that don’t matter. 

 

With promise to self that I won’t lie when it is not required, time to finish off this blog post and get back to work!

 

***Update***

I was able to catch senior teacher on Thursday right after college hours. I apologized to him and he was pretty much satisfied with my apology. Case closed!

28 Nov

Frustration, frustration and frustration – Story of State Colleges in India

Today was our Summer Project viva day and overall it went good for me. Although I was suppose to give viva on Sat, but that just didn’t happened as I was kicked out  and insulted from my respective teachers for “not wearing formal clothes“. That’s very  sad. I am not taking it personally but I am just pointing out the level of education and overall mentality in state college education system. I am not saying quality is low or teachers are poor or something like that. I personally feel we have very good teachers overall but it’s just whole system which is screwed up badly and causing problems for just everyone including teachers too.

 

Today, I gave my viva in so called “formal clothes” and it went good. Now question here is – why really formal clothes?
Or is that’s the only thing which makes one look professional? On sat I was in clothes I own, today I was in clothes taken on “request” from someone.
It’s all about  “system” and mentality of that system. And really funny thing was when my presentation ended, my question to a very good teacher of mine was Sir any questions? His reply was – “No, very good presentation”. I felt happy to hear those words from him – since he’s one of very good teachers in our college and I have lot of respect for him. But next, he called me and pointed out (so called) “mistakes” in my file. Now to clarify – (I attest it with 100% confidence) that there was NO technical glitch or mistake in file but it was all about “Standard ways” Vs “Non-Standard ways“.

 

My file was rejected for following reasons:

  1. I underlined headings (and I was not supposed to be) (why?)
  2. I had bit of free spaces here and there (and no one is humble enough to ignore!) 🙂
  3. I wrote title of images on top, rather then bottom
  4. I wrote title of images but did not name those as image 1.1, 1.2 etc (Does that matters?)

 

Despite of these (so called as) mistakes anyone can read my file well, and can understand it well. And I can also “claim” to be one of probably 3-4 students out of 60 students who created whole file, whole project, whole presentation by hand (rather then copying). He knew that well, still file rejected. Fix fonts, fix underlines and print again.

 

I just wonder why people are seriously looking at things which DOESN’T NOT MATTER and completely ignoring things which matter a LOT. I spent considerable amount of time in looking into whole system and looking at the core issue. I was surprised to find it’s not about any teacher or say group of teachers who are causing problem, but it’s about whole system. Infact one of madam sitting in same lab later agreed to me saying “in our time we did in formal manner, we were forced to that, and same we expect from you“. This reminds me very old thought of Hindu culture where “discipline” is more about living life in uncomfortable hard manner for just nothing but to maintain a system. Like e.g it was discipline not to look into eyes of elders, it was discipline not to ever question judgement of someone senior in family, it was discipline to just keep things like way they are going even if someone has a better solution out to that. It is sad that education system in India carried over that “discipline as stick” rule to impose meaningless things rather then focusing on bringing innovation in young minds.

 

I can technically challenge all these rules like say:

  1. Why wear formal clothes? Any single logical point? We are into “technical education” rather then say MBA or any such stream. I have seen Mr Sridhar Vembu, CEO of Zoho coming in shorts in Office and working. I have seen how people dress up at Google. Overall, about clothes all I can say is – they should be comfortable and next, should look decent. Full stop beyond those points.
  2. What’s the WHOLE point in printed presentation? I am sure here college will claim that it’s a “Kurukshetra University” demand but again WHAT’s THE POINT in having hard copies and wasting more paper? Next, we organize a “Save trees day” and pass message to save trees by making funny paintings ON PAPER. Completely meaningless but no one (in top management) seems bold enough to challenge it and get it fixed. Or may be it’s about economy? 🙂 Well, yeah small computer shops printing these projects are making quite a bit (as I have seen myself). They did asked us for soft copy on CD, which should be enough.
  3. Why so much of negative trashing questions to students? I have myself seen our respective teachers putting SERIOUSLY HARD EFFORT to find “mistakes” in presentation despite of fact it was first presentation at this level for 3rd year students. No one tried to boast moral, no one tried to ignore mistakes, no one tried to just let one “convey” their message. Surely, I can’t deny of fact that many students were poor in preparation but I am saying there were enough cases where student knew 90% of his subject and isn’t that’s a good number? For rest of 10% part, student had no clear idea. Why to dig more and more of 10% and prove him/her as plain dumb when they are not? (Happened to many of my friends)

But alas, this is not teachers problem, it’s just whole system. I myself know many good teachers who get very bad treatment from students and vice versa as in my case! 🙂

 

Clearly chicken-egg game

One or a group of student insult a teacher for some reason or whatever, teacher gets supper irritated with everyone and keeps on trashing everyone. And eventually old students start giving out their frustration on new teachers and cycle continues. No one gains anything from it, but just more and more frustration and loss of time & energy. 🙁

I still don’t have any solution to break this chicken – egg series, just suffering like few other “decent” students. All I can think off right now is – be more respectful and humble even with teachers who are not behaving in good manner and eventually break their anger & frustration with more and more respect & love.

 

Reminds me of this scene from very motivating movie “Accepted“.

 

 

Wish, people around me – not just teachers but students too, and almost everyone becomes more humble, loving, forgiving – and world would be such a nice place.

Thanks for reading. Feel free to leave your comments below.