Computer Networks Important Questions
Computer Networks Important Questions
Unit – 1
1
• Packaging - The Internet layer fragments and reassembles data packets.
If a packet is too large to be transmitted in a single packet, the Internet
layer breaks it into smaller pieces.
• Addressing - The Internet layer provides IP addresses to devices and
domains that connect to the internet. IP addresses are attached to each
packet, which helps routers send them to the correct destination.
• Routing - The Internet layer controls the routing of data to ensure it's
sent accurately and quickly.
• Core Internet Layer Protocols – IP, ARP, ICMP, IGMP.
2
Step 2: Compare corresponding bits of the two sequences.
Step 3: Count the number of bit positions where the bits differ. This is the
Hamming Distance.
Step 4: If the distance exceeds the allowed threshold, an error is detected.
ii] Internet Checksum: The Internet Checksum is a simple error detection method
used in protocols like IPv4, TCP, and UDP. It calculates a checksum value based
on the sum of the data segments.
Step 1: Divide data into blocks (e.g., 16 bits each).
Step 2: Add the blocks and complement the result.
Step 3: Send data with the checksum. The receiver recalculates it. If it matches, no
error; otherwise, an error is detected.
i] Point-to-Point:
• Point-to-point networks contains exactly two hosts such as computer,
switches or routers, servers connected back to back using a single piece of
cable.
3
ii] Bus Topology:
• In case of Bus topology, all devices share single communication line or
cable. Bus topology may have problem while multiple hosts sending data at
the same time.
4
v] Mesh Topology:
• In this type of topology, a host is connected to one or multiple hosts.
• This topology has hosts in point-to-point connection with every other host or
may also have hosts which are in point-to-point connection to few hosts
only.
• There are two types in this –
o Full Mesh: All hosts have a point-to-point connection to every
other host in the network.
o Partially Mesh: Hosts are in point-to-point connection to few hosts
only.
5
viii] Hybrid Topology:
• A network structure whose design contains more than one topology is said to
be hybrid topology.
• Hybrid topology inherits merits and demerits of all the incorporating
topologies.
• Internet is the best example of largest Hybrid topology.
6
• Cost Assessment - Cost assessment’s goal is to assess the costs of various
network alternatives produced as part of technology design.
• The process of cycling through all three design phases is repeated until a
final design is decided on.
7
6. Suppose our data is a list of five 4-bit numbers that we want to send to a
destination, if the set of numbers is (7, 11, 12, 0, 6)
a) Calculate the checksum at the Sender side
b) Calculate the checksum at the Receiver side
c) Check whether the sender and receiver have received the same data.
A.
a) Calculate the checksum at the Sender side:
• Sum of all numbers in the set = 7+11+12+0+6 = 36.
• Convert the sum into binary => 36 = 100100 (6 bits).
• To find the wrapped sum add the first 2 bits to the last next 4 bits =>
0100+10 = 0110.
• Convert this to decimal => 0110 = 6. Therefore, the wrapped sum is 6.
• Perform one’s complement for 0110 => It gives 1001.
• Converting this to decimal we get the checksum => 1001=9.
• Add this checksum to the set => 7,11,12,0,6,9.
c) Check whether the sender and receiver have received the same data:
• If the checksum obtained is equal to 0 then the packet is valid, else it is
invalid and has to be discarded.
• In our calculations since we got the checksum as 0 at the receiver’s side, the
packet is valid.
8
i] Physical Layer:
• Controls the transmission of the actual data onto the network cable.
• Is concerned with transmitting raw bits over a communication channel, the
physical medium.
9
• This layer is also responsible for finding a path through the network to the
destination computer.
v] Session Layer:
• Allows two applications to establish, use and disconnect a connection
between them called a session.
• Provides for name recognition and additional functions like security, which
are needed to allow applications to communicate over the network.
10
vii] Application Layer:
• The application layer provides services that are frequently required by
applications that involve communications.
• It contains a variety of protocols such as FTP, SMTP etc.
• It provides services directly to user applications.
• It provides user interfaces and support for services such as email, remote file
access and transfer, shared database management, etc.
i] Circuit Switching:
• Circuit switching is a technique that directly connects the sender and the
receiver in an unbroken path.
• Telephone switching equipment, for example, establishes a path that
connects the caller's telephone to the receiver's telephone by making a
physical connection.
• With this type of switching technique, once a connection is established, a
dedicated path exists between both ends until the connection is terminated.
• Advantage - Once the circuit has been set up, communication is fast without
error.
• Disadvantage - More expensive than any other switching techniques,
because a dedicated path is required for each connection.
11
ii] Message Switching:
• With message switching there is no need to establish a dedicated path
between two stations.
• When a station sends a message, the destination address is appended to the
message.
• The message is then transmitted through the network, in its entirety, from
node to node.
• Advantage - Traffic congestion can be reduced, because messages may be
temporarily stored in route.
• Disadvantage - Message switching is not compatible with interactive
applications.
12
9. Explain the basic services of computer network.
A. Some basic services computer network can offer are:
i] Directory Services:
a) Accounting:
• In an organization, a number of users have their user names and
passwords mapped to them.
• Directory Services provide means of storing this information in cryptic
form and make available when requested.
b) Authentication & Authorization:
• User credentials are checked to authenticate a user at the time of login
and/or periodically.
• User accounts can be set into hierarchical structure and their access to
resources can be controlled using authorization schemes.
13
c) Internet Chat: Two or more people can communicate with each other
using text based Internet Relay Chat services.
v] Application Services:
a) Resource Sharing: To use resources efficiently and economically,
network provides a mean to share them.
b) Databases: It stores data and information, processes it, and enables the
users to retrieve it efficiently by using queries.
c) Web Services: It is used to connect to the internet, and access files and
information services provided by the internet servers.
i] Attenuation:
• Attenuation means a loss of energy. When a signal, simple or composite,
travels through a medium, it loses some of its energy in overcoming the
resistance of the medium.
• That is why a wire carrying electric signals gets warm after a while.
• Some of the electrical energy in the signal is converted to heat.
• To compensate for this loss, amplifiers are used to amplify the signal.
• To show that a signal has lost or gained strength, engineers use the unit of
the decibel.
• The decibel (dB) measures the relative strengths of two signals or one signal
at two different points.
14
ii] Distortion:
• Distortion means that the signal changes its form or shape.
• Distortion can occur in a composite signal made of different frequencies.
• Each signal component has its own propagation speed through a medium
and, therefore, its own delay in arriving at the final destination.
iii] Noise:
• Noise is another cause of impairment. Several types of noise, such as
thermal noise, induced noise, crosstalk, and impulse noise, may corrupt the
signal.
• Thermal noise is the random motion of electrons in a wire which creates an
extra signal not originally sent by the transmitter.
• Induced noise comes from sources such as motors and appliances.
• Crosstalk is the effect of one wire on the other. One wire acts as a sending
antenna and the other as the receiving antenna.
• Impulse noise is a category of (acoustic) noise that includes unwanted,
almost instantaneous (thus impulse-like) sharp sound.
15
11. Explain datagram and virtual circuits.
A.
i] Datagram:
• Datagram packet switching is similar to message switching in that each
packet is a self-contained unit with complete addressing information
attached.
• This allows packets to take a variety of possible paths through the network.
• So the packets, each with the same destination address, do not follow the
same route, and they may arrive out of sequence at the exit point node (or
the destination).
• Reordering is done at the destination point based on the sequence number of
the packets.
• It is possible for a packet to be destroyed if one of the nodes on its way is
crashed momentarily. Thus all its queued packets may be lost.
16
12. With relevant diagrams explain block oriented and stream-oriented
information.
A.
i] Block-oriented information:
• In block-oriented communication, data is divided into blocks or fixed-size
chunks before transmission.
• Each block is treated as an independent unit and may include a header or
metadata for identification, sequencing, and error control.
• Often used in protocols where structured data transmission is required, such
as FTP or HTTP.
Features:
• Data is sent and received as discrete blocks.
• Suitable for file transfers or structured data (e.g., database
communication).
• Each block might have:
o Header: Metadata about the block.
o Payload: Actual data content.
• Allows retransmission of specific blocks in case of errors.
Example Protocols:
• FTP (File Transfer Protocol)
• HTTP (HyperText Transfer Protocol)
17
ii] Stream-Oriented Information:
• In stream-oriented communication, data is sent as a continuous stream of
bytes with no inherent structure.
• The application defines how to interpret the stream, splitting it into
meaningful segments as needed.
• Commonly used in protocols for real-time communication, such as TCP.
Features:
• Data is sent in a continuous stream.
• No pre-defined boundaries; the receiver interprets the data format.
• Suitable for real-time or continuous data (e.g., audio/video streaming,
interactive terminal sessions).
• Less overhead compared to block-oriented transmission.
Example Protocols:
• TCP (Transmission Control Protocol)
• Live media streaming protocols (e.g., RTP over TCP).
Example:
18
Consider two binary strings of equal length:
String 1: 1011101
String 2: 1001001
To calculate the Hamming distance, we compare each corresponding bit:
• 1 vs 1 → No difference
• 0 vs 0 → No difference
• 1 vs 0 → Difference (1st mismatch)
• 1 vs 1 → No difference
• 1 vs 0 → Difference (2nd mismatch)
• 0 vs 0 → No difference
• 1 vs 1 → No difference
Hamming distance = 2 (because there are 2 positions where the bits differ).
Unit – 2
19
ii] Time – Division Multiple Access (TDMA):
• In TDMA, the stations share the bandwidth of the channel in time.
• Each station is allocated a time slot during which it can send data.
• Each station transmits its data in its assigned time slot.
• The main problem with TDMA is achieving synchronization between
different stations.
• Each station needs to know the beginning of its slot and the location of its
slot, which may be difficult because of propagation delays.
• To compensate for the delays, guard times are inserted.
20
2. Explain CSMA, CSMA/CA and CSMA/CD with diagrams.
A.
i] CSMA (Carrier Sense Multiple Access):
• To minimize the chance of collision, and , therefore, increase the
performance, the CSMA method was developed.
• The chance of collision can be reduced if a station senses the medium before
trying to use it.
• CSMA requires that each station first listen to the medium before sending.
• CSMA is based on the principle “sense before transmit” or “listen before
talk”.
• Types of CSMA Protocols –
o 1-Persistent CSMA
o Non-Persistent CSMA
o p-Persistent CSMA.
21
iii] CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance):
• CSMA/CA was invented for wireless networks where collision should be
avoided.
• In this collisions are avoided through the use of three strategies:
o InterFrame Space (IFS).
o Contention window.
o Acknowledgement.
• IFS is the time interval between two frames to control access to the channel.
• Contention window is an amount of time divided into slots.
• The positive acknowledgement and the time – out timer can help guarantee
that the receiver has received the frame.
22
4. Explain ALOHA and Slotted ALOHA.
A.
• Aloha is the earliest random-access protocol.
• It was designed for wireless LAN, but it can be used on any shared medium.
• Two versions of ALOHA protocol are - Pure ALOHA and Slotted ALOHA.
i] Pure ALOHA:
• The original ALOHA protocol is called pure ALOHA.
• The idea is that each station sends a frame whenever it has a frame to send.
• Since only one channel to share, there is the possibility of collision between
frames from different stations.
• The pure ALOHA protocol relies on acknowledgements from the receiver.
• If no ACK was received, sender assumes that the frame or ACK has been
destroyed and resends that frame after it waits for a random amount of time
(back – off time).
• If station fails to receive an ACK after repeated transmissions, it gives up.
• Pure ALOHA maximum channel utilization is 18.4%.
23
ii] Slotted ALOHA:
• Slotted ALOHA was invented to improve the efficiency of pure ALOHA.
• In slotted ALOHA , time is divided into slots equal to a frame transmission
time (Tfr)
• A station can transmit at the beginning of a slot only.
• If a station misses the beginning of a slot, it has to wait until the beginning
of the next time slot.
• A central clock or station informs all stations about the start of each slot.
• Maximum channel utilization is 37%.
• There is still the possibility of collision, if two stations try to send at the
beginning of the same slot.
24
• Send window divides the possible sequence numbers into four regions.
o Acknowledged Frames: Already acknowledged.
o Sent but Unacknowledged Frames: Awaiting acknowledgment.
o Frames Ready to Send: Can be sent immediately.
o Frames Not Yet Sendable: Await window sliding.
25
• The upper sublayer, responsible for flow and error control is called as
Logical Link Control (LLC). Some functions of this layer are-
o Multiplexing: Allows multiple network layer protocols (e.g., IPv4,
IPv6) to operate over the same physical link.
o Flow Control and Error Control: Ensures reliable delivery by
managing data flow and detecting errors.
o Connection Modes: Supports connection-oriented and
connectionless communication.
o Key Protocols Used in LLC: IEEE 802.2 standard.
26
• HDLC provides two common transfer modes –
a) Normal Response Mode (NRM):
o In this the station configuration is unbalanced.
o We have one primary station and multiple secondary stations.
o A primary station can send commands, a secondary station can only
respond.
o NRM is used for both point – to – point and multipoint links.
27
• Millions of Internet users who need to connect their home computers to the
server of an Internet Service Provider use PPP.
• PPP is implemented at the data link layer to control and manage the transfer
of data.
• PPP does not provide any flow control.
• Error control by PPP is limited to error detection.
• The PPP frame format includes the following fields:
o Flag: 1-byte starts and ends the frame, the pattern is 01111110.
o Address: Constant value set to 11111111 (broadcast address).
o Control: Constant value set to 11000000.
o Protocol: Specifies the type of data in the payload (user data or control
info).
o Payload: Contains user data or control info (up to 1500 bytes).
o Frame Check Sequence (FCS): 2-byte or 4-byte CRC for error
detection.
28
• The range which is of concern to the sender is called send sliding window.
• The range which is of concern to the receiver is called receive sliding
window.
29
10. Write short notes on (i) Congestion Control (ii) Flow control.
A.
i] Congestion Control:
• Congestion control is a technique used to prevent congestion in a network.
• Congestion occurs when too much data is being sent over a network, and the
network becomes overloaded, leading to dropped packets and poor network
performance.
• Mechanisms of Congestion Control are:
o Traffic Shaping: Regulates data flow, e.g., using leaky bucket or
token bucket algorithms.
o Congestion Avoidance: Proactively prevents congestion using
techniques like RED (Random Early Detection).
o Congestion Recovery: Adjusts data rates dynamically after
congestion is detected, e.g., in TCP, using slow start and congestion
window.
• Advantages:
o Prevents network congestion.
o Efficient use of network resources.
• Disadvantages:
o May cause delays.
o May require additional hardware or software.
30
• It ensures that a sender does not overwhelm a receiver with too much data
too quickly.
• The goal of flow control is to prevent buffer overflow, which can lead to
dropped packets and poor network performance.
• Mechanisms of Flow Control:
o Stop-and-Wait Protocol: Sender waits for an acknowledgment
(ACK) after each frame before sending the next.
o Sliding Window Protocol: Allows multiple frames to be sent before
requiring ACKs, improving efficiency.
• Advantages:
o Prevents buffer overflow.
o Efficient use of network resources.
• Disadvantages:
o May cause delays.
o May not be effective in congested networks.
Unit – 3
31
i] Class A Address:
• Used in LAN and WAN networks.
• The first bit of the first octet is always set to 0 zero. Thus, the first octet
ranges from 1 – 127.
• The default subnet mask for Class A IP address is 255.0.0.0.
v] Class E Address:
• Reserved for Future use.
• This is reserved Research and Development.
• Like Class D, this class too is not equipped with any subnet mask.
32
2. Explain various services of Network Layer.
A. The different services provided by the Network Layer are:
• Addressing: This is responsible for addressing messages and data so they
are sent to the correct destination, and for translating logical addresses and
names) into physical addresses.
This layer is also responsible for finding a path through the network to the
destination computer.
• Data delivery: Provides for the efficient and successful transfer of data in
the form of packets across a communication network.
• Switching: It refers to temporary connection between physical links.
• Routing: It determines how packets are routed from source to destination.
• Congestion control: Traffic congestion is controlled by the Network layer.
• Accounting function: The software must count how many packets or
characters or bits are sent by each customer, to produce billing information.
• Packet Switching: Packet Switching transmits data across digital networks
by breaking it down into blocks or packets for more efficient transfer using
various network devices.
33
• Mobile Node (MN): It is the hand-held communication device that the user
carries.
• Home Network: It is a network to which the mobile node originally belongs
as per its assigned IP address (home address).
• Home Agent (HA): It is a router in-home network to which the mobile node
was originally connected.
• Foreign Network: It is the current network to which the mobile node is
visiting (away from its home network).
• Foreign Agent (FA): It is a router in a foreign network to which the mobile
node is currently connected. The packets from the home agent are sent to the
foreign agent which delivers them to the mobile node.
• Correspondent Node (CN): It is a device on the internet communicating to
the mobile node.
34
• Each number needs to be less than or equal to 255.
• For instance, an example of an IPv4 address is 172.16.254.1.
• Classful Addressing:
• Mask:
o A 32-bit number made of contiguous 1s followed by contiguous 0s.
o The concept does not apply to classes D and E.
o The mask can help us to find the netid and the hostid.
o This notation is also called slash notation or Classless Interdomain
Routing (CIDR) notation.
o CIDR (Classless Inter-Domain Routing or supernetting) is a method
of assigning IP addresses.
35
ii] IPv6 Address:
• The Internet Protocol Version 6 (IPv6) is the most recent version of the
Internet Protocol.
• It is also known as Internet Protocol next generation (IPng).
• IPv6 is a relatively newer version of IP address, and its use is still not
widespread compared to IPv6.
• An IPv6 address is 128-bit long. Each 16-bits is separated with a colon(:).
• Need for IPv6:
o The major issues with IPv4 are the limitation of the number of
addresses and the growth of routing tables.
o The IPv4 uses a 32-bit addressing scheme that is capable of
generating 2^32 unique addresses.
o However, with the ever-increasing need for IP addresses in network
communication, this number is simply not sufficient.
o IPv6 uses a 128-bit addressing scheme and capable of generating
2^128 unique addresses.
o This is a significantly large number and deemed sufficient for the near
future.
36
Routing algorithms are classified into two main categories:
i] Adaptive Routing algorithm:
• It is also known as dynamic routing algorithm.
• This algorithm makes the routing decisions based on the topology and the
network traffic.
• A router may select a new route for each packet in response to changes in the
condition and topology of the networks.
• An adaptive routing algorithm can be classified into three parts:
a) Centralized Algorithm:
o It is also known as global routing algorithm as it computes the least-cost
path between source and destination by using complete and global
knowledge about the network.
o This algorithm takes the connectivity between the nodes and link cost as
input, and this information is obtained before actually performing any
calculation.
b) Isolation algorithm:
o It is an algorithm that obtains the routing information by using local
information rather than gathering information from other nodes.
c) Distributed algorithm:
o It is also known as decentralized algorithm as it computes the least-cost
path between source and destination in an iterative and distributed
manner.
o In the decentralized algorithm, no node has the knowledge about the cost
of all the network links.
37
b) Random Walks:
o In case of random walks, a packet sent by the node to one of its neighbors
randomly.
o An advantage of using random walks is that it uses the alternative routes
very efficiently
Unit – 4
1. Differentiate between user datagram protocol (UDP) and transmission
control protocol (TCP).
A.
Basis Transmission Control User Datagram Protocol (UDP)
Protocol (TCP)
Error checking TCP provides extensive error- UDP has only the basic error-
mechanism checking mechanisms. It is checking mechanism
using checksums.
because it provides flow control
and acknowledgment of data.
38
Basis Transmission Control User Datagram Protocol (UDP)
Protocol (TCP)
39
2. Explain the following: (i) Leaky Bucket (ii) Token bucket.
A.
i] Leaky Bucket:
• The leaky bucket algorithm used to control rate in a network.
• It is implemented as a single-server queue with constant service time.
• If the bucket (buffer) overflows then packets are discarded.
• The leaky bucket enforces a constant output rate (average rate) regardless of
the burstiness of the input.
• Does nothing when input is idle.
• The host injects one packet per clock tick onto the network.
• This results in a uniform flow of packets, smoothing out bursts and reducing
congestion.
40
The main differences between Leaky Bucket and Token Bucket are:
• LB is not token dependent but TB is token dependent.
• LB discards packets but TB discards tokens.
• LB leaks at constant rate whereas TB has maximum capacity.
41
• Control Flags (9 bits):
o URG: Indicates urgent data.
o ACK: Acknowledgment field is valid.
o PSH: Push data immediately to the application.
o RST: Resets the connection.
o SYN: Initiates a new connection.
o FIN: Terminates a connection.
• Window Size (16 bits): Specifies the number of bytes the receiver is willing
to accept. Used for flow control.
• Checksum (16 bits): Ensures data integrity by detecting errors in the header
and payload.
• Urgent Pointer (16 bits): Points to urgent data in the segment if the
URG flag is set.
• Options (32 bits): Provides additional functionalities like maximum
segment size or timestamps.
42
The UDP frame contains the following fields:
Source Port (16 bits)
o Identifies the sending application (port number).
o Optional; can be set to 0 if not used.
Destination Port (16 bits)
o Identifies the receiving application (port number).
o It is used to identify application-level service on the destination machine.
Length (16 bits)
o Specifies the total length of the UDP header and data (in bytes).
o Minimum value: 8 bytes (header size).
Checksum (16 bits)
o Used for error detection across the header and data.
o Optional; may be set to 0 if error-checking is not required.
Data/Payload (Variable Length)
• Contains the application data. The size depends on the value in the Length
field.
43
Step 2 - Send packets of Data:
• When a packet of data is sent over TCP, the recipient must always
acknowledge what they have received.
• The first system sends a packet with data and sequence number. The second
system acknowledges it by setting the ACK bit and increasing the
acknowledgment number by the length of the received data.
• They are part of the TCP header and support the system to keep track of
which data was successfully received, which data was lost, and which data
was accidentally sent twice.
QoS Parameters:
• Packet Loss: This happens when the network links becomes congested, and
routers and switches start dropping packets.
• Delay: This is the time taken to travel a packet from the source to the
destination.
• Jitter: The irregular speed of packets on a network as a result of congestion,
which can result in packets arriving late out of sequence.
• Bandwidth: This is the capacity of a network communication link to
transmit the maximum amount of data from one point to another in a given
amount of time.
Benefits of QoS:
• Improved Performance for Critical Applications
44
• Enhanced User Experience
• Efficient Bandwidth Utilization
• Increased Network Reliability
• Reduced Network Costs
• Improved Security
Importance of QoS:
• Video and audio conferencing require a bounded delay and loss rate.
• Video and audio streaming requires a bounded packet loss rate, it may not be
so sensitive to delay.
• Time-critical applications (real-time control) in which bounded delay is
considered to be an important factor.
• Valuable applications should provide better services than less valuable
application.
QoS Models:
• IntServ: Guarantees QoS for individual sessions through resource
reservation.
• Diff-Serv: Offers scalable services for larger traffic flows, addressing
scalability issues of IntServ.
45
• SMTP client and SMTP server are divided into two components:
i] Mail User Agent (MUA):
o The user agent provides an interface where in he/she can write the
message, specify the destination address.
o Therefore the UA puts the message into the envelope.
ii] Message transfer agent (MTA):
o The transfer of messages i.e; mails is delivered through the agent
known as Message Transfer agent.
o MTA’s assist a user in sending as well as receiving the messages.
o The MTA consists of two shades i.e; MTA client for sending the mail
while the MTA server for receiving and listening the mails.
Working of SMTP:
• Mail Composition: A user sends an e-mail by creating an electronic mail
message with the help of a Mail User Agent (MUA).
• Mail Submission: After drafting an email, the mail client sends the finished
email to the SMTP server through SMTP on TCP port 25.
• Mail Delivery: E-mail addresses are made up of two parts: the recipient’s
username and the domain name. If the domain name of the recipient’s email
address differs from the domain name of the sender, MSA will route the
message to the Mail Transfer Agent (MTA).
• Receipt and Processing of Mail: When an incoming message is received,
the exchange server sends it to the incoming server (Mail Delivery Agent),
which holds the email until the user retrieves it.
• Mail Access and Retrieval: MUA may be used to retrieve email saved in
MDA (Mail User Agent). Login and password are required to access MUA.
46