Wednesday 31 July 2013

MCQ on OSI Model in networking

 MCQ

OSI MODEL

Q.1) The Internet model consist of -----------  layer 

Ans ...            Five.

Q.2)  which of the following is an application layer service ..

A) mail system
B) File Transfer
C) Remote Log In 
D) All of them

Ans .......     D

Q.3) When a host on n/w A send a message to the host on n/w B which address does the router look at ?

Ans ...       Logical


Q.4 )   IPV6 has ........  bit address ?

Ans ........     128

Q.5) ICMPv6   includes .............

Ans .........   IGMP     and ARP

Q.6)  ............. is a process-to-process protocol that adds only port addresses, checksum error control, and length information to the data from the upper layer.

Ans ..........     UDP

Q.7)  The ________ address, also known as the link address, is the address of a node as defined by its LAN or WAN.

Ans .....     physical

Q.8)   Ethernet uses a ______ physical address that is imprinted on the network interface card (NIC).

Ans .....      6 byte

Q.9)   A port address in TCP/IP is ______ bits long.

Ans ....   16

Q.10)  The TCP/IP _______ layer is equivalent to the combined session, presentation, and application layers of the OSI model.

Ans ...........   Application

 

Q.11)   The ____ address uniquely defines a host on the Internet.

Ans ......    IP

Q.12)  The_____ address identifies a process on a host. 

Ans .....    port

Q.13)  Routers operate at which layer of the OSI Model?

Ans ...  Network

Q.14) Which of the following operates at the Presentation layer?

Ans .....  MIDI & JPEG

Q.15)   Which of the following are Transport layer protocols?

Ans .....     TCP  and UDP

Q.16)  Flow Control take place at which layer ?

Ans ....   Transport

Q.17)  Repeaters & hubs operate at whaich layer?

Ans .....    Physical 

Q.18)  Bit synchronization is handled at which layer of the OSI Model?

Ans ..... Session

Q.19)   Bridges operate at which layer of the OSI Model?

Ans .........Network

Q.20) What are the sublayers of the Data Link layer?

Ans ....   MAC   and LLC

Q.21)  Which layer is responsible for packet sequencing, acknowledgements, & requests for retransmission?

Ans ....   Transport

Q.22) Which layer translates between physical & logical addresses?

Ans ....   Network

Monday 8 July 2013

ARRAY EXAMPLE IN JAVA

Hello Friends,
                        It is very common to have objective question about Array creation in any competition exam.
and it is also possible to be confused and do mistake. 
So here I am giving you an program as an example.
This program illustrate correct as well as incorrect array syntax :



public class ArrayExample {

    /**
     * @param args
     */
    public static void main(String[] args) {

        //first way to create array. declairing,constructing and initializing in the same line
    int[] array1={1,2,4,6};
   
     //retrieving array elements
    for(int i=0;i<array1.length;i++)
    {
    System.out.println(array1[i]);
    }

    //second way to create array
    //declaire and construct an array
    int[] array2;
     array2 = new int[3];
 
     int x= -2;
     array2[x] = 7;
     System.out.println(array2[x]);
       //  Run time exception

   
   
     //it is not valid to give size at the time of declaration
   
    int[3] array3;
   
     //so above statement gives compilation error.
   
     int[] array4 = new int[3];
     byte b = 4;
     char c = 'a';
     short d = 7;
     array4[0] = b;
     array4[1] = c;
     array4[2] = d;
     for(int i=0; i<array4.length;i++)
     {
         System.out.println(array4[i]);
         
     }
 

     // constructing Multidimentional array
    String array2d[][] = new String[3][];
    //this is a valid syntax but
   
     String sw1[][] = new String[][3];
    //is not valid .
   
   
    //Second way to create 2-d array
    String array2d1[][] = {   {"ram","shiv","bholenath"}, {"o","m","n","a","m"}};
   
    //Second way to initialize 2-d array
    int array2d3[][] = new int[3][];
    array2d3[0]= new int [2];
    array2d3[0][0]=6;
    array2d3[0][1]=7;
   array2d3[0][2]=9; 

// run time exception 
    array2d3[1]= new int [1];
    array2d3[1][0] = 3;
    }

}

Friends just copy and paste this code and save the file ArrayExample.java , and Run it.
Code in blue colour work correctly but code in red colour gives u error.  So comment the code in red and then run it. and look carefully because it may lead you to a mistake.


Thank you ..........

Sunday 7 July 2013

ARRAYS in JAVA


                                                                  ARRAYS  IN JAVA


Some interesting facts about arrays in java :

A)  It is never legal to include the size of array at the time of array    declaration in JAVA.
int[7] marks;    is invalid
Because jvm does not allocate space until you actually initiate array object, then size matters.


B) Array objects created on heap. 

C) int array[][] = new int[3][];  is acceptable in java 
    but
    int[][] array = new int[][3];   is not acceptable 

   because jvm needs to know the size of object assigned to the     variable array.

D) Anonymous Array Creation :

  int[] test;
  test = new int {4,7,5};

In this anonymous array we construct and initialize and array and then assign the array to previously declare array reference variable.
      The preceding code create a int array object with three elements 4,7,5 and assign this object to previously declared array reference test.
       We do not specify the size  of anonymous array obj. , size is derived from the number of elements in the curly braces .
So  :   new Object[3] {null, new object(), new object()};
is invalid  size must not be specified.

E)  Just in Time array argument :

       public class Foo {
        void takeArray(int[] someArray)
        { 
             //  use array parameter
        }

       public static void main (String[] args) {
              Foo f = new Foo();
              f.takeArray(new int[]  {1,2,3,4,5});
        }
    }

      Here we are not assigning array object to any reference variable, just-in-time array is used as an argument to method.







Friday 21 June 2013

JAVA MCQ EXERCISE


HEY FRIENDS ......
                            Try to answer  ..................... 



1.  Which four options describe the correct default values for array elements of the types indicated?
  1. int -> 0
  2. String -> "null"
  3. Dog -> null
  4. char -> '\u0000'
  5. float -> 0.0f
  6. boolean -> true
A. 1, 2, 3, 4B. 1, 3, 4, 5
C. 2, 4, 5, 6D. 3, 4, 5, 6



Q.2  Which one of these lists contains only Java programming language keywords?
A. class, if, void, long, Int, continue
B. goto, instanceof, native, finally, default, throws
C. try, virtual, throw, final, volatile, transient
D. strictfp, constant, super, implements, do
E. byte, break, assert, switch, include




Q.3)  Which is a reserved word in the Java programming language?
A. methodB. native
C. subclassesD. reference
E. array

Q.4) Which three are legal array declarations?
  1. int [] myScores [];
  2. char [] myChars;
  3. int [6] myScores;
  4. Dog myDogs [];
  5. Dog myDogs [7];
A. 1, 2, 4B. 2, 4, 5
C. 2, 3, 4D. All are correct.


Q.5)  
public interface Foo 
{ 
    int k = 4; /* Line 3 */
}
 
Which three piece of codes are equivalent to line 3?
  1. final int k = 4;
  2. public int k = 4;
  3. static int k = 4;
  4. abstract int k = 4;
  5. volatile int k = 4;
  6. protected int k = 4;   


A . 1, 2  and 3                                    B.   2, 3, 4
C.  3, 4  and 5                                    D.   4, 5, 6


9.  Which three are valid declarations of a char?
  1. char c1 = 064770;
  2. char c2 = 'face';
  3. char c3 = 0xbeef;
  4. char c4 = \u0022;
  5. char c5 = '\iface';
  6. char c6 = '\uface';
A. 1, 2, 4
B. 1, 3, 6
C. 3, 5
D. 5 only


10.   Which is the valid declarations within an interface definition?
A. public double methoda();
B. public final double methoda();
C. static void methoda(double d1);
D. protected void methoda(double d1);




 
 
 

Thursday 20 June 2013

Objective Question for Java Lovers

Short Java Questions


Q.1 ) JAR stand for -------

-->         Java Archive

 

Q.2)  Command which is used to see the details of compilation --

-->       Javac -verbose  Test.java

Q.3)  Select the keywords in java :

a) Assert            Keyword

b) transient       Keyword 

c) Script fp        Keyword      

d) instance of    Keyword   

e) finalize          Not Keyword


Q.4)  //   /* Nesting of comment  */    is it true in Java ?

--->   True.


Q.5)   Can we run the same java program on different enviroment  with same version of JDK ?

--->  No


Q.6) The compiler and other java development tool reside in  -----------  sub folder ?

--->   bin


Q.7) The library containing files needed to integrate java programs written in other languages reside inside following sub folder ------- ?

--->    include

 

Q.8) Java has ----  no. of primitive data types ?

-->   8   such as  byte,   short, int, long, char, float, double, boolean.

 


    


Virtual - Circuit - Switching

VIRTUAL - CIRCUIT - SWITCHING


 Virtual circuit switching is a combination of  Datagram switching and Circuit Switching. 

This type of switching includes some features of Datagram switching and some of Circuit Switching, I will try to explain u with a figure :

 

DATAGRAM                 Virtual-Circuit                  Circuit-Switching

         |                                     |                                              |

Network Layer             Data Link Layer                Physical Layer

Resource allocation             -------                       Resource allocation

Packetization                                                       Three Phases

 

Addressing  in Virtual - Circuit Switching :

 In the header section of Packet is local jurisdiction, not the end- to end jurisdiction.

There are 2 type of addresses used in Virtual Circuit Switching :

Global and Local address(VCI)

  Global Address : Source or destination needs to have a global add., a address that can be unique in the scope of the whole Network

Global address in VCN is used only to create VCI.

VCI ( Virtual Circuit Identifier ) : actually used for data transfer, a small number that has only switch scope.

 

 

 

 

 

 

Sunday 16 June 2013

Circuit Switching

Circuit Switching


Circuit Switching take place in Physical Layer.

In this type 2 network nodes establish a dedicated communication channel through the network before the nodes may communicate.

The  circuit guarantees the full bandwidth of the channel and remain connected for the duration of the communication session. The circuit function as if the nodes were physically connected .

In circuit switching a bit delay is constant.

There is no addressing involved during data transfer. The switches route the data based on their banwidth (FDM) or time slot (TDM) , Of course  end to end addressing used during set up phase. 

Three phases of circuit switching are:

  1.  Set-up phaseConnection is established between end points  before any communication. First end send the connection request and the second end send the acknowledgement in this phase.

  2.  Data Transfer Phase In this phase communication take place.

  3.  Tear-down phase : when one of the parties want to disconnect a signal is sent to each switch to leave the resources.

    EFFICIENCY :  This type of switching is not efficient.

    Delay But delay is minimal. There is no waiting time at each switch. Total delay is due to time needed to create connection, transfer data and  and disconnect circuit.

    Uses :

    Plain old telephone system (POTS) uses circuit switching.

    Original GSM is also based on circuit switching. But GPRS introduce packet switching in GSM network.






Monday 27 May 2013

SWITCHING

Some short questions about switching :

Q.1) Circuit Switching is used for 
           Physical layer

Q.2) A -------- n/w is made of a set of switches connected by physical link in which each link is devided into n channel.

==> Circuit Switched

Q.3) Simplest type of switching fabric is :
==> crossbar switch

Q.4) A ------ switch is a multistage switch with micro switches at each stage that route the packet based on the output port represented as a binary string
==> banyan 

Q.5)which address in the header part of a packet in a datagram n/w normally remain same during the entire journey of the packet?
==> destination address

Q.6) A switch in a datagram n/w uses a routing table that is based on  -------  ?
==>  destination address

Q.7) The network layer in the internet  is designed as a -----?
==>   datagram n/w

Q.8) In a ------- n/w two types of addressing are involved global and local ?
==>    virtual circuit n/w

Q.9) A switched wan is normally implemented as  a ------- n/w ?
==>  virtual circuit

Q.10) ARP is ---- ?
==>  Address Resolution Protocol
A tcp/ip protocol used to dynamically bind a high level ip address to a low level physical hardware address.

Q.11) Which of the following tcp/ip protocol is used for file transfer with minimal capability & minimal overhead ?
==>  TFTP

Q.12)  Ip address can be used to specify a broadcast & map to hardware broadcast if available, by conversion broadcast address has hosted with all bits ?
==>   1

Q.13)   How many class A,B & c networks ID's can exist ?
==> 2,113,658
    

 
     

Packet Switching In Computer Networking

Packet Switching In Computer Networking


PACKET SWITCHING  :  Packet Switching is a digital networking communication method that groups all transmitted data, regardless of content, type or structure in a suitably sized block called "Packet".

Packet switching features delivery of variable bit rate data stream over a shared network, when traversing network adapters, switches, routers etc.

Packets are buffered and queued, resulting in variable delay and throughput depending  on the traffic load in the N/W .

Best example of packet switching is Internet  and LAN.

Division of Packet Switching 

Circuit Switching            Packet Switching         Message Switching
  
  
Packet Switching

ConnectionLess                                              Connection Oriented
  (datagram)                                                        (virtual circuit)

 ConnnectionLess Packet Switching :

 All packets have header including all address information as source address, destination address and port number.
Each packet treated independently.
Connection less protocol are => Ethernet, Ip & Udp  

 Connection Oriented Packet Switching :

 A connection is defined and preallocate in each involve node during a connection phase before any packet is transferred.
All packet include connection ID rather than address info.
 Connection Oriented protocols are => x.25, frame-relay

X.25
It is a reliable protocol based on node to node automatic repeat request.  
 It is a network layer protocol.

Frame Relay :
 Non reliable protocol 
It is a further development of x.25, fast & more cost effective.
It is a data link layer protocol.
It does not provide logical address & routing , it is only used for semi-permanent connections. 

 



 

Search This Blog

Total Pageviews