Bca - Computer Networking
Bca - Computer Networking
NAME
ROLL NUMBER
SEMESTER IV
SET - I
1
Q1. Why is layered model used for computer networks? Explain OSI referenced model.
I. Physical Layer
• Deals with the physical connection between devices.
• It defines hardware components, transmission media, and electrical signals used to transmit
binary data.
2
IV. Transport Layer
• Ensures reliable communication between devices.
• It manages error recovery, flow control, and data sequencing using protocols like TCP and
UDP.
V. Session Layer
• Manages sessions or connections between applications.
• It handles starting, maintaining, and closing communication sessions.
Conclusion
The layered model makes it easier to build, understand, and manage networks. The OSI
reference model organizes communication into seven well-defined layers, helping developers
and engineers design systems that work across a wide range of technologies and platforms.
Q2 – Discuss the working of Stop and Wait protocol in a noisy channel with the help of
an example.
3
2. Timeout and Retransmission
• If the sender does not receive an ACK before the timer expires, it assumes the frame or the
ACK was lost or corrupted.
• The sender then retransmits the same frame.
• Consider a sender that needs to send two frames to a receiver: Frame 0 and Frame 1.
• This cycle repeats for every frame, ensuring data integrity and reliability even in noisy
environments.
• Ensures reliable delivery of each frame, even when transmission errors occur.
• Simple and easy to implement, making it suitable for basic communication systems.
• Prevents data overload at the receiver, as only one frame is in transit at any time.
• Low Efficiency:
– Only one frame is sent at a time, which causes poor utilization of bandwidth, especially
in high-speed networks or networks with long propagation delays.
• Idle Time:
– The sender remains idle while waiting for an acknowledgment, leading to
underutilization of resources.
Conclusion
The Stop and Wait protocol is a simple yet powerful method for ensuring reliable
communication over a noisy channel. Through the use of acknowledgments, timeouts, and
sequence numbers, it can handle data loss, duplication, and corruption. Although it has
significant limitations in terms of efficiency and speed, it lays the foundation for more
advanced error control protocols and remains essential in understanding basic data link layer
operations.
4
Q3. Give a contrast between unicast, multicast and broadcast. Also explain the way they
implemented.
I). Unicast
• Definition
Unicast refers to a one-to-one communication method in which data is sent from a single
sender to a single specific receiver across the network.
• Characteristics
– It is the most commonly used form of data transmission, especially in client-server models.
– Each unicast communication session involves a unique connection between sender and
receiver.
– Data is delivered only to the intended destination, ensuring privacy and controlled usage of
network resources.
• Example
Accessing a website from a personal computer or downloading a file from a server.
II). Multicast
• Definition
Multicast is a one-to-many communication method in which data is sent from one sender to a
group of selected recipients who are interested in receiving the data.
• Characteristics
– The sender transmits data only once, and the network ensures delivery to multiple
subscribed receivers.
– Only the devices that have expressed interest in the multicast group receive the data.
– It is bandwidth-efficient for group communication like video conferencing or live
streaming.
• Example
A teacher broadcasting an online lecture to selected students connected in a virtual
classroom.
III). Broadcast
• Definition
Broadcast refers to a one-to-all communication method where data is sent from one sender to
all devices within a local network segment.
• Characteristics
– Every device on the local network receives the broadcast data regardless of whether it is
interested in it.
– Broadcast is limited to the broadcast domain (usually the local network or subnet).
– It is useful for network discovery protocols and address resolution tasks.
• Example
ARP (Address Resolution Protocol) messages sent to all devices on a local LAN.
5
➤ Implementation of Unicast, Multicast, and Broadcast
• IP Addressing:
Unicast communication uses a unique IP address assigned to the destination device.
For example, when a browser sends a request to a web server, the request is sent to that
server’s IP address directly.
• MAC Addressing:
In Ethernet networks, the unicast frame contains the MAC address of the destination device.
Switches read the MAC address and deliver the frame to the correct port.
• Routing:
Routers forward unicast packets based on the destination IP address using routing tables.
• IP Addressing:
Multicast communication uses reserved IP address ranges (e.g., 224.0.0.0 to
239.255.255.255 in IPv4) to represent multicast groups.
• Group Membership:
Devices join multicast groups using IGMP (Internet Group Management Protocol).
Routers and switches maintain multicast group information to ensure data is only delivered
to subscribed devices.
• Efficient Transmission:
The sender sends a single copy of data, and routers replicate and deliver it only to relevant
recipients, saving bandwidth.
• Broadcast Addressing:
Broadcasts use a special IP address such as 255.255.255.255 (limited broadcast) or the
network-specific broadcast address (e.g., 192.168.1.255 for 192.168.1.0/24).
• MAC Addressing:
Ethernet frames are sent to the broadcast MAC address FF:FF:FF:FF:FF:FF so that all
devices on the LAN receive the frame.
• Network Scope:
Broadcast traffic does not cross routers. Routers drop broadcast packets to prevent flooding
beyond the local network.
Conclusion
Unicast, multicast, and broadcast represent three different ways of sending data across a
network. Unicast delivers data to one specific device, multicast delivers it to a selected group
of interested receivers, and broadcast sends it to all devices in the local network. Each
method has its own use case and is implemented using specific IP address types, transmission
protocols, and hardware-level addressing schemes to suit various network communication
needs.
6
SET - II
Q4. Explain various routing methods follow in network layer. Discuss their purpose in
different environments.
Routing is the process of selecting a path for traffic in a network. The network layer is
responsible for determining the best route for data packets from the source to the destination
across multiple networks. Various routing methods are used depending on the size,
complexity, and requirements of the network environment.
• Definition
Static routing is a method where routes are manually configured and entered into the routing
table by a network administrator.
• Advantages
– Simple to implement and understand.
– No routing overhead or bandwidth consumption by routing protocols.
• Limitations
– Not scalable for large or dynamic networks.
– Requires manual updates for any changes in network structure.
7
• Definition
Dynamic routing uses routing protocols that automatically adjust routes based on the current
network status and topology.
• Examples of Protocols
– RIP (Routing Information Protocol)
– OSPF (Open Shortest Path First)
– EIGRP (Enhanced Interior Gateway Routing Protocol)
• Advantages
– Automatic updates reduce administrative burden.
– Efficient and adaptive to network changes.
• Limitations
– Consumes more bandwidth and CPU resources.
– Slightly more complex to configure and troubleshoot.
• Definition
Default routing is used when a router is configured to send all packets destined for unknown
networks to a single default route or gateway.
• Advantages
– Simple and efficient configuration for limited traffic paths.
– Saves routing table space and reduces complexity.
• Limitations
– Not ideal for networks that require multiple path options or granular control.
– May result in suboptimal routing decisions in complex networks.
• Definition
In source routing, the sender specifies the complete route that a packet should follow through
the network.
8
• Advantages
– Provides full control over the packet's path.
– Useful for diagnostics and troubleshooting.
• Limitations
– Not scalable or secure for large networks.
– Adds overhead due to additional routing information in each packet.
• Definition
Hierarchical routing divides the network into different levels or regions, with routers
assigned specific roles in each level.
• Advantages
– Reduces routing table size through route summarization.
– Enhances efficiency and performance in large environments.
• Limitations
– Requires careful design and planning.
– Can become complex as hierarchy levels increase.
• Definition
Adaptive routing dynamically changes the routing paths based on current network conditions
such as traffic load, link failure, or delay.
• Advantages
– Ensures optimal route selection based on real-time conditions.
– Enhances fault tolerance and network performance.
• Limitations
– Higher complexity and resource consumption.
– May cause routing instability if not properly configured.
Conclusion
Different routing methods serve specific purposes based on the structure and needs of a
network. Static and default routing are simple and best suited for small or stable
environments, while dynamic, adaptive, and hierarchical routing support larger and more
complex networks. Source routing provides special control in testing scenarios. Selecting the
appropriate routing method is essential for ensuring network efficiency, reliability, and
scalability.
9
Q5. Explain the process of controlling congestion in the transport layer in detail with
the help of examples.
1. Slow Start
• This is the initial phase of TCP congestion control where data is sent cautiously to probe
the network capacity.
• TCP begins with a small congestion window (cwnd), usually one segment.
• For each acknowledgment received, the congestion window doubles, allowing the sender to
increase its rate exponentially.
• This continues until a threshold (ssthresh) is reached or a packet loss occurs.
• Example: If the initial cwnd is 1, the next values will be 2, 4, 8, 16, and so on.
2. Congestion Avoidance
• Once the cwnd reaches the slow start threshold (ssthresh), TCP switches to congestion
avoidance mode.
• In this phase, cwnd increases linearly instead of exponentially.
• This controlled growth helps to avoid congestion while maintaining good throughput.
10
avoidance to grow more slowly.
• Suddenly, a segment is lost, and the sender receives three duplicate ACKs.
• TCP performs a fast retransmit and reduces cwnd before gradually recovering.
• If ECN is enabled, routers may inform the sender about upcoming congestion before actual
packet loss, helping it adjust transmission rate proactively.
Conclusion:
Congestion control is essential for managing traffic in modern networks. The transport layer,
mainly through TCP, uses techniques like slow start, congestion avoidance, fast retransmit,
fast recovery, and ECN to detect and control congestion effectively. These methods allow
TCP to adapt to varying network conditions, prevent overload, and ensure consistent and fair
data transmission across the network.
Q6. Compare between the lossy and lossless compression. Discuss the tradeoff between
these.
I. Lossless Compression
• Definition
Lossless compression is a technique that reduces file size without losing any data. After
decompression, the original file is restored exactly to its original state.
• Working
This method eliminates redundancy and repeated patterns in data using algorithms like
Huffman Coding, LZW (Lempel-Ziv-Welch), or Run-Length Encoding.
• Advantages
– Perfect data reconstruction
– Ideal for critical or sensitive data
– Ensures accuracy and integrity
• Limitations
– Typically lower compression ratio compared to lossy
– Larger file sizes than lossy compression
11
• Definition
Lossy compression reduces file size by permanently removing some data that is considered
less important or less noticeable to human perception.
• Working
It discards certain information during compression to achieve higher size reduction.
Algorithms include JPEG (for images), MP3 (for audio), and MPEG (for video).
• Advantages
– High compression ratio
– Significantly smaller file sizes
– Faster transmission and loading
• Limitations
– Cannot recover original data after compression
– Quality degrades, especially after multiple compressions
– Not suitable for sensitive or precise data
• 2. Application Suitability
Lossy is suitable for multimedia where minor data loss is acceptable. Lossless is preferred
for documents, codes, and data files where accuracy is essential.
Conclusion:
Lossy and lossless compression each serve different purposes based on the need for file
accuracy or space savings. Lossy compression prioritizes smaller size and faster delivery,
making it ideal for multimedia, while lossless compression guarantees data integrity, making
it best suited for text, software, or archival use. The choice between the two depends on the
required balance between quality and efficiency.
12