0% found this document useful (0 votes)
10 views39 pages

Micro

micro is a great help

Uploaded by

Rehan HussanCSE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views39 pages

Micro

micro is a great help

Uploaded by

Rehan HussanCSE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 39

1)How does Manchester encoding differ from * Throughput for Slotted ALOHA is: S = Ge-G

differential Manchester encoding? * Maximum efficiency at G=1 is:

Smax = e-1 ≈ 0.368 (36.8%)


Differential Manchester
Manchester Encoding
Encoding
Each bit has a Always has a transition at * Slotted ALOHA has about twice the efficiency of Pure
transition in the the beginning of the bit ALOHA due to time synchronization.
middle of the bit period. 3. Differentiate between circuit switching &
period. packet switching.
Logical '1': Low to High Logical '1': No transition in
transition. the middle. Circuit Switching Packet Switching
Logical '0': High to Logical '0': Transition in the Dedicated physical path is No dedicated path —
Low transition middle. established before data data sent in packets
transfer. independently.
Provides better error
Synchronization is Connection-oriented Can be connectionless or
resilience as it depends on
maintained using communication. connection-oriented.
the presence or absence of
the mid-bit Suitable for real-time Suitable for data
transition, not voltage level.
transition. services (e.g., telephone transmission (e.g.,
More error-prone in calls). internet, emails).
More robust against polarity
case of polarity Efficient utilization —
inversion Inefficient resource
inversion multiple packets share
utilization if line is idle.
same network.
2. draw the following encoding scheme for the bit Example: Traditional
pattern 0001110101. (i) RZ (ii) AMI (iii) Differential Example: Internet
PSTN (Public Switched
Manchester encoding. Protocol (IP) networks.
Telephone Network).
Resources (bandwidth) are Resources used as per
reserved for entire call availability; no
duration. reservation.
Data is broken into
Continuous data
packets and sent in
transmission.
bursts.

4. Write the difference between bit stuffing and


character stuffing

Bit Stuffing Character Stuffing


5. Derive the expression of the efficiency of pure
Extra bits are inserted Extra characters are inserted
ALOHA. Compare it with the slotted ALOHA.
into data stream. into data stream.
Ans: Efficiency of Pure ALOHA are :-
* In Pure ALOHA, frames can be sent anytime, so the Performed at the bit Performed at the character
vulnerable period for collisions is 2 frame times. level. level.
* If GGG is the average number of transmission attempts Used to prevent
Used to distinguish control
per frame time, the probability of no collision is: accidental occurrence
characters from data.
of flag patterns in data.
𝑷𝟎 = 𝒆−𝟐𝑮
Throughput (efficiency) is: S = 𝑮𝒆−𝟐𝑮
Example: Insert a special
Example: Insert a ‘0’
character like DLE (Data
Maximum efficiency occurs at G=𝟏:
after five consecutive
Link Escape) before control
𝟐
‘1’s.
characters.
Smax = e-1 ≈ 0.184 (18.4%)
1 Common in protocols Common in protocols like
2 like HDLC. PPP.
Comparison with Slotted ALOHA Increases size by
* Slotted ALOHA divides time into slots, reducing Increases size by inserting
inserting individual
the vulnerable period to 1 frame time. whole characters.
bits.
(baki ans) 
7. Briefly describe the guided media in computer * The client sends an ACK packet to acknowledge the
networks and state the comparison among them.
ANS: Guided media refers to transmission
channels that use a solid physical path to guide
data signals from sender to receiver.The main
types are:
(i) Twisted Pair Cable
* Consists of pairs of insulated copper wires
twisted together.
* Types: Unshielded Twisted Pair (UTP) and Shielded
Twisted Pair (STP).
* Used in LANs, telephone networks.
(ii) Coaxial Cable
* Has a central copper conductor surrounded by
insulating material, metallic shield, and outer
cover.
* Used for cable TV, broadband internet.
(iii) Optical Fiber Cable
* Uses light signals through glass or plastic fibers.
* Types: Single-mode fiber (SMF) and Multi-mode
fiber (MMF).
* Used for high-speed, long-distance data
transmission.
Twisted Coaxial Optical
Criteria
Pair Cable Cable Fiber Cable
Low to
Bandwidth Medium Very high
medium
Transmission Up to 10 Up to 1-10 10 Gbps and
Speed Gbps Gbps beyond
Short Medium (up Long (tens
Distance
(<100m) to km) of km)
Cost Very low Moderate High
Susceptibility to
High Low Immune
EMI
Installation Difficult,
Easy Moderate
Ease delicate

8. Enumerate the mechanism of three-way


handshake protocol for TCP.
Ans: The Three-Way Handshake is a process used by
TCP to establish a reliable connection between a
client and a server. It ensures that both parties are
ready to transmit data.
(i) SYN (Synchronize)
* The client sends a SYN packet to the server.
* It indicates a request to establish a connection and
includes the initial sequence number.
(ii) SYN-ACK (Synchronize-Acknowledge)
* The server responds with a SYN-ACK packet.
* The server acknowledges the client’s SYN by
sending ACK.
* It also sends its own SYN request with its
initial sequence number.
(iii) ACK (Acknowledge)
Server’s SYN-ACK. many).
* Now, both sides know that the connection
is established and ready for data transfer.
9. Explain the working of Electronic mail.
How SMTP used in Email applications.
Ans: Electronic Mail (Email) is a service that allows
users to send and receive messages electronically over
computer networks.
(i) Composition : User composes an email using
a Mail User Agent (MUA) like Gmail, Outlook,
etc.
(ii) Submission : The email is sent from the client to
a Mail Server using SMTP (Simple Mail Transfer
Protocol).
(iii) Transfer : The Mail Server forwards the email
to the recipient’s Mail Server via SMTP.
(iv) Storage : The recipient’s server stores the email
in the recipient’s mailbox.
(v) Access : The recipient uses MUA to retrieve
the email using protocols like POP3 or IMAP.

Use of SMTP in Email Applications


* SMTP (Simple Mail Transfer Protocol) is the
standard protocol used for sending emails
across networks.
* It is a push protocol — sends email from:
* Client to Server.
* Server to Server.
SMTP working :
(i) Client connects to SMTP server (port 25/587).
(ii) Sends sender & recipient addresses.
(iii) Sends the message body.
(iv) Server responds with ACK or error codes.
(v) Email is forwarded to recipient’s mail server.
15. How many bits are there in physical
address? In terms of addressing, what are the
types of addressing? Mention their purpose of
uses.
Ans: A physical address is also known as a MAC
(Media Access Control) address.It has 48 bits in
length (6 bytes).And Usually written in hexadecimal
format, (e.g.: 00:1A:2B:3C:4D:5E.)
Types of Addressing in Networking
There are mainly 4 types of addressing used in networking:
(i) Physical Address (MAC) : Used to identify devices at
the Data Link Layer (Layer 2). Unique for every device
on the LAN.
(ii) Logical Address (IP Address) : Used to identify
devices at the Network Layer (Layer 3). Provides global
unique addressing. Example: IPv4 (32 bits), IPv6 (128
bits).
(iii) Port Address : Used at the Transport Layer to
identify specific processes on a device. Example: Port 80
(HTTP), Port 443 (HTTPS).
(iv) Specific Address (Multicast/Broadcast/Unicast):
Determines how packets are delivered: Unicast (one-
to- one), Broadcast (one-to-all), Multicast (one-to-
10. Discuss about the techniques to improve QoS 11. Explain CSMA and protocols with Collision
in internetworking. detection and Avoidance.
Ans: Quality of Service (QoS) refers to the set of Ans: CSMA is a media access control (MAC)
technologies and techniques used to ensure the protocol used to manage how data is transmitted on a
efficient transmission of data with minimum delay, shared communication channel.
jitter, and packet loss in networks. * The sender first listens (carrier sensing) to check if
Major QoS Improvement techniques are : the channel is free.
(i) Traffic Shaping: Controls the volume and rate of * If the channel is idle, the sender starts transmission.
traffic entering the network. * If the channel is busy, the sender waits and tries
Example: Token Bucket or Leaky Bucket algorithms. again.
(ii) Admission Control : Determines whether to accept CSMA Protocol Variants
a new traffic flow based on current network load. 1. CSMA/CA (Collision Detection)
Prevents congestion by rejecting excessive traffic. * Used in wired networks (e.g., Ethernet).
(iii) Resource Reservation : Reserves required * Sender monitors the channel while transmitting.
bandwidth and buffer space for specific flows. * If a collision is detected: Transmission stops
Protocols like RSVP (Resource Reservation immediately and jam signal is sent to inform all nodes.
Protocol) are used. Sender waits for a random backoff time before
(iv) Priority Queuing : Assigns different priorities to retrying.
different types of traffic (voice, video, data). Working Steps:
High-priority traffic is served first to ensure low delay. i). Listen → Channel idle → Transmit.
(v) Packet Scheduling : Controls the order in which ii). Listen while transmitting.
packets are transmitted. iii). If collision detected → Stop → Jam → Backoff →
Methods: Weighted Fair Queuing (WFQ), Round Retry.
Robin, First Come First Served (FCFS). 2. CSMA/CA (Collision Avoidance)
(vi) Congestion Control : Manages congestion using * Used in wireless networks (e.g., Wi-Fi).
techniques like window size adjustment, packet * Collisions are harder to detect wirelessly, so the
dropping, etc. protocol tries to avoid them.
(vii) Error Control: Techniques like Automatic Repeat * Uses mechanisms like RTS/CTS (Request to Send /
Request (ARQ) and Forward Error Correction (FEC) Clear to Send) to avoid collisions.
help reduce retransmission delays. Working Steps:
12. Show mathematically that if noise is too high i). Listen → Channel idle → Wait for Inter-Frame
of a noisy channel, the channel capacity will be Space (IFS).
zero. (Hint: consider SNR of signal) ii). Optionally exchange RTS/CTS to reserve channel.
Ans: According to Shannon’s Theorem, the capacity iii). Transmit data.
C of a noisy channel is given by: iv). Wait for ACK.
C = B log2(1 + SNR) 27. What is a Default Mask?
Where: Ans: A default mask, also called default subnet mask,
C = Channel Capacity (bits/sec) is the standard subnet mask assigned to an IP address
B = Bandwidth (Hz) based on its class (Class A, B, or C). It defines which
SNR = Signal-to-Noise Ratio portion of the IP address identifies the network and
SNR = Ps which portion identifies the host. It is used in IP
Pn networking to separate the network ID from the host
Where: ID in an IP address.
Ps= Signal Power Default Masks for IP Classes:
Pn = Noise Power Class A: 255.0.0.0
Now, when Noise Pn→∞ (very high noise): Class B: 255.255.0.0
SNR = Ps  0
Pn
Class C: 255.255.255.0
Substitute SNR→0 in the formula: Purpose:
C = B log2 (1+0) = B log2 (1) = b x 0 = 0 * Helps routers and devices identify the network
portion of an IP address.
So,When Noise is too high, SNR→0, which leads to: * Essential for routing traffic between networks.
C→0 Example:
Thus, the channel capacity becomes zero, meaning no IP address: 192.168.1.1 (Class C)
reliable data transmission is possible. Default mask: 255.255.255.0
13. Discuss application areas, merits and demerits
of FDM and TDM techniques in detail. conceptual framework that standardizes the functions
Ans: Frequency Division Multiplexing (FDM) : of a communication system into 7 layers:
In FDM, the total bandwidth is divided into multiple non-
overlapping frequency bands. Each user is assigned a Layer
unique frequency band for transmission. Layer Name Functions
No.
Applications of FDM:
* Radio broadcasting (AM, FM radio) Provides network services to
Application
* Cable TV networks 7 end users (email, file transfer,
Layer
* Telephone systems (old analog systems) web browsing)
* Satellite communication Data translation,
Merits of FDM: Presentation
6 encryption/decryption, data
* Continuous transmission — suitable for analog signals. Layer
compression
* No need for synchronization between users.
* Simple implementation in analog systems. Establishes, manages, and
Session
Demerits of FDM: 5 terminates communication
Layer
* Requires large bandwidth. sessions
* Interference between channels (cross-talk). Provides reliable data transfer
* Complex filtering needed to separate channels. Transport
4 (TCP/UDP), error control, flow
Time Division Multiplexing (TDM). Layer
control
In TDM, the entire bandwidth is shared in time. Each user
is allocated a time slot for transmission in a round-robin
Network Handles logical addressing and
3
fashion. Layer routing (IP)
Applications of TDM: Data Link Frames data, MAC addressing,
2
* Digital telephony (ISDN) Layer error detection
* Optical fiber communication Deals with physical
* Computer networks (e.g., multiplexed data streams) Physical
1 transmission of bits (cables,
* 4G/5G networks (TDMA — Time Division Layer
signals, voltages)
Multiple Access)
Merits of TDM:
* Efficient use of bandwidth 16. What TELNET stands for? Explain working
* Easy to implement in digital systems principle of TELNET.
* No need for complex filters Ans: TELNET stands for: Telecommunication
Demerits of TDM: Network
* Requires precise synchronization. It is a network protocol used to provide a command-
* Idle time slots wasted if no data to send. line interface for communication with a remote device
* Higher latency for some users. over a network.
14. Explain the utility of layered architecture. * Defined by IETF as a standard protocol for remote
Explain different layers of ISO/OSI models. login.
Ans: Utility of Layered Architecture : * Works over TCP port 23.
The layered architecture in networking divides Working Principle of TELNET
complex network functions into a series of (i) Connection Establishment:
independent layers. Each layer performs a specific * The client initiates a connection to the server using
role and interacts only with adjacent layers. TCP.
Benefits: * A virtual terminal session is created.
* Modularity — each layer can be developed (ii) Login: The user provides a username and password
independently to authenticate.
* Interoperability — ensures compatibility across (iii) Remote Control: * The client can now send text-
different hardware/software based commands to the server.
* Simplification — breaks complex communication * Commands are executed on the remote machine.
into manageable parts * Output is sent back to the client and displayed on the
* Flexibility — easy to update or replace a layer user’s terminal.
without affecting others (iv) Communication:
* Standardization — promotes universal standards for * TELNET transmits data in plain text.
network communication * It allows character-based interaction as if the user is
OSI Model Layers (7 Layers) sitting at the remote system.
The OSI (Open Systems Interconnection) model is a (v) Session Termination: The user can log out
(baki ans)  and terminate the session.
17. Discuss different persistent methods in (ii) In wireless networks, signal fading and
CSMA technique with flowchart. Why interference make it hard to reliably detect collisions
CSMA/CD is not implemented in WLAN? (iii)Therefore, WLAN uses CSMA/CA (Collision
Ans: Carrier Sense Multiple Access (CSMA) allows Avoidance) instead, which tries to avoid collisions
a device to sense the communication channel before before they occur by using techniques like RTS/CTS
sending data. The way the device behaves based on (Request to Send / Clear to Send) handshake and
the channel status defines the type of persistence random backoff times.
method used. 18. State the difference between IPV4 and IPV6?
(i) 1-Persistent CSMA
* The device senses the channel. Feature IPv4 IPv6
* If the channel is idle, it transmits immediately. Address length 32 bits 128 bits
* If the channel is busy, it continuously Address format
Decimal, e.g., Hexadecimal, e.g.,
keeps sensing until the channel becomes idle, 192.168.1.1 2001:0db8::1
then transmits. About 4.3 billion
About 3.4 x 10^38
Address space
* This method can cause high collision addresses addresses
probability because multiple devices may transmit Header size 20 bytes 40 bytes
as soon as the channel is free. Security
Optional (uses Built-in IPSec
(ii) Non-Persistent CSMA IPSec optionally)
support
* The device senses the channel. Auto-configuration
Configuration Manual or DHCP
* If the channel is idle, it transmits. supported
* If the channel is busy, it waits for a random Packet Done by sender Done only by
backoff time and then senses the channel fragmentation and routers sender
again. Not supported;
Broadcast Supported
* This reduces the chance of collision but uses multicast
increases transmission delay. Mobility and
Limited Improved
(iii) p-Persistent CSMA (used in slotted channels) scalability
* The device senses the channel. Quality of Better QoS support
Limited
Service (QoS) with flow label
* If the channel is idle, it transmits with a
probability p, or waits for the next time slot with
19. Define socket address along with its
a probability (1-p).
parameters Ans: A socket address is a combination
* If the channel is busy, it keeps sensing or waits.
of an IP address and a port number used to identify a
* This method balances the trade-off between specific process on a specific device in a network.
delay and collision probability. * It allows a device to communicate with a specific
application running on another device.
* It is used mainly in the Transport Layer (TCP/UDP
communication).
Parameters of Socket Address:
(i). IP Address
* Identifies the host (device) in the network.
* Example: IPv4 → 192.168.1.1, IPv6 →
2001:0db8::1.
(ii) Port Number
* Identifies a specific process or service on the host.
* Example: Port 80 (HTTP), Port 443 (HTTPS), Port
25 (SMTP).
Why CSMA/CD is not implemented in WLAN Format: Socket Address = (IP Address, Port Number)
CSMA/CD (Collision Detection) works well in wired Purpose:* Allows multiple processes to use the
networks like Ethernet but is not used in wireless LAN network simultaneously.
(WLAN) due to the following reasons: * Provides unique identification for network
(i) In wireless networks, it is difficult to detect connections.
collisions because the sender cannot sense the * Enables end-to-end communication between
channel while transmitting. Wireless systems operate processes.
in half- duplex mode.
20. What are the common services provided by TCP Connection Termination (4-Step Process)
both the layers TCP and Data-link? TCP connection termination is done gracefully using a
Ans: Both TCP (Transport Layer) and Data Link 4-step process to ensure all data is transmitted.
Layer provide several similar services to ensure (i) FIN → Client sends FIN (finish) to server to
reliable and efficient data communication. These request termination.
common services include: (ii) ACK → Server acknowledges the FIN.
(i) Framing / Segmentation : Divides the data into (iii) FIN → Server sends its own FIN.
manageable frames (Data Link Layer) or segments (iv) ACK → Client sends final ACK.
(TCP) before transmission. Diagram:
(ii) Flow Control: * Ensures that the sender does not Client Server
overwhelm the receiver with too much data at once.
* TCP: Uses window-based flow control. | ---------- FIN-------------------> |
* Data Link Layer: Uses techniques like stop-and-wait
or sliding window. | <------- ACK---------------------|
(iii) Error Control: * Detects and corrects errors in
transmitted data. | <--------- FIN---------------------|
* TCP: Uses checksums, ACKs, retransmissions.
* Data Link Layer: Uses CRC, | -------- ACK-------------------> |
ACKs, retransmissions.
(iv) Addressing : * Both layers use addressing to Connection Terminated
deliver data to the correct destination. 22. Distinguish TCP and UDP.
* TCP: Uses port numbers.
* Data Link Layer: Uses MAC addresses.
(v) Reliable Delivery : * Ensures correct sequencing
and complete delivery of data.
* TCP: Provides end-to-end reliable delivery.
* Data Link Layer: Provides node-to-node reliable
delivery (on the same link).
21. Explain 3-way handshaking mechanisms in
TCP for both connection establishment and
termination with suitable diagrams.
Ans:TCP Connection Establishment (3-Way
Handshake)
The 3-way handshake is used to establish a reliable
connection between client and server in TCP.
(i) SYN → Client sends a SYN (synchronize) packet
to the server to initiate a connection.
Segment: SYN=1, Seq=x
(ii) SYN-ACK → Server responds with a SYN-
ACK (synchronize + acknowledge) packet.
Segment: SYN=1, ACK=1, Seq=y, Ack=x+1
(iii)ACK → Client sends an ACK (acknowledgment)
packet to the server.
Segment: ACK=1, Seq=x+1, Ack=y+1
Diagram:
Client Server

| ------------ SYN >|

| <------- SYN + ACK---------------|

| ACK >|

Connection Established
TCP (Transmission UDP (User Datagram
Control Protocol) Protocol)
It is connection-oriented It is connectionless
protocol. protocol.
Provides reliable data
Provides unreliable data
transfer with error
transfer without
checking and
acknowledgment.
acknowledgment.
Ensures data is No guarantee of order of
delivered in order. delivery.
Slower due to overhead
Faster due to minimal
of reliability
overhead.
mechanisms.
Suitable for applications Suitable for applications
where accuracy is where speed is more
important (e.g., web important (e.g., video
browsing, email). streaming, online games).
Supports flow control Does not support flow or
and congestion control. congestion control.
Header size is larger (20 Header size is smaller (8
bytes minimum). bytes).
23. Define Domain Name System (DNS). Give * HTTP is a stateless protocol — each request is
example of three generic domain levels. independent and the server does not retain information
Ans: Domain Name System (DNS): about past requests.
DNS is a hierarchical and distributed naming system * Works over TCP, usually on port 80 (HTTPS uses
used to translate human-readable domain names port 443).
(like www.google.com) into IP addresses * Example: When you type www.example.com, your
(like 142.250.182.78) that computers use to identify browser sends an HTTP request to the server to fetch
each other on the network.It acts like the phonebook the webpage.
of the Internet, allowing users to access websites WWW (World Wide Web):
using domain names instead of remembering * WWW stands for World Wide Web.
numerical IP addresses. * It is a system of interlinked hypertext documents and
Example of DNS Process: multimedia content that can be accessed via the
When you type www.google.com in a browser, DNS Internet.
translates it to the IP address of the Google server. * Users can access the web using web browsers (like
Three Generic Domain Levels: Chrome, Firefox) to view web pages that may
(i) .com → Commercial websites (e.g., contain text, images, videos, and other media.
www.amazon.com) * The WWW uses HTTP as its communication
(ii) .org → Organizations (usually non-profit) (e.g., protocol.
www.wikipedia.org) * Created by Tim Berners-Lee in 1989.
(iii) .edu →Educational institutions(e.g., 26. What is the network address? What is the
www.mit.edu) purpose of subnetting?
24. What FTP stands for? Explain working Ans: Network Address: A network address is an
principle of FTP. identifier assigned to a network. It represents the
Ans: FTP stands for File Transfer Protocol. It is a starting point of the IP address range of a network. In
standard network protocol used to transfer files an IP address, the network address is obtained by
between a client and a server over a TCP/IP network, applying a bitwise AND operation between the IP
such as the Internet address and the subnet mask. It identifies the specific
Working Principle of FTP: network segment to which a device belongs.
(i) Connection Establishment: FTP uses two separate Example:
connections between client and server: If IP address = 192.168.1.10
* Control connection (port 21): Used for sending Subnet mask = 255.255.255.0
commands and responses. Network address = 192.168.1.0
* Data connection (port 20): Used for actual file Purpose of Subnetting:
transfer. Subnetting is the process of dividing a large network
(ii) Authentication: The client connects to the server into smaller, more manageable sub-networks
and provides username and password for (subnets). It improves network efficiency and security.
authentication. Purposes are:
(iii) Command Communication: Once connected, the (i) Efficient IP Address Management: Helps in optimal
client sends commands like LIST, RETR (download), utilization of IP addresses.
or STOR (upload) over the control connection. (ii) Improved Security: Subnets can isolate sensitive
(iv) Data Transfer: When a file needs to be transferred, data and systems.
a separate data connection is established temporarily (iii) Reduced Network Traffic: Limits broadcast traffic
to transfer the data. to smaller subnets.
(v) Closing Connection: After the transfer is complete, (iv) Enhanced Performance: Smaller networks reduce
the data connection is closed. The control connection congestion and improve speed.
remains open for further commands or is closed when (v) Simplified Management: Easier to monitor and
the session ends. troubleshoot small subnets.
25. Write short notes on the followings: HTTP and
WWW.
Ans: HTTP (HyperText Transfer Protocol):
* HTTP is a protocol used to transfer hypertext
documents on the World Wide Web.
* It defines how messages are formatted and
transmitted, and how web servers and browsers should
respond to various commands.
28. Define the following terminologies: switch, 30. Different Topologies Available in a Network
bridge, router and gateway. (i) Differentiate error Ans: A network topology is the arrangement or layout
detection and error correction and set of different elements (nodes, links, etc.) in a computer
appropriate examples. (ii) Define piggybacking network. It defines how devices are connected and
with suitable example. how data flows between them.
Ans: *Switch: A switch is a network device that There are several types of network topologie :-
connects multiple devices within a LAN. It operates at * Bus Topology: In a bus topology all devices are
the Data Link Layer (Layer 2) of the OSI model and connected to a single central cable (the bus). Data
forwards data based on MAC addresses. It helps travels in both directions along the bus. It is simple
reduce collisions and improves network efficiency. and cost-effective but has high chances of data
*Bridge: A bridge is used to connect two or more collisions and failure.
network segments, making them function as a single Example: Early Ethernet networks.
network. It also operates at the Data Link Layer and * Star Topology: In star topology all devices are
filters traffic based on MAC addresses to reduce connected to a central device (hub or switch). Data
unnecessary traffic. passes through the central hub. It is easy to manage
*Router: A router connects different networks and and expand but failure of hub affects the entire
routes data from one network to another. It works at network.
the Network Layer (Layer 3) and forwards packets Example: Modern LANs.
based on IP addresses. Routers are used to connect * Ring Topology: In ring topology devices are
LANs to WANs or the internet. connected in a closed loop. Data travels in one
*Gateway: A gateway acts as a translator between direction (unidirectional) or both (bidirectional)
networks using different protocols. It operates at all around the ring. Failure in one device can disrupt the
layers of the OSI model and enables communication whole network unless using dual rings.
between networks that use different architectures or Example: Fiber Distributed Data Interface (FDDI).
data format * Mesh Topology: In mesh topology every device is
(i) connected to every other device. It provides high
redundancy and fault tolerance. These are expensive
Aspect Error Detection Error Correction and complex to set up.
Detect the Detect and correct Example: Used in critical networks like military or
Purpose banking.|
presence of errors errors automatically
* Tree Topology: Tree topology is a combination of
Adds extra bits Adds
star and bus topologies.In which Devices are
Method (parity, CRC, redundancy
connected in a hierarchical manner and easy to
checksum) (Hamming Code,
manage. but dependent on the root node.
Reed-Solomon)
Example: Large organizations' networks.
Requests Corrects error * Hybrid Topology: Hybrid topology is a combination
Receiver’s
retransmission if without of two or more topologies (e.g., star + mesh). It offers
Action
error found retransmission flexibility and scalability.it is complex and costly to
Parity Bit, Hamming Code, implement.
Example
Checksum, CRC Reed-Solomon Code Example: Large enterprises and data centers.

(ii) Piggybacking is a technique used in bidirectional data


transfer where the acknowledgment (ACK) of a received
frame is not sent immediately but is combined with the
next data frame going in the reverse direction. It use to
improve network efficiency and reduce overhead caused
by separate ACK frames.
Example:
If Station A sends data to Station B, instead of Station B
sending a separate ACK, it waits till it has data to send to
Station A. It then sends the data along with the ACK in the
same frame.
31. Briefly describe the components of a network? (iv) Transport Layer (Layer 4):
Ans: A computer network consists of several essential * Provides reliable data transfer between end systems.
components that work together to enable * Manages error recovery, flow control, and
communication and data exchange between devices. segmentation of data.
The main components are: * Protocols: TCP (connection-oriented), UDP
(i) Nodes (Devices): These are end devices like (connectionless).
computers, printers, servers, smartphones, etc., that (v) Session Layer (Layer 5):
send, receive, or process data on the network. * Establishes, manages, and terminates sessions
(ii) Transmission Media: The physical pathway between applications.
through which data travels between devices. It can be * Controls dialogues and synchronization between
wired (like twisted pair cables, coaxial cables, fiber communicating systems.
optic cables) or wireless (like Wi-Fi, Bluetooth). (vi) Presentation Layer (Layer 6):
(iii) Network Interface Cards (NICs): Hardware * Translates data formats between the application and
installed in each device that allows it to connect to the network.
network and communicate using network protocols. * Handles data encryption, compression, and
(iv) Switches: Devices that connect multiple devices conversion (e.g., ASCII to EBCDIC).
within a LAN, forwarding data based on MAC (vii) Application Layer (Layer 7):
addresses to reduce collisions and improve efficiency. * Provides network services directly to user
(v) Routers: Devices that connect different networks applications.
and route data packets between them using IP * Supports protocols like HTTP, FTP, SMTP,
addresses. and DNS.
(vi) Modems: Convert digital data from a computer to * Enables user interaction with the network.
analog signals for transmission over telephone lines 33. Why the divisor in CRC is expressed as an
and vice versa, enabling internet access. algebraic polynomial? How to derive the
(vii) Protocols: Rules and standards (like TCP/IP, divisor from the polynomial?
HTTP) that govern data communication, ensuring Ans: In Cyclic Redundancy Check (CRC), the divisor
proper data exchange and error handling.| is expressed as an algebraic polynomial because:
32. Describe the functions of the layers in OSI * Polynomial representation simplifies the
model. mathematical operations required for CRC
Ans : The OSI (Open Systems Interconnection) model calculation, such as binary division.
is a seven-layer conceptual framework that * It helps visualize and manage the process of error
standardizes communication functions of a detection as operations are done using modulo-2
telecommunication or computing system. Each layer arithmetic (no carries or borrows).
performs specific functions: * CRC operations become similar to polynomial
(i) Physical Layer (Layer 1): division rather than traditional arithmetic division,
* Deals with the physical connection between devices. which makes them easier to implement in hardware
* Transmits raw bit streams over physical media and software.
(cables, wireless).
* Defines electrical and mechanical specifications How to derive the divisor from the polynomial:
(voltage, pin layout). * Each term of the polynomial corresponds to a bit in
(ii) Data Link Layer (Layer 2): the divisor.
* Provides error-free transfer of data frames between * If a term like xnx^nxn is present, set the
devices on the same network. corresponding bit to 1.
* Performs framing, error detection and correction, * If a term is absent, set the corresponding bit to 0.
and flow control. * The highest-degree term represents the leftmost bit
* Uses MAC addresses for device identification within (MSB).
the LAN. * The constant term represents the rightmost bit
(iii) Network Layer (Layer 3): (LSB).
* Responsible for logical addressing and routing of Example:
packets between different networks. Given polynomial: x3 + x + 1
* Handles packet forwarding, congestion control, and Terms present: x3 , x1 , x0 → bits are 1.
internetworking. x2 is missing → bit is 0.
* Uses IP addresses to identify devices across Divisor (binary form):
networks. x3 + 0 * x2 + x + 1 → 1 0 1 1 → 1011
34. With suitable diagram, explain stop and wait
protocol considering all possible cases.
Ans: The Stop-and-Wait protocol is a simple data link
layer protocol for flow control and error control. It
ensures reliable transmission of data between sender
and receiver by using acknowledgments (ACK).
Working Principle:
* The sender sends one frame at a time.
* After sending, it waits for an acknowledgment
(ACK) from the receiver.
* Only after receiving the ACK does the sender send
the next frame.
* If no ACK is received within a timeout period, the
sender retransmits the frame.
Diagram:
Sender Receiver
| |
Frame 0 -----------------------> Frame 0 Received
Send ACK 0
ACK 0 <----------------------- 36. Define burst error. What is the limitation of
Frame 1 -----------------------> Frame 1 Received simple parity checker?
Send ACK 1 Ans: A burst error occurs when two or more bits in a data
ACK 1 <----------------------- unit (such as a frame) are changed from their original
(And so on...) state (0 to 1 or 1 to 0) consecutively.
Possible Cases: * The length of the burst error is measured from the
(i) Normal Transmission (No Error): Sender sends a first corrupted bit to the last, including unaltered bits in
frame → Receiver receives it and sends ACK → between.
Sender sends the next frame.No retransmission Example:
needed. Original data: 11010110
(ii) Lost Data Frame: Frame is lost → Receiver does Received data: 10011110 → Multiple bits are altered →
not send ACK → Sender waits → Timeout occurs → Burst error.
Limitation of Simple Parity Checker:
Sender retransmits the frame.
* A simple parity checker can detect only odd numbers of
(iii) Lost ACK: Receiver sends ACK but ACK is lost bit errors.
→ Sender waits → Timeout occurs → Sender * It fails to detect errors if an even number of bits
retransmits the frame → Receiver discards duplicate are altered, as the parity bit will still appear correct.
frame but sends ACK again. * It is also ineffective for detecting burst errors
(iv) Damaged Frame: Receiver detects error in frame where multiple bits are affected.
→ Discards the frame → Does not send ACK → * Provides no error correction, only detection.
Sender times out → Retransmits the frame.
35. State the ALOHA protocol with a suitable flow
diagram.
Ans: ALOHA is a simple random access protocol
used for sharing a common communication channel. It
was developed at the University of Hawaii for wireless
packet networks.
Principle:
* In ALOHA, stations transmit data whenever they
have data to send (without checking the channel).
* If two stations transmit at the same time, collision
occurs, and the frames are destroyed.
* The sender waits for an ACK. If no ACK is received
within a timeout period, it assumes collision and
retransmits the frame after a random delay.
Types: * Pure ALOHA: Transmits at any time.
* Slotted ALOHA: Transmission allowed only at the
start of time slots → better efficiency.
1. In Go Back-N ARQ, sender window size>2m-1”. Crossbar Switch:
Is it correct? Justify. How lost data packet and lost * Single stage with N×NN \times NN×N crosspoints.
acknowledgement is handled in Go-Back-N ARQ * Expensive and complex for large N.
with example diagram. Multistage Switch:
Ans: * Made of multiple smaller switches connected in
stages.
* Reduces number of crosspoints and cost.
* More scalable and reliable.
Advantage of Multistage over
Crossbar:
* Uses fewer crosspoints (less hardware).
* Easier to expand for large networks.
* Can reroute if one path fails.
(b)

In Go-Back-N ARQ (Automatic Repeat request), the


sender window size should be ≤ 2ᵐ - 1, where m is the
number of bits in the sequence number. If the sender
window size exceeds 2ᵐ - 1, it can lead to ambiguity in
acknowledgments due to sequence number
wraparound, causing incorrect retransmissions. So, the
statement "sender window size > 2ᵐ - 1" is incorrect.
Handling Lost Data Packets and Lost
Acknowledgements: The general equation for a sine wave is:
(i) Lost Data Packet: [ y = A sin(Bx + C) + D ]
* If a data packet is lost or arrives with an error, the Where:
receiver simply discards it and does not send an *(A) is the amplitude, determining the wave's peak
acknowledgment. height.
* The sender continues to send frames within the * (B) affects the wavelength (or period), calculated as
window but will eventually timeout after not receiving ( \frac{2\pi}{B} ).
an acknowledgment. * ( C ) is the phase shift, moving the wave left or right.
* Upon timeout, the sender retransmits the lost packet *( D)is the vertical shift, moving the wave up or down
and all subsequent packets in the window. 4 a) What is QoS? Explain different techniques to
(ii) Lost Acknowledgement: improve QoS.
* If an acknowledgment is lost, the sender does not Ans: QoS (Quality of Service):
know that the packet was successfully received. QoS refers to the ability of a network to provide
* The sender continues transmission, but once the guaranteed service quality to selected network traffic.
timeout occurs, it retransmits the packet even though It ensures reliable transmission by managing delay,
the receiver may have already received it. jitter, bandwidth, and packet loss.
* Since the receiver discards duplicate packets, the Techniques to Improve QoS:
protocol remains efficient. * Traffic Shaping: Controls the rate of traffic sent to
2. a)What is circuit switching? Explain with the network.
proper example how multistage switch is better * Resource Reservation: Reserves
than crossbar switch. b) Draw a sine wave and bandwidth/resources in advance for
write the equation of the wave. Define each of the critical applications.
parameters in the equation. * Priority Scheduling: Gives priority to important
Ans: Circuit Switching: It is a communication method traffic (voice, video) over less critical traffic
where a dedicated communication path is established (emails, downloads).
between sender and receiver for the entire duration of * Admission Control: Decides whether new traffic
the communication.Example: Telephone network. flows can be allowed without degrading existing
QoS.
* Congestion Management: Manages traffic queues to
avoid congestion and ensure smooth delivery.
3 a) What is distance vector routing protocol? 4 b) Describe Token Bucket Algorithm for
What is the difference between RIP and BGP? b) congestion control.
Distinguish ARP and RARP. What NAT stands Ans: Token Bucket Algorithm: It is a traffic shaping
for? Describe purpose of using of NAT. algorithm used to control the amount and rate of traffic
Ans: Distance Vector Routing Protocol: It is a sent into the network.
dynamic routing protocol in which routers share Working:
information about the entire network with their * A bucket holds tokens that are added at a fixed rate.
neighbors. Each router maintains a table (distance * Each token represents permission to send a certain
vector) containing the best known distance to each amount of data (e.g., one byte).
destination and updates it based on the information * To send data, the sender must remove corresponding
from neighbors. tokens from the bucket.
* If tokens are available, data is sent; if not, data must
RIP (Routing BGP (Border Gateway wait until more tokens are added.
Information Protocol) Protocol) Benefits:
Interior Gateway Exterior Gateway Protocol * Allows bursty traffic up to a limit while controlling
Protocol (IGP) (EGP) the average rate.
* Smoothens traffic flow and helps prevent
Used within an Used between autonomous
congestion.
autonomous system systems
7. Describe the characteristics and applications of
Uses path vector (AS path) the following network devices: (a) Repeaters
Uses hop count as metric
as metric (b) Routers (c) Bridge (d) Switches (e) Gateway
No such limit on path Ans: * Switch: A switch is a network device that
Max hop count = 15
length connects multiple devices within a LAN. It operates at
Simple and suitable for Suitable for large-scale the Data Link Layer (Layer 2) of the OSI model and
small networks internet routing forwards data based on MAC addresses. It helps
Updates sent every 30 Updates sent only on reduce collisions and improves network efficiency.
seconds change (event-driven * Bridge: A bridge is used to connect two or more
network segments, making them function as a single
NAT: NAT stands for Network Address Translation. network. It also operates at the Data Link Layer and
Purpose of using NAT: filters traffic based on MAC addresses to reduce
* NAT allows private IP addresses within a local unnecessary traffic.
network to be mapped to a single or few public IP * Router: A router connects different networks and
addresses. routes data from one network to another. It works at
* It enables multiple devices to share a single public the Network Layer (Layer 3) and forwards packets
IP address when accessing the Internet. based on IP addresses. Routers are used to connect
* It helps in conserving IPv4 address space and LANs to WANs or the internet.
provides basic security by hiding internal IP * Gateway: A gateway acts as a translator between
addresses from the outside world. networks using different protocols. It operates at all
layers of the OSI model and enables communication
between networks that use different architectures or
ARP (Address RARP (Reverse Address data format
Resolution Protocol) Resolution Protocol) * Repeaters: It operates at Physical layer (Layer 1).
Regenerate and amplifies weak signals. Ans does not
Maps IP address to MAC Maps MAC address to IP filter or interpret data. It used to extend network length
address address and Commonlt used in long wired networks.
Used when sender Used when sender knows
knows IP but needs MAC but needs IP
MAC
Operates when sending data
Used during system
to a known IP
boot-up
Widely used in modern
Mostly obsolete today
networks
5 a) What is the network address in a class A Purpose:
subnet with the IP address of one of the hosts as * Enables communication within a LAN by resolving
25.34.12.56 and mask 255.255.0.0? IP to MAC address.
Ans: Given IP address: 25.34.12.56 * Works at Data Link Layer (Layer 2) and interacts
Subnet mask: 255.255.0.0 with the Network Layer (Layer 3).
→ in binary:11111111.11111111.00000000.00000000 b) Compare IPv4 and IPv6:
Finding network address:
Perform bitwise AND between IP address and subnet
mask:

IP Subnet Result (Network


Octet
Address Mask Address)

1 25 255 25

2 34 255 34

3 12 0 0

4 56 0 0

Network Address:
25.34.0.0
5 b) A company is granted the site address
181.56.0.0 (class B). The company needs 1000
subnets. Design the subnets.
Ans: Given address: 181.56.0.0
(Class B → default mask 255.255.0.0)
Total subnets required = 1000
How many bits needed?
Number of subnets = 2n ≥ 1000 → n = 10 bits → 210 =
1024 subnets.
New subnet mask:
* Default mask: 255.255.0.0 → 16 bits for network.
* Add 10 bits for subnetting → total 26 bits for
network + subnet.
Subnet mask in dotted decimal:
26 bits → 255.255.255.192
Summary:
Subnet mask: 255.255.255.192
Number of subnets: 1024
Number of hosts per subnet: 26 – 2 = 62 hosts per
subnet.
8. Write a brief note on a) ARP . b) Compare
IPv4 and IPv6.
Ans: ARP is a protocol used to map an IP address to a
MAC address in a local area network.
Working:
* When a device knows the IP address of the
destination but not the MAC address, it sends an
ARP request on the network.
* The device with the matching IP responds with its
MAC address (ARP reply).
* The sender then uses this MAC address to send
the data frame.
IPv4 IPv6

32-bit address 128-bit address

Supports around 4.3 Virtually unlimited address


billion addresses space

Address written as: Address written as:


192.168.1.1 2001:0db8::1

Packet size varies


Fixed 40-byte header
from 20-60 bytes

Supports broadcast No broadcast; uses


communication multicast

Fragmentation handled Fragmentation handled by


by routers sender

Security optional (IPSec IPSec support is


optional) mandatory

Complex NAT often No NAT required (end-to-


needed end connectivity)
6. The following character encoding is used in Final Summary Table:
a data link protocol: A: 01000111; B:
11100011; FLAG: 01111110; ESC: 11100000 Method Transmitted Sequence
Show the bit
sequence transmitted (in binary) for the four- i) Character 00000101 01000111 11100011
character frame: AB ESC FLAG when each of the Count 11100000 01111110
following framing methods are used: i. Character
Count ii. Flag bytes with byte stuffing iii. Starting ii) Flag bytes 01111110 01000111 11100011
and ending flag bytes, with bit stuffing. with byte 11100000 11100000 11100000
Ans: Given Encoding: stuffing 01111110 01111110

Character Encoding iii) Flag bytes 01111110 01000111 11100011


with bit stuffing 11100000 011111010 01111110
A 01000111

B 11100011 9. a) Discuss stop and wait protocol. b) Explain


about Carrier Sense Multiple Access (CSMA)
FLAG 01111110 Protocols Ans: Stop and Wait is a simple Data Link
Layer protocol used for reliable communication. It ensures
ESC 11100000 that the sender transmits one frame at a time and waits for
an acknowledgment (ACK) before sending the next frame.
Working:
Frame to send: A B ESC FLAG * Sender transmits a data frame.
Bit sequence: 01000111 11100011 11100000 * Sender waits for an acknowledgment (ACK).
01111110 * If ACK is received → sender transmits the next frame.
i) Character Count Method: * If ACK is not received within timeout → sender
* First byte indicates the number of bytes in the retransmits the same frame.
frame (including count byte). Advantages: * Simple and easy to implement.
* Total bytes = 5 → Character count = 00000101 * Guarantees reliable delivery of frames.
Transmitted Sequence: Disadvantages:
00000101 01000111 11100011 11100000 * Inefficient for long-distance or high-speed networks.
01111110 * Sender remains idle while waiting for ACK.
Diagram:
ii) Flag Bytes with Byte Stuffing:
Sender → Frame → Receiver
* Frame starts and ends with FLAG (01111110). Sender ← ACK ← Receiver
* If FLAG or ESC appears in data, insert an ESC byte (b) CSMA is a Medium Access Control (MAC) protocol
before it. used in networks with shared communication channels.
Byte stuffing applied: Before transmitting, a device senses the channel to check if
A → 01000111 (no change) it is free.
B → 11100011 (no change) Working Principle:
ESC → ESC + ESC → 11100000 11100000 * Carrier Sense: Device listens to the channel.
FLAG → ESC + FLAG → 11100000 01111110 * If channel is idle, device transmits data.
Transmitted Sequence: * If channel is busy, device waits until it becomes idle.
01111110 01000111 11100011 11100000 Types of CSMA Protocols:
11100000 11100000 01111110 01111110
iii) Flag Bytes with Bit Stuffing: Type Description
* Frame starts and ends with FLAG (01111110). 1-Persistent Transmits immediately when channel
* After five consecutive 1's in data, insert a '0'. CSMA is idle.
Bit stuffing applied: Non-Persistent Waits random time before sensing
A → 01000111 (no stuffing) CSMA again if busy.
B → 11100011 (no stuffing) P-Persistent In slotted channels, transmits with
ESC → 11100000 (no stuffing) CSMA probability p.
FLAG → 011111010 (after 5 consecutive 1’s)
Transmitted Sequence: Advantages: * Reduces collisions compared to ALOHA.
01111110 01000111 11100011 11100000 * Simple and efficient in light traffic.
011111010 01111110 Disadvantages: * Collisions may still occur.
* Performance decreases under heavy load.
10. a) A block of addresses is granted to a * Subnet Address: 140.11.36.0
small organization. We know that one of the * Host ID: 22
Addresses are 205.16.37.39/28.
a. What is the first address in the block?
b. Find the last address for the block
c. Find the number of addresses
Ans: Given address:
205.16.37.39/28
* /28 → subnet mask: 255.255.255.240
* /28 → 28 bits for network, remaining 4 bits for host.
* Number of addresses = 24 = 16 addresses in this
block.
a) First address in the block:
* To find the first address, convert the last octet (39)
to binary: 39 = 00100111
* Subnet mask for last octet:
/28 → last 4 bits for host → block size = 16
Block ranges: 0-15, 16-31, 32-47, 48-63, ...
* 39 lies in block 32-47 → first address of this block is
205.16.37.32
Answer: 205.16.37.32
b) Last address in the block:
* Block size = 16 → range is 32 to 47
* Last address is
205.16.37.47 Answer:
205.16.37.47
c) Number of addresses:
* Number of host bits = 4 → 24 =16 addresses.
Answer: 16 addresses
Final Summary:
Item Value

First address 205.16.37.32

Last address 205.16.37.47

Number of addresses 16

b) Find the sub network address and the host-ID for


the following a. IP Address – 120.14.22.16 & Mask-
255.255.128.0 b. IP Address – 140.11.36.22 & Mask-
255.255.255.0 c. IP Address – 141.181.14.16 & Mask-
255.255.224.0 d. IP Address – 200.34.22.156 & Mask-
255.255.255.240

Ans:
(a) IP Address: 120.14.22.16, Mask: 255.255.128.0
* Subnet mask → 255.255.128.0 → First 17 bits
are network bits.
* Subnet Address: 120.14.0.0
* Host ID: 22.16 (remaining part of IP address)
(b) IP Address: 140.11.36.22, Mask: 255.255.255.0
* Subnet mask → 255.255.255.0 → First 24 bits
are network bits.
(c) IP Address: 141.181.14.16, Mask: 255.255.224.0
* Subnet mask → 255.255.224.0 → First 19 bits
are network bits.
* Subnet Address:
224 in last octet → blocksize = 32
14 lies in block 0-31 → Subnet Address:141.181.0.0
* Host ID: 14.16
d) IP Address: 200.34.22.156, Mask: 255.255.255.240
* Subnet mask → 255.255.255.240 → First 28 bits
are network bits.
* 240 → block size = 16
* 156 lies in block 144-159 → Subnet Address:
200.34.22.144
* Host ID: 12 (156 - 144 = 12)
Final Summary Table:
Subnet Host
IP Address Subnet Mask
Address ID

22.1
120.14.22.16 255.255.128.0 120.14.0.0
6

140.11.36.22 255.255.255.0 140.11.36.0 22

141.181.14.1 14.1
255.255.224.0 141.181.0.0
6 6

200.34.22.15 255.255.255.24 200.34.22.14


12
6 0 4
11. i)What HTML stands for? ii)Write down the The IPv4 header is a fixed-size structure of 20 bytes
structure of a web page. iii)Name some common (160 bits), used to route packets across networks.
tags used with HTML. iv)Write a short HTML Fields in IPv4 Header:
program to understand the structure of HTML.
Ans: i) HTML stands for HyperText Markup
Language.
ii) Structure of a Web Page:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<!-- Page content goes here -->
</body>
</html>
iii) Some common HTML tags:
* <html> — Root tag of the HTML document
* <head> — Contains metadata and title
* <title> — Defines the page title
* <body> — Contains the visible page content
* <h1> to <h6> — Headings
* <p> — Paragraph
* <a> — Hyperlink
* <img> — Image
* <br> — Line break
* <div> — Division or section
iv) Short HTML program:
<!DOCTYPE html>
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
<h1>Welcome to HTML</h1>
<p>This is a simple HTML page.</p>
<a href="https://www.example.com">Visit Example</a>
</body>
</html>
13. Describe the IPv4 header format with a suitable
diagram.
Size
Field Description
(bits)
Version 4 IP version (4 for IPv4)
IHL (Header Length of the header in 32-bit
4
Length) words
Type of Service 8 Priority and quality of service
Length of entire packet
Total Length 16
(header + data)
Identification 16 Unique ID for fragmentation
Control flags (e.g., Don't
Flags 3
Fragment)
Position of fragment in
Fragment Offset 13
original packet
Time to Live
8 Max hops packet can travel
(TTL)
Protocol of the payload
Protocol 8
(TCP=6, UDP=17, etc.)
Header
16 Error-checking of the header
Checksum
Source Address 32 IP address of sender
Destination
32 IP address of receiver
Address
Options Additional header options (if
Variable
(optional) any)
14. Mention and describe in brief about the system Steps:
calls using UDP for client and server (i) Incoming packets enter the bucket at variable rate.
processes in client-server paradigm. (ii) Bucket leaks packets at a fixed rate → controls
Ans: In UDP (User Datagram Protocol), transmission rate.
communication is connectionless and uses datagrams (iii) If incoming rate > leak rate → bucket fills up.
instead of a connection stream. Both client and server (iv) If bucket overflows → packets are dropped.
use system calls to send and receive data. Diagram:
Client Process (UDP):
1. socket(): Create socket
sockfd = socket(AF_INET, SOCK_DGRAM,
0);
2. sendto(): Send data to server
sendto(sockfd, buffer, len, flags,
(struct sockaddr*)&server_addr,
addrlen);
3. recvfrom(): (Optional) Receive reply from
server
recvfrom(sockfd, buffer, len, flags,
(struct sockaddr*)&server_addr,
&addrlen); 16. (i)How many bits are there with IPv4
4. close(): Close socket addressing? How to represent an IPv4
close(sockfd); address in dotted decimal format? Mention
Server Process (UDP): the highest valued and lowest valued IPv4
1. socket(): Create socket address
sockfd = socket(AF_INET, SOCK_DGRAM, in dotted decimal format. iii) Explain, what type of
0); addresses are used in a LAN without having a
2. bind(): Bind to local address and port internet connection? iv)How a router works in a
bind(sockfd, (struct network?
sockaddr*)&server_addr, Ans: (i) IPv4 Addressing:
sizeof(server_addr)); * Number of bits: IPv4 addresses are 32 bits long.
3. recvfrom(): Receive data from client * Dotted decimal format: The 32 bits are divided
recvfrom(sockfd, buffer, len, flags, into 4 octets (8 bits each), and each octet is written in
(struct sockaddr*)&client_addr, decimal, separated by dots.
&addrlen); Example: 192.168.1.1
4. sendto(): Send reply to client Highest valued IPv4 address: 255.255.255.255
sendto(sockfd, buffer, len, flags, Lowest valued IPv4 address: 0.0.0.0
(struct sockaddr*)&client_addr, (iii) Addresses used in LAN without Internet
addrlen); connection:
5. close(): Close socket * Private IP addresses are used for internal
close(sockfd); communication in LANs.
15. Describe the leaky bucket mechanism toward * These addresses are not routable on the public
traffic shaping with a suitable diagram. Internet.
Ans: The Leaky Bucket algorithm is a traffic shaping Private IP address ranges:
mechanism used to control the rate of data Class A: 10.0.0.0 to 10.255.255.255
transmission in a network. It ensures that data is Class B: 172.16.0.0 to 172.31.255.255
transmitted at a constant and smooth rate, preventing Class C: 192.168.0.0 to 192.168.255.255
bursts that can cause congestion. (iv) How a router works in a network:
Working Principle: * A router connects different networks together and
* Imagine a bucket with a small hole at the bottom. forwards data packets between them.
* Data packets are poured into the bucket at any rate * It uses the destination IP address to decide the
(even in bursts). best path for packet delivery.
* The bucket leaks packets at a constant rate through * The router maintains a routing table that stores paths
the hole. to various network destinations.
* If the bucket overflows → excess packets are * On receiving a packet:
discarded. (i) It checks the destination IP address.
(ii) Looks up the best next hop in the routing table.
(iii) Forwards the packet towards its destination.
18. .i) Define Network. 19. i) Describe the functions of the layers in OSI
ii)What are the components of a network? model. ii) With suitable diagram, explain the
iii)Mention the criteria of a network. working principles of signal propagation through
iv)Discuss about different topologies available with fiber optic cable.
a network. Ans: The OSI model (Open Systems Interconnection)
Ans: i) Define Network: has 7 layers, each with specific functions:
A network is a collection of interconnected
Layer Functions
computers, devices, and communication systems that
can exchange data and share resources such as files, Transmits raw bits over the
1. Physical
printers, and Internet connections. communication medium. Handles
Layer
ii) Components of a Network: electrical, optical, or radio signals.
* Sender — The device that sends data. Provides framing, error
* Receiver — The device that receives data. 2. Data Link detection/correction, and flow control.
* Transmission medium — The physical path (cables, Layer Ensures reliable data transfer between
wireless) over which data travels. adjacent nodes.
* Networking devices — Routers, switches, hubs, Responsible for routing, addressing
modems, repeaters, etc. 3. Network
(IP), and forwarding packets across
* Protocols — Set of rules that govern data Layer
networks.
communication (TCP/IP, HTTP, etc.). Provides end-to-end communication,
* Software — Operating systems, drivers, and network 4. Transport
flow control, segmentation, and error
applications. Layer
control (TCP, UDP).
iii) Criteria of a Network:
Manages sessions or connections
* Performance — Measured in terms of throughput, 5. Session
between applications (start, maintain,
response time, and efficiency. Layer
end sessions).
* Reliability — Ability of a network to maintain the
service (includes fault tolerance). 6.
Handles data translation, encryption,
* Security — Protection of data from unauthorized Presentation
compression, and format conversion.
access and threats. Layer
* Scalability — Ability to expand the network to 7. Provides network services to the user’s
accommodate more devices. Application applications (HTTP, FTP, DNS,
iv) Different Network Topologies: Layer SMTP).
Topology Description
Diagram: (draw 7-layer stack from Physical (bottom)
All devices connected to a single backbone
Bus to Application (top))
cable. Simple but limited scalability.
All devices connected to a central hub or (ii) Fiber optic cables transmit data using light pulses,
Star
switch. Easy to manage and expand. which travel through a core made of glass or plastic.
Devices connected in a closed loop. Each The working principle is based on total internal
Ring device has two neighbors. Data travels in reflection, ensuring that light signals remain within the
one direction. core and travel long distances with minimal loss.
Every device connected to every other
Mesh device. Provides high redundancy and
reliability.
Combination of star and bus topologies.
Tree
Hierarchical structure.
Combination of two or more topologies to
Hybrid
suit specific needs.
20.a. Show mathematically that if noise is too high 17. Write about different transmission modes of
of a noisy channel, the channel capacity will be zero. communicating devices with suitable diagrams and
(Hint: consider SNR of signal) b. Show the line examples. ii) Draw a sine wave and write the
coding for the given string following Manchester equation of the wave. Define each of the parameters
and Differential Manchester encoding. 0 1 0 0 1 1 1 0 in the equation.
Ans: The Shannon capacity of a channel is given by: Ans: i) Transmission modes define how data flows
C=Blog2 (1+SNR) between devices in a network. There are three primary
where: types:
(i) Simplex Mode
 C is the channel capacity (bits per second), * Data flows in only one direction.
 B is the bandwidth of the channel, * Example: A keyboard sending input to a computer
 SNR is the signal-to-noise ratio. screen.
(ii) Half-Duplex Mode
Now, if the noise level is very high, the SNR * Data flows in both directions, but only one device can
approaches zero (SNR→0). Substituting SNR= 0 in transmit at a time.
the formula: * Example: Walkie-talkies, where one person speaks while
C=Blog2 (1+0) = Blog2 (1) = B × 0 = 0 the other listens.
Thus, if noise is too high, the channel capacity (iii) Full-Duplex Mode
becomes zero, meaning the channel cannot transmit * Data flows in both directions simultaneously.
any meaningful data. * Example: Telephone conversations, where both parties
(b) answer can talk at the same time.

(ii)
* Amplitude (A): Maximum height of the wave
from its equilibrium position.
* Frequency (f): Number of cycles per second,
measured in Hertz (Hz).
* Angular Frequency (ω): Speed of oscillation, given
by ( \omega = 2\pi f ).
* Time (t): Represents the wave's progression
along the horizontal axis.
* Phase Shift (φ): Determines horizontal
displacement of the wave.
* Wavelength (λ): Distance between two consecutive
peaks or troughs.

 Diagram
12 (b)With suitable diagram, explain stop and wait ~ Outcome: Reliability is maintained, but
protocol considering all possible cases. retransmission increases delay.
Ans : The Stop-and-Wait protocol is a fundamental Case 3: Lost Acknowledgment (ACK)
flow control mechanism used in reliable data * The sender sends a frame, and the receiver
communication. It ensures that data is transmitted successfully receives it.
error-free and in sequence by using acknowledgments * The receiver sends an ACK, but it gets lost.
(ACKs) and retransmissions when needed. Here's a * The sender waits, does not receive an ACK, and
step-by-step explanation of how it works, along with retransmits the frame.
all possible scenarios: * The receiver identifies the duplicate frame and
1. Basic Operation: ignores it.
The sender transmits a single data frame and then ~ Outcome: The sender retransmits unnecessarily, but
waits for an acknowledgment (ACK) from the proper delivery is ensured.
receiver before sending the next frame. This process Case 4: Corrupted Frame
ensures reliability but introduces idle time since the * The sender sends a frame, but due to transmission
sender cannot send a new frame until it receives an errors, the receiver detects corruption.
ACK. Diagram: Basic Stop-and-Wait Protocol * The receiver does not send an acknowledgment,
* Sender: [Frame 1] → Waits for ACK → [Frame 2] forcing a timeout.
→ Waits for ACK → ... * The sender retransmits the corrupted frame after the
timeout.
*Receiver: [ACK 1] ← [ACK 2] ← ~ Outcome: Error detection ensures only correct
frames are processed.
2. Cases in Stop-and-Wait Protocol Advantages:
* Simple to implement.
* Ensures reliable communication.
Disadvantages:
* Inefficient for high-speed communication (due to
waiting time).
* Wastes time if acknowledgments or frames are lost.

Case 1: Successful Transmission


* The sender sends a frame.
* The receiver successfully receives it and sends back
an acknowledgment.
* The sender then sends the next frame.
~ Outcome: The communication proceeds smoothly
with minimal delay.
Case 2: Lost Data Frame
* The sender sends a frame, but it gets lost due to
network issues.
* Since the sender does not receive an ACK, it waits
for a timeout.
*After the timeout, the sender retransmits the frame.
3. Distinguish between Classful and Class less IP remaining host bits
Number of hosts per subnet = 2 −2
Addressing (subtract 2 for network and broadcast addresses).

Classful IP
Classless IP Addressing
Addressing
Introduced to overcome
Introduced in the
limitations of classful
early stages of IP
addressing (CIDR - Classless
addressing.
Inter-Domain Routing).
IP addresses are
No concept of fixed classes; IP
divided into fixed
addresses are divided using
classes (A, B, C, D,
prefix length (e.g., /24, /16).
E).
Subnet mask is Subnet mask or prefix is
implicitly defined explicitly defined and can be
by the class. of any length.
Leads to wastage of
Efficient use of IP addresses
IP addresses due to
through flexible allocation.
rigid class structure.
Routing protocols
Routing protocols use prefix-
use class-based
based routing.
routing.
Example: Class A
(1.0.0.0 to Example: IP address
126.0.0.0), Class B, 192.168.1.0/27.
Class C, etc.
11. Explain the process of subnetting in computer
networking.
Ans : Subnetting is the process of dividing a large IP
network into smaller, manageable subnetworks
called subnets. It helps improve network
performance, security, and simplifies
management. Process of Subnetting:
(i) Start with a given IP network:
* For example, a Class B network like 172.16.0.0/16.
(ii) Determine the number of required subnets or
hosts:* Decide how many smaller networks or
hosts per subnet you need.
(iii) Borrow bits from the host portion:* In the IP
address, the subnet mask divides network and
host parts.
* To create subnets, you borrow bits from the host
portion and use them as part of the network
portion.
(iv) Calculate the new subnet mask:* Original subnet
mask for Class B is 255.255.0.0 (/16).
* After borrowing bits, the subnet mask
might become 255.255.240.0 (/20), for
example.
(v) Calculate the number of subnets and hosts per
subnet:
* Number of subnets = 2 number of borrowed bits
(vi) Assign subnet addresses: Disadvantages:
* Each subnet has a unique network address * More complex to implement than simple FIFO (First
based on the new subnet mask. In First Out) scheduling.
Benefits of subnetting:
* Efficient use of IP addresses.
* Reduces network congestion by limiting
broadcast domains.
* Improves network security and management.
6. Provide a valid allocation of addresses to X
and Y? Ans: The ISP has the address block:
252.246.128.0/21
→ total 2048 IP
addresses. The ISP wants
to:
* give half of this block to Organization X → 1024
Ips.
* give quarter of this block to Organization Y → 512
Ips.
(i) Allocation to Organization X:
* Half of 2048 = 1024 Ips → requires a /22 subnet.
* Subnet: 252.246.128.0/22.
* Address Range for X:
252.246.128.0 to 252.246.131.255.
(ii) Allocation to Organization Y:
* Quarter of 2048 = 512 Ips → requires a /23 subnet.
* Subnet: 252.246.132.0/23.
* Address Range for Y:
252.246.132.0 to 252.246.133.255.
7. Explain the difference between static and
dynamic routing

Static Routing Dynamic Routing


Routes are automatically
Routes are manually
learned and updated by
configured by the network
routers using routing
administrator.
protocols.
Suitable for small Suitable for large and
networks with simple complex networks with
topology. frequent topology changes.
Requires no extra CPU or Uses CPU and memory
memory overhead on resources on routers to
routers after calculate and maintain
configuration. routes.
Can adapt automatically to
Does not adapt to network
network changes and
failures or topology
failures by recalculating
changes automatically.
routes.
More complex to
Easier to configure but
configure but highly
not scalable.
scalable.
Example protocols: None
Example protocols: RIP,
(static routes manually
OSPF, EIGRP, BGP.
entered).
9. Find the last address for the block and also find * Requires maintaining multiple queues and additional
the number of addresses in the block processing.
Ans : (i) Number of addresses in the block: 22. Consider packet sizes are 1000 bits, transmission
If the network is given in CIDR notation as /n, then: rate is 1 Mbps, and propagation delay from source to
32-n destination is 15 milliseconds. Assume that acks are
* Number of addresses = 2
very small, processing time for packets and acks is
(Because IPv4 addresses are 32 bits long, and the
negligible, and there are no errors in transmission.
remaining bits after the prefix define the host
What will be the throughput if we use Stop-and-
addresses.)
Wait ARQ.
(ii) Finding the last address in the block:
Ans : Given Data:
* The first address is the network address (all
* Packet size = 1000 bits
host bits 0).
* Transmission rate = 1 Mbps = 106 bps
* The last address is the broadcast address (all
* Propagation delay = 15 ms (one way)
host bits 1).
* Processing time and ACK time = negligible
* To find the last address, add 2(32−n)−12^{(32-n)} -
* No errors in transmission
12(32−n)−1 to the network address.
Step 1: Calculate Transmission Time
Example:
If the block is 192.168.1.0/24,
32-24 8
* Number of addresses = 2 =2 =
256 addresses.
Step 2: Calculate Round Trip Time (RTT)
* The last address = 192.168.1.0 + 255
RTT = 2 × Propagation delay = 2 × 15 ms = 30 ms
= 192.168.1.255. Step 3: Total Time per Packet in Stop-and-Wait
16. Explain fair queuing at packet level. * In Stop-and-Wait, after sending one packet, the
Ans : Fair Queuing (FQ) at Packet Level is a sender waits for an ACK before sending the next
scheduling algorithm used in computer networks to packet.
ensure that each data flow gets a fair share of the Total time per packet = Transmission time + RTT =
bandwidth. It is especially used in routers to manage 1 ms + 30 ms = 31
packet transmission across multiple network flows. Step 4: Throughput Calculation
How it works:
* The router maintains a separate queue for each
active flow (for example, one queue per user or per
connection).
* Packets arriving from each flow are placed in their
respective queue. The throughput using Stop-and-Wait ARQ is
* The router schedules packets from each queue in a approximately 32.26 kbp
way that all flows get an equal opportunity to send
packets, preventing any single flow from dominating
the link.
* In simple terms, it works like round-robin at the
packet level but considers the size of packets to
ensure fairness.
Key Concepts:
(i) Round-Robin Selection: The router sends
one packet from each flow's queue in a round-
robin manner.
(ii) Packet Size Awareness: Fair queuing can be byte-
wise fair (equal number of bytes per flow) rather
than packet-wise (equal number of packets), because
packet sizes can vary.
(iii) Virtual Finish Time: The algorithm computes a
virtual finish time for each packet to maintain fairness
in bandwidth allocation.
Advantages:
* Prevents starvation of smaller or low-priority flows.
* Ensures fair bandwidth distribution among all users. Final routing table at A:
* Helps in providing Quality of Service (QoS).
21. Explain the Bellman-Ford routing algorithm with Destination Cost
an example.
Ans The Bellman-Ford algorithm is a distance-vector A 0
routing algorithm used to find the shortest path from
B 1
a source node to all other nodes in a network.
It is widely used in routing protocols such as RIP C 4
(Routing Information Protocol).
Working Principle: D 4
* Each router maintains a routing table (distance
vector), which contains the cost to reach each
Advantages:
destination in the network.
* Simple and easy to implement.
* Routers periodically exchange their routing
* Works well in small to medium networks.
tables with immediate neighbors. Disadvantages:
* Each router updates its routing table based on * Slow convergence.
the information received from neighbors using the * Vulnerable to count-to-infinity problem.
Bellman-Ford equation: * Not suitable for very large or dynamic networks.
24. Explain the three way handshaking protocol to
establish the transport level connection ?
Ans : Three-Way Handshaking is a process used in
TCP (Transmission Control Protocol) to establish a
reliable connection-oriented communication between a
client and a server at the transport layer.
It ensures that both parties are ready to send and
* The process repeats until no more updates occur receive data.
(network converges). Steps of Three-Way Handshaking:
Steps of the Algorithm: (i) Step 1 — SYN (Synchronize):
(i) Initialize routing table: * The client initiates the connection by sending a SYN
* Distance to self = 0. (synchronize) packet to the server.
* Distance to all others = ∞ (infinity). * This packet contains an initial sequence number
(ii) Send routing table to neighbors. (ISN) chosen by the client.
(iii) Update table based on neighbors' information. (ii) Step 2 — SYN-ACK (Synchronize-Acknowledge):
(iv) Repeat the process until no changes * The server responds with a SYN-ACK packet.
occur. Example: * The SYN part is used to synchronize the server’s
Consider a simple network: sequence number.
A ---1--- B ---3--- C * The ACK part acknowledges the client’s SYN by
\ | sending back ACK = ISN + 1.
\--4-- D (iii) Step 3 — ACK (Acknowledge):
* The client responds with an ACK packet.
Initial state: * This ACK acknowledges the server’s SYN.
* A’s table: A(0), B(∞), C(∞), D(∞) * After this step, the connection is established, and
* B’s table: B(0), A(∞), C(∞), D(∞) both parties can start data transmission.
* C’s table: C(0), A(∞), B(∞), D(∞) Diagram:
* D’s table: D(0), A(∞), B(∞), C(∞) Client Server
First update:
* A receives info from B and D: | ---------- SYN-------------> |
A→B=1
A→D=4 | <----- SYN + ACK---------|
Next update:
A → C = A → B (1) + B → C (3) = 4 | ---------- ACK-------------> |

Connection Established
23. Consider packet sizes are 1000 bits, 25. You are working on your laptop connected to a
transmission rate is 1 Mbps, and propagation 100 Mbps Ethernet LAN. You need a 2GB file that
delay from source to destination is 15 is on the server in the same LAN. The entire file is
milliseconds. Assume that acks are very small, also on your pen drive but you have left the pen
processing time for packets and acks is negligible, drive in another room. You have a dog, sitting
and there are no errors in transmission. What will beside you, that is trained to bring the pen drive to
be the throughput if we use Go-back-N ARQ, with you. The average speed of the dog is 20 km/hour.
a window size of 20 packets Upto what distance does the dog have a higher data
Ans: Given Data: rate than 100 Mbps Ethernet ?
* Packet size = 1000 bits Ans : Given Data:
* Transmission rate = 1 Mbps = 10610^6106 bps * Ethernet speed = 100 Mbps
* Propagation delay (one way) = 15 ms * File size = 2 GB = 2 × 1024 × 1024 × 8 = 16,777,216
20000 meters
* Window size = 20 packets kilobits = 16,777,216 kb


* ACK size and processing time = negligible

3600 sec
* No transmission errors *Dog’s speed = 20 km/hour =
Step 1: Transmission Time per Packet
1000
5.56 m/s

bits
Step 1: Time to transfer file over Ethernet
= 0.001 sec = 1 ms
106
Tt =
bps
Step 2: Round Trip Time (RTT)
RTT = 2 × Propagation delay = 2 × 15 ms = 30 ms
Step 3: Go-Back-N Pipeline Concept
In Go-Back-N ARQ, the sender can send up to
window size = 20 packets without waiting for an
ACK. Step 2: Time for dog to deliver pen drive

2xD
ACKs are cumulative — one ACK can acknowledge * Let the distance to the other room be D meters.
multiple packets.
5.5 rate
Pipeline effect: While the first packet propagates, * Time for dog to go and come back seconds
6
other packets are being transmitted. =
Step 3: Condition for dog to have
Step 4: Effective Throughput Calculation higher data
* Time to transmit 20 packets: * Dog’s total time should be less than 167.77 seconds :
20 × Tt = 20 × 1 ms = 20 ms
* The sender must then wait for an ACK for the
first packet, which takes RTT = 30 ms.
* Therefore, total cycle time for sending 20 packets
and receiving ACK =
max(20 ms, RTT) = max(20,30) = 30 ms
Since the transmission pipeline fills during RTT, the
cycle time is dominated by RTT (30 ms).
Step 5: Throughput

The dog will have a higher data rate than 100 Mbps
Ethernet if the distance to the pen drive is less than
Final Answer: approximately 467 meters.
Throughput using Go-Back-N ARQ
(Window size = 20) is approximately 666.67 kbps. Q30. Example:

1. Client sends request for File A.


2. Packet gets delayed or lost.
3. Client retransmits request.
4. Due to incorrect handling or stale state at the
server, server starts sending File B.
5. Client receives File B thinking it is File A,
as no built-in mechanism in UDP ensures
the correct association.
28. Write a short note on Traffic Shaping and * The acknowledgment number always indicates the
Random Early Detection. next expected sequence number from the other side.
Ans : Traffic Shaping: Step 1: H1’s Sequence Range
* Traffic shaping is a network management technique * H1 starts at sequence number 601.
used to control the flow of traffic entering or leaving * H1 sends 300 bytes → last byte has sequence number
a network to ensure efficient utilization of bandwidth. 601 + 300 - 1 = 900.
* The goal is to smooth out bursty traffic, reduce * So, H1’s sequence numbers range from 601 to 900.
congestion, and improve Quality of Service (QoS). * H2 expects the next byte from H1 to be 901, so ACK
* Traffic shaping regulates the data rate by delaying number = 901.
packets as necessary, ensuring that traffic conforms Step 2: H2’s Sequence Range
to a predefined traffic profile. * H2 starts at sequence number 1550.
Common methods of traffic shaping: * H2 sends 1000 bytes → last byte has sequence
(i) Leaky Bucket Algorithm: Packets are transmitted number 1550 + 1000 - 1 = 2549.
at a constant rate, smoothing out bursts. * So, H2’s sequence numbers range from 1550 to 2549.
(ii) Token Bucket Algorithm: Allows bursts but * The very last packet will have sequence number =
controls the average data rate over time. 2549.
Benefits: * The ACK number in this last packet will be 901,
* Prevents network congestion. because H2 is still acknowledging that it has received
* Improves QoS for critical applications. all bytes from H1 up to byte 900.
* Provides fair bandwidth distribution. Final Answer:
Random Early Detection (RED) * Sequence number of H2’s last packet = 2549
* Random Early Detection (RED) is a congestion * Acknowledgment number in H2’s last packet = 901
avoidance mechanism used in routers. 30. Consider a simple UDP-based protocol for
* It monitors the average queue size and proactively requesting files. The client sends an initial file
drops packets before the queue becomes full. request and the server answers with the first data
* Dropping packets early signals to the sender to packet. Client and server then continue with a stop-
reduce its transmission rate, preventing severe and-wait transmission mechanism. Describe a
congestion. scenario by which a client might request one file but
How RED works: get another.
* When the queue is small, no packets are dropped. Ans : In a simple UDP-based file transfer protocol,
* As the queue grows, RED starts dropping packets communication happens without a connection and
randomly with increasing probability. without guaranteed delivery or ordering of packets
* When the queue reaches a maximum threshold, all (since UDP is unreliable and connectionless).
packets are dropped. The client sends a file request to the server, and the
Benefits: server responds with the first data packet, after which
* Prevents global synchronization of TCP flows. stop-and-wait transmission is used.
* Maintains low average queue size and low latency. Possible Issue (Wrong File Delivery Scenario):
* Improves overall network throughput. * Suppose the client sends a file request for File A.
29. Two hosts, H1 and H2 establish a TCP * Due to packet loss, packet duplication, or delayed
connection between themselves. H1 used an packets in the network, the initial request may get lost
initial sequence number of 601, while H2 used the or delayed.
initial sequence number of 1550. H1 sends a total * In the meantime, the server might receive another
of 300 bytes during the connection, and H2 sent outdated or duplicate request from the client (possibly
1000 bytes. What is the sequence number and the caused by retransmission or network errors).
acknowledgement number of the very last packet * If multiple clients are communicating with the server
sent by H2 ? at the same time, the server might confuse the request
Ans : Given: and send File B instead of File A.
* H1’s Initial Sequence Number (ISN) = 601 * Another possible issue: if the server uses source port
* H2’s Initial Sequence Number (ISN) = 1550 numbers or IP addresses to track which client requested
* H1 sends 300 bytes which file, and if source port changes (due to NAT or
* H2 sends 1000 network reconfiguration), the server may associate the
bytes Concept Recap: wrong file with the client.
* In TCP, sequence numbers count bytes, not packets. * Since UDP does not guarantee sequencing or
* When a host sends N bytes, the next sequence association of messages, the client might end up
number will be ISN + N. receiving the wrong file (File B), thinking it is File A.

You might also like