Monday, August 26, 2013

Lets use Python or Ruby

Hi All,

I suggest everybody to use Python or Ruby for programming everything because python/ruby require less code which in turn means less chances of bug. Yes Python is little bit slower than C but that can be compensated by using a high end server class machine.

Wednesday, August 21, 2013

Where to put index in a database

Hi All,
Index are used for faster searching. Just as in Books, index helps us to find a topic fast. Similarly we use index on a database table to make our query fast. Now the question is on which column we should put index. Answer is quite obvious from book example. We should put out index on the column which is used for searching. Suppose you have a employee table with  columns as employee_id,name,email,salary,address,last_updated etc. Now if you frequently query employee table as "select * from employee where name='x'" then you should be put index on column "name".

Tuesday, July 30, 2013

Difference between MPLS VRF and MPLS VPN

Dear All,
Please do not confuse with MPLS terminology. MPLS VRF(Virtual Router Forwarding Instance) is just a virtual router  consisting of one or more number of interfaces. When two or more VRF joins then a VPN is formed. Here joins means sharing the route tables so that they can communicate with each other.
VRF is distinguished by RD(Router Distinguisher). When a VRF import and export routes from another VRF, the virtual router's routing table get exchanged. After that two VRF can communicate with each other. In this case we can say that above two VRF are part of same VPN.



What do SNMP MIB table indexes stands for ?

Dear All,
I just came across a problem where I need to access MIB tables. For accessing any table in SNMP at least one index is there. So what is this index?
Here meaning of index is same as book index you find at the end of the books.
So every table leafs has a OID(Object Identifier which gives the location of managed object data in the MIB tree data structure) and all index must be appended in sequential order to the get the actual row data in the table. For example take interface table with entry OID(.1.3.6.1.2.1.2.2.1) in standard MIB-II. To access a row in the interface table you need to append interface number to the leaf OID. Like you want to access interface description of second interface then you need query OID (.1.3.6.1.2.1.2.2.1.2.2) using GET SNMP commands. Other way to fetch entire MIB table is to use GetTable command. Although GetTable command is not a standard command but many SNMP implementation like(NetSNMP, SNMP4J etc) support it.

Sunday, July 28, 2013

Difference between Switch and Bridge

Switch is just multi-port bridge

Wednesday, July 24, 2013

What is Multiprotocol Label Switching (MPLS)

MPLS (Multiprotocol Label Switching) is a new TCP/IP protocol which forward packets based on a 32 bit-labels inserted between Layer 2 and Layer 3 header. The basic idea behind MPLS is based on two paradigm:-

1. Layer 2 Switching is faster than Layer 3 Routing i.e. Switching is faster than Routing:-
The reason behind this is that in case routing the router has to read all routing table to route any packet excluding broadcast and multicast packets. So the complexity level will be O(n). While in case of Layer 2 switching any first match is sufficient to forward the packet. So in case of switching the complexity will be of order O(n/2).

2. Circuit switching is more reliable and faster that packet switching:-
There is most obvious thing. When Internet was designed,the existing network links were unreliable. So it was thought that each packet may traverse through different path. Keeping in view of that all mandatory information for routing(Source and Destination address) was kept with every packet. But now-a-days links are becoming more and more reliable with each passing years. So Circuit Switching concept was brought back in Internet in the form of MPLS. Circuit switching involve less overhead of routing and therefore faster than packet switching.

How MPLS works:-  MPLS forward the packet based on label only. It like the shopping of food items. When you go shopping for food item you see the label for identifying whether this item is made of VEG stuffs or NON-VEG stuffs. So in this process you may skip reading of contents of that food. This makes you life easier. Recently, SEBI has mandated mutual fund  houses to put label on their mutual fund products based on risk involved so that by merely looking at you will come to know whether this mutual fund is suitable for you or not.

A MPLS Router can assume three role
1. Provider Edge(PE) Router:- This router reads the packet and determine its forward equivalence class,put a label and forward it other MPLS router. It also remove label and forward the normal IP packets.
2. Provider (P) Router:- These are backbone router and forwards packets based on labels only.

In simple word, MPLS first identify a flow(most probably based on destination address) insert a tag or label and forward the packet in MPLS network. In between MPLS network packet forwarding takes place based on label only. At exit end of the network the router removes the label and send the plain IP packet to the user.

Now the question arises how the label switching works. MPLS first forms Label Switched Path(quite similar to Circuit switching path) using an underlying routing protocol OSPF or BGP. In principle, OSPF/BGP helps a MPLS router to calculate a Forward Equivalence Class(FEC) which in turn is used to classify the packets for labels to inserted. Label has only local significance to a link i.e. same label may reused at others link also.


Out of 32 bit of label, only 20 bit is used for actual label. 3 bit is used for Experimental purpose. It will further used for importing differentiated service field of IP packet. This field can be used later on to provide QoS. S bit indicate end of stack label. The idea here is that there may be multiple label inserted in between in order to have higher level of aggregation of traffic in the MPLS network.When a packet comes to a MPLS enabled router, it can either PUSH,POP or swap a label. The S bit show the lowest label. The last 8 bit is used for TTL field. This TTL field is same as IP packet. The purpose for TTL bit is same as in IP packet to drop a packet from traversing infinitely in the network in case of looping.

Importance of Loopback address in network management using SNMP protocol

One of my colleague asked why do we require Loopback IP address for managing a network device(Router,Switch Modem etc) using SNMP protocol. There are several reasons for that:-
1. Since loopback is software based address, it will be always up. Therefore as long as device is up and reachable through any of its interface, we will get SNMP response by polling the Loopback address.
2. If you choose any other interface IP other than Loopback and if that interface goes down, the SNMP query will fail. In this scenario, even though your device/machine is up, you will get wrong information that machine is down.
3. In case of Desktop, you do not require a separate Loopback because usually desktop has only one cable connecting it network.
4. Loopback address provides unique identity to the network device which can be used as primary key in management database.
5. So if a device has multiple connectivity it is always better to use Loopback address as management address for all management purpose including TELNET and SSH.