Top 10 Networking Interview Questions and Answers
Top 10 Networking Interview Questions and Answers
Top 10 Networking Interview Questions and Answers
stack?
Answer -1: OSI stack has 7 layers while TCPIP has 5 layers. Presentation
and session do not exist in TCPIP stack. The idea here is to derive the
knowledge of functions of each of these layers. Let me brief the main
functions of each of these layers.
Layer-1(Physical layer): Takes care of providing reliable wired or wireless
connection, wired one will have voltage and current specifications. Wireless
one will have forward error connection, modulation techniques.
Layer-2(Data link or MAC layer): Takes care of providing peer to peer
reliable connection using addition of checksum or CRC. Also takes care of
incorporating Ethernet or MAC header with destination and source
addresses as well as length of the packet. Takes care of re-transmission of
erroneous packets.
Layer-3(IP layer): Takes care of routing the packet using ip address.
Layer-4(TCP or UDP layer): Takes care of multiplexing and DE multiplexing
of multiple applications. TCP is used for connection oriented and UDP for
connectionless system. Takes care of sequencing of received dis-ordered
packets.
Layer-5(session layer): Establishes, maintains and terminates the
connection. Helps in billing.
Layer-6(presentation layer): Used to communicate having systems with two
different syntax, such as EBCDIC and ASCII.
Layer-7(Application layer): Used to provide service to more than one
applications with the help of assigning unique port address of size 16 bits.
For example FTP has been assigned 23 and HTTP has been assigned
8080.
TCP vs UDP
Both protocols sit on layer-4(Transport layer) of the OSI layer just above
the IP layer.
Unlike TCP, UDP is connectionless and provides no reliability, no
windowing and no function to ensure data is received in the same order as
it was transmitted. However UDP provides some functionalities as
supported by UDP such as data transfer, multiplexing and has fewer bytes
of overhead in the data. This fewer bytes in the overhead makes UDP
protocol need less time in processing the packet and need less memory.
Also absence of acknowledgement field makes it faster as it need not have
to wait on ACK or need not have to hold data in memory until they are
ACKed.
LAN stands for Local Area Network, WAN stands for Wide Area Network
and MAN stands for Metropolitan Area Network. All the technologies are
mainly used for data communication.
LAN
LAN has smaller coverage range within the house or office premises or can
at least connect from one building to the nearby building.
CAN
WAN
WAN has coverage larger than LAN and used for data & cellular
applications, supporting both voice and data applications. Larger network
covering entire country or state is referred as WANs.
MAN
MAN occupies coverage in between LANs and WANs. MAN has distance
coverage and data rate higher than LAN, but less than WAN. This is the
major difference between LAN and MAN. MAN overlaps to some extent to
geographical coverage requirement of WAN. A typical example of MAN is
Local Cable TV system.
What is an IP Address?
It is a short form of Internet Protocol Address. This is very important
address which is used by any device (desktop, laptop, tablet, mobile, ipad)
to connect to the internet.
IP Address are of two types IPV4 and IPV6.
IPV4 is in use throughout the world and IPV6 is under trial. IP address is
the part of TCP/IP Protocol Suit and is very important to know.
IPV4 address is a 32 bit number. IP addresses are usually written in what is
called dotted decimal notation, with a decimal number representing each of
the octets of the 32-bit address. For example, the IP address 11000000
11100100 00010001 00111001 is written as 192.228.17.57.
There are four main classes. Class A, Class B, Class C and Class D.
Class A- 0, network(7 bits), host (24 bits)
Class B- 10, network(14 bits), host (16 bits)
Class C- 110, network(21 bits), host (8 bits)
Class D- 1110, rest of the bits are for multicast
Class E-11110,rest of the bits are for future us
For Class C, host id space is 8 bits long, 2 to the power 8 is 256 hence 256
hosts i.e. computers are supported in class C. Hence appropriate class is
selected based on need of networks and hosts. Remember initial decimal
digit i.e. first 8 bits to differentiate between these four classes i.e. network
ID.
For class A, network ID is from 0 to 127
For class B, network ID is from 128 to 191
For class C, network ID is from 192 to 223
For class D, network ID is from 224 to 239
For class E, network ID is from 240 to 255
arp -a
Above command lists out all the IP addresses and their physical addresses
attached to the system where command is issued.
Similarly "rarp" command is used to convert physical address to the IP
address.
"ipconfig/all" command is used to know physical address of the device.
Introduction :
A hub is a networking device which connects multiple Ethernet devices
based on twisted pair or fiber optic technology. Hence hub makes these
devices represent as a single network segment in a broad sense or in a
internet. Hubs works at layer 1 i.e. physical layer of OSI protocol stack. It is
basically form of multiport repeater.
In Hub based Ethernet network only one device can transmit at a time.
Here each host is responsible for collision detection/retransmission of
packet.
Passive Hub: This type of hub does not amplify or boost the signal. It does
not manipulate or view the traffic that crosses it. Passive hub does not
require electrical power to work.
Active Hub: It amplifies the incoming signal before passing it to the other
ports. It requires AC power to do the task.
Intelligent Hub: They are also called as smart hubs. It functions as active
hub and also include diagnostic capabilities. Intelligent hubs include
microprocessor chip and are very useful in troubleshooting conditions of
the network.
The port can connection Ethernet cables of various speed types viz. 10
Mbps, 100 Mbps depending upon support in the hubs.
Switch
Network switches are identical to network hubs, but a switch is more
intelligent than hub. Network switch inspects the packet, determine source
and destination address and route the packet accordingly. By way of
forwarding the packet to the appropriate device switches conserve
bandwidth significantly. Now-a-days network switches are available with
10/100/1000 Mbit/sec as well as 10/100 Gbit/s ports. It operates at layer 2
of OSI Stack. It is often recognized as multiport bridge.
There are 4 methods layer 2 switch uses as mentioned below to forward
the packet.
1. Store and Forward- In this method, it buffers and performs checksum on
each frame before forwarding.
2. Cut through- In this method, no error check is performed. Switch reads
up the frame's hardware address and forwards it.
3. Fragment Free- This method is combination of above two methods i.e.
Store and Forward and Cut through. This method checks first 64 bytes in
the frame which gives addressing information. This tells switch which is the
destination of the frame. Error checking is performed by layer 3 and 4
typically router of the end device.
4. Adaptive switching- A method to automate switching between the other 3
modes.
Network Bridge
The network bridge works at layer 2 i.e. data link layer of OSI model. It
connects multiple network segments at this layer. Bridge does not simply
broadcast traffic from one network segment to the other unlike hub/repeater
but also manages the traffic as mentioned below.
Bridges use bridge table to send frames across network segments. The
bridge table is initially empty. It is filled by bridge as it starts receiving
frames from nodes (computers) attached in the network segments. Bridge
table is also called forwarding database.
What is router?
This page describes what is router in networking, function of router with
ATM to LAN routing example.
A device used to link two or more networks. Router operates at OSI layer 3.
Internetworking among dissimilar sub networks is achieved by using
routers to interconnect the sub networks. It is essential that the router must
perform following functions.
As mentioned in above figure this router will have protocols up to Layer3 for
both ATM as well as LAN networks. This router takes care of both server
and work station communication with each other.
1. When TCP/IP packet comes from server to router, router will remove
ATM protocol headers and insert LAN compatible headers from Layer 1 to
Layer 3 and pass packet to LAN networks.
2. Similarly when TCP/IP packet comes from work station to router, router
will remove LAN protocol headers and insert ATM compatible headers from
Layer 1 to Layer 3 and pass packet to ATM networks.
Following figure describes protocols at ATM based server, LAN based work
station and protocols at router. This figure is taken from book by william
stallings as mentioned below to describe routing concept.
Today there are routers available for latest broadband technologies viz.
LTE, WiMAX and so on which takes care of interworking as explained to
make to different networks talk to each other.
Networking Gateway
From networking point of view Gateway is a device which provides
connectivity between two heterogeneous networks/systems to
communicate. This is done using protocol translation. Gateway embeds
both protocols of different systems in order to provide interoperability
functions. Gateway can provide interconnectivity between more than two
different systems also.
Firewall
Firewall is a hardware and/or software which checks all the inbound and
outbound packets from any system/LAN connected with internet mainly.
This helps prevent any unauthenticated connection being established or
prevent any spam/virus affecting the system/LAN. Different types of firewall
exist which can have any one of the following type or it may include more
than one combinations out of mentioned below.
Firewall types
Packet filter- This kind of firewall looks at each inbound and outbound
packets and is called IP spoofing.
Application gateway- This kind of firewall operates at application layer
and hence is applied to specific applications viz. FTP and Telnet based
client-server applications.
Circuit level gateway- This kind of firewall is active during a TCP or UDP
connection is being established. No check has been performed on packets
passed between systems, once TCP/IP or UDP/IP based connection is
established.
Proxy server- this kind of firewall basically checks all the
packets/messages into and out of the LAN/network. This type of firewall
works efficiently as it hides original/actual IP based network addresses.
Many of the firewalls use two or more of the above mentioned techniques.
Firewall Software
Following are the firewall software available which help prevent our system
from any unauthenticated attack.
1. COMODO Firewall
2. PC Tools Firewall Plus
3. ZoneAlarm Firewall
4. Ashampoo FireWall
5. Online Armor
6. Agnitum Outpost Firewall
7. Filseclab Personal Firewall Professional Edition
8. Sygate® Personal Firewall PRO
9. Symantec Norton Personal Firewall 2004
10. McAfee Personal Firewall Plus
Firewall Hardware manufacturers
ARP-RARP protocol
ARP is Address Resolution Protocol mainly used to determine Ethernet
address if IP address is known for a node in the network. RARP does
reverse of the ARP protocol, it determines IP address if Ethernet address is
known. Following table mentions ARP protocol fields for ARP request and
ARP response. ARP request is the broadcast packet sent to all the PCs.
PC whose IP address matches with the one sent in the broadcast packet
will respond back to the source PC of the packet with its Ethernet address
as needed.
Question -4: What is the difference between wired LAN and Wireless
LAN?
Answer -4:
The WLAN devices are based on The Ethernet LAN devices are
IEEE 802.11 family of standards. based on IEEE 802.3 standards.
Answer -5: Both router and gateway works at layer-3 i.e. networking layer
of OSI stack. Gateway interfaces two different set of protocols while router
interfaces same set of protocols.
Question -6: What is the function of TCP and UDP in the IP packets?
Question -7: Explain the difference between RIP and OSPF routing
protocols.
Answer -7: Both of these are routing protocols,
Router table will have destination IP address, next hop and router port
interface. There are different types of routers viz. core routers, exterior
routers and interior routers. These routers use different protocols and
algorithms to build the routing table.
Interior routers use Interior Gateway Protocol (IGP). Both RIP and OSPF
are examples of interior routing protocols. RIP stands for Routing
Information Protocol and OSPF stands for Open Shortest Path First
(OSPF). We will see difference between RIP and OSPF protocols below.
RIP is a distance vector protocol and OSPF is a link state protocol. RIP
determines optimal route for the packet to reach destination by hop count.
Let us see how RIP works.
In RIP participant routers are classified as active and passive. Active router
sends its routing table to the others and listens for their updates. Passive
router listens for updates from other participants but does not propagate its
own routing entries.
Initially OSPF can in place with RFC 1131 in the year 1989, later the
update OSPF ver.2 is described in RFC 2328.
Each router is assigned with router ID, here link state routers build internal
map of the network topology. Each router prepares network into tree format
after keeping itself at the root. This network tree is known as shortest path
tree.
Following table mentions difference between RIP and OSPF. Also refer
difference between various networking terminologies on the left side panel.
RIP OSPF
It is a distance vector
protocol It is a link state protocol
The metrics used in RIP is The metrics used in OSPF are bandwidth
hop count and delay
Question -8: What is IP address and Ethernet Address and what is the
size of them?
.
As we know that Source computer (i.e. host) must know Ethernet address
or physical address of the destination network adapter to send the IP data.
Hence ARP and RARP protocols are very important as they convert IP
address to the physical address and vice versa.
ARP stands for Address Resolution Protocol and RARP stands for Reverse
Address Resolution Protocol. ARP convert IP address to physical address
(i.e. Ethernet address). RARP convert physical address to the IP address.
Though these protocols are existing it is invisible to the user as TCP/IP
internally uses these protocols to send the IP packet from one computer to
the other connected on the network.
Each host on the network maintains ARP table. This table has entries of
physical address with respect to IP addresses of the other hosts on the
network segments. Whenever a host computer wants to send the data first
it checks the ARP table to see whether the Ethernet address is available. If
it is available it will use and send the data. If it is not available than it
broadcasts the ARP request to all the hosts and obtain the ARP response
from the host whose IP address matches as contained in the ARP request
message. This newly available details of IP address to physical address
mapping is then added to the ARP table or ARP cache. This is called
dynamic addition of the entry in ARP table.
ARP commands
RARP
Intranet
An intranet can host multiple private websites. Both uses www, SSL
protocols for web applications and SMTP, POP3 and IMAP protocols for
email applications.
Answer -12: It is very easy to install any router. As installation vary based
on routers from different manufacturers, one has to follow manual provided
by the supplier or manufacturer in order to set up the router.
Question-13: What is the difference between NAT and PAT?
Answer -13:
NAT stands for Network Address Translation and PAT stands for Port
Address Translation.
NAT
PAT
Say for example there are two computers trying for access to the internet.
As per PAT say computer 'A' tries to connect, this time computer-A will be
assigned with one port number and IP address. At this time another
computer B tries for the connection will be given the same local IP address
but the different port number. This way one can conserve the IP address
space by way of identifying the received packet with the use of port number
and local IP address. .
Answer -14: FTP is used as file transfer protocol. With this file can be send
or receive. HTTP is used for internet browsing. They have unique port
number assigned.
FTP handles both binary and text format files. URL syntax of FTP
protocol is described in RFC1738. The link starts with ftp as mentioned
below.
FTP EXAMPLE:
ftp://ftp.microsoft.com/Products/
HTTP PROTOCOL
TCP Port
Number 20 and 21 80 and 8080
RFC
reference RFC959, RFC765, RFC2616, RFC7230 and
documents RFC1738 RFC7231
Answer -15: In class-C IPV4, there are 8 bits reserved for hosts and hence
there will be 28 = 256 -2 =254 hosts can be assigned unique IP addresses.
We have subtracted 2 as one is reserved for broadcast address (all 1's)
and the other one (all 0's) for loop back testing.
IPV4 vs IPV6 | difference between IPV4 and IPV6
This page compares IPV4 vs IPV6 and describes difference between IPV4
and IPV6. The major difference between them is IPv4 uses 32 bit address
where as IPv6 uses 128 bit address.
Introduction:
IP is a layer-3 protocol in OSI stack. Packets are routed with the help of
destination address. The functions of IP are as follows:
• Connectionless best effort data delivery based on destination ip address.
• Fragmentation and re-assembly of datagrams to support links with
different MTUs (Maximum Transmission Units).
IPV4 is defined in RFC 791. Table-1 below mentions all the fields of IPV4
header with functional description.
IPV4 header
field Description
IHL(Header
length) datagram length in 32 bit words
Header
hecksum Requires for error detection at the destination host
Source
address Address of sending node
Destination
address Address of receiving node
Options Support various other options such as security etc.
IPV6
IPV6 has 128 bit IP address, which helps support one billion networks,
hence extends the drawbacks of IPV4 system. The figure depicts IPV6
header fields used in the IP protocol. IPv6 is defined in RFC 2460. Table-2
below mentions all the fields of IPV6 header with functional description.
IPV6 header
field Description
Payload
length(16 bit) Length of payload in bytes
Source
address(128 bit) Origin of IPv6 packet
Destination
address(128 bit) destination of IPv6 packet
IPv4 IPv6
IPv4 header contains IPv6 header contains 8-bit field called traffic class
8-bit field called field.
service type.
Security in IPv4
networks is limited to
tunneling between IPv6 has been designed to satisfy growing and
two networks. expanded need for network security.
Source and
destination
addresses are 32 bits Source and destination addresses are 128 bits in
in length. length.
IPsec support is
optional. IPsec support is required.
No identification of
packet flow for QoS
handled by routers is Packet flow identification for QoS handled by
present within IPv4 routers is included in IPv6 header using "flow label
header. field".
Must be configured
either manually or
through DHCP. Does not require manual configuration or DHCP.
"ICMP router
discovery" is used to
determine IPv4
address of the best "ICMP router discovery" is replaced with "ICMPv6
default gateway and router solicitation and router advertisement"
it is optional. message and it is required.
1. Simplex Mode
2. Half duplex Mode
3. Full duplex Mode
SIMPLEX Mode
In this type of transmission mode, data can be sent only in one direction i.e.
communication is unidirectional. We cannot send a message back to the sender.
Unidirectional communication is done in Simplex Systems where we just need to send a
command/signal, and do not expect any response back.
Examples of simplex Mode are loudspeakers, television broadcasting, television and
remote, keyboard and monitor etc.
In full duplex system there can be two lines one for sending the data and the other for
receiving data.