Saturday 22 September 2012

Ace Estimation

Magic time.
This is how i relax and i love relaxing.
Enjoy.


Cisco Catalyst Switches

So, this is the first post relating to networking.
Hmm-mm, let's see what shall we discuss.

Cisco Catalyst Switches.
Sounds like a good topic to me. Now, i am not going to go into alot of details regarding what is it, how may interfaces and all. I will discuss the forwarding methods used by a switch to determine where it needs to send the data and how it builds its "mac address table".

Cisco Catalyst Switches dynamically build up there tables. For that, they look at the source mac address of the  frame coming in and if not present in the table, makes an entries for it with the interface on which the data was received by the switch.
Below, we have a mac address table. Use the command show mac address-table (yes a hyphen is required there) on your switch and you will get something like this.


          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----          -----------             --------        -----
All    0100.0ccc.cccc      STATIC     CPU
All    0100.0ccc.cccd      STATIC     CPU
All    0180.c200.0000    STATIC     CPU
All    0180.c200.0001    STATIC     CPU
All    0180.c200.0002    STATIC     CPU
All    0180.c200.0003    STATIC     CPU
All    0180.c200.0004    STATIC     CPU
All    0180.c200.0005    STATIC     CPU
All    0180.c200.0006    STATIC     CPU
All    0180.c200.0007    STATIC     CPU
All    0180.c200.0008    STATIC     CPU
All    0180.c200.0009    STATIC     CPU
All    0180.c200.000a    STATIC     CPU
All    0180.c200.000b    STATIC     CPU
All    0180.c200.000c    STATIC     CPU
All    0180.c200.000d    STATIC     CPU
All    0180.c200.000e    STATIC     CPU
All    0180.c200.000f     STATIC     CPU
All    0180.c200.0010    STATIC     CPU


Note that, we have a lot of static entries there. They vary from one a switch at my place to the one at your place. These are for switches own use and we are not really concerned with it.
Do note the columns - VLAN, Mac Address, Type and Port.
This is an example of a switch just out of the box and hasn't learned any addresses from any devices on the network.

Lets have a look at the mac table after i connect a couple of PC's.


          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----          -----------            --------         -----
All    0100.0ccc.cccc      STATIC     CPU
All    0100.0ccc.cccd      STATIC     CPU
All    0180.c200.0000    STATIC     CPU
All    0180.c200.0001    STATIC     CPU
All    0180.c200.0002    STATIC     CPU
All    0180.c200.0003    STATIC     CPU
All    0180.c200.0004    STATIC     CPU
All    0180.c200.0005    STATIC     CPU
All    0180.c200.0006    STATIC     CPU
All    0180.c200.0007    STATIC     CPU
All    0180.c200.0008    STATIC     CPU
All    0180.c200.0009    STATIC     CPU
All    0180.c200.000a    STATIC     CPU
All    0180.c200.000b    STATIC     CPU
All    0180.c200.000c    STATIC     CPU
All    0180.c200.000d    STATIC     CPU
All    0180.c200.000e    STATIC     CPU
All    0180.c200.000f     STATIC     CPU
All    0180.c200.0010    STATIC     CPU
1    001b.d450.970f    DYNAMIC     Fa0/19
1    001b.d450.9710    DYNAMIC     Fa0/20
1    001b.d450.9711    DYNAMIC     Fa0/21


There you see, 3 dynamic entries.

Vlan 1 as it is the default vlan on a switch.
3 unique mac addresses and the type set to dynamic.
Also note that instead of CPU we have port numbers.

How did we get this.
Lets see the first entry.
This means that the Switch received a frame on its Fast Ethernet port 0/19 and had a source address of 001b.d450.970f.
Same principle applies for the other 2 entries as well.
This is how a Switch builds up its Mac Address Table.

So, now what ? How does it forward the frame ?

That is pretty simple as well.
For the forwarding decision, it relies on the destination mac address in the Ethernet header and decides whether its gonna flood, filter or drop the frame.

1. Flood : If a switch gets a frame with a destination mac address that is not present in its mac table, then it floods it i.e. it sends out the frame as if it was a broadcast to all the devices connected to it.
2. Filter : If the destination mac address is present in the mac table, then the switch assumes it as a unicast address and sends it to only that particular device.
3. Drop : A switch drops a packet if the destination device and the source device reside on the same port.

Lets see this in detail.
See the following table. Notice, it contains only the dynamic entries. Well, you can do that too. Just issue the show mac address-table dynamic command on the switch.



          Mac Address Table
-------------------------------------------

Vlan    Mac Address           Type             Ports
----        -----------                  --------            -----


1       001b.d450.970f      DYNAMIC     Fa0/19
1       001b.d450.9710     DYNAMIC     Fa0/20
1       001b.d450.9711     DYNAMIC     Fa0/21







Lets see the flood case first.
Suppose the switch receives data with an Ethernet header having the source mac : 001b.d450.970f and the destination mac : 001b.d450.9721. The switch looks at the source mac and finds an entry in its table. Next, it looks at the destination mac. Its not present in its table so, the switch forwards the data out all the ports i.e. fa0/20 and fa0/21. However, it doesn't send the data out fa0/19 port because this is the port that the data initially came in. That is easy.

Now onto the filter case.
Assume the source mac : 001b.d450.9711 and the destination mac : 001b.d450.970f. Switch looks at its mac table and see that the source mac is present and then looks at the destination mac to find that it is also present in the table. Now the Switch treats this data as a unicast i.e. destined for only one device and forwards it out fa0/19 port only.

Lastly, the drop case.
I will have to make use of a topology diagram here. It will help understand this really well.
Pretty simple topology here. In between Host A and Host B, that is a Hub.
Switch's mac address table is as follows :

VLAN        Mac Address                                  Type                  Port
    1            AA-AA-AA-AA-AA-AA             DYNAMIC           fa0/1
    1            BB-BB-BB-BB-BB-BB             DYNAMIC           fa0/1
    1            CC-CC-CC-CC-CC-CC             DYNAMIC           fa0/2
    1            DD-DD-DD-DD-DD-DD          DYNAMIC           fa0/3

Now, if the switch receives a data having source mac : AA-AA-AA-AA-AA-AA and destination mac : BB-BB-BB-BB-BB-BB. 
If you notice in the mac table above, both the hosts have been learnt through the same fa0/1 port.
Therefore, this data will be dropped because a Switch doesn't forward out the same port on which it initially received.

















That was a pretty long explanation but its easy. Just watchout for whats the case in terms of the Source and Destination Mac addresses and accordingly decide as to what the switch will do.

One last thing here, as we went through all the explanations I bet you noticed that the switches are only concerned with the mac addresses and mac's are a Layer 2 ( OSI model ) thing so the Switches operate only at the Layer 2 of the OSI model and Layer 1 of the TCP/IP model.

The next post i will go over some lab stuf relating to switches.
Configuring VLAN's, port security etc etc.

Thank You.

Saturday 15 September 2012

Hello Everyone.

I thought for a long time, whether or not i should start my own blog.

Finally, today's the day. This is the first time i am writing a blog so bare with me if i bore you but still a little encouragement on your part could really help me.
You must be wondering," **** here's another blogger who is gonna ask me to donate or something to support him". But, hey hey its nothing like that. Encouragement to me would be a good couple of minutes that you can contribute towards my blog, reading it and if possible, yes commenting as well. :):):):):):):)

Let me start off by introducing my self.
My name is Nipun Singh Raghav, yes that's only one person and not three and that's me for the sake of it.:D:D. I am from New Delhi, capital of India. So, what now ????? Ya, got the little tube light in my head to function again. :D:D
This blog would basically reflect my posts towards my passion, Networking and some of the other stuffs as well ( i know i know, i wrote my blog's address but yes that's what this blog would be all about).

I am into networking, not long though but i see my future in this field. Thanks to a friend of mine who introduced me to networking especially CISCO.
Now what is Cisco, u say ???
Cisco is an American multinational corporation headquartered in San Jose, California, United States, that designs, manufactures, and sells networking equipment's.

Don't even bother going over to Wikipedia in order to fill your knowledge banks. I copied this from there only:D:D:D:D.
So yes, i am studying as to how to work with the equipment's(sort of) that this company manufactures and believe me I am LOVING IT.

Apart from this, I also do magic. Yup, you heard me right folks. Magic. Really love performing and practicing, entertaining people etc etc. I particularly do Card Magic@close up. NO NO, don't copy and paste it in into your browser expecting some website with wands and magically stars following your mouse pointer :D:D. My future posts will showcase some of my favorite effects as well.


Phew, that looks good for the first post. I hope to have some good time talking to you guys and sharing my experience virtually.

Thank You all.