Computer Networks - Most Asked Interview Questions
Computer Networks - Most Asked Interview Questions
QUESTIONS COVERED: -
1. Explain TCP model 14.What is Cryptography and
2. Name layers of the OSI what are the Encryption
Model with protocols Methods?
belonging to the layers 15.What are the Application
3. What is the significance of layer protocols?
Data Link Layer 16.Explain DNS
4. What is Access Point? 17.What happens when you
5. What does the network type URL in your browser?
layer do 18.Explain server-side load
6. In which layer are the balancer
Routers? 19.What is FTP? How is FTP
7. What are the different types different from Secure FTP?
of delays? 20.What is SMTP
8. Explain Firewalls? 21.Explain the Working of
9. What are the different types HTTP and HTTPs
of firewall? 22.Where are ports? What are
10.What does transport layer the Port numbers of some
do? common protocols?
11.Differentiate between IPv4 23.How to prevent SYN DDoS
and IPv6 attack?
12.Difference between Private
and Public IP addresses
13.Explain in detail 3 way
Handshaking
1. Process/Application Layer
2. Host-to-Host/Transport Layer
3. Internet Layer
4. Network Access/Link Layer
1. Network Access Layer This layer corresponds to the combination of the Data Link
Layer and Physical Layer of the OSI model. It looks out for hardware addressing and
the protocols present in this layer allows for the physical transmission of data.
We just talked about ARP being a protocol of Internet layer, but there is a conflict
about declaring it as a protocol of Internet Layer or Network access layer. It is
described as residing in layer 3, being encapsulated by layer 2 protocols.
2. Internet Layer This layer parallels the functions of OSI's Network layer. It defines
the protocols which are responsible for the logical transmission of data over the
entire network. The main protocols residing at this layer are :
2. ARP - stands for Address Resolution Protocol. Its job is to find the hardware
address of a host from a known IP address. ARP has several types: Reverse
ARP, Proxy ARP, Gratuitous ARP and Inverse ARP.
4. Process Layer This layer performs the functions of the top three layers of the OSI
model: Application, Presentation and Session Layer. It is responsible for node-to-
node communication and controls user-interface specifications. Some of the
protocols present in this layer are HTTP, HTTPS, FTP, TFTP, Telnet, SSH, SMTP,
SNMP, NTP, DNS, DHCP, NFS, X Window, LPD. Have a look at Protocols in
Application Layer for some information about these protocols. Protocols other than
those present in the linked article are :
0. HTTP and HTTPS - HTTP stands for Hypertext transfer protocol. It is used
by the World Wide Web to manage communications between web
browsers and servers. HTTPS stands for HTTP-Secure. It is a combination of
HTTP with SSL(Secure Socket Layer). It is efficient in cases where the
browser need to fill out forms, sign in, authenticate and carry out bank
transactions.
1. SSH - SSH stands for Secure Shell. It is a terminal emulations software
similar to Telnet. The reason SSH is more preferred is because of its ability
to maintain an encrypted connection. It sets up a secure session over a
TCP/IP connection.
2. NTP - NTP stands for Network Time Protocol. It is used to synchronize the
clocks on our computer to one standard time source. It is very useful in
situations like bank transactions. Assume the following situation without the
presence of NTP. Suppose you carry out a transaction, where your computer
reads the time at 2:30 PM while the server records it at 2:28 PM. The server
can crash very badly if it's out of sync.
The packet received from the Network layer is further divided into frames
depending on the frame size of NIC(Network Interface Card). DLL also encapsulates
Sender and Receiver’s MAC address in the header.
1. Framing: Framing is a function of the data link layer. It provides a way for a
sender to transmit a set of bits that are meaningful to the receiver. This can
be accomplished by attaching special bit patterns to the beginning and end
of the frame.
1. Routing: The network layer protocols determine which route is suitable from
source to destination. This function of network layer is known as routing.
2. Logical Addressing: In order to identify each device on internetwork
uniquely, network layer defines an addressing scheme. The sender &
receiver’s IP address are placed in the header by network layer. Such an
address distinguishes each device uniquely and universally.
1. Transmission Delay
2. Propagation Delay
3. Queuing Delay
4. Processing Delay
1. Transmission Delay :
Time taken to put a packet onto link. In other words, it is simply time required
to put data bits on the wire/communication medium. It depends on length of
packet and bandwidth of network.
2. Propagation delay : Time taken by the first bit to travel from sender to
receiver end of the link. In other words, it is simply the time required for bits
to reach the destination from the start point. Factors on which Propagation
delay depends are Distance and propagation speed.
3. Queuing Delay : Queuing delay is the time a job waits in a queue until it can
be executed. It depends on congestion. It is the time difference between
when the packet arrived Destination and when the packet data was
processed or executed. It may be caused by mainly three reasons i.e.
originating switches, intermediate switches or call receiver servicing
switches.
6. L=size of packet
7. R=bandwidth
A firewall establishes a barrier between secured internal networks and outside untrusted
network, such as the Internet.
1. Segmentation and Reassembly: This layer accepts the message from the
(session) layer , breaks the message into smaller units . Each of the segment
produced has a header associated with it. The transport layer at the
destination station reassembles the message.
2. Service Point Addressing: In order to deliver the message to correct process,
transport layer header includes a type of address called service point
address or port address. Thus by specifying this address, transport layer
makes sure that the message is delivered to the correct process.
Public IP address of a system is the IP address which is used to communicate outside the
network. Public IP address is basically assigned by the ISP (Internet Service Provider).
Private IP addresses of the systems connected in a network Public IP may differ in uniform or non-
differ in a uniform manner. uniform manner.
Private IP can be known by entering “ipconfig” on command Public IP can be known by searching “what is
prompt. my ip” on google.
Range:
10.0.0.0 – 10.255.255.255,
Range:
Besides private IP addresses, rest are public.
172.16.0.0 – 172.31.255.255,
192.168.0.0 – 192.168.255.255
Example: 192.168.1.10 Example: 17.5.7.8
2. FTP:
FTP stands for file transfer protocol. It is the protocol that actually lets us transfer
files.It can facilitate this between any two machines using it. But FTP is not just a
protocol but it is also a program.FTP promotes sharing of files via remote
computers with reliable and efficient data transfer. Port number for FTP is 20 for
data and 21 for control.
Command
ftp machinename
Command
tftp [ options... ] [host [port]] [-c command]
4. NFS:
It stands for network file system.It allows remote hosts to mount file systems over a
network and interact with those file systems as though they are mounted locally.
This enables system administrators to consolidate resources onto centralized
servers on the network.
Command
service nfs start
5. SMTP:
It stands for Simple Mail Transfer Protocol. It is a part of the TCP/IP protocol. Using
a process called "store and forward," SMTP moves your email on and across
networks. It works closely with something called the Mail Transfer Agent (MTA) to
send your communication to the right computer and email inbox. Port number for
SMTP is 25.
Command
MAIL FROM:<[email protected]?
6. LPD:
It stands for Line Printer Daemon.It is designed for printer sharing.It is the part that
receives and processes the request. A "daemon" is a server or agent.
Command
lpd [ -d ] [ -l ] [ -D DebugOutputFile]
7. X window:
It defines a protocol for the writing of graphical user interface–based client/server
applications. The idea is to allow a program, called a client, to run on one computer.
It is primarily used in networks of interconnected mainframes.
Command
Run xdm in runlevel 5
9. DNS:
It stands for Domain Name Service. Every time you use a domain name, therefore, a
DNS service must translate the name into the corresponding IP address. For
example, the domain name www.abc.com might translate to 198.105.232.4.
Port number for DNS is 53.
Command
ipconfig /flushdns
10. DHCP:
It stands for Dynamic Host Configuration Protocol (DHCP).It gives IP addresses to
hosts.There is a lot of information a DHCP server can provide to a host when the
host is registering for an IP address with the DHCP server. Port number for DHCP is
67, 68.
Command
clear ip dhcp binding {address | * }
Explain DNS
DNS is a hostname to IP address translation service. DNS is a distributed database
implemented in a hierarchy of name servers. It is an application layer protocol for
message exchange between clients and servers.
Requirement
Every host is identified by the IP address but remembering numbers is very difficult
for the people and also the IP addresses are not static therefore a mapping is
required to change the domain name to IP address. So DNS is used to convert the
domain name of the websites to their numerical IP address.
Organization of Domain
It is very difficult to find out the IP address associated with a website because there
are millions of websites and with all those websites we should be able to generate
the IP address immediately,
there should not be a lot of delay for that to happen organization of database is
very important.
DNS record – Domain name, IP address what is the validity?? what is the time to
live ?? and all the information related to that domain name. These records are
stored in a tree-like structure.
The host request the DNS name server to resolve the domain name. And the name
server returns the IP address corresponding to that domain name to the host so that
the host can future connect to that IP address.
Top level server – It is responsible for com, org, edu etc and all top level country
domains like uk, fr, ca, in etc. They have info about authoritative domain servers and
know names and IP addresses of each authoritative name server for the second
level domains.
The client machine sends a request to the local name server, which , if root does not
find the address in its database, sends a request to the root name server , which in
turn, will route the query to an intermediate or authoritative name server. The root
name server can also contain some hostName to IP address mappings . The
intermediate name server always knows who the authoritative name server is. So
finally the IP address is returned to the local name server which in turn returns the
IP address to the host.
Both of the above approaches look good, but they require additional state information to be
maintained for load balancing. Following is a simple approach that works better than the
above approaches.
Analysis of above Random Approach Let us analyze the average load on a server when
the above approach of randomly picking server is used.
Rij is Tj if j'th job (or Jj) is assigned to Si, otherwise 0. Therefore, value of Rij is Tj with
probability 1/n and value is 0 with probability (1-1/n)
=
= (Total Load)/n
What is the possibility of deviation from average (A particular server gets too much
load)? The average load from above random assignment approach looks good, but there
may be a possibility that a particular server becomes too loaded (even if the average is ok).
It turns out that the probability of deviation from average is also very low (can be proved
using Chernoff bound). Readers can refer below reference links for proves of deviations. For
example, in MIT video lecture, it is shown that if there are 2500 requests per unit time and
there are 10 servers, then the probability that any particular server gets 10% more load is
at most 1/16000. Similar results are shown at the end of the second reference also.
So above simple load balancing scheme works perfectly. In-fact this scheme is used in load
balancers.
SFTP stands for Secure File Transfer Protocol. It is a protocol which provides the secure
channel, to transfer or copies the file from one host to another host or systems. SFTP
establishes the control connection under SSH protocol and It is used in port no-22.
There are some difference between them which are given below:
S.NOFTP SFTP
1. FTP stands for File Transfer Protocol. SFTP stands for Secure File Transfer Protocol.
In FTP, secure channel is not provided to transfer In SFTP, secure channel is provided to transfer
2.
the files between the hosts. the files between the hosts.
FTP (File transfer protocol) usually runs on port no- SFTP (Secure File Transfer Protocol) runs on port
4.
21. no-22.
FTP establishes the connection under TCP SFTP establishes the control connection under
5.
protocol. SSH protocol.
6. FTP do not encrypt the data before sending. SFTP, data is encrypted before sending.
What is SMTP
Email is emerging as one of the most valuable services on the internet today. Most
of the internet systems use SMTP as a method to transfer mail from one user to
another. SMTP is a push protocol and is used to send the mail whereas POP (post
office protocol) or IMAP (internet message access protocol) are used to retrieve
those emails at the receiver’s side.
SMTP Fundamentals SMTP is an application layer protocol. The client who wants
to send the mail opens a TCP connection to the SMTP server and then sends the
mail across the connection. The SMTP server is the always-on listening mode. As
soon as it listens for a TCP connection from any client, the SMTP process initiates a
connection on that port (25). After successfully establishing the TCP connection the
client process sends the mail instantly.
Communication between sender and the receiver : The senders, user agent
prepare the message and send it to the MTA. The MTA functioning is to transfer the
mail across the network to the receivers MTA. To send mail, a system must have
the client MTA, and to receive mail, a system must have a server MTA.
RECEIVING EMAIL: The user agent at the server-side checks the mailboxes at a
particular time of intervals. If any information is received it informs the user about
the mail. When the user tries to read the mail it displays a list of emails with a short
description of each mail in the mailbox. By selecting any of the mail user can view
its contents on the terminal.
• HELO - Identifies the client to the server, fully qualified domain name, only
sent once per session
• MAIL - Initiate a message transfer, fully qualified domain of originator
• RCPT - Follows MAIL, identifies an addressee, typically the fully qualified
name of the addressee and for multiple addressees use one RCPT for each
addressee
• DATA - send data line by line
In short, both of these are protocols using which the information of a particular
website is exchanged between Web Server and Web Browser. But what’s difference
between these two? Well, extra s is present in https and that makes it secure! What
a difference :) A very short and concise difference between http and https is
that https is much more secure compared to http.
Also, another syntactic difference between http and https is that http uses default
port 80 while https uses default port 443. But it should be noted that this security
in https is achieved at the cost of processing time because Web Server and Web
Browser needs to exchange encryption keys using Certificates before actual data can
• In HTTP, URL begins with “http://” whereas URL starts with “https://”
• HTTP uses port number 80 for communication and HTTPS uses 443
• HTTP is considered to be unsecure and HTTPS is secure
• HTTP Works at Application Layer and HTTPS works at Transport Layer
• In HTTP, Encryption is absent and Encryption is present in HTTPS as
discussed above
• HTTP does not require any certificates and HTTPS needs SSL Certificates
• We can connect external devices to the computer with the help of ports and
cables.
• These are basically slots on mother board where we connect external
devices or we can plugged in external devices through cables.
• Mouse, keyboards, printers, speakers are some of the example of external
devices that connected to the computer through ports.
2. Rate limiting Rate limiting involves controlling the rate of traffic that is sent
or received by a network interface. It is efficient in reducing the pace of web
scrapers as well as brute-force login efforts. But, just rate limiting is unlikely
to prevent compound DDoS attacks.
HIMANSHU KUMAR(LINKEDIN)
https://www.linkedin.com/in/himanshukumarmahuri
CREDITS- INTERNET.
DISCLOSURE- ALL THE DATA AND IMAGES ARE TAKEN FROM GOOGLE AND INTERNET.