google.com, pub-4617457846989927, DIRECT, f08c47fec0942fa0 Learn to enjoy every minute of your life.Only I can change my life.

Saturday, May 7, 2016

Templates in C++

C++ supports a mechanism known as template to implement the concept of generic programming .

Templates allows us to generate a family of classes or a family of functions to handle different types.

Template classes and functions eliminate code duplication for different types and thus make the program development easier and more manageable.

We can use multiple parameters in both the class templates and function templates.

A specific class created from a class template is called a template class and the process of creating a template class is known as instantiation. Similarly, a specific function created from a function template is called a template function.

Like other functions, template functions can be overloaded.

Member functions of a class template must be defined as function templates using the parameters of the class template.

We may also use non - type parameters such basic or derived data types as arguments templates.


Thursday, May 5, 2016

Congestion in networking


What is congestion?
Congestion is traffic.
Interference of two or more packets .
Reasons:-  Sending packets the same time.

Definition:  Congestion is a situation in which number of packets in network is greater than capacity of network or channel.

Total load > Capacity of channel  ,
is the main reason of congestion

Effect of congestion :-
Two main factors are affected by congestion
1) Delay versus load.
2) Throughput versus load.

When load is less than network capacity delay is permission and vice versa .
Delay depends on propagation delay and transmission delay .
propagation time , transmission time, buffer time
Congestion is directly  proportional to Delay
and
Congestion is directly proportional to Load

Throughput:-
Number of packets successfully delivered is called throughput .
Throughput is inversely proportional to congestion

When less congestion all packets will be successfully delivered means high throughput.

causes of congestion :
If number of packets are same .
If buffer capacity is less .
Insufficient memory buffer .
Slow processor .
Low bandwidth (capacity ) line if channel.
Failed router or processor .
If there is excess traffic to some specific host .

Congestion control:
It refers to technique and mechanism that can either defend congestion or remove congestion .

Two main types of congestion control :
1 ) Open loop ( prevention )
2 ) Closed loop ( removal ) the collision

1) Open loop :-
1. It is either handled by source or destination .
2. Retransmission property.
3. Use of sliding window protocol .example Selectivity.
4. Use of piggy bank acknowledgement .
5. Decision of discarding policy.

2. Closed loop congestion :-
Removal of congestion
1 by using CSMA policy
2 monitoring the system for congestion .
3 dynamically increase buffer capacity
4 if congestion detect at any point inform to all routers within that path
5 dynamically decides the router or path.

 

अच्छे विचार करे विचार

  पहचान की नुमाईश, जरा कम करें... जहाँ भी "मैं" लिखा है, उसे "हम" करें... हमारी "इच्छाओं" से ज़्यादा "सुन...