Wednesday, October 28, 2015

How does traceroute work

Here is a very good document which i found from cisco documents.
Have been asked many times in interview

The traceroute command is used to discover the routes that packets actually take when traveling to
their destination. The device (for example, a router or a PC) sends out a sequence of User Datagram
Protocol (UDP) datagrams to an invalid port address at the remote host.
Three datagrams are sent, each with a Time-To-Live (TTL) field value set to one. The TTL value of 1
causes the datagram to "timeout" as soon as it hits the first router in the path; this router then responds
with an ICMP Time Exceeded Message (TEM) indicating that the datagram has expired.
Another three UDP messages are now sent, each with the TTL value set to 2, which causes the second
router to return ICMP TEMs. This process continues until the packets actually reach the other
destination. Since these datagrams are trying to access an invalid port at the destination host, ICMP
Port Unreachable Messages are returned, indicating an unreachable port; this event signals the
Traceroute program that it is finished.
The purpose behind this is to record the source of each ICMP Time Exceeded Message to provide a
trace of the path the packet took to reach the destination.

Why is it required that iBGP peers always form full mesh?

eBGP uses the AS_PATH as loop avoidance mechanism since iBGP router doesn't change AS_PATH attribute while advertising routes to another iBGP peer we can't use it as loop avoidance in iBGP. To avoid loop iBGP peer doesn't advertised routes learned from another iBGP peer. So in order for an iBGP peers to receive all routes need to establish BGP session with all other peers hence full mesh.

How to Write Test Plans


Test Plans should be based on functionality and the feature to be tested. It can cover following things :

1) Configuration test cases

2) Functionality Test cases

3) Standard Based/ RFC based test cases

4)  Negative test cases

5) Performance related test cases

6) Stress Test cases

7) Logs related test case

8) Statistics Related test cases

9) User interface related test cases

10) Inter Feature test cases ( Lets say VLAN test plan is to be written and in this section we can add DHCP server related test cases, a combination of two or more  features)

what are different types of software testing

Testing Types
===========

1) Sanity testing - Speed is the main criteria. Sanity test is to rule out certain classes of obviously false results

2) Smoke testing - tests to reveal simple failures severe enough to reject a prospective software release. aims to determine whether the application is so badly broken as to make further immediate testing unnecessary

3) Regression testing - aims at finding new bugs or old reoccuring bugs when software changes enhancements have been applied.

4) Performance testing- aims to determine how software works with a given load . focuses on reponsiveness and stability

5) Load testing - with this much load. max data max useres . does the system run

6) Stress testing - with given load how long and how is it performing

7) Soak testing -  involves testing a system with a typical production load, over a continuous availability period, to validate system behavior under production use.

What are the levels of software testing

Testing levels
==========

1) Unit testing -  verify the functionality of a specific section of code

2) Integration testing -  works to expose defects in the interfaces and interaction between integrated components (modules).

3) System testing -tests a completely integrated system to verify that it meets its requirements

what are different software testing methods

Testing methods
============

1)White-Box testing - tests internal structures or workings of a program, as opposed to the functionality exposed to the end-user.  it is usually done at the unit level. It can test paths within a unit, paths between units during integration, and between subsystems during a system–level test.

2)Black-box testing - examining functionality without any knowledge of internal implementation. The testers are only aware of what the software is supposed to do, not how it does it

3)Grey-box testing - involves having knowledge of internal data structures and algorithms for purposes of designing tests, while executing those tests at the user, or black-box level. Manipulating input data and formatting output do not qualify as grey-box, because the input and output are clearly outside of the "black box" that we are calling the system under test.

Monday, October 26, 2015

BGP interview Questions

Here is a list of questions that I could come across while i studied BGP topics. This is a very rough draft.

BGP Questions
- How do you inject a network into bgp ? the command
- what is r - rib failure in sh ip bgp? - it means it is best route in bgp but we lost from the routing table as it is learnt via another protocol
- what is command  no auto-summary in bgp config? it means that put the exact network and the exact mask and it will advertise( classless).so if you have lot of 10.0.0.0 network and you insert command "network 10.0.0.0" inside bgp these networks wont be advertise via bgp. this is because autosummary is off by default and we need to type exact network and mask. if we turn on autosummary and then do this classfull network command we will see all 10 networks inside bgp
- what is no synchronization command in bgp config? if sych is off it means that i will not use the bgp route unless it is learnt via an igp. Now it is no sync by default.
- In bgp what are origin code of "i" and "?" - i means this network is into bgp from the network command and is configured on this router. "?" means that this network is into bgp from the redistribute command under bgp config
- what is sourcing a default route in bgp - it means that r1---->r2.. suppose r1 wants to inform r2 that is r2 wants to send traffic anywhere and is not specified in r2 table then send it to me r1
- How to source a default route? on r1 put the command " neighbor r2ip default-originate" . you wont see a default route on r1 . but if you check sh ip bgp of r2 you will see 0.0.0.0 next hop r1
- what is aggregation(summary) routes in bgp? how to do it? - it is here we take many detailed networks and advertise them as block of single larger address.We do this to reduce the number of router in bgp on internet.
- what is split horizon rule of bgp? as89(R8) ----- as3(R6 --R5--R3)
R8 sends ebgp update to R6. R6 will send ibgp update to R5 . But R5 will not send ibgp updat to R3 or any other internal bgp neighbors.
- why peering with loopback interface is good instead of physical interface?
- What are the ways to overcome full mesh topology in ibgp network? - confederation and routereflectors
- what are the two benefits of route reflectors? - 1) eleminate need for full mesh - ie send one update to route reflector the route reflector sends update to all its clients
2) loop prevention through cluster id- ie if i am a route reflector and i receive a route with my own cluster id i discard it.
- Explain configuring rr. ?  as3(R6 --R5--R3) on R5 we want it to be rr. neighbor 3.3.3.3 remote-as 3, neighbor 3.3.3.3 route-reflector-client. -> this is the only command needed on R5 ie rr and it will start sending updates to R3
- On router how will you check if that router is advertising bgp routes down to its neighbor ? sh ip bgp neighbor <neighbor ip> advertised-route
- does bgp send all routes it knows via bgp to its neighbor? entire sh ip bgp table? - no bgp send to its neighbor only valid routes with > sign
- if a client sends and update to rr, do  clients and nonclients get it? answer yes
- if a nonclient send a update to rr , do  clients and nonclients get it? - clients get it. Non clients dont get it
-
- in confederations does the rule of ttl of 1 between two ebgp apply? how to overcome it?.- yes it applies. to overcome it neighbor <ip> ebgp-multihop <coutn
- How to configure peer groups? neighbor MYPEERS peer-group, neighbor MYPEERS remote-as 123, neighbor MYPEERS update-source lo, neighbpr 1.1.1.1 peer-group MYPEERS
- what is bgp update-group? bgp dynamically assigns neighbors to update groups
- what is commmand to enable password for forming bgp neighbor? we need to do neighbor 1.1.1.1 password xyz
- what is ttl security in bgp?  neighbor <ip> ttl-security hops <number of hops> put on both routers
- What is NHS ? explain with example
- what is default ttl for ibgp neighbors and ebgp neighbors?
- what modifications are needed to ttl if ebgp neighbors are not directly connected
- what is advantage of peering with neighbors loopback ip address instead of physical address
- If we want to neighbor up with peers loopback address what is the additional command and what is the implication if we do not use that commnad and still use loopback to peer up with neighbor
- There are two bgp neighbors. You want one neighbor to always be server and other to be client. How can you do that? hint - update loopback sourc on one neighbor.
other neighbor dont mention this commnad... R1 forms neighborship with 2.2.2.2 using loopback and R2 when trying to form neibhborship with R1 loopback dont use update loopback source and it wil form neighborship as already it will see that it has a neighbor statement

R1-----------------------------------------------------------------------R2
on R1 - neighbor 2.2.2.2 update source lo 0
Now R1 forms neighbor with 2.2.2.2 from 1.1.1.1
From R2 - neibhbor 1.1.1.1 (no update source)
R2 thinks I already have neibhborship with 1.1.1.1 so forms neibhbor.
In this case R2 will always be server , R1 always client


- how do you change the router id of bgp and does it have impact on existing bgp established sessions?
- How do you inject a network into bgp ? the command
- what is r - rib failure in sh ip bgp? - it means it is best route in bgp but we lost from the routing table as it is learnt via another protocol
- what is command  no auto-summary in bgp config? it means that put the exact network and the exact mask and it will advertise( classless).so if you have lot of 10.0.0.0 network and you insert command "network 10.0.0.0" inside bgp these networks wont be advertise via bgp. this is because autosummary is off by default and we need to type exact network and mask. if we turn on autosummary and then do this classfull network command we will see all 10 networks inside bgp
- what is no synchronization command in bgp config? if sych is off it means that i will not use the bgp route unless it is learnt via an igp. Now it is no sync by default.
- In bgp what are origin code of "i" and "?" - i means this network is into bgp from the network command and is configured on this router. "?" means that this network is into bgp from the redistribute command under bgp config
- what is sourcing a default route in bgp - it means that r1---->r2.. suppose r1 wants to inform r2 that is r2 wants to send traffic anywhere and is not specified in r2 table then send it to me r1
- How to source a default route? on r1 put the command " neighbor r2ip default-originate" . you wont see a default route on r1 . but if you check sh ip bgp of r2 you will see 0.0.0.0 next hop r1
- what is aggregation(summary) routes in bgp? how to do it? - it is here we take many detailed networks and advertise them as block of single larger address.We do this to reduce the number of router in bgp on internet.
- what is split horizon rule of bgp? as89(R8) ----- as3(R6 --R5--R3)
R8 sends ebgp update to R6. R6 will send ibgp update to R5 . But R5 will not send ibgp updat to R3 or any other internal bgp neighbors.
- why peering with loopback interface is good instead of physical interface?
- What are the ways to overcome full mesh topology in ibgp network? - confederation and routereflectors
- what are the two benefits of route reflectors? - 1) eleminate need for full mesh - ie send one update to route reflector the route reflector sends update to all its clients
2) loop prevention through cluster id- ie if i am a route reflector and i receive a route with my own cluster id i discard it.
- Explain configuring rr. ?  as3(R6 --R5--R3) on R5 we want it to be rr. neighbor 3.3.3.3 remote-as 3, neighbor 3.3.3.3 route-reflector-client. -> this is the only command needed on R5 ie rr and it will start sending updates to R3
- On router how will you check if that router is advertising bgp routes down to its neighbor ? sh ip bgp neighbor <neighbor ip> advertised-route
- does bgp send all routes it knows via bgp to its neighbor? entire sh ip bgp table? - no bgp send to its neighbor only valid routes with > sign
- if a client sends and update to rr, do  clients and nonclients get it? answer yes
- if a nonclient send a update to rr , do  clients and nonclients get it? - clients get it. Non clients dont get it
-
- in confederations does the rule of ttl of 1 between two ebgp apply? how to overcome it?.- yes it applies. to overcome it neighbor <ip> ebgp-multihop <coutn
- How to configure peer groups? neighbor MYPEERS peer-group, neighbor MYPEERS remote-as 123, neighbor MYPEERS update-source lo, neighbpr 1.1.1.1 peer-group MYPEERS
- what is bgp update-group? bgp dynamically assigns neighbors to update groups
- what is commmand to enable password for forming bgp neighbor? we need to do neighbor 1.1.1.1 password xyz
- what is ttl security in bgp?  neighbor <ip> ttl-security hops <number of hops> put on both routers
- explain origin code in bgp? - i put into bgp with network statement.
-what are well know mandatoryattributes? give examples - well know is recognized by every bgp speaker and must be present in update eg. nh, aspath.
-what are well know discretionary? give examples - well know is recognized by every bgp speaker and discretionary means may or may not be present in an update eg atomic path aggregator
- what are optional transitive? give examples - optional may or may not be recognized by other bgp neighbors, and transitive means passed betn ebgp and ibgp neighbors
- what are optional nontransitive? give examples - non transitive means passed only between ibgp neighbors
- what is the most important aspect of as path attribute? - loop prevention, if an as sees its own as path in the updates it will not accept it
- how will u influence r6 to be the egress for all traffic to 2,2,2,2 route - set the local pref to be highest for 2.2.2.2 route on r6 . this is propagated to all nodes in as3 and all take r6 as best path to egress out to 2.2.2.2 n- w
- how will you influence ingress traffic on one link when you are hultihomed to single service provider? advertise med for the particular neighbor with lower med value
- what is atomic aggregate and aggrigator?  atomic aggregate - here atomic means one.this means we advertise one summary inor out of the as.
 aggregator is the individual who did the aggregation.
- how do we maniputlate outbound taffic ? Local pref and weight
- what is aspath prepending?why use it? - this is used to influence others to take a particular path.
- why use med when we can do inbound traffic manipulation using aspath prepend? - aspath prepand we do not know what the policy of the other as is towards our as.
- what is a distribute list explain with eg
- what is a route map explain with eg
- what is a pefix list explain with eg
- difference between acl distribute list prefix list and route map explain?
- how to load balance across multiple bgp paths
- is it possible to connecect to two diff isp? how do we do that? does load balancing work? - we must have our own as herer to connect to two diff isps
- Range of pivate AS number? and range of public AS number? - 64512 to 65535