TCP/IP INTERVIEW QUESTIONS

1)What are the layers of the OSI(Open System InterConnection) model ?

  a)Application Layer
  b)Presentation Layer
  c)Session Layer
  d)Transport Layer
  e)Network Layer
  f)Data Link Layer
  g)Physical Layer

-----------------------------------------------------------------------------------------------------------

2)What are the layers of the TCP(Transmission Control Protocol)/IP(Internet Protocol) model ?

 a)Application Layer
  b)Transport Layer
  c)Internet Layer
  d)Network Layer

------------------------------------------------------------------------------------------------------------

3)What is Application Layer and Which Protocols work in Application Layer ?

 a)The application layer is present at the top of the TCP/IP model.
  b)It is the layer through which users Interact.
  c)It provides services to the user.
  d)FTP   (File Transfer Protocol)
    TFTP  (Trivial File Transfer Protocol)
    TELNET(Telecommunications Network)
    SMTP  (Simple Mail Transfer Protocol)
    DNS   (Domain Name Service)
    DHCP  (Dynamic HOst Configuration Protocol)
    HTTP  (Hyper Text Transfer Protocol)
    HTTPS (Hyper Text Transfer Protocol Secure)
    POP3  (Post Office Protocol Version 3)
    IMAP  (Internet Message Access Protocol)
    SSH   (Secure Socket Shell)
    NTP   (Network Time Protocol)

-----------------------------------------------------------------------------------------------------------

4)What is Transport Layer and Which Protocols work in Transport Layer ?

  a)Transport Layer is the second layer of the TCP/IP model.
  b)It is an end-to-end layer used to deliver messages to a host.
  c)To find the nature of Connectivity.
  d)TCP  (Transmission Control Protocol)
    UDP  (User Datagram Protocol)
    DCCP (Datagram Congestion Control Protocol)
    SCTP (Stream Control Transmission Protocol)

-------------------------------------------------------------------------------------------------------------


5)What is Internet Layer and which Protocols works in Internet Layer ?

  a)Internet Layer is the third layer of the TCP/IP model.
  b)It is responsible for logical transmission of data packets over the internet.
  c)It can be Compared to the network layer of the OSI model.
  d)IP   (Internet Protocol)
    ARP  (Address Resolution Protocol)
    RARP (Reverse Address Resolution Protocol)
    ICMP (Internet Control Message Protocol)
    IGMP (Internet Group Message Protocol)

-----------------------------------------------------------------------------------------------------------


6)What is Network Layer and Which Protocols work in Network Layer ?
   a)Network Access Layer is the last layer of the TCP/IP model.
   b)It is responsible for flow control,traffic control in a network.
   c)Ethernet  (802.3)
     Token Ring(802.4)
     Token Bus (802.5)
     WIFI      (802.11)

------------------------------------------------------------------------------------------------------------


7)Difference between OSI model and TCP/IP model ?
  
   a)It is developed by ISO(International Standard Organization)
     It is developed by ARPANET(Advanced Research Project Agency Network)
   b)OSI refers to Open Systems InterConnection.
     TCP refers to Transmission Control Protocol.
   c)OSI follows a Vertical approach.
     TCP/IP follows a horizontal approach.
   d)OSI  have seven layers.
     TCP/IP has four layers.
   e)OSI is Theoretical Existance.
     TCP/IP is Practical Existance.

-----------------------------------------------------------------------------------------------------------

8)Difference between FTP and TFTP ?

   a)FTP stands for File Transfer Protocol.
     TFTP Stands for Trivial File Transfer Protocol.
   b)FTP need authentication for communication.
     TFTP does not need authentication for communication.
   c)FTP is a Complex Protocol.
     TFTP is Simple Protocol.
   d)FTP works on two ports: 20 and 21
     TFTP  Works on 69 port number.
   e)Used to transfer multiple files at a time.
     Used to transfer one file at a time.

--------------------------------------------------------------------------------------------------------------

9)Difference between TCP and UDP ?

  a)TCP stands for Transmission Control Protocol.
    UDP stands for User Datagram Protocol.
  b)TCP works in Transport Layer.
    UDP also Works in Transport Layer.
  c)TCP is a Connection-Oriented Protocol.
    UDP is Connection less Oriented.
  d)TCP is Reliable Service.
    UDP is UnReliable Service.
  e)TCP is a Slower Process.
    UDP is Faster,Simpler and more efficient than TCP.
  f)TCP has a 20-60bytes variable length header.
    UDP has a 8 bytes fixed length header.
  g)Sequencing of data is a feature of TCP.
    There is no Sequencing of data in UDP.
  h)Retransmission of lost packets is possible in TCP,but not in UDP.
    There is no Retransmission of lost packets in UDP.
  i)TCP is heavy -Weight.
    UDP is light-Weight.
  j)TCP doesn't supports Broadcasting.
    UDP supports Broadcasting.
  k)HTTP,FTP,.....Uses the services of TCP.
    DHCP,TFTP,... Uses the services of UDP.

---------------------------------------------------------------------------------------------------------------

10)What is PDU and What are the PDU'S Of OSI model ?
   a)PDU stands for Protocol Data Unit.
   b)A PDU is a specifc block of information transferred over a network.
   c)It is often used in reference to the OSI model.
   d)It describes the different types of data that are transferred from each layer.
   e)The technical name in  each layer is PDU.
   f)Application layer  - Data    - The data received (or) Transmitted by a Software Application.
     Presentation layer - Data    - The data formatted for Presentation.
     Session layer      - Data    - The data passed to the network connection.
     Transport layer    - Segment - A segment that includes a TCP header and data.
     Network layer      - Packet  - A packet that contains the source and destination address.
     Data Link layer    - Frame   - A frame
     Physical layer     - Bits    - Raw bits transmitted physically via the hardware.

-----------------------------------------------------------------------------------------------------------

11)Difference between MAC Address and IP Address ?

  a)MAC Address stands for Media Access Control  Address.
    IP Address stands for Internet Protocol Address.
  b)MAC Address is a six byte hexadecimal address.
    IP Address is either four byte(IPV4) (or) six byte(IPV6) address.
  c)A device attached with MAC Address can retrieve by ARP Protocol.
    A device attached with IP Address can retrieve by RARP Protocol.
  d)NIC Card's Manufacturer provides the MAC Address.
    Internet service provider Provides IP Address.
  e)MAC Address is used to ensure the Physical address of computer.
    IP Address is logical address of the computer.


--------------------------------------------------------------------------------------------------------------

12)Difference between Static and Dynamic IP address ?

  a)It is provided by ISP.
    It is provided by DHCP.
  b)Static IP is fixed.
    Dynamic IP is not fixed.
  c)Static IP will never be changed.
    Dynamic IP will vary.
  d)Static IP address is more stable than Dynamic IP address.
    While Dynamic IP address is less stable than static ip address.
  e)The device designed by static ip address can be trace.
    But the device designed by dynamic ip address can't be trace.
  f)The cost to maintain the static ip address is higher than dynamic ip address.
    While the maintaining cost of dynamic ip address is less than static ip address.

--------------------------------------------------------------------------------------------------------------


13)Explain range of TCP/IP Classes.

IP Address Contains Network Address and Host Address.

CLASS A =   1 to 126
CLASS B = 128 to 191 
CLASS C = 192 to 223
CLASS D = 224 to 239(Multicasting)
CLASS E = 240 to 255(Research)

------------------------------------------------------------------------------------------------------------


14)what is Loopback Address ?

 The Loop back address is 127.0.0.1.This address is used to check local TCP/IP suite (or) local machine.

-------------------------------------------------------------------------------------------------------------

15)What are Private IP Address ?

Private IP are IPs which are not used in internet (or) which are not routable in Internet.They are also called as non-routable IP's.

CLASS A =    10.0.0.0  to  10.255.255.255
CLASS B =  172.16.0.0  to  172.31.255.255
CLASS C = 192.168.0.0  to 192.168.255.255


--------------------------------------------------------------------------------------------------------------

16)What is Subnet Mask ?
Subnet mask is used to differentiate Network ID and Host ID from a giVen IP address.
The default subnet mask are as under
CLASS A =     255.0.0.0
CLASS B =   255.255.0.0
CLASS C = 255.255.255.0

-------------------------------------------------------------------------------------------------------------

17)what are the notations of the Classful ip and Classless ip address?

classful ip  = 0-255.0-255.0-255.0255
Classless ip = 0-255.0-255.0-255.0-255/number


-------------------------------------------------------------------------------------------------------------

18)Name the two routing Protocols ?

RIP  - Routing Information Protocol
OSPF - Open Shortest path first

------------------------------------------------------------------------------------------------------------

19)What is DORA Process ?

 a)DORA is a Process which is used by DHCP in order to provide an IP address to hosts (or)
    client machine.
 b)DORA Process has four messages.
   1)Discover
   2)Offer
   3)Request
   4)Acknowledgment
  c)DORA is a sequence of messages of the DHCP process.
  d)The DHCP server and DHCP client exchanges some message and after that DHCP provides
       an IP address to DHCP client.

-------------------------------------------------------------------------------------------------------------------

20)What is DHCP?

Dynamic Host Configuration Protocol(DHCP) is a network Protocol that enables  a server to automatically assign an IP address to a computer from a defined range of numbers configured 
for a given network.

--------------------------------------------------------------------------------------------------------------

21)What ports are used by DHCP and the DHCP Clients ?

Requests are on UDP port  68
Serve replies on UDP port 67

-------------------------------------------------------------------------------------------------------------


22)What is Topology ?

 a)Geometric representation of how the computers are connected to each other is known as topology.
 b)Topology is a method of connecting the systems in a network.

---------------------------------------------------------------------------------------------------------------

23)What are the different types of Topology in computer networks ?

 a)Bus    Topology
 b)Star   Topology
 c)Ring   Topology
 d)Mesh   Topology
 e)Hybrid Topology


---------------------------------------------------------------------------------------------------------------

24)What are the Network Devices ?

 a)Repeater
 b)Hub
 c)Switch
 d)Bridge
 e)Router
 f)Gateway

----------------------------------------------------------------------------------------------------------------


25)Explain about Repeater ?

 a)Repeaters are network devices operating at physical layer of the OSI model that amplify  (or)              regenerate an incoming signal before retransmitting it.
 b)They are incorporated in networks to expand its coverage area.
 c)They are also known as signal boosters.
 d)Repeaters are used to extend the LAN.
 e)Repeaters do not amplify the signal.
 f)When the signal becomes weak,they copy the signal bit by bit and regenerate it at the original strength.
 g)It is a  2 port device.
 h)It is not an Intelligent device.


------------------------------------------------------------------------------------------------------------------

26)Explain about Hub ?

 a)A Hub is basically a multiport repeater.
 b)A Hub is a layer-1 device and operates only in the physical network of the OSI model.
 c)It Mainly deals with the data in the form of bits (or) electrical signals.
 d)A Hub is mainly used to create a network and connect devices on the same network only.
 e)A Hub is connected in limited network size.
 f)It is not an Intelligent device.


---------------------------------------------------------------------------------------------------------------


27)Explain about Switch ?

 a)A Switch is a layer-2 network connecting device.
 b)It works on the Physical and data-link layer of the OSI Model.
 c)It interprets data in the form of bits.
 d)It acts as a multiport bridge in the network.
 e)A switch maintains a switch table which has the MAC addresses of all the devices connected toit.
 f)It can connect the devices only in the same network.
 g)It is an Intelligent device.
 h)It is used to connect multiple systems with in a network.


-------------------------------------------------------------------------------------------------------------------


28)Explain about Bridge ?

 a)A Bridge operates at data link layer.
 b)Bridge is used to connect two different networks.
 c)It Interprets data in the form of data frame.
 d)In the Physical layer,the bridge acts a repeater which regenerates the weak signals,while in the data-link layer,it checks the MAC address of the data frame for its transmission.
 e)It Connects the devices which are present in the same network.
 f)Bridge is a Repeater with filtering capability.
 g) It is an Intelligent device.


------------------------------------------------------------------------------------------------------

29)Explain about Router ?
 a)A Router is a layer-3 network Connecting device.
 b)It works on the Physical,Data-Link and Network Layer of the OSI Model.
 c)It Interprets data in the form of data packets.
 d)It is an Internet working device,which can connect devices of different networks.
 e)Router is the Gateway of a network.
 f) A router maintains a routing table using the routing algorithms.
 g)It is an Intelligent device.
 h)TO find the shortest path,to the destination in router RIP protocol is configured.
 i)To convert public IP to Private IP and Private IP to Public IP.In router NAT protocol is Configured.
j)In routers also OS is Installed for Multitasking Purpose.

--------------------------------------------------------------------------------------------------------

30)Explain about Gateway ?

 a)A Gateway Operates at Application Layer.
 b)Gateway is used to connect two different nature of Networks.
 c)It is a passage to connect two networks together that may work upon different networking models.
 d)They are also called as Protocol Converters and can Operate at any network layer.
 e)Generally more complex than switch (or) router.

--------------------------------------------------------------------------------------------------------

31)What is Socket Programming ?
           
                    Socket programs are used to communicate between various processes usually
running on different systems.It is mostly used to create a client-server communication.

-----------------------------------------------------------------------------------------------------------

32)What is network port number ?

         A port number is a way to identify a specific process to which an internet (or) other
network message is to be forwarded when it arrives at a server.

------------------------------------------------------------------------------------------------------------

33)Difference between a port and socket ?

       A socket represents a single connection between two network applications.

       A Port represents an endpoint (or) channel for network communications.

--------------------------------------------------------------------------------------------------------------

34)List out the functions used by server in tcp ?

   1)socket()

   2)bind()

   3)listen()

   4)accept()

   5)read()

   6)write()

   7)close()

-----------------------------------------------------------------------------------------------------------

35)List out the functions used by client in tcp ?


 1)socket()

 2)connect()

3)write()

4)read()

5)close()

----------------------------------------------------------------------------------------------------------------

36)Explain the following socket calls in detail with syntax ?

  1)socket() 
  2)bind()
  3)listen()
  4)accept()
  5)connect()
------------

1)socket()

    socket() creates an endpoint for communication and returns a file descriptor to the
    calling process.

syntax:  int socket(int domain,int type,int protocol);

--------------

2)bind()

     bind()  is a system call that binds a socket to an address.

syntax: int bind(int sockfd,const structsockaddr*addr,socklen_t addrlen);

----------------

3)listen()

    This call allow a process to listen on socket for communication.

syntax: int listen(int sockfd,int backlog);

backlog=no of connections

------------------

4)accept()
   
     It is a system call that causes the process to block until the client connects to the sever.


syntax : int accept(int sockfd,struct sock addr* addr,socklen_t *addrlen);

-------------------

5)connect()

   It is a function used by client to establish a connection to the sever.

  syntax :int connect(int sockfd,const struct sockaddr *addr,socklen_t *addrlen);

-------------------------------------------------------------------------------------------------------------------

37)What is  NIC ?

 NIC stands for Network Interface card.It is also known as Network Adapter (or) Ethernet card.
 It is in the form of an add-in card and is installed on a computer so that computer can be
 connected to a network.

 Each NIC has a MAC address which helps in identifying the computer on a network.

--------------------------------------------------------------------------------------------------------------------

38)What is Round Trip Time ?

    Round Trip Time is the duration in milliseconds it takes for a network request to go from
    a starting point to a destination and back again to the starting point.

   RTT is the time it takes a packet to go from source to destination and back to the source.
   In TCP the time to acknowledge the packet is added.A user can determine RTT by using the
   ping command.

--------------------------------------------------------------------------------------------------------------------

39)What are Ipconfig and If config ?

      Ipconfig stands for Internet Protocol Configuration and this command is used on
      Microsoft windows to view and configure the network interface.
   
      The command ipconfig is useful for dispalying all TCP/IP network summary information
      currently available on  a network.It also helps to modify the DHCP protocol and DNS
       setting.

       if config stands for Interface Configuration and this command is used on Linux,Mac,and
       UNIX operating system.It is used to configure,control the TCP/IP network Interface
        parameters from command line inetrface.It allows you to see the IP addresses of these
        network interfaces.

----------------------------------------------------------------------------------------------------------------------

40)What is Network ?

       A set of computers (or) devices connected together with a communication path
       to share data.

-------------------------------------------------------------------------------------------------------------------

41)What is Networking ?

          The design and construction of a network are termed as Networking.

--------------------------------------------------------------------------------------------------------------------

42)What is Link ?

       The communication path through which the devices are connected in a network is called
        a Link.

--------------------------------------------------------------------------------------------------------------------

43)What is Node ?

       The devices connected to the links are named as Nodes.

--------------------------------------------------------------------------------------------------------------------

44)What is Protocol ?

      A set of instructions (or) rules (or) guidelines that are used in establishing communications
      between computers of a network is called protocol.

--------------------------------------------------------------------------------------------------------------------

45)What is Broadcasting ?

     Sending a packet to each device of the network is termed as broadcasting.

------------------------------------------------------------------------------------------------------------------

46)What is meant by Hop Count ?

      In Networking, Hop Count is the  total number of intermediate devices such as routers
      through which a given piece of data must pass between  the source and destination,
     instead of flowing directly over a single wire.Along the data path,each routers forms a hop
      with data moving from one source to another.

---------------------------------------------------------------------------------------------------------------------

47)What is IP Address ?

 IP Address is an address of your network hardware.It helps in connecting your computer
 to other devices on your network and all over the world.An IP Address is made up of
 numbers (or) characters.
---------------------------------------------------------------------------------------------------------------------


48)What are Applications of TCP and UDP ?

1)World Wide Web,E-mail,Whatsapp,NetFlix,Youtube,Skype Uses TCP.

2)Online Gaming,Video Conference Uses UDP.


---------------------------------------------------------------------------------------------------------------------