0% found this document useful (0 votes)
23 views

Computer Networks Important Questions

cn

Uploaded by

gr2118655
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Computer Networks Important Questions

cn

Uploaded by

gr2118655
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Computer Networks Important Questions

Unit – 1

1. With a neat diagram explain the TCP/IP model.


A.
• A highly standardized protocol used widely on the Internet.
• Standards area available in the form of RFC documents – Request For
Comments (RFC).
• Standards are overseen by the Internet Engineering Task Force (IETF).
• There are four layers of the TCP/IP reference model.

i] Network Interface Layer:


• Responsible for sending and receiving TCP/IP packets on the network
medium (Physical/Data Link).
• Applicable LAN technologies – Ethernet, Token Ring, FDDI (Fiber
Distributed Data Interface) etc.
• Applicable WAN technologies – X.25 (old), Frame Relay, ATM
(Asynchronous Transfer Mode) etc.
• Some Core Protocols - IEEE 802.3, IEEE 802.5 and IEEE 802.11 series
of protocols.

ii] Internet Layer:

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.

iii] Transport Layer:


• This layer engages in host-to-host transportation of data packets and the
delivery of them to the application layer.
• It is also responsible for Sequencing and transmission of packets.
• It helps in Recovery of packets and Flow control.
• Core Protocols of the Transport Layer – TCP (Transmission Control
Protocol) and UDP (User Datagram Protocol).

iv] Application Layer:


• Provides applications with the ability to access the services of the other
layers.
• New protocols and services are always being developed in this category.
• Some Core Protocols - HTTP (Hyper Text Transfer Protocol), FTP (File
Transfer Protocol), Telnet, etc.

2. Explain the various error detection techniques (Hamming distance, Internet


checksum and Block coding using CRC steps can be explained).
A. Error detection techniques like Hamming distance, Internet checksum, and
block coding using CRC (Cyclic Redundancy Check) are methods used to identify
potential errors in data transmission by adding redundancy information, allowing
the receiver to verify the data integrity upon arrival and detect any corruption that
might have occurred during transmission.

i] Hamming Distance: Hamming Distance is a method of detecting errors by


measuring how many bits differ between two binary sequences. It is used in
Hamming Code, a type of error-correcting code.
Step 1: Determine the binary representation of the transmitted and received data.

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.

iii] Block Coding Using Cyclic Redundancy Check (CRC):


CRC is a more sophisticated method used to detect errors in data blocks. It uses
polynomial division to generate a checksum, which is then appended to the data.
Step 1: Append zeroes to the data.
Step 2: Divide by a fixed polynomial and use the remainder as the CRC.
Step 3: Send data with CRC. If the receiver gets a non-zero remainder, an error is
detected.

3. With relevant diagrams explain network topologies.


A. A Network Topology is the arrangement with which computer systems or
network devices are connected to each other.
Topologies may define both physical and logical aspect of the network.

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.

iii] Star Topology:


• All hosts in Star topology are connected to a central device, known as hub
device, using a point-to-point connection.
• That is, there exists a point to point connection between hosts and hub.
• If hub fails, connectivity of all hosts to all other hosts fails.

iv] Ring Topology:


• In ring topology, each host machine connects to exactly two other machines,
creating a circular network structure.
• When one host tries to communicate or send message to a host which is not
adjacent to it, the data travels through all intermediate hosts.
• Failure of any host results in failure of the whole ring.

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.

vi] Tree Topology:


• Also known as Hierarchical Topology, this is the most common form of
network topology in use presently.
• This topology imitates as extended Star topology and inherits properties of
bus topology.

vii] Daisy Chain:


• This topology connects all the hosts in a linear fashion.
• Similar to ring topology, all hosts are connected to two hosts only, except the
end hosts.
• Means, if the end hosts in daisy chain are connected then it represents Ring
topology.

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.

4. Explain the various approaches to network design.


A.
i] Traditional network design: The traditional network design approach follows a
structured systems analysis and design process similar to that used to build
application systems.
• The network analyst meets with users to determine the needs and
applications.
• The analyst estimates data traffic on each part of the network.
• The analyst designs circuits needed to support this traffic and obtains cost
estimates.
• Finally, a year or two later, the network is implemented.

ii] Building block network design:


• This approach involves three phases - needs analysis, technology design, and
cost assessment.
• Needs analysis - The objective of needs analysis is to produce a logical
network design, which describes what network elements will be needed to
meet the organization’s needs.
• Technology Design - After needs assessment has been completed, the next
design phase is to develop a technology design (or set of possible designs)
for the network.

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.

5. Explain the goals of computer network.


A. The five main goals of computer network are-
• Resource sharing: The main goal of networking is resource sharing, and it
is to make all programs, data and equipment available to anyone on the
network without the regard to the physical location of the resource and the
user.
• High reliability: A second goal is to provide high reliability by having
alternative sources of supply. For example, all files could be replicated on
two or three machines, so if one of them is unavailable, the other copies
could be available.
• Saving money: Another goal is saving money. Small computers have a
much better price/performance ratio than larger ones. This goal leads to
networks with many computers located in the same building. Such a network
is called a LAN (local area network).
• Performance: Another closely related goal is to increase the systems
performance as the work load increases by just adding more processors.
• Powerful communication medium: Computer networks provide a powerful
communication medium. A file that was updated or modified on a network
can be seen by the other users on the network immediately.

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.

b) Calculate the checksum at the Receiver side:


• Sum of all numbers in the set = 7+11+12+0+6+9 = 45.
• Convert the sum into binary => 45 = 101101 (6 bits).
• To find the wrapped sum add the first 2 bits to the last next 4 bits =>
1101+10 = 1111.
• Convert this to decimal => 1111 = 15. Therefore, the wrapped sum is 15.
• Perform one’s complement for 1111 => It gives 0000.
• Converting this to decimal we get the checksum => 0000=0.

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.

7. With a neat diagram explain the OSI reference model.


A. The Open System Interconnection (OSI) reference model describes how
information from a software application in one computer moves through a network
medium to a software application in another computer.
The OSI reference model is a conceptual model composed of seven layers, each
specifying particular network functions.

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.

ii] Data-Link Layer:


• This layer takes the data frames or messages from the Network Layer and
provides for their actual transmission.
• At the receiving computer, this layer receives the incoming data and sends it
to the network layer for handling.

iii] Network Layer:


• 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.

9
• This layer is also responsible for finding a path through the network to the
destination computer.

iv] Transport Layer:


• It is responsible for the end – to – end transfer of messages from a process in
the source machine to a process in the destination machine.
• The basic function of this layer is to accept data from the session layer, split
it up into smaller units called segment or datagram, pass these to the network
layer, and ensure that the pieces all arrive correctly at the other end.

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.

vi] Presentation Layer:


• It is concerned with the syntax and semantics of the information transmitted.
• Determines the format used to exchange data among networked computers.
• It does tasks like Compression (Reduces the number of bits contained in the
information), Encryption (transforming the original information to another
form), Decryption, etc.

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.

8. With neat diagrams explain circuit, message and packet switching


techniques.
A.
• Switching is process to forward packets coming in from one port to a port
leading towards the destination.
• When data comes on a port it is called ingress, and when data leaves a port
or goes out it is called egress.

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.

iii] Packet Switching:


• Packet switching is a method that tries to combine the advantages of
message and circuit switching and to minimize the disadvantages of both.
• There are two methods of packet switching: Datagram and virtual circuit.
• In both packet switching methods, a message is broken into small parts,
called packets.
• Advantage - Packet switching is cost effective, because switching devices do
not need massive amount of secondary storage.
• Disadvantage - Protocols for packet switching are typically more complex.

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.

ii] Domain Name Services:


• DNS is widely used and one of the essential services on which internet
works.
• This system maps IP addresses to domain names, which are easier to
remember and recall than IP addresses.

iii] File Services:


a) File Sharing:
• File sharing enables its users to share their data with other users.
• User can upload the file to a specific server, which is accessible by all
intended users.
b) File Transfer:
• This is an activity to copy or move file from one computer to another
computer or to multiple computers, with help of underlying network.
• Network enables its user to locate other users in the network and transfers
files.

iv] Communication Services:


a) Email: When a user sends email to other user, it is actually transferred
between users with help of email server.
b) Social Networking: The computer savvy people, can find other known
people or friends, can connect with them, and can share thoughts, pictures,
and videos.

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.

10. With neat diagrams explain the various transmission impairments.


A.
• Signals travel through transmission media, which are not perfect and this
imperfection causes a signal impairment.
• This means that the signal at the beginning of the medium is not the same as
the signal at the end of the medium.
• The three main types of impairments are –

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.

ii] Virtual Circuit:


• In the virtual circuit approach, a preplanned route is established before any
data packets are sent. •
• A logical connection is established when a sender sends a "call request
packet" to the receiver and the receiver sends back an acknowledge packet
"call accepted packet" to the sender.
• Virtual circuits imply acknowledgements, flow control, and error control so
virtual circuits are reliable.
• They have the capability to inform upper-protocol layers if a transmission
problem occur.
• In virtual circuit, the route between stations does not mean that this is a
dedicated path, as in circuit switching.

The main difference between virtual circuit and datagram approaches:


• With virtual circuit, the node does not need to make a routing decision for
each packet whereas for datagram circuits this has to be done for each
packet.
• Datagram networks are not as reliable as Virtual Circuits.
• Datagram is a connectionless service whereas Virtual Circuits are connection
oriented.

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).

13. With an example explain the concept of hamming distance.


A. Hamming Distance is a method of detecting errors by measuring how many bits
differ between two binary sequences. It is used in Hamming Code, a type of error-
correcting code.
• Step 1: Determine the binary representation of the transmitted and received
data.
• Step 2: Compare corresponding bits of the two sequences.
• Step 3: Count the number of bit positions where the bits differ. This is
Hamming Distance.
• Step 4: If the distance exceeds the allowed threshold, an error is detected.

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

1. Explain TDMA, CDMA and FDMA with diagrams.


A. Channelization is a multiple – access method in which the available bandwidth
of a link is shared in frequency, time or through code, between different stations.
The three channelization protocols are-

i] Frequency – Division Multiple Access (FDMA):


• In FDMA, the available bandwidth of the common channel is divided into
frequency bands.
• Each station is allocated a band to send its data.
• Each band is reserved for a specific station, and it belongs to that station all
the time.
• To prevent station interferences, the allocated bands are separated from one
another by small guard bands.
• If the traffic produced by a station bursts, then FDMA will be inefficient.
• When a station is not sending data then FDMA channel sits idle, wasting its
resource.

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.

iii] Code – Division Multiple Access (CDMA):


• In CDMA, one channel carries all transmissions simultaneously.
• CDMA differs from FDMA because only one channel occupies the entire
bandwidth of the link.
• CDMA differs from TDMA because all stations can send data
simultaneously, there is no timesharing.
• In CDMA, each station codes its data signal by a specific code before
transmission.
• The stations’ receivers use these codes to recover the data for the desired
station.
• It is the common platform on which 3G technologies are built.

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.

ii] CSMA/CD (Carrier Sense Multiple Access with Collision Detection):


• The CSMA method does not specify the procedure following a collision.
• CSMA/CD expands the algorithm to handle the collision.
• Use one of the CSMA persistence algorithm (non-persistent, 1-persistent, p-
persistent) for transmission.
• If a collision is detected by a station during its transmission then it should do
the following:
o Abort transmission.
o Transmit a jam signal (48 bit) to notify other stations of collision.
o After sending the jam signal, backoff (wait) for a random amount of time.
o Transmit the frame again.

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.

3. Explain stop and wait ARQ with a neat diagram.


A.
• In stop and wait ARQ, the transmitter and receiver work on the delivery of
one frame at a time.
• The sender sends one frame and stops until it receives the confirmation from
the receiver and then sends the next frame.
• Error correction in Stop-and-Wait ARQ is done by keeping a copy of the
sent frame and retransmitting of the frame when the timer expires.
• The protocol specifies that frames need to be numbered. This is done by
using sequence numbers.
• A field is added to the data frame to hold the sequence number of that frame.
• In Stop-and-Wait ARQ, we use sequence numbers to number the frames and
the sequence numbers are based on modulo-2 arithmetic.
• The acknowledgement numbers announce the sequence number of the next
frame expected by the receiver.

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.

5. Explain sliding window method of flow control.


A.
• The sliding window concept is used by Go – Back – N ARQ.
• Sliding window is a concept that defines the range of sequence numbers
both for sender and receiver.
• 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.
• Send window is an imaginary box covering the sequence numbers of the
data frames which can be transmitted.
• After receiving the acknowledgement from the receiver, the window will
slide.
• The maximum size of the send window is 2m – 1, where m is the number of
bits allowed in the frame for the sequence number.

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.

6. Explain LLC and MAC sublayers of data link layer.


A.
• The data link layer is responsible for moving frames from one hop (node) to
the next.
• We can consider the data link layer as two sublayers.
• The upper sublayer is responsible for data link control.
• The lower sublayer is responsible for resolving access to the shared media.
• If the channel is dedicated, we do not need the lower sublayer.

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.

• The lower sublayer that is mostly responsible for multiple – access


resolution is called the Media Access Control (MAC) layer. Some functions
of this layer are-
o Medium Access Control: Implements protocols to avoid
collisions in shared media (e.g., CSMA/CD, CSMA/CA).
o Addressing: Adds a unique MAC address to each frame, ensuring
correct delivery.
o Error Detection: Includes error-checking mechanisms (e.g.,
Cyclic Redundancy Check - CRC).
o Key Protocols and Technologies Used in MAC: Ethernet (IEEE
802.3) and Wi-Fi (IEEE 802.11)

7. What do you mean by point-to-point protocol? Explain HDLC and PPP.


A. The Point-to-Point Protocol (PPP) is a data link layer communication protocol
used to establish a direct connection between two networking nodes.

i] High level Data Link Control (HDLC):


• HDLC is a bit – oriented protocol.
• It is used for communication over point – to – point and multipoint links.
• It implements ARQ techniques.
• A frame is a digital data unit in networking and telecommunication. HDLC
defines three types of frames:
o I-frames (Information Frames): Carry user data and control
information (piggybacking).
o S-frames (Supervisory Frames): Carry only control information.
o U-frames (Unnumbered Frames): Handle system management and
link control.

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.

b) Asynchronous Balanced Mode (ABM):


o In this, the configuration is balanced.
o The link is point – to – point, and each station can function as a primary
and a secondary (acting as peers).
o This is the common mode today.

ii] Point – to – Point Protocol (PPP):


• PPP is one of the most common protocols for point – to – point access.
• PPP is a byte – oriented protocol.

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.

8. Explain Go back N ARQ with a neat diagram.


A.
• Go – Back – N ARQ implements pipelining concept.
• It overcomes the inefficient transmission that occurs in Stop – and – Wait
ARQ.
• To improve the efficiency of transmission multiple frames must be in
transmission while waiting for an acknowledgement.
• In this several frames can be sent before receiving acknowledgements and a
copy of these frames will be kept until the acknowledgements arrive.
• In Go – Back – N ARQ frames from a sending stations are numbered
sequentially.
• If the frame allows m bits for the sequence number, the sequence numbers
range from 0 to 2m – 1.
• Go – Back – N ARQ uses the sliding window concept.
• Sliding window is a concept that defines the range of sequence numbers
both for sender and receiver.

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.

9. Explain Selective Repeat ARQ with a neat diagram.


A.
• In Go – Back – N ARQ, if one frame is corrupted then all other N frames
will be resent.
• The resending of multiple frames by the sender uses up the bandwidth and
slows down the transmission.
• This drawback is overcome in Selective Repeat ARQ protocol.
• In Selective Repeat ARQ, instead of resending N frames, only the damaged
frame is resent.
• Even though this is more efficient approach for noisy links, the processing at
the receiver end becomes more sophisticated.
• The two windows which are used in this protocol are send window and
receive window.
• The send window and receive window size in Selective Repeat ARQ are
same and is determined by the equation 2m-1.
• The size of send and receive windows are same.

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.

ii] Flow Control:


• Flow control is a technique used to regulate the flow of data between
different nodes in a network.

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

1. Explain IPV4 address formats with a neat diagram.


A.
• The IPv4 addresses are unique and universal.
• It uses a 32-bit addressing scheme to define the IP address.
• Thus, it allows generating 2^32 addresses (~ 4 billion).
• An IPv4 address followed a dotted-decimal notation in
XXX.XXX.XXX.XXX to express the address.
• Each number needs to be less than or equal to 255.
• For instance, an example of an IPv4 address is 172.16.254.1.

• The IPv4 Addressing system is divided into five classes of IP Addresses.

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.

ii] Class B Address:


• Used in LAN and WAN networks.
• Class B Address an IP address which belongs to class B has the first two bits
in the first octet set to 10.
• The default subnet mask for Class B is 255.255.x.x.

iii] Class C Address:


• Used in LAN and WAN networks.
• The first octet of Class C IP address has its first 3 bits set to 110.
• The default subnet mask for Class C is 255.255.255.x.

iv] Class D Address:


• Used for Multicasting.
• Very first four bits of the first octet in Class D IP addresses are set to 1110.
• There is no subnet mask for class D.

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.

3. Explain the concept of Mobile IP.


A.
• Mobile IP is a communication protocol (created by extending Internet
Protocol, IP) that allows the users to move from one network to another with
the same IP address.
• It ensures that the communication will continue without the user’s sessions
or connections being dropped.

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.

Working of Mobile IP:


• The correspondent node sends data packets to the mobile node.
• Packets first reach the home agent, but the mobile node has moved to a
foreign network.
• The foreign agent provides a care-of-address to the home agent for
forwarding packets.
• A tunnel is established between the home agent and the foreign agent using
encapsulation.
• The home agent encapsulates packets with the care-of-address as the
destination and forwards them through the tunnel.
• The foreign agent decapsulates the packets and delivers them to the mobile
node.
• The mobile node replies via the foreign agent, which directly forwards the
response to the correspondent node.

4. Explain IPv4 and IPv6 address.


A.
i] IPv4 Address:
• The IPv4 addresses are unique and universal.
• It uses a 32-bit addressing scheme to define the IP address.
• Thus, it allows generating 2^32 addresses (~ 4 billion).
• An IPv4 address followed a dotted-decimal notation in
XXX.XXX.XXX.XXX to express the address.

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:

• Netid and Hostid:


o In class A, one byte defines the netid and three bytes define the hostid.
o In class B, two bytes define the netid and two bytes define the hostid.
o In class C, three bytes define the netid and one byte defines the hostid.

• 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.

5. Explain the different types of routing algorithms.


A.
• In order to transfer the packets from source to the destination, the network
layer must determine the best route through which packets can be
transmitted.
• The routing protocol is a routing algorithm that provides the best path from
the source to the destination.
• The best path is the path that has the "least-cost path" from source to the
destination.

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.

ii] Non-adaptive Routing algorithm:


• Non Adaptive routing algorithm is also known as a static routing algorithm.
• When booting up the network, the routing information stores to the routers.
• Non Adaptive routing algorithms do not take the routing decision based on
the network topology or network traffic.
• The Non-adaptive routing algorithm can be classified into two parts:
a) Flooding:
o In case of flooding, every incoming packet is sent to all the outgoing
links except the one from where it has been reached.
o The disadvantage of flooding is that node may contain several copies of a
particular packet.

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)

Type of TCP is a connection-oriented UDP is the Datagram-oriented


Service protocol. protocol. This is because there is
Connection orientation means no overhead for opening a
that the communicating devices connection, maintaining a
should establish a connection connection, or terminating a
before transmitting data and connection. UDP is efficient for
should close the connection broadcast and multicast types of
after transmitting the data. network transmission.

Reliability TCP is reliable as it guarantees The delivery of data to the


the delivery of data to the destination cannot be guaranteed
destination router. in UDP.

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.

Acknowledgm An acknowledgment segment is No acknowledgment segment.


ent present.

38
Basis Transmission Control User Datagram Protocol (UDP)
Protocol (TCP)

Sequence Sequencing of data is a feature There is no sequencing of data in


of Transmission UDP. If the order is required, it has
to be managed by the application
Control Protocol (TCP). this layer.
means that packets arrive in
order at the receiver.

Speed TCP is comparatively slower UDP is faster, simpler, and more


than UDP. efficient than TCP.

Retransmissio Retransmission of lost packets There is no retransmission of lost


n is possible in TCP, but not in packets in the User Datagram
UDP. Protocol (UDP).

Broadcasting TCP doesn’t support UDP supports Broadcasting.


Broadcasting.

Protocols TCP is used by HTTP, UDP is used by DNS , DHCP ,


HTTPs , FTP , SMTP and Teln TFTP, SNMP , RIP , and VoIP .
et .

Stream Type The TCP connection is a byte UDP connection is a message


stream. stream.

Applications Used for Sending Emails, Used for Gaming, Video


Transferring Files, Web Streaming, Online Video Chats,
Browsing, etc. etc.

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.

ii] Token bucket:


• In contrast to the LB (Leaky Bucket), the Token Bucket Algorithm, allows
the output rate to vary, depending on the size of the burst.
• In the TB (Token Bucket) algorithm, the bucket holds tokens. To transmit a
packet, the host must capture and destroy one token.
• Tokens are generated by a clock at the rate of one token every Δt sec.
• Idle hosts can capture and save up tokens (up to the max. size of the bucket)
in order to send larger bursts later.

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.

3. Explain the TCP frame format.


A. A TCP frame (or segment) is the data unit used in the Transmission Control
Protocol (TCP) to ensure reliable communication. The frame contains various
fields to manage data transmission, reliability, and flow control.

The TCP frame consists of the following fields:


• Source Port (16 bits): Identifies the sender's application (port number).
• Destination Port (16 bits): Identifies the receiver's application (port
number).
• Sequence Number (32 bits): Specifies the sequence number of the first byte
in the current segment. Used for data ordering and reliability.
• Acknowledgment Number (32 bits): Contains the next expected byte from
the sender. Used for acknowledging received data.
• Data Offset (4 bits): Indicates the size of the TCP header (in 32-bit words).
Helps locate the start of the payload.
• Reserved (3 bits): Reserved for future use; usually set to 0.

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.

4. Explain the UDP format.


A. The User Datagram Protocol (UDP) is a connectionless transport layer protocol
used for fast, lightweight data transmission without ensuring reliability or ordering.
The UDP frame, also called a datagram, has a simple structure.

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.

5. Explain the TCP connection (3-way handshake).


A. When two computers want to send data to each other over TCP, they first need
to establish a connection using a three-way handshake.

Step 1 - Establish a connection:


• The first system sends a packet with the SYN bit set to 111 (SYN = <>).
• The second system sends back a packet with the ACK bit set to 111 (ACK =
“acknowledge!”) plus the SYN bit set to 111.
• The first computer replies with an ACK. Both bits are part of TCP header.
• These packets typically do not include any data.
• Once the computers are done with the handshake they are actually ready to
receive the packets containing the actual data.

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.

Step 3 - Close the connection:


• Either computer can close the connection when they are no longer want to
send or receive data.
• A system initiates closing the connection by sending a packet with the FIN
bit set to 1(FIN= finish).
• The other computer replies with an ACK and another FIN. After one more
ACK from the initiating computer the connection is closed.

6. Explain the importance of Quality of Services (QoS).


A.
• The Quality of Service (QoS) in computer networks enables business to
deliver reliable services with minimal disruption to users.
• It is a measurement of the overall performance of a service such as a
computer network, telephony and cloud computing.

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.

7. Explain the working of Simple Mail Transfer Protocol (SMTP).


A.
• SMTP is an application layer protocol.
• The main purpose of the SMTP is to set up the communication guidelines
between the servers.
• The client SMTP is the one that initiates the session and the server SMTP is
the one that responds to the session request.

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.

• SMTP is used two times while sending an email:


o Between the sender and the Sender’s mail server.
o Between the sender’s mail server and the receiver mail server.
• SMTP model is of two types:
o End-to-end method: Used to communicate between different
organizations.
o Store-and- forward method: Used within an organization.

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

You might also like