Computer Networks Question Bank Solutions
Computer Networks Question Bank Solutions
By
Faculty Name: Mrs. Poornima M, Dr. Abhilash C.N & Mr. Abhinand B.V
• This model is based on a proposal developed by the International Standards Organization (ISO). It just
tells what each layer should do.
• The model is called the ISO OSI (Open Systems Interconnection) Reference Model because it deals
with connecting open systems—that is, systems that are open for communication with other systems.
The Physical Layer
• The physical layer focuses on transmitting raw bits through a communication channel.
• Key design issues include ensuring accurate bit representation (1 as 1 and 0 as 0).
• Considerations involve the choice of electrical signals, bit duration, and simultaneous bidirectional
transmission.
• The layer addresses connection establishment and teardown processes.
• It also deals with mechanical, electrical, and timing interfaces, as well as the physical transmission
medium.
The Data Link Layer
• The data link layer's primary function is to eliminate undetected transmission errors from a raw
transmission facility.
• The sender segments input data into data frames, usually ranging from a few hundred to a few
thousand bytes.
• Frames are transmitted sequentially from the sender to the receiver.
• In reliable services, the receiver sends back an acknowledgment frame to confirm the correct receipt
of each data frame.
• The medium access control (MAC) sub layer is responsible for managing access to the shared
communication channel.
• The data link layer plays a crucial role in ensuring efficient and error-free communication between
devices in a network.
The Network Layer
• The network layer manages subnet operations, focusing on packet routing from source to destination.
• Routing methods include static tables, automatic updates for failed components, initial session-based
routing, and dynamic routing based on current network conditions.
• Network congestion occurs when too many packets are present simultaneously, leading to
bottlenecks.
The Transport Layer
• The basic function of the transport layer is to accept data from above it, split it up into smaller units,
if need be, pass these to the network layer, and ensure that the pieces all arrive correctly at the other
end.
• The most popular type of transport connection is an error-free point-to- point channel that delivers
messages or bytes in the order in which they were sent.
• The type of service is determined when the connection is established.
• The transport layer is a true end-to-end layer; it carries data all the way from the source to the
destination.
The Session Layer
• The session layer allows users on different machines to establish sessions between them.
• Sessions offer various services, including dialog control (keeping track of whose turn it is to transmit),
token management (preventing two parties from attempting the same critical operation simultaneously),
and synchronization (checkpointing long transmissions to allow them to pick up from where they left
off in the event of a crash and subsequent recovery).
The Presentation Layer
• The presentation layer is concerned with the syntax and semantics of the information transmitted. In
order to make it possible for computers with different internal data representations to communicate, the
data structures to be exchanged can be defined in an abstract way, along with a standard encoding to be
used ‘‘on the wire.
The Application Layer
• The application layer contains a variety of protocols that are commonly needed by users.
• One widely used application protocol is HTTP (Hyper Text Transfer Protocol), which is the
basis for the World Wide Web.
• When a browser wants a Web page, it sends the name of the page it wants to the server hosting the page
using HTTP.
• The server then sends the page back. Other application protocols are used for file transfer, electronic
mail, and network news.
2. Define Computer Network. Explain local area network in detail with a neat diagram
Solution:-
• Broadcast networks share a communication channel among all machines on the network.
Packets sent by any machine are received by all other machines on the network.
• A Local Area Network (LAN) is a privately owned network operating within a single building or nearby
areas.
• LANs are commonly used to connect personal computers and consumer electronics for resource
sharing and information exchange.
• In corporate settings, LANs are referred to as enterprise networks.
• Wireless LANs are increasingly popular in various environments, including homes and offices.
• Wireless LANs eliminate the need for cabling, making installation easier in places like cafeterias and
older buildings.
• Each computer in a wireless LAN is equipped with a radio modem and antenna for
communication.
• Computers typically connect to an Access Point (AP), wireless router, or base station.
• The AP relays data packets between wireless computers and the Internet.
• Direct peer-to-peer communication (Instead of relying on a central server to connect users, devices talk
directly to each other) is possible among nearby computers in a wireless LAN.
• A switch relays packets among connected computers by using packet addresses to determine the
destination.
• Larger LANs can be constructed by connecting multiple switches through their ports.
• Network protocols are designed to handle packet routing, ensuring safe delivery even in the case
of looped connections between switches.
• Large physical LAN can be divided into smaller logical LANs for better management.
• This division is useful when the network layout does not align with organizational structure.
• Example: Engineering and Finance departments may benefit from separate Virtual LANs (VLANs).
• Each port in a VLAN is tagged with a specific “color” to distinguish between different
departments.
• Packets sent to one VLAN (e.g., red for finance) do not reach another VLAN (e.g., green for
engineering).
• Switched Ethernet is a modern variant of classic Ethernet, which originally used a single linear cable.
• Classic Ethernet allowed only one machine to transmit at a time and used a collision resolution
algorithm.
• In classic Ethernet, machines would wait a random time after a collision before trying to transmit
again.
• Both wired and wireless networks can be categorized into static and dynamic channel allocation designs.
• Many devices are already network-capable, including computers, entertainment systems,
and smart appliances.
• Home networks should be user-friendly, as many consumers struggle with complicated wireless
router setups.
3. List out various the design issues of the layers
• Congestion occurs when network demand exceeds its capacity, requiring computers to reduce
their traffic.
• Networks offer more than just bandwidth; they also need to ensure timely delivery for
applications like live video.
• Quality of service mechanisms help balance the competing demands of real-time delivery and
high throughput.
• Network security is a major design issue, addressing threats such as eavesdropping on
communications.
• Confidentiality mechanisms are implemented across multiple layers to protect against
unauthorized access.
• Authentication and integrity mechanisms are crucial for verifying identities and
ensuring messages remain unchanged.
4. Differentiate between LAN, WAN and MAN
Solution:-
5. Differentiate between connection oriented and connection less service
Solution:-
6. What are service primitives with a help of a diagram and service primitives explain client server
communication
Solution:-
SERVICE PRIMITIVES
• A service is defined by a set of primitives (operations) that user processes can use to access it.
• When the protocol stack is in the operating system, these primitives are typically implemented
as system calls.
• System calls trigger a trap to kernel mode, transferring control to the operating system to
manage packet transmission.
• The specific set of available primitives varies based on the type of service being offered.
• Connection-oriented services have a distinct set of primitives compared to connectionless services.
• Understanding the nature of the service is crucial for determining the appropriate primitives
to use.
• In a client-server environment, the server uses the LISTEN primitive to accept incoming
connections, generally implemented as a blocking system call.
• The server process remains blocked until a connection request is received.
• The client process initiates a connection using the CONNECT call, specifying the server's
address.
• The operating system sends a connection request packet to the server, causing the client
process to suspend until a response is received.
• Upon receiving the connection request, the server's operating system checks for a listener and
unblocks it if present.
• The server establishes the connection with the ACCEPT call, sending a response back to the
client to confirm the connection.
• The server then executes the RECEIVE call to prepare for the first request, which blocks the server
again.
• The client sends its request using the SEND call and waits for a reply by executing RECEIVE.
• After processing the request, the server sends the response back to the client, unblocking it to inspect
the answer.
• The client terminates the connection with DISCONNECT, followed by the server acknowledging and
also disconnecting, which ultimately releases both processes.
7. Explain various protocols in TCP/IP Model
Solution:-
• The first one, TCP (Transmission Control Protocol), is a reliable connection-oriented protocol
that allows a byte stream originating on one machine to be delivered without error on any other
machine in the internet.
• It segments the incoming byte stream into discrete messages and passes each one on to the internet
layer.
• At the destination, the receiving TCP process reassembles the received messages into the
output stream.
• TCP also handles flow control to make sure a fast sender cannot swamp a slow receiver with
more messages than it can handle.
• The second protocol in this layer, UDP (User Datagram Protocol), is an unreliable,
connectionless protocol for applications that do not want TCP’s sequencing or flow control and
wish to provide their own.
• It is also widely used for one-shot, client-server-type request-reply queries and applications in
which prompt delivery is more important than accurate delivery, such as transmitting speech or
video.
• On top of the transport layer is the application layer. It contains all the higher-level protocols. The
early ones included virtual terminal (TELNET), file transfer (FTP), and electronic mail (SMTP),
the Domain Name System (DNS), for mapping host names onto their network addresses, HTTP, the
protocol for fetching pages on the World Wide Web, and RTP, the protocol for delivering real-time
media such as voice or movies.
8. List the difference between OSI and TCP/IP reference Model
Solution:-
A Comparison of the OSI and TCP/IP Reference Models
• The OSI and TCP/IP reference models share similarities, particularly in their structure as stacks of
independent protocols and the functionality of their layers.
• Both models aim to provide end-to-end, network-independent transport services to
communicating processes through their transport layers.
• Key concepts in the OSI model are services, interfaces, and protocols, with a clear distinction made
between them.
• The OSI model emphasizes the semantic definition of services, how layers interface with one
another, and the internal workings of protocols being hidden from higher layers.
• The OSI model was created prior to the invention of its corresponding protocols, resulting in
a more general framework but also leading to challenges in defining layer functionalities.
• In contrast, the TCP/IP model was developed around existing protocols, ensuring a good fit.
• The OSI model consists of seven layers, while the TCP/IP model has only four layers, with
differences in their respective functions.
• The OSI model supports both connectionless and connection-oriented communication in the
network layer but only connection-oriented in the transport layer.
• The TCP/IP model supports connectionless communication in the network layer and both modes in
the transport layer, offering users greater flexibility, particularly for simple request-response
protocols
9. With a neat diagram explain guided transmission media
Solution:-
• The purpose of the physical layer is to transport bits from one machine to another. Various
physical media can be used for the actual transmission.
• Each one has its own niche in terms of bandwidth, delay, cost, and ease of installation and
maintenance.
• Media are roughly grouped into guided media, such as copper wire and fiber optics, and unguided
media, such as terrestrial wireless, satellite, and lasers through the air.
Magnetic Media
Data transportation can be achieved by writing it onto magnetic tape or removable media
and physically delivering it to another computer, often proving more cost-effective than
using advanced technologies like satellites.
An Ultrium tape can store 800 gigabytes, and a box containing 1000 tapes can hold a total
of 800 terabytes, allowing for efficient large- scale data transport.
Delivery of data tapes can be accomplished within 24 hours across the U.S., achieving an
effective bandwidth of over 70 Gbps, and exceeding 1700 Gbps for local deliveries.
The cost of an Ultrium tape is approximately $40, and considering reusability and
shipping, the total expense for transporting 800 TB amounts to around $5000, or just
over half a cent per gigabyte.
Current computer networks cannot match the effective bandwidth and cost efficiency of
physical tape transport for large data transfers.
Twisted Pairs
A twisted pair consists of two insulated copper wires, typically around 1 mm thick, twisted together in
a helical form.
By twisting wires that carry current through them, the interference/noise produced by one wire
is effectively canceled by the interference/noise produced by the other.
Signals are transmitted as the difference in voltage between the two wires, enhancing noise
immunity.
External noise tends to affect both wires equally, which keeps the differential signal
intact.
The most prevalent use of twisted pairs is in telephone systems.
Twisted pairs can run several kilometers without amplification, but for longer distances the signal
becomes too attenuated and repeaters are needed.
Twisted pairs can be used for transmitting either analog or digital information.
The bandwidth depends on the thickness of the wire and the distance traveled, but several
megabits/sec can be achieved for a few kilometers in many cases.
Due to their adequate performance and low cost, twisted pairs are widely used and are likely to
remain so for years to come.
Twisted-pair cabling has several varieties, with Category 5 (Cat 5) being common in offices.
A category 5 twisted pair consists of two insulated wires gently twisted together. Four such pairs
are typically grouped in a plastic sheath to protect the wires and keep them together.
Coaxial Cable
• It has better shielding and greater bandwidth than unshielded twisted pairs, so it can span longer
distances at higher speeds.
• Two kinds of coaxial cable are widely used. One kind, 50-ohm cable, is commonly used when it is
intended for digital transmission from the start. The other kind, 75-ohm cable, is commonly used for
analog transmission and cable television.
• A coaxial cable consists of a stiff copper wire as the core, surrounded by an insulating material. The
insulator is encased by a cylindrical conductor, often as a closely woven braided mesh. The outer
conductor is covered in a protective plastic sheath.
Power Lines
• The use of power lines for data communication is an old idea. Power lines have been used by
electricity companies for low-rate communication.
• The difficulty with using household electrical wiring for a network is that it was designed to distribute
power signals.
Fiber Optics
• A fiber-optic cable is made of glass or plastic and transmits signals in the form of light.
• Light travels in a straight line as long as it is moving through a single uniform substance.
• If a ray of light traveling through one substance suddenly enters another substance (of a different
density), the ray changes direction.
10. Explain MAN with a neat labeled diagram
Solution:-
Metropolitan Area Networks
• A Metropolitan Area Network (MAN) typically covers a city, with cable television networks
being prominent examples.
• These cable systems evolved from community antenna systems meant to improve poor over-
the-air television reception.
• Early systems involved large antennas placed on hills, transmitting signals to subscribers' homes.
• Initially, these were locally designed systems until companies started securing contracts to
wire entire cities.
• The expansion included specialized television programming and channels catering to specific
interests, like news and sports.
• Until the late 1990s, cable networks were primarily for television reception only.
• The rise of the Internet led cable operators to realize they could offer two- way Internet service
using unused spectrum.
• This transition marked the evolution of cable systems from television distribution to
Metropolitan Area Networks (MANs).
• The centralized cable head end now distributes both television signals and Internet services to
homes.
• In addition to cable networks, high-speed wireless Internet access developments have led to another
MAN standard known as WiMAX (IEEE 802.16).
11. What is Path Loss? Explain different types of Frequency bands in radio transmission with
necessary diagram
Solution:-
At low frequencies, radio waves pass through obstacles well, but the power falls off sharply with
distance from the source. This attenuation is called path loss.
Radio Transmission
Radio frequency (RF) waves are easy to generate, can travel long distances, and can penetrate buildings
easily, so they are widely used for communication, both indoors and outdoors.
Radio waves also are omnidirectional, meaning that they travel in all directions from the source, so the
transmitter and receiver do not have to be carefully aligned physically.
The properties of radio waves are frequency dependent.
At low frequencies, radio waves pass through obstacles well, but the power falls off sharply with distance
from the source. This attenuation is called path loss.
At high frequencies, radio waves tend to travel in straight lines and bounce off obstacles.
12. What are guided transmission media? Explain twisted pair cable in detail
Solution:-
A twisted pair consists of two insulated copper wires, typically around 1 mm thick, twisted
together in a helical form.
By twisting wires that carry current through them, the interference/noise produced by
one wire is effectively canceled by the interference/noise produced by the other.
Signals are transmitted as the difference in voltage between the two wires, enhancing noise
immunity.
External noise tends to affect both wires equally, which keeps the differential
signal intact.
The most prevalent use of twisted pairs is in telephone systems.
Twisted pairs can run several kilometers without amplification, but for longer distances the
signal becomes too attenuated and repeaters are needed.
Twisted pairs can be used for transmitting either analog or digital information.
The bandwidth depends on the thickness of the wire and the distance traveled, but several
megabits/sec can be achieved for a few kilometers in many cases.
Due to their adequate performance and low cost, twisted pairs are widely used and are
likely to remain so for years to come.
Twisted-pair cabling has several varieties, with Category 5 (Cat 5) being common in
offices.
A category 5 twisted pair consists of two insulated wires gently twisted together. Four such
pairs are typically grouped in a plastic sheath to protect the wires and keep them together.
13. Explain different Wireless communication Technique.
Solution:-
WIRELESS TRANSMISSION
• The modern era has created "information junkies" who require constant online connectivity
through various portable devices.
• Traditional wired communication methods like twisted pair, coax, and fiber optics are insufficient
for these mobile users, who prefer wireless solutions.
• Wireless communication offers significant advantages beyond just mobile internet access,
benefiting even fixed devices in certain situations.
• In challenging terrains such as mountains, jungles, or swamps, wireless technology can be a
more effective solution than laying fiber cables.
• The origins of modern wireless digital communication trace back to the Hawaiian Islands,
where geographical barriers and inadequate telephone infrastructure prompted the need for
wireless solutions.
Radio Transmission
Radio frequency (RF) waves are easy to generate, can travel long distances, and can penetrate buildings
easily, so they are widely used for communication, both indoors and outdoors.
Radio waves also are omnidirectional, meaning that they travel in all directions from the source, so the
transmitter and receiver do not have to be carefully aligned physically.
The properties of radio waves are frequency dependent.
At low frequencies, radio waves pass through obstacles well, but the power falls off sharply with distance
from the source. This attenuation is called path loss.
At high frequencies, radio waves tend to travel in straight lines and bounce off obstacles.
Amateur radio operators (hams) use these bands to talk long distance. The military also communicate in the
HF and VHF bands.
Microwave Transmission
Above 100 MHz, the waves travel in nearly straight lines and can therefore be narrowly focused.
Concentrating all the energy into a small beam by means of a parabolic antenna (like the familiar satellite TV
dish) gives a much higher signal to-noise ratio, but the transmitting and receiving antennas must be accurately
aligned with each other. In addition, this directionality allows multiple transmitters lined up in a row to
communicate with multiple receivers in a row without interference, provided some minimum spacing rules are
observed.
For decades these microwaves formed the heart of the long-distance tele phone transmission system
Microwaves travel in a straight line, so if the towers are too far apart, Thus, repeaters are needed periodically.
The higher the towers are, the farther apart they can be. The distance between repeaters goes up very roughly
with the square root of the tower height.
Infrared Transmission
Infrared waves are widely used for short-range communication.
The remote controls used for televisions, VCRs, and stereos all use infrared communication.
They are relatively directional, cheap, and easy to build but have a major drawback: they do not pass through
solid objects.
On the other hand, the fact that infrared waves do not pass through solid walls well is also a plus.
It means that an infrared system in one room of a building will not interfere with a similar system in adjacent
rooms or buildings: you cannot control your neighbor’s television with your remote control.
no government license is needed to operate an infrared system, in contrast to radio systems, which must be
licensed outside the ISM bands.
As per IrDA (Infrared Data Association) standard.
Light Transmission
Unguided optical signaling or free-space optics has been in use for centuries. A more modern application
is to connect the LANs in two buildings via lasers mounted on their rooftops.
Optical signaling using lasers is inherently unidirectional, so each end needs its own laser and its own photo
detector.
It is also relatively easy to install.
MODULE 2
• To provide service to the network layer, the data link layer must use the service provided to it by the
physical layer.
• What the physical layer does is accept a raw bit stream and attempt to deliver it to the destination.
• It is up to the data link layer to detect and, if necessary, correct errors.
• The usual approach is for the data link layer to break up the bit stream into discrete frames,
compute a short token called a checksum for each frame, and include the checksum in the frame
when it is transmitted.
• The first framing method uses a field in the header to specify the number of bytes in the frame.
• When the data link layer at the destination sees the byte count, it knows how many bytes
follow and hence where the end of the frame is.
• The trouble with this algorithm is that the count can be garbled by a transmission error.
• For example, if the byte count of 5 in the second frame becomes a 7 due to a single bit flip, the
destination will get out of synchronization. It will then be unable to locate the correct start of the
next frame. The byte count method is rarely used by itself.
• The second framing method gets around the problem of resynchronization after an error by having
each frame start and end with special bytes. Often the same byte, called a flag byte, is used as both
the starting and ending delimiter.
• Two consecutive flag bytes indicate the end of one frame and the start of the next. Thus, if the
receiver ever loses synchronization, it can just search for two flag bytes to find the end of the current
frame and the start of the next frame.
• It may happen that the flag byte occurs in the data being transmitted
• The third method - Each frame begins and ends with a special bit pattern. This pattern is a flag byte.
Whenever the sender’s data link layer encounters five consecutive 1s in the data, it automatically
stuffs a 0 bit into the outgoing bit stream.
• When the receiver sees five consecutive incoming 1 bits, followed by a 0 bit, it
automatically destuffs (i.e., deletes) the 0 bit.
• If the user data contain the flag pattern, 01111110, this flag is transmitted as 011111010 but stored in
the receiver’s memory as 01111110.
• With both bit and byte stuffing, a side effect is that the length of a frame now depends on the contents
of the data it carries.
The last method of framing - We can use some reserved signals to indicate the start and end of
frames. We are using ‘‘coding violations’’ to delimit frames.
2. Write the algorithm for computing the checksum (CRC). Calculate CRC for a frame.
The network layer on A gives packet 1 to its data link layer. The packet is correctly received at
B and passed to the network layer on B. B sends an acknowledgement frame back to A.
2. The acknowledgement frame gets lost completely. It just never arrives at all. Life would be a
great deal simpler if the channel mangled and lost only data frames and not control frames, but
sad to say, the channel is not very discriminating. Dept. of ISE, SJBIT Page 17 COMPUTER
NETWORKS 23ISI403
3. The data link layer on A eventually times out. Not having received an acknowledgement, it
(incorrectly) assumes that its data frame was lost or damaged and sends the frame containing
packet 1 again
4. The duplicate frame also arrives intact at the data link layer on B and is unwittingly passed
to the network layer there. If A is sending a file to B, part of the file will be duplicated (i.e.,
the copy of the file made by B will be incorrect and the error will not have been detected). In
other words, the protocol will fail.
Protocols in which the sender waits for a positive acknowledgement before advancing to the
next data item are often called ARQ (Automatic Repeat reQuest) or PAR (Positive
Acknowledgement with Retransmission). Like protocol 2, this one also transmits data only in
one direction. Protocol 3 differs from its predecessors in that both sender and receiver have a
variable whose value is remembered while the data link layer is in the wait state. The sender
remembers the sequence number of the next frame to send in next frame to send; the receiver
remembers the sequence number of the next frame expected in frame expected.
4. Find the CRC for the data blocks 100100 with divisor 1101 and compute the code word.
.
5. Explain with code an unrestricted simplex protocol for sender and receiver.
.
6. Explain the working of ARQ with code.
Protocols in which the sender waits for a positive acknowledgement before advancing to the next
data item are often called ARQ (Automatic Repeat reQuest) or PAR (Positive Acknowledgement
with Retransmission).
Like protocol 2, this one also transmits data only in one direction. Protocol 3 differs from its
predecessors in that both sender and receiver have a variable whose value is remembered while
the data link layer is in the wait state.
The sender remembers the sequence number of the next frame to send in next frame to send;
the receiver remembers the sequence number of the next frame expected in frame expected.
Each protocol has a short initialization phase before entering the infinite loop .After
transmitting a frame and starting the timer, the sender waits for something exciting to happen .
.
7. Explain with neat diagram selective repeat protocol
The other general strategy for handling errors when frames are pipelined is called
selective repeat.
When it is used, a bad frame that is received is discarded, but any good frames received after it
are accepted and buffered. When the sender times out, only the oldest unacknowledged frame is
retransmitted.
If that frame arrives correctly, the receiver can deliver to the network layer, in sequence, all the
frames it has buffered. Selective repeat corresponds to a receiver window larger than 1.
This approach can require large amounts of data link layer memory if the window is large.
Selective repeat is often combined with having the receiver send a negative
acknowledgement (NAK) when it detects an error, for example, when it receives a checksum
error or a frame out of sequence.
NAKs stimulate retransmission before the corresponding timer expires and thus improve
performance
In Fig. 3-18(b), frames 0 and 1 are again correctly received and acknowledged and frame 2 is
lost. When frame 3 arrives at the receiver, the data link layer there notices that it has missed a
frame, so it sends back a NAK for 2 but buffers 3.
When frames 4 and 5 arrive, they, too, are buffered by the data link layer instead of being
passed to the network layer. Eventually, the NAK 2 gets back to the sender, which immediately
resends frame 2. When that arrives, the data link layer now has 2, 3, 4, and 5 and can pass all of
them to the network layer in the correct order.
.
8. Explain with neat diagram Go Back N protocol
One option, called go-back-n, is for the receiver simply to discard all subsequent frames,
sending no acknowledgements for the discarded frames. This strategy corresponds to a
receive window of size 1.
In other words, the data link layer refuses to accept any frame except the next one it must
give to the network layer.
If the sender’s window fills up before the timer runs out, the pipeline will begin to empty.
Eventually, the sender will time out and retransmit all unacknowledged frames in order,
starting with the damaged or lost one. This approach can waste a lot of bandwidth if the
error rate is high.
In Fig. 3-18(b) we see go-back-n for the case in which the receiver’s window is large. Frames
0 and 1 are correctly received and acknowledged.
Frame 2, however, is damaged or lost. The sender, unaware of this problem,
continues to send frames until the timer for frame 2 expires.
Then it backs up to frame 2 and starts over with it, sending 2, 3, 4, etc. all over again
.
9. Explain with code the working of 1-bit sliding window protocol
A sliding window protocol with a window size of 1. Such a protocol uses stop-and-wait since the
sender transmits a frame and waits for its acknowledgement before sending the next one.
Figure 3-16 depicts such a protocol. Like the others, it starts out by defining some variables.
Next frame to send tells which frame the sender is trying to send. Similarly, frame expected tells
which frame the receiver is expecting. In both cases, 0 and 1 are the only possibilities
.
10. Differentiate between pure ALOHA and slotted ALOHA
11. Differentiate between Persistent and Non-persistent CSMA
12. Explain any code Collision free protocol with neat diagram
A Bit-Map Protocol In our first collision-free protocol, the basic bit-map method, each
contention period consists of exactly N slots.
If station 0 has a frame to send, it transmits a 1 bit during the slot 0. No other station is allowed
to transmit during this slot.
Regardless of what station 0 does, station 1 gets the opportunity to transmit a 1 bit during slot 1,
but only if it has a frame queued.
Protocols like this in which the desire to transmit is broadcast before the actual transmission are
called reservation protocols because they reserve channel ownership in advance and prevent
collisions.
Let us briefly analyze the performance of this protocol. For convenience, we will measure
time in units of the contention bit slot, with data frames consisting of d time units.
The channel efficiency at low load is easy to compute. The overhead per frame is N bits and the
amount of data is d bits, for an efficiency of d / (d+N ).
13. Write a note on Adaptive Tree walk protocol
This mixed sample was then tested for antibodies. If none were found, all the soldiers in the
group were declared healthy. If antibodies were present, two new mixed samples were
prepared, one from soldiers 1 through N / 2 and one from the rest. The proc-ess was repeated
recursively until the infected soldiers were determined
If, on the other hand, two or more stations under node 2 want to transmit, there will be a
collision during slot 1, in which case it is node 4‘s turn during slot 2.
In essence, if a collision occurs during slot 0, the entire tree is searched, depth first, to locate
all ready stations.
Each bit slot is associated with some particular node in the tree. occurs, the search continues
recursively with the node‘s left and right children. If a bit slot is idle or if only one station
transmits in it, the searching of its node can stop because all ready stations have been located.
When the load on the system is heavy, it is hardly worth the effort to dedicate slot 0 to node 1
because that makes sense only in the unlikely event that precisely one station has a frame to
send.
14. Explain with neat diagram MACA protocol and identify how the hidden nodes problems are
solved
An early and influential protocol that tackles these problems for wireless LANs is MACA
(Multiple Access with Collision Avoidance) (Karn, 1990).
The basic idea behind it is for the sender to stimulate the receiver into outputting a short frame,
so stations nearby can detect this transmission and avoid transmitting for the duration of the
upcoming (large) data frame.
This technique is used instead of carrier sense.
MACA is illustrated in Fig. 4-12. Let us see how A sends a frame to B. A starts by sending
an RTS (Request To Send) frame to B, as shown in Fig. 4-12(a).
This short frame (30 bytes) contains the length of the data frame that will eventually follow.
Then B replies with a CTS (Clear To Send) frame, as shown in Fig. 4-12(b).
The CTS frame contains the data length (copied from the RTS frame). Upon receipt of the
CTS frame, A begins transmission
MODULE 3
1. Write Dijksthras algorithm to compute shortest path through graph Explain with an example
Dijkstra’s algorithm finds the shortest path from a source node to all other nodes in a weighted graph by
iteratively selecting the node with the smallest tentative distance and updating the distances to its
neighbours.
It ensures the shortest path is progressively discovered and is based on the principle of greedy
optimization.
Algorithm:
Create a Set sptSet (shortest path tree set) that keeps track of vertices included in the shortest path tree,
i.e., whose minimum distance from the source is calculated and finalized. Initially, this set is empty.
Assign a distance value to all vertices in the input graph. Initialize all distance values as INFINITE.
Assign the distance value as 0 for the source vertex so that it is picked first.
While Set doesn’t include all vertices
Pick a vertex ‘u‘ that is not there in Set and has a minimum distance value.
Include ‘u‘ to sptSet.
Then update the distance value of all adjacent vertices of u.
To update the distance values, iterate through all adjacent vertices.
For every adjacent vertex v, if the sum of the distance value of u (from source) and weight of edge u-v, is
less than the distance value of v, then update the distance value of v.
2. Illustrate the working of OSPF and BGP
• The presence of congestion means that the load is (temporarily) greater than the resources (in a part
of the network) can handle.
• Two solutions come to mind: increase the resources or decrease the load. Leaky Bucket
Algorithm
It mainly controls the total amount and the rate of the traffic sent to the network.
• Step 1 − Let us imagine a bucket with a small hole at the bottom where the rate at which water is
poured into the bucket is not constant and can vary but it leaks from the bucket at a constant rate.
• Step 2 − So (up to water is present in the bucket), the rate at which the water leaks does not depend on
the rate at which the water is input to the bucket.
• Step 3 − If the bucket is full, additional water that enters into the bucket that spills over the sides and is
lost.
• Step 4 − Thus the same concept applied to packets in the network. Consider that data is coming from the
source at variable speeds.
Token bucket algorithm
• Main problem is that it cannot control burst data, as it only allows average rate i.e. constant rate of data
flow and also it does not consider idle time of host.
• Step 1 − For example, if the host was idle for 12 seconds and now it is willing to send data at a very high
speed for another 12 seconds, the total data transmission will be divided into 24 seconds and average data
rate will be maintained.
• Step 2 − The host has no advantage of sitting idle for 12 seconds. Thus, we adopted a token bucket
algorithm.
• Step 3 − Hence, the token bucket algorithm is modification of leaky bucket in which leaky bucket
contains tokens.
• Step 4 − in this a token(s) are generated at every clock tick. For every packet to be transmitted, the system
must remove token(s) from the bucket. Thus, the token bucket algorithm allows idle hosts to accumulate
credit for the future in the form of tokens.
4. What is packet scheduling algorithm? Explain FIFO algorithm
• Algorithms that allocate router resources among the packets of a flow and between competing flows are
called packet scheduling algorithms.
• Three different kinds of resources can potentially be reserved for different flows:
1. Bandwidth.
2. Buffer space.
3. CPU cycles.
• The first one, bandwidth, is the most obvious. If a flow requires 1 Mbps and the outgoing line has a
capacity of 2 Mbps, trying to direct three flows through that line is not going to work. Thus, reserving
bandwidth means not oversubscribing any output line
• Packet scheduling algorithms allocate bandwidth and other router resources by determining which
of the buffered packets to send on the output line next.
• We already described the most straightforward scheduler when explaining how routers work. Each router
buffers packets in a queue for each output line until they be sent, and they are sent in the same order that
they arrived.
• This algorithm is known as FIFO (First-In First-Out), or equivalently FCFS (First- Come First-Serve).
FIFO -The other scheduling algorithms that we will describe also create other opportunities for deciding
which packet to drop when the buffers are full.
• FIFO scheduling is simple to implement, but it is not suited to providing good quality of service
because when there are multiple flows, one flow can easily affect the performance of the other
flows.
• If the first flow is aggressive and sends large bursts of packets, they will lodge in the queue.
Processing packets in the order of their arrival means that the aggressive sender can hog most of the
capacity of the routers its packets traverse, starving the other flows and reducing their quality of
service.
• To add insult to injury, the packets of the other flows that do get through are likely to be delayed
because they had to sit in the queue behind many packets from the aggressive sender.
5. Explain store and forward switching with neat diagram
• This packet is stored there until it has fully arrived once the link is fully processed by verifying the
checksum then it is forwarded to the next router till it reaches the destination. This mechanism is called
“Store and Forward packet switching.”
6. Explain the implementation of connection oriented and connectionless service with neat
diagrams
Flooding
• Flooding is a method where every router forwards a received packet to all its outgoing
connections, except the one from which it came. This ensures that the packet reaches every possible
destination.
• Problems with Flooding:
1. Too Many Duplicates – Every router keeps forwarding packets, creating an overwhelming
number of duplicates.
2. Infinite Loops – If unchecked, packets can keep circulating forever.
• How to Control the Flood:
1. Hop Counter (TTL - Time to Live)
– Each packet has a counter that decreases at every hop.
– When the counter reaches zero, the packet is discarded.
– The counter should ideally match the expected path length.
2. Tracking Sent Packets (Sequence Number Method)
– Each packet has a unique sequence number assigned by the source.
– Routers remember previously seen sequence numbers and discard duplicates.
– When is Flooding Useful?
1. Broadcasting Messages – If information must reach every node in the network.
2. Highly Reliable Communication – If routers fail (like in war zones), flooding
ensures delivery as long as a path exists.
3. Building Other Routing Protocols – Since it requires no setup, flooding can help
discover paths before using more efficient routing methods.
4. Benchmarking – Since it explores all paths, it helps compare other routing algorithms.
9. Explain Distance vector routing with Example: Distance Vector Routing a short note on flooding
• Computer networks generally use dynamic routing algorithms that are more complex than flooding, but
more efficient because they find shortest paths for the current topology.
• Two dynamic algorithms in particular, distance vector routing and link state routing, are the
most popular.
• A distance vector routing algorithm operates by having each router maintain a table (i.e., a vector)
giving the best-known distance to each destination and which link to use to get there.
• These tables are updated by exchanging information with the neighbors. Eventually, every router knows
the best link to reach each destination.
EXAMPLE
The Count-to-Infinity Problem
• Good news spreads fast: If a better route is found, routers update immediately.
• Bad news spreads slowly: If a link fails, routers take multiple steps to realize it.
• A —— B —— C —— D
• Each router knows the shortest distance to A:
• B → A (1 hop)
• C → A (2 hops)
• D → A (3 hops)
• A ✖B —— C —— D
• B loses its direct path to A.
• B asks C for a route.
• C still thinks A is 2 hops away, so it tells B:
• "I can reach A in 2 hops"
• B updates its route to A as 3 hops (even though A is actually gone).
• A ✖B(3) —— C(4) —— D(5)
• C updates its distance to A as 4 (B’s 3 + 1)
• D updates its distance to A as 5 (C’s 4 + 1)
• The wrong information keeps spreading!
• The count keeps increasing until it reaches a set maximum.
• Split Horizon: Prevents routers from advertising routes back to the source.
Poison Reverse: Marks failed routes as infinite immediately.
Hold-Down Timer: Prevents immediate updates from incorrect sources.
10. Discuss count to infinity problem with example
What is the Count to Infinity Problem?
The Count to Infinity Problem occurs in distance vector routing protocols when routers
continuously increase the metric (hop count) to a destination that has become unreachable, due to a
slow propagation of failure information.
Distance vector protocols rely on neighboring routers' information to update their routing tables.
If a route goes down, it takes time for all routers to realize the destination is unreachable.
Meanwhile, they may believe a neighbor still has a valid path, causing the hop count to increase
gradually—this is called counting to infinity.
Example:
Let’s take a simple network of 3 routers: A, B, and C. A --- B --- C
Each link has a hop count of 1.
So the initial routing tables look like this:
Hierarchical Routing
• As networks grow, routers need to store more entries in their routing tables.
• More memory, CPU power, and bandwidth are required to handle these growing tables.
• At a certain point, it becomes impractical for every router to know about every other router.
• Divide the network into regions so that each router only tracks details of its own region and
summary information for other regions.
• Routers inside a region know the full details of local routing.
• For outside traffic, routers forward packets to a designated router that handles connections to other
regions.
• The process can be extended into multiple levels (regions → clusters → zones → groups, etc.).
EXAMPLE
• Suppose a packet travels from Berkeley, California to Malindi, Kenya:
– Berkeley router handles California traffic but sends out-of-state traffic to Los Angeles.
– Los Angeles router knows U.S. routes but forwards international traffic to
New York.
– New York router directs all Kenyan traffic to Nairobi.
– Nairobi router forwards the packet to Malindi.
• Saves memory: The routing table size is greatly reduced.
• Scalability: Works better for very large networks.
• If there are N routers, the best number of hierarchy levels is ln(N) (natural logarithm of N).
• A logarithm is just the opposite of an exponent. It tells you what power you need to raise a number to
get another number.
• ln720≈6.58 → This means e raised to 6.58 is about 720.
12. Write a short note on broadcast routing and Multicast routing
Broadcast Routing
1. Basic Broadcasting (Inefficient)
The simplest way is for the source to send a separate packet to each destination.
• Problems: Wastes bandwidth, slow, and requires knowing all destinations.
2. Multidestination Routing (Better, but Still Not Ideal)
Instead of separate packets, the source sends one packet with multiple destinations listed.
• Uses bandwidth better but still requires knowing all destinations.
3. Flooding (Efficient but Redundant)
A packet is sent to all neighboring routers, which forward it again, spreading the message.
• To prevent infinite loops, routers check sequence numbers and discard duplicates.
• Good for emergencies, but inefficient for regular broadcasting.
4. Reverse Path Forwarding (More Efficient)
• Routers only forward a broadcast packet if it arrives on the shortest path from the source.
• When a router receives a broadcast packet, it checks the link it came from.
• If the packet arrived on the best path from the source, the router forwards it to all other links.
• If the packet came from a different (non-optimal) path, the router discards it (since it’s likely a
duplicate).
5. Spanning Tree Broadcasting (Most Efficient)
Uses a spanning tree, a special structure that connects all routers without loops.
• Each router forwards the packet only along tree paths.
• Advantage: Minimizes the number of packets needed.
• Disadvantage: Routers must know the spanning tree, which is not always available.
• Basic broadcasting wastes bandwidth.
Multicast Routing
• Multicast routing efficiently delivers messages only to group members using special routing
techniques.
1. Pruning a Spanning Tree (For Dense Groups)
• Dense Groups (Many members, spread across the network)
• Most routers in the network have group members nearby.
• First, use a broadcast tree to reach all routers.
• Then, remove unnecessary links (pruning) so the message only goes where needed.
• Example protocols: MOSPF (Multicast OSPF), DVMRP.
• Problem: Large networks need to store too many trees, making it inefficient.
13. Explain packet routing for mobile host with a neat diagram
• The presence of congestion means that the load is (temporarily) greater than the resources (in a part
of the network) can handle.
• Two solutions come to mind: increase the resources or decrease the load.
Packet Scheduling
• Algorithms that allocate router resources among the packets of a flow and between competing flows are
called packet scheduling algorithms. Three different kinds of resources can potentially be reserved for
different flows:
1. Bandwidth. 2. Buffer space. 3. CPU cycles.
• It takes router CPU time to process a packet, so a router can process only a certain number of packets
per second.
1. FIFO (First In, First Out) — Simple but unfair
• All packets go into one queue.
• Whoever arrives first, leaves first.
• Problem: One greedy flow can hog the queue and ruin QoS for others.
2. Fair Queueing (FQ) — Everyone gets a fair share
• Each flow gets its own queue.
• Router picks from queues round-robin: 1 packet per queue per round.
• Problem: Flows with large packets get more bandwidth.
3. Byte-based Fair Queueing
• Fixes the above issue by simulating byte-by-byte fairness.
• Computes finish time for each packet based on size:
s Finish time = Arrival time or previous finish time + Length of packet
• Packets are sent in order of finish time.
4. Weighted Fair Queueing (WFQ) — Fair, but with priority
• Gives some flows more bandwidth (via weights).
• Example: Video stream gets 3x the share of a file download. Finish time Fi =
max(Ai, Fi−1) + Li / Wi
• Popular and used in real-world routers.
5. Deficit Round Robin (DRR) — WFQ but fast
• WFQ can be slow to implement because of sorting packets.
• DRR is an approximation of WFQ that’s much faster (constant time per packet).
6. Priority Scheduling
• Packets are marked as high or low priority.
• Always send high-priority packets first.
• Problem: Low-priority traffic can starve (never get sent).
7. Timestamp Scheduling
• Each packet has a timestamp.
• Send packets in timestamp order.
• Helps even out delay by speeding up slow packets and slowing down fast ones — results in more
consistent delivery.
MODULE 4
1. Explain the Transport service primitives
• But application layer must recover from transport-level failures (like incomplete
transactions after a server crash).
5. Discuss max-min fairness
Max-Min Fairness
• Definition: A bandwidth allocation is max-min fair if no flow can be given more
bandwidth without decreasing
the allocation of another flow that has less or equal bandwidth.
Example:
If three flows share a link:
• They each get 1/3.
• Even if another link has spare capacity, redistributing bandwidth would hurt less
privileged flows — violating fairness.
Convergence: Adjusting to Changing Conditions
• Network traffic is dynamic.
• New flows arrive, others leave, usage fluctuates. A good
congestion control algorithm must:
• Converge quickly to the best state.
• Track changes in traffic efficiently.
• Avoid oscillation or delay in adjustments.
Example:
• Flow 1 starts → gets all bandwidth.
• Flow 2 joins → they split bandwidth.
• Flow 3 joins, but only uses 20% → other two adjust to 40% each.
• Flow 2 leaves → Flow 1 takes up remaining bandwidth.
• At every step, total usage = 100%, and no one gets more than they need.
• What Makes a Congestion Control Algorithm "Good"?
6. Briefly discuss the steps of Remote Procedure call
• Similarly, the server is bound with a procedure called the server stub.
1. Client calls a local "stub" function (the client stub).
2. The client stub:
• Packs (marshals) the parameters. [Packing the parameters is called marshaling. ]
• Sends a network message (usually via UDP) to the server.
3. The server's OS gets the message and passes it to the server stub.
4. The server stub unpacks the parameters and calls the real procedure.
5. The reply goes back the same way in reverse.
This way, the programmer sees a normal function call, not a network operation
7. Explain R T P —The Real-time Transport Protocol header with a diagram
• IP header: 20 bytes
• TCP header: 20 bytes (minimum)
• Max data size: 65,535 - 20 - 20 = 65,495 bytes
• Optional: Up to 40 bytes of options
• Main TCP Header Fields (Fixed 20 Bytes)
• UDP transmits segments consisting of an 8-byte header followed by the pay load.
• The two ports serve to identify the end points within the source and destination machines.
Header contains:
5. Source Port (used for replies)
6. Destination Port (used to route to the correct app)
7. Length (header + data)
8. Checksum (optional, for error checking)
• It checksums the header, the data, and a conceptual IP pseudoheader.
• When performing this computation, the Checksum field is set to zero and the data field is padded out with
an additional zero byte if its length is an odd number.
• The checksum algorithm is simply to add up all the 16-bit words in one’s complement and to take the
one’s complement of the sum.
• When the receiver performs the calculation on the entire segment, including the Checksum field,
the result should be 0.
• The checksum checks for errors in:
• UDP header
• UDP data
• A special "pseudoheader" (contains source/destination IPs, protocol, and length)
• It contains the 32-bit IPv4 addresses of the source and destination machines, the protocol number for
UDP (17), and the byte count for the UDP segment (including the header).
• No flow control
• No congestion control
• No retransmission of lost packets These
responsibilities are left to the application
MODULE 5
Solution:
Client-Server Architecture
• In this architecture, there is a server and many clients distributed over the network (Figure 1.1a).
• The server is listening on the network and a client initializes the communication.
• Upon the requests from a client, the server provides certain services to the client.
• The applications such as FTP, telnet, Web, e-mail etc use the client-server architecture.
P2P Architecture
1. Request-line
2. 2. Header-line and
3. 3. Carriage return.
• The first line of message is called the request-line. The subsequent lines are called the header lines.
• The request-line contains 3 fields. The meaning of the fields is as follows:
1) Method ➢“GET”: This method is used when the browser requests an object from the server.
• The method field can take following values: GET, POST, HEAD, PUT and DELETE.
1. Status line
2. Header-lines
2) 400 Bad Request: The server cannot process the request due to a client error.
• The meaning of the Status line is as follows: “HTTP/1.1 200 OK”: This line indicates the server is using
HTTP/1.1 & that everything is OK.
3. Server: This line indicates that the message was generated by an Apache Web-server.
4. Last-Modified: This line indicates the time & date when the object was last modified.
6. Content-Type: This line indicates that the object in the entity body is HTML text.
3. Explain the use of cookie in web application
4. With a neat diagram explain how SMTP can be used for transmitting mails from sender to
Receiver
5. Explain persistent and non-persistent http in detail
6. Explain web caching with a diagram
7. List and Explain the transport services available to Applications
8. Write a short note on FTP protocol
9. Discuss FTP commands and Replies
10. Write a note on Mail Access protocols