Wednesday 5 October 2016

     Switching

    Techniques

In large networks there might be multiple paths linking sender and receiver. Information may be switched as it travels through various communication channels. There are three typical switching techniques available for digital traffic.
    Circuit Switching 
    Message Switching
      Packet Switching

Circuit Switching:-
Circuit switching is a technique that directly connects the sender and the receiver in an unbroken path.
Telephone switching equipment, for example, establishes a path that connects the caller's telephone to the receiver's telephone by making a physical connection.
With this type of switching technique, once a connection is established, a dedicated path exists between both ends until the connection is terminated.
Routing decisions must be made when the circuit is first established, but there are no decisions made after that time.
Circuit switching is a technique that directly connects the sender and the receiver in an unbroken path.
Telephone switching equipment, for example, establishes a path that connects the caller's telephone to the receiver's telephone by making a physical connection.
With this type of switching technique, once a connection is established, a dedicated path exists between both ends until the connection is terminated.
Routing decisions must be made when the circuit is first established, but there are no decisions made after that time.

Message Switching:-
 With message switching there is no need to establish a dedicated path between two stations.
When a station sends a message, the destination address is appended to the message.
The message is then transmitted through the network, in its entirety, from node to node.
Each node receives the entire message, stores it in its entirety on disk, and then transmits the message to the next node.
This type of network is called a store-and-forward network.

Packet Switching:-
   In both packet switching methods, a message is broken into  
     small parts, called packets.
   Each packet is tagged with appropriate source and destination  
    addresses.
   Since packets have a strictly defined maximum length, they
    can be stored in main memory instead of disk, therefore access
    delay and cost are minimized.
   Also the transmission speeds, between nodes, are optimized.
   With current technology, packets are generally accepted onto
    the network on a first-come, first-served basis. If the network
    becomes overloaded, packets are delayed or discarded. 

                       Thanks :)

Saturday 3 September 2016

Himanshu:  Take input when number of Inputs are not given in...

Himanshu:  Take input when number of Inputs are not given in...:  Take input when number of Inputs are not given in C++. This is simple example of problems in which the of inputs are not given and also...
 Take input when number of Inputs are not given in C++.
This is simple example of problems in which the of inputs are not given and also it can be use as a tricky programming.
#include <iostream>
using namespace std;
int main() 
{
int t,c=0;
while(cin>>t)
c++;
cout<<c<<endl;
return 0;
 }
Here when input is given each time cin>>t will return '1' otherwise it will return '0' that makes whilecondition false. The number of inputs are store in variable 'c' as it increase by 1 each time while condition istrue.
  • Display output without using semicolon ";" .
Here it is shown that how to display output without using semicolon ";" at the end of line.
#include <iostream>
using namespace std;
int main() 
{
  int t,c=0;
  if(cout<<c<<endl)
  c++;
  cout<<c<<endl;
  return 0;
 }
Here If condition becomes true as cout<<c<<endl return 1 because of that value of variable c increase by 1. Same thing can be done in C programming , just use printf in if condition.
#include <stdio.h>
int main() 
{
  int c=0;
  if(printf("Hello World!\n"))
  c++;
  printf("%d",c);
  return 0;
 }