CN QB Solution

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Practice Questions solution

Computer Networks

1. What are the applications of Network?


 Resource Sharing
Resource sharing is an application of a computer network. Resource sharing
means you can share one Hardware and Software among multiple users.
Hardware includes printers, Disks, Fax Machines, etc. Computing devices. And
Software includes Atom, Oracle VM Virtual Box, Postman, Android Studio,
etc.

 Information Sharing
Using a Computer network, we can share Information over the network, and
it provides Search capabilities such as WWW. Over the network, a single
information can be shared among the many users over the internet.

 Communication
Communication includes email, calls, message broadcast, electronic funds
transfer system etc.

 Entertainment Industry
In Entertainment industry also uses computer networks widely. Some of the
Entertainment industries are Video on demand, Multiperson real-time
simulation games, movie/TV programs, etc.

 Access to Remote Databases


Computer networks allow us to access the Remote Database of the various
applications by the end-users. Some applications are Reservation for Hotels,
Airplane Booking, Home Banking, Automated Newspaper, Automated Library
etc.

 Home applications
There are many common uses of the computer network are as home
applications. For example, you can consider user-to-user communication,
access to remote instruction, electronic commerce, and entertainment.
Another way is managing bank accounts, transferring money to some other
banks, paying bills electronically. A computer network arranges a robust
connection mechanism between users.

 Mobile users
The rapidly growing sectors in computer applications are mobile devices like
notebook computers and PDAs (personal digital assistants). Here mobile
users/device means portable device. The computer network is widely used in
new-age technology like smartwatches, wearable devices, tablets, online
transactions, purchasing or selling products online, etc.

 Social media
Social media is also a great example of a computer network application. It
helps people to share and receive any information related to political, ethical,
and social issues.

2. Differentiate between connection oriented and connectionless services.


3. Define topology. List advantages and disadvantages of various
topologies.
A network topology refers to the way in which nodes in a network are
connected to one another. The network structure defines how they communicate.
Each kind of arrangement of the network nodes has its own advantages and
disadvantages. Here we tell you about the same.
Network topologies describe the ways in which the elements of a network
are connected. They describe the physical and logical arrangement of network
nodes.

Bus Topology

 Advantages of Bus Topology


o It is easy to set up, handle, and implement.
o It is best-suited for small networks.
o It costs very less.
 Disadvantages of Bus Topology
o The cable length is limited. This limits the number of network nodes
that can be connected.
o This network topology can perform well only for a limited number of
nodes. When the number of devices connected to the bus increases,
the efficiency decreases.
o It is suitable for networks with low traffic. High traffic increases load
on the bus, and the network efficiency drops.
o It is heavily dependent on the central bus. A fault in the bus leads to
network failure.
o It is not easy to isolate faults in the network nodes.
Ring Topology
o Advantages of Ring Topology
 The data being transmitted between two nodes passes through all the
intermediate nodes. A central server is not required for the
management of this topology.
 The traffic is unidirectional and the data transmission is high-speed.
 In comparison to a bus, a ring is better at handling load.
 The adding or removing of network nodes is easy, as the process
requires changing only two connections.
 The configuration makes it easy to identify faults in network nodes.
 In this topology, each node has the opportunity to transmit data.
Thus, it is a very organized network topology.
 It is less costly than a star topology.
o Disadvantages of Ring Topology
 The failure of a single node in the network can cause the entire
network to fail.
 The movement or changes made to network nodes affect the entire
network’s performance.
 Data sent from one node to another has to pass through all the
intermediate nodes. This makes the transmission slower in
comparison to that in a star topology. The transmission speed drops
with an increase in the number of nodes.
 There is heavy dependency on the wire connecting the network nodes
in the ring.
Mesh Topology
o Advantages of Mesh Topology
 The arrangement of the network nodes is such that it is possible to
transmit data from one node to many other nodes at the same time.
 The failure of a single node does not cause the entire network to fail
as there are alternate paths for data transmission.
 It can handle heavy traffic, as there are dedicated paths between any
two network nodes.
 Point-to-point contact between every pair of nodes, makes it easy to
identify faults.
o Disadvantages of Mesh Topology
 The arrangement wherein every network node is connected to every
other node of the network, many connections serve no major
purpose. This leads to redundancy of many network connections.
 A lot of cabling is required. Thus, the costs incurred in setup and
maintenance are high.
Star Topology
o Advantages of Star Topology
 Due to its centralized nature, the topology offers simplicity of
operation.
 It also achieves isolation of each device in the network.
 Adding or removing network nodes is easy, and can be done without
affecting the entire network.

Due to the centralized nature, it is easy to detect faults in the network


devices.
 As the analysis of traffic is easy, the topology poses lesser security
risk.
 Data packets do not have to pass through many nodes, like in the case
of a ring network. Thus, with the use of a high-capacity central hub,
traffic load can be handled at fairly decent speeds.
o Disadvantages of Star Topology
 Network operation depends on the functioning of the central hub.
Hence, central hub failure leads to failure of the entire network.
 Also, the number of nodes that can be added, depends on the
capacity of the central hub.
 The setup cost is quite high

4. Define protocol.
A network protocol is a set of established rules that specify how to format,
send and receive data so that computer network endpoints, including computers,
servers, routers and virtual machines, can communicate despite differences in their
underlying infrastructures, designs or standards.
To successfully send and receive information, devices on both sides of a
communication exchange must accept and follow protocol conventions. In
networking, support for protocols can be built into the software, hardware or both.
Without network protocols, computers and other devices would not know
how to engage with each other. As a result, except for specialty networks built
around a specific architecture, few networks would be able to function, and the
internet as we know it wouldn't exist. Virtually all network end users rely on network
protocols for connectivity.

5. What is transmission media? What are its types?


Transmission media is a communication channel that carries the information
from the sender to the receiver. Data is transmitted through the electromagnetic
signals.
The main functionality of the transmission media is to carry the information
in the form of bits through LAN(Local Area Network).
It is a physical path between transmitter and receiver in data communication.
6. Explain Fiber Optic cable with advantages and disadvantages
Advantages
 Light weight , Immune to electrical and magnetic interference.
 Highly suitable for long distance and industrial environments.
 Secure transmission, resistance to corrosive materials.
 Used for broadband transmission.
Disadvantages

 Installation and maintenance is difficult.


 Connecting two fibers together is a difficult process.
Because of noise immunity, they are virtually impossible to tap.
 Propagation of light is unidirectional.
 Most expensive.

7. State and explain the functionalities of Network Layer


 Implements routing of frames (packets) through the network.
 Defines the most optimum path the packet should take from the source to
the destination
 Defines logical addressing so that any endpoint can be identified.
 Handles congestion in the network.
 Facilitates interconnection between heterogeneous networks
(Internetworking).
 The network layer also defines how to fragment a packet into smaller packets
to accommodate different media.

8. List the functions of Internetworking devices and specify the layer in


which it works.
Network Devices: Network devices, also known as networking hardware, are
physical devices that allow hardware on a computer network to
communicate and interact with one another. For example Repeater, Hub,
Bridge, Switch, Routers, Gateway, Brouter, and NIC, etc.
o Repeater – A repeater operates at the physical layer. Its job is to regenerate
the signal over the same network before the signal becomes too weak or
corrupted to extend the length to which the signal can be transmitted over
the same network. An important point to be noted about repeaters is that
they not only amplify the signal but also regenerate it. When the signal
becomes weak, they copy it bit by bit and regenerate it at its star topology
connectors connecting following the original strength. It is a 2-port device.

o Hub – A hub is a basically multi-port repeater. A hub connects multiple wires


coming from different branches, for example, the connector in star topology
which connects different stations. Hubs cannot filter data, so data packets
are sent to all connected devices. In other words, the collision domain of all
hosts connected through Hub remains one. Also, they do not have the
intelligence to find out the best path for data packets which leads to
inefficiencies and wastage.

o Bridge – A bridge operates at the data link layer. A bridge is a repeater, with
add on the functionality of filtering content by reading the MAC addresses of
the source and destination. It is also used for interconnecting two LANs
working on the same protocol. It has a single input and single output port,
thus making it a 2 port device.

o Switch – A switch is a multiport bridge with a buffer and a design that can
boost its efficiency(a large number of ports imply less traffic) and
performance. A switch is a data link layer device. The switch can perform
error checking before forwarding data, which makes it very efficient as it
does not forward packets that have errors and forward good packets
selectively to the correct port only. In other words, the switch divides the
collision domain of hosts, but the broadcast domain remains the same.

o Routers – A router is a device like a switch that routes data packets based on
their IP addresses. The router is mainly a Network Layer device. Routers
normally connect LANs and WANs and have a dynamically updating routing
table based on which they make decisions on routing the data packets. The
router divides the broadcast domains of hosts connected through it.

o Gateway – A gateway, as the name suggests, is a passage to connect two


networks that may work upon different networking models. They work as
messenger agents that take data from one system, interpret it, and transfer it
to another system. Gateways are also called protocol converters and can
operate at any network layer. Gateways are generally more complex than
switches or routers. A gateway is also called a protocol converter.

o Router – It is also known as the bridging router is a device that combines


features of both bridge and router. It can work either at the data link layer or
a network layer. Working as a router, it is capable of routing packets across
networks and working as the bridge, it is capable of filtering local area
network traffic.
o NIC – NIC or network interface card is a network adapter that is used to
connect the computer to the network. It is installed in the computer to
establish a LAN. It has a unique id that is written on the chip, and it has a
connector to connect the cable to it. The cable acts as an interface between
the computer and the router or modem. NIC card is a layer 2 device which
means that it works on both the physical and data link layers of the network
model.

9. Draw a neat diagram and Explain TCP/IP protocol.

1. Application layer
This is the top layer of TCP/IP protocol suite. This layer includes applications
or processes that use transport layer protocols to deliver the data to destination
computers.

At each layer there are certain protocol options to carry out the task designated to
that particular layer. So, application layer also has various protocols that applications
use to communicate with the second layer, the transport layer. Some of the popular
application layer protocols are :
HTTP (Hypertext transfer protocol)
FTP (File transfer protocol)
SMTP (Simple mail transfer protocol)
SNMP (Simple network management protocol)

2. Transport Layer
This layer provides backbone to data flow between two hosts. This layer
receives data from the application layer above it. There are many protocols that
work at this layer but the two most commonly used protocols at transport layer are
TCP and UDP.

3. Network Layer
This layer is also known as Internet layer. The main purpose of this layer is to
organize or handle the movement of data on network. By movement of data, we
generally mean routing of data over the network. The main protocol used at this
layer is IP. While ICMP(used by popular ‘ping’ command) and IGMP are also used at
this layer.

4. Data Link Layer


This layer is also known as network interface layer. This layer normally
consists of device drivers in the OS and the network interface card attached to the
system. Both the device drivers and the network interface card take care of the
communication details with the media being used to transfer the data over the
network. In most of the cases, this media is in the form of cables. Some of the
famous protocols that are used at this layer include ARP(Address resolution
protocol), PPP(Point to point protocol) etc.

10.Draw and Explain OSI reference model.


11.Discuss the design issues for various layers
 Reliability: It is a design issue of making a network that operates correctly
even when it is made up of unreliable components.
 Addressing: There are multiple processes running on one machine.
Every layer needs a mechanism to identify senders and receivers.
 Error Control: It is an important issue because physical communication
circuits are not perfect. Many error detecting and error correcting codes
are available. Both sending and receiving ends must agree to use any one
code.
 Flow Control: If there is a fast sender at one end sending data to a slow
receiver, then there must be flow control mechanism to control the loss of
data by slow receivers. There are several mechanisms used for flow
control such as increasing buffer size at receivers, slow down the fast
sender, and so on. Some process will not be in position to accept
arbitrarily long messages. This property leads to mechanisms for
disassembling, transmitting and the reassembling messages.
 Multiplexing and De-multiplexing: If the data has to be transmitted on
transmission media separately, it is inconvenient or expensive to setup
separate connection for each pair of communicating processes. So,
multiplexing is needed in the physical layer at sender end and de-
multiplexing is need at the receiver end.
 Scalability: When network gets large, new problem arises. Thus
scalability is important so that network can continue to work well when it
gets large.
 Routing: When there are multiple paths between source and destination,
only one route must be chosen. This decision is made on the basis of
several routing algorithms, which chooses optimized route to the
destination.
 Confidentiality and Integrity: Network security is the most important
factor. Mechanisms that provide confidentiality defend against threats like
eavesdropping. Mechanisms for integrity prevent faulty changes to
messages

12. List and Explain DLL design issues

 Services provided to the network layer –

The data link layer act as a service interface to the network layer. The
principle service is transferring data from network layer on sending
machine to the network layer on destination machine. This transfer also
takes place via DLL (Data link-layer).

 Frame synchronization –
The source machine sends data in the form of blocks called frames to
the destination machine. The starting and ending of each frame should
be identified so that the frame can be recognized by the destination
machine.

 Flow control –

Flow control is done to prevent the flow of data frame at the receiver
end. The source machine must not send data frames at a rate faster
than the capacity of destination machine to accept them.

 Error control –

Error control is done to prevent duplication of frames. The errors


introduced during transmission from source to destination machines
must be detected and corrected at the destination machine.

13.Explain the concept of CRC with examples.


https://www.tutorialspoint.com/explain-the-cyclic-redundancy-checks-
crcs

14.

M(x) = 𝑥 5 + 𝑥 4 + 𝑥
= 𝑥 5 + 𝑥 4 + 0𝑥 3 + 0𝑥 2 + 𝑥 + 0𝑥 0
Binary representation = 110010

Here G(x) is a generating polynomial


G(x) = 𝑥 3 + 𝑥 2 + 1
= 𝑥 3 + 𝑥 2 + 0𝑥 + 1𝑥 0
Binary representation = 1101

Since the highest power of generating function is 3.


3 redundant bits will be added to the M(x)
110010000

Since the remainder is non-zero so there is a error in the message.


Now previously added redundant bits will be replaced by remainder i.e.
110010100
After CRC remainder is 0.

110010100
is correct.

15. Explain Hamming code with examples.


https://www.scaler.com/topics/hamming-code/

16.Sample Problem on IP addressing


i) Given network address 221.35.76.0 .Find the Class ,Netid and range of the
addresses.
Based on the provided network address 221.35.76.0, let's determine the class
of the address, the network ID (NetID), and the range of addresses.

Class of the Address:


The class of an IP address is determined by the first few bits of the address.
The ranges for different IP address classes are as follows:
Class A: 1.0.0.0 to 126.0.0.0
Class B: 128.0.0.0 to 191.0.0.0
Class C: 192.0.0.0 to 223.0.0.0
Class D: 224.0.0.0 to 239.0.0.0 (Reserved for multicast)
Class E: 240.0.0.0 to 255.0.0.0 (Reserved for experimental use)
Given the network address 221.35.76.0 falls within the range of Class C
addresses (192.0.0.0 to 223.0.0.0), it belongs to Class C.

NetID (Network ID):


In Class C addresses, the first three octets represent the network portion. For
the address 221.35.76.0, the NetID is 221.35.76.

Range of Addresses:
In Class C addresses, the range of addresses is determined by the last octet.
The first address in the subnet is the network address itself (221.35.76.0),
and the last address is the broadcast address (221.35.76.255). The range of
usable host addresses falls between these two.

So, for the given network address 221.35.76.0:

Class: Class C
NetID: 221.35.76
Range of Addresses: 221.35.76.1 to 221.35.76.254 (usable host addresses)

ii) Given the address 134.5.18.87 .Find the beginning address(Network


Address)
To find the network address (beginning address) from an IP address, you
need to apply the subnet mask associated with that IP address. The subnet
mask determines which portion of the IP address represents the network and
which portion represents the host.

Since you didn't provide a subnet mask, I'll assume you want to find the
network address assuming a default subnet mask based on the IP address
you provided, which appears to be an IPv4 address (based on the format).

Assuming a default subnet mask of /24 (which means the first 24 bits are
used for the network portion), the network address can be found by setting
all host bits to 0. Here's the calculation:

IP address: 134.5.18.87
Subnet mask: 255.255.255.0 (/24)

Performing a bitwise AND operation:

IP address : 10000110.00000101.00010010.01010111
Subnet mask : 11111111.11111111.11111111.00000000
Network address : 10000110.00000101.00010010.00000000

Converting the binary network address back to decimal:


Network address: 134.5.18.0

So, assuming a default subnet mask of /24, the network address for the
given IP address 134.5.18.87 is 134.5.18.0.

iii) Find first address, last address and no. of addresses in block if one of the
address is 75.100.25.35/16
To find the first address, last address, and the number of addresses in the
block for the given IP address and subnet mask (75.100.25.35/16), we need
to determine the range of addresses within the subnet.

The subnet mask "/16" means that the first 16 bits of the IP address are used
for the network portion, and the remaining bits (32 - 16 = 16 bits) are
available for host addresses.

Let's perform the calculations:

Given IP address: 75.100.25.35


Subnet mask: 255.255.0.0 (which is equivalent to /16)

First Address:
The first address in the subnet can be found by setting all host bits to 0:
IP address: 01001011.01100100.00011001.00100011
Subnet mask: 11111111.11111111.00000000.00000000
Network addr: 01001011.01100100.00000000.00000000

Converting the binary network address back to decimal:

Network address: 75.100.0.0

Last Address:
The last address in the subnet can be found by setting all host bits to 1:
IP address: 01001011.01100100.00011001.00100011
Subnet mask: 11111111.11111111.00000000.00000000
Broadcast addr: 01001011.01100100.11111111.11111111

Converting the binary broadcast address back to decimal:

Broadcast address: 75.100.255.255


Number of Addresses:
The number of addresses in the block can be calculated by counting the
possible host addresses within the subnet, which is 2^16 - 2 (subtracting 2 for
the network address and broadcast address):
Number of addresses = 2^16 - 2 = 65534

So, for the given IP address and subnet mask (75.100.25.35/16), the details
are as follows:

First Address (Network Address): 75.100.0.0


Last Address (Broadcast Address): 75.100.255.255
Number of Addresses: 65534

17. What are the drawbacks of IPv4?


 IP relies on network layer addresses to identify end-points on network, and
each network has a unique IP address.
 The world’s supply of unique IP addresses is dwindling, and they might
eventually run out theoretically.
 If there are multiple host, we need IP addresses of next class.
 Complex host and routing configuration, non-hierarchical addressing, difficult
to re-numbering addresses, large routing tables, non-trivial implementations
in providing security, QoS (Quality of Service), mobility and multi-homing,
multicasting etc. are the big limitation of IPv4 so that’s why IPv6 came into
the picture.

18.Explain in short different framing methods.


https://www.geeksforgeeks.org/various-kind-of-framing-in-data-link-layer/

19.Explain sliding window protocol using Go-Back-N technique.


Sliding Window Protocol
The sliding window is a technique for sending multiple frames at a time. It
controls the data packets between the two devices where reliable and
gradual delivery of data frames is needed. It is also used in TCP (Transmission
Control Protocol).

In this technique, each frame has sent from the sequence number. The
sequence numbers are used to find the missing data in the receiver end. The
purpose of the sliding window technique is to avoid duplicate data, so it uses
the sequence number.

Types of Sliding Window Protocol


Sliding window protocol has two types:
Go-Back-N ARQ
Selective Repeat ARQ

Go-Back-N ARQ
Go-Back-N ARQ protocol is also known as Go-Back-N Automatic Repeat Request. It is
a data link layer protocol that uses a sliding window method. In this, if any frame is
corrupted or lost, all subsequent frames have to be sent again.

The size of the sender window is N in this protocol. For example, Go-Back-8, the size
of the sender window, will be 8. The receiver window size is always 1.

If the receiver receives a corrupted frame, it cancels it. The receiver does not accept a
corrupted frame. When the timer expires, the sender sends the correct frame again.
The design of the Go-Back-N ARQ protocol is shown below.

20.Explain Checksum with examples.


https://www.geeksforgeeks.org/error-detection-code-checksum/

21.Explain stop and wait protocol.


https://www.javatpoint.com/stop-and-wait-protocol
22.Explain services provided by the data link layer.
o Unacknowledged Connectionless Service :
 Unacknowledged connectionless service simply provides datagram
styles delivery without any error, issue, or flow control. In this service,
source machine generally transmits independent frames to
destination machine without having destination machine to
acknowledge these frames.
 This service is called as connectionless service because there is no
connection established among sending or source machine and
destination or receiving machine before data transfer or release after
data transfer.

 In Data Link Layer, if anyhow frame is lost due to noise, there will be
no attempt made just to detect or determine loss or recovery from it.
This simply means that there will be no error or flow control. An
example can be Ethernet.

o Acknowledged Connectionless Service :


 This service simply provides acknowledged connectionless service i.e.
packet delivery is simply acknowledged, with help of stop and wait for
protocol.
 In this service, each frame that is transmitted by Data Link Layer is
simply acknowledged individually and then sender usually knows
whether or not these transmitted data frames received safely. There
is no logical connection established and each frame that is
transmitted is acknowledged individually.
 This mode simply provides means by which user of data link can just
send or transfer data and request return of data at the same time. It
also uses particular time period that if it has passed frame without
getting acknowledgment, then it will resend data frame on time
period.
 This service is more reliable than unacknowledged connectionless
service. This service is generally useful over several unreliable
channels, like wireless systems, Wi-Fi services, etc.

o Acknowledged Connection-Oriented Service :


 In this type of service, connection is established first among sender
and receiver or source and destination before data is transferred.
 Then data is transferred or transmitted along with this established
connection. In this service, each of frames that are transmitted is
provided individual numbers first, so as to confirm and guarantee that
each of frames is received only once that too in an appropriate order
and sequence.

You might also like