Computer Networks: OSI & TCP/IP Models
Computer Networks: OSI & TCP/IP Models
YEAR/SEMESTER:III/V
Part A (2 Marks)
1. Explain the OSI Reference Model in detail with a neat diagram, and discuss the
functions of each layer. (A)
o Answer Structure:
Introduction to the OSI (Open Systems Interconnection) Model (7
layers).
The OSI (Open Systems Interconnection) model is a seven-layer framework for understanding
how data is transferred in a computer network, with each layer performing specific functions.
The seven layers, from lowest to highest, are the Physical, Data Link, Network, Transport,
Session, Presentation, and Application layers. This model helps standardize how different
systems communicate by providing a layered approach to network communication, making
troubleshooting and understanding network functions easier.
The seven layers of the OSI model:
Layer 7: Application Layer: Provides network services directly to the user and the application
itself.
Layer 5: Session Layer: Manages communication sessions, including dialog control and
synchronization.
Layer 3: Network Layer: Responsible for logical addressing and routing, breaking data into
packets for host-to-host delivery.
Layer 2: Data Link Layer: Handles hop-to-hop delivery by converting packets into frames and
managing access to the physical medium.
Layer 1: Physical Layer: Transmits raw data bits over the physical medium, handling the actual
physical connection between devices.
2. Describe the TCP/IP Protocol Suite with a neat diagram, and compare it with the OSI
Model. (A)
The TCP/IP protocol suite is a four-layer model (Application, Transport, Internet, and Network
Access) that governs data communication on the internet, while the OSI model is a seven-
layer conceptual framework (Physical, Data Link, Network, Transport, Session, Presentation,
and Application) used for understanding network functions. The main differences are that the
TCP/IP model is a practical, protocol-dependent implementation used in the real world,
whereas the OSI model is a theoretical, protocol-independent reference model.
Application Layer: Provides network services directly to user applications and combines the
functions of the OSI model's Session, Presentation, and Application layers.
Internet Layer: Handles addressing, routing, and packet forwarding across different networks.
The main protocol here is the Internet Protocol (IP).
Network Access Layer: Also known as the Link Layer, this is the lowest layer that combines
the functions of the OSI model's Physical and Data Link layers. It deals with the physical
transmission of data over the local network.
3. Discuss the principles of the Domain Name System (DNS) and the role of DNS in a
computer network, including its involvement in accessing a web page. (B)
Principles of DNS
Hierarchical structure: DNS is organized as a tree, with a root at the top, followed by top-level
domains (TLDs) like .com and .org , and then second-level domains (the actual domain
name). This distributed structure prevents a single point of failure.
Mapping: The primary principle is to map domain names to IP addresses. This mapping is
essential because it allows IP addresses to change without affecting users, as the DNS record
is simply updated.
Decentralized: The DNS system is not controlled by a single entity but is distributed across
thousands of servers worldwide, making it scalable and resilient.
Caching: To improve performance, DNS resolvers and browsers cache recent lookups, storing
the IP address and a time-to-live (TTL) value for a period.
Internet navigation: It provides the framework for users to access online resources using easy-
to-remember domain names instead of numerical IP addresses.
Directing traffic: By translating domain names into IP addresses, DNS ensures that internet
traffic is directed to the correct servers.
Network services: DNS is crucial for many network services beyond the web, such as finding
email servers and locating domain controllers for authentication in systems like Active
Directory.
1. User input: A user types a domain name (e.g., [Link] ) into their web browser.
2. Local cache check: The computer first checks its own local cache to see if it has recently
resolved this domain name to an IP address. If it has, it uses that IP address and the process
ends. If not, it proceeds to the next step.
3. DNS resolver query: The computer sends a query to a DNS resolver, typically provided by the
Internet Service Provider (ISP).
4. DNS lookup process (if not in cache): The DNS resolver starts the lookup process by contacting
a series of DNS servers:
1. It queries a root DNS server for the location of the next server.
2. The root server directs the resolver to the appropriate top-level domain (TLD) server (e.g., a
server for the .com domain).
3. The TLD server directs the resolver to the authoritative name server for the specific domain
(e.g., [Link] ).
4. The authoritative name server holds the record and returns the IP address of the web server
to the DNS resolver.
5. Response to browser: The DNS resolver sends the IP address back to the user's computer.
6. Accessing the web page: The browser then uses the IP address to establish a connection and
request the webpage from the web server.
Application Layer (Layer 7): DNS is a protocol that operates at this layer, which is responsible
for providing network services to applications. It is an application-layer protocol for message
exchange between clients and servers.
Transport Layer (Layer 4): DNS typically uses the User Datagram Protocol (UDP) for its queries
and responses because UDP is faster than TCP, and a lost packet can be re-requested.
Network Layer (Layer 3): The IP address received from DNS is then used at this layer to route
the request across the network to the destination server.
4. Explain the working of the File Transfer Protocol (FTP) and its control and data
connections. (B)
File Transfer Protocol (FTP) works on a client-server model to transfer files over a network,
using two separate connections: a control connection for commands and authentication, and
a data connection for the actual file transfer. The control connection is established on the
server's port 21 to send and receive commands, while the data connection uses server port
20 (in active mode) or a different port number (in passive mode) to transmit file data.
Control connection
Purpose: Handles all the commands and responses, such as login, password, and commands
for actions like uploading, downloading, or listing files.
Duration: Remains open for the entire FTP session to manage all interactions between the
client and server.
Data connection
Purpose: Used exclusively for the actual transfer of files and directory listings.
Port: Uses a different port for data transfer. In Active Mode, the server uses port 20, while
in Passive Mode, the server opens a random port and informs the client, which then connects
to it.
Duration: Created and closed for each file transfer. It is opened when a file transfer is initiated
and closed after the transfer is complete, while the control connection remains open for
subsequent commands.
1. Connection Initiation: The FTP client initiates a connection to the FTP server on port 21.
2. Authentication: The server requests and the client provides a username and password to
authenticate the user.
4. Data Connection Establishment: When the client requests a file transfer, a separate data
connection is opened. This happens either actively (server initiates) or passively (client
initiates).
5. File Transfer: The actual file data is transferred over the data connection.
6. Data Connection Closure: After the file transfer is finished, the data connection is closed, but
the control connection remains open for further commands.
7. Session Termination: When the user disconnects, both the data and control connections are
closed
HTTP is a request-response protocol where a client (like a web browser) sends a request
message to a server, which then sends back a response message. This communication
happens over a network connection, typically using TCP/IP. The request message contains a
method (e.g., GET, POST), the URL, and headers, while the response includes a status code
(e.g., 200 OK), headers, and the requested data in the body.
Client: A program, like a web browser, that initiates communication by sending an HTTP
request to a server.
Server: A program, typically a web server, that listens for requests and responds by sending
back the requested resource (like an HTML page).
Proxies: Optional intermediary servers that can act as relays between the client and the
server, sometimes used for caching or security.
Working of HTTP
1. Client sends a request: The client (e.g., your browser) establishes a connection to the server
and sends an HTTP request.
2. Server processes the request: The server receives the request and processes it. This might
involve fetching a file from storage or executing a script to generate a response.
3. Server sends a response: The server sends back an HTTP response to the client, which
contains the status of the request and the requested data.
4. Client processes the response: The client receives the response and renders the content, such
as displaying a web page or an image.
HTTP Messages
1. Request Message
Request Line: Specifies the method (e.g., GET , POST ), the target URL, and the HTTP version.
Headers: Provide metadata about the request, such as the User-Agent (browser
type), Accept (preferred content type), and Cookie .
Body: An optional section containing data sent to the server, typically for methods
like POST (e.g., form data).
2. Response Message
Status Line: Includes the HTTP version, a three-digit status code (e.g., 200, 404), and a short
status message.
Body: Contains the actual requested resource, such as an HTML document, image, or CSS file.
6. Describe the various network topologies (Mesh, Star, Bus, Ring, Hybrid) in detail with
a neat diagram for each. (C )
Network topologies describe how devices are arranged in a network, with Bus connecting all
devices to a central cable, Star using a central hub, Ring connecting devices in a
circle, Mesh connecting every device to multiple other devices for high redundancy,
and Hybrid combining two or more topologies. Each topology has distinct advantages, such
as the cost-effectiveness of a bus network or the fault tolerance of a mesh network.
Bus Topology
Description: All devices are connected to a single, shared network cable, known as the
backbone.
Diagram: A single, long horizontal line with several devices branching off from it.
Cons: If the main cable breaks, the entire network fails. It can be slow with many devices and
difficult to troubleshoot.
Star Topology
Description: Each device is connected to a central hub or switch, which acts as the central
connection point.
Diagram: A central point (hub/switch) in the middle, with lines extending out to each device,
forming a star shape.
Pros: Easy to add new devices, and if one cable fails, only that device is affected.
Cons: The network is dependent on the central hub, which is a single point of failure.
Ring Topology
Description: Each device is connected to exactly two other devices, forming a closed, circular
loop. Data travels in one direction around the ring.
Diagram: A circle with devices positioned around the circumference and lines connecting each
device to its two neighbors.
Cons: A single device or cable failure can bring the entire network down. Adding or removing
a device can disrupt the network.
Mesh Topology
Description: Every device is interconnected with every other device, either directly or
indirectly. This creates multiple paths for data to travel.
Diagram: Multiple points with lines connecting every point to every other point.
Pros: Highly reliable and fault-tolerant because if one path fails, data can be rerouted through
another path.
Cons: Very expensive and complex to set up due to the extensive cabling.
Hybrid Topology
Diagram: A complex diagram showing different layouts, like a central star network connected
to a bus network. For example, a tree topology is a hybrid of bus and star.
Pros: Offers the flexibility to combine the advantages of different topologies to meet specific
needs.
Cons: Can be complex to manage and is often more expensive to implement than a single
topology
Part A (2 Marks)
1. Explain the services provided by the Transport Layer and illustrate the concept of
Transport Layer Multiplexing and Demultiplexing with examples. (A)
Multiplexing and Demultiplexing: Allows multiple applications on a single host to share the
network connection at the same time.
Segmentation and reassembly: Breaks down large messages from upper layers into smaller
segments for transmission and reassembles them into the original message at the destination.
Flow control: Manages the amount of data a sender transmits to prevent the receiver from
being overwhelmed.
Error control: Ensures data integrity by detecting and correcting errors. This can include error
detection (using checksums) and retransmitting lost or corrupted segments.
Congestion control: Manages the flow of data into the network to prevent congestion and
packet loss.
Multiplexing
Concept: On the sending host, the Transport Layer takes data from multiple applications (e.g.,
a web browser, an email client, and a video player) and combines them into a single stream
of segments before passing them to the Network Layer.
Process: Each application's data is given a transport-layer header that includes the source and
destination port numbers. These port numbers identify the specific application that sent the
data and the application that should receive it.
Example: Your computer is simultaneously streaming a video and downloading a file. The
transport layer on your computer collects data from both the video player (e.g., using a
specific port like 1935) and the download application (e.g., using port 21 for FTP). It then
multiplexes these segments, adding the appropriate port numbers, and sends them over the
network.
Demultiplexing
Concept: On the receiving host, the Transport Layer receives a stream of segments from the
Network Layer and separates them, delivering each one to the correct application based on
the port number in the header.
Process: The destination host's Transport Layer examines the destination port number in each
incoming segment. It then uses this number to direct the segment's data to the corresponding
application that is listening on that port.
Example: The video stream data arrives at your computer. The transport layer sees the
destination port number in the header is for your video player (e.g., port 1935). It then
delivers the data to the video player application, allowing it to reassemble the data and play
the video. Similarly, it would direct any file download data (e.g., from port 21) to your file
transfer application.
This ensures that data intended for one application is not mistakenly delivered to another,
and it allows you to run multiple network applications at the same time without them
interfering with each other.
2. Describe the detailed structure and function of the TCP Segment Header with a neat
diagram. (A)
The TCP segment header is a 20-byte fixed header, followed by an optional variable-
length field. It includes fields like Source Port, Destination Port, Sequence Number,
and Acknowledgement Number for connection and data flow management. It also
contains flags like SYN, ACK, and FIN for connection control, as well as fields for Header
Length, Window Size, Checksum, Urgent Pointer, and Options.
Structure of the TCP Segment Header
Field Size Description
Sequence Number 32 bits Tracks the byte order of the data. It is the sequence number
of the first byte in this segment.
Acknowledgement 32 bits Indicates the sequence number of the next byte expected
Number from the sender. It is used to acknowledge received data.
Data Offset 4 bits Defines the size of the TCP header in 32-bit words. It
indicates where the data portion of the segment begins.
Window Size 16 bits Specifies the number of bytes the receiver is willing to
accept, used for flow control.
Checksum 16 bits Used for error detection to verify data integrity during
transmission.
Urgent Pointer 16 bits Indicates the location of the end of urgent data when the
URG flag is set.
Options 0-40 Optional field for extensions like maximum segment size,
bytes window scaling, or timestamps.
3.
3. Illustrate the process of Connection Management in TCP, explaining the three-way
and four-way handshakes with state transition diagrams. (B)
This process is used to establish a reliable connection between a client and a server.
o The client sends a segment with the SYN flag set to the server, along with a randomly
generated initial sequence number.
o The server, in a LISTEN state, receives the SYN segment. It sends a segment back with both
the SYN and ACK flags set.
o This segment acknowledges the client's SYN by including an acknowledgment number that is
one greater than the client's sequence number. It also includes the server's own initial
sequence number.
o The client receives the SYN-ACK. It sends an ACK segment back to the server, acknowledging
the server's sequence number by incrementing it.
o Both the client and the server transition to the ESTABLISHED state, indicating that the
connection is ready for data transfer.
o The client sends a FIN segment to the server to indicate it has no more data to send.
Step 2: ACK
Step 3: FIN
o After the server has finished sending any remaining data, it sends its own FIN segment to the
client.
Step 4: ACK
o The client receives the server's FIN and sends a final ACK segment.
o The client enters the TIME-WAIT state before the connection fully closes.
o The server receives the final ACK and closes the connection.
Connection Termination: The client transitions from ESTABLISHED -> FIN-WAIT-1 -> FIN-
WAIT-2 -> TIME-WAIT -> CLOSED . The server transitions from ESTABLISHED -> CLOSE-
WAIT -> LAST-ACK -> CLOSED
4. Explain the concepts of Flow Control and Error Control mechanisms in TCP in detail.(B)
Flow control in TCP prevents a fast sender from overwhelming a slow receiver by managing
the rate of data transmission. Error control ensures the reliability of data transmission by
detecting and correcting errors that occur during transit, using mechanisms like checksums,
acknowledgments, and retransmissions.
Flow control
Purpose: To prevent the sender from sending data faster than the receiver can process it,
which would lead to data loss and buffer overflow.
o How it works: The receiver advertises its available buffer space as a "receive window" size in
the TCP header of each acknowledgment (ACK) packet.
o The sender keeps track of the amount of data it has sent that has not yet been acknowledged.
It can only send an amount of data up to the receiver's advertised window size.
o The window size can change dynamically during the communication based on how much
buffer space the receiver has available at any given time.
Key concept: The receiver uses feedback (the window size in ACKs) to control the sender's
rate, making it a feedback-based method.
Additional features:
o Persistent timer: If the receiver's window size becomes zero, it can cause a deadlock where
the sender waits indefinitely for an ACK. To prevent this, the sender starts a persistent timer
and sends small "window probe" packets to check if the receiver's window has opened up
again.
Error control
Purpose: To ensure the received data is a complete and accurate copy of the sent data,
detecting and correcting any errors that occurred during transmission.
Mechanisms:
o Error detection: Achieved using a checksum in each TCP segment. The receiver calculates the
checksum of the received segment and compares it to the checksum value in the header. If
they don't match, the segment is considered corrupt and is discarded.
o Acknowledgments (ACKs): The receiver sends acknowledgments for the segments it has
successfully received. These ACKs are cumulative, meaning an ACK for segment 5 indicates
that all segments up to and including 5 have been received correctly.
o Retransmission:
o Timeout: The sender starts a retransmission timer for each segment it sends. If an
acknowledgment is not received before the timer expires, the sender assumes the segment
or its ACK was lost and retransmits the segment.
o Fast retransmission: If the sender receives three duplicate ACKs for the same segment
(meaning the receiver has received an out-of-order segment and is expecting the one with
the missing sequence number), it can immediately retransmit the missing segment without
waiting for the timer to expire.
o Error correction: If an error is detected (e.g., the checksum fails) or a segment is assumed lost
due to a timeout, the sender simply retransmits the segment. TCP does not typically perform
complex forward error correction; it relies on retransmission to correct errors
5. Discuss the various Congestion Control and Congestion Avoidance techniques used in
TCP. (C )
Slow Start:
Initiates a connection with a small congestion window (cwnd), typically 1 Maximum Segment
Size (MSS).
Increases cwnd exponentially for each acknowledged segment, effectively doubling cwnd per
Round Trip Time (RTT).
This rapid increase helps quickly probe available network capacity until a slow start threshold
(ssthresh) is reached or packet loss occurs.
Congestion Avoidance (Additive Increase/Multiplicative Decrease - AIMD):
cwnd is increased by 1 MSS for each RTT (or a fraction of MSS for each ACK).
Upon detecting packet loss (via timeouts or duplicate ACKs), ssthresh is set to half of the
current cwnd, and cwnd is reset to 1 MSS (in Tahoe) or reduced by half (in Reno).
Fast Retransmit:
When the sender receives three duplicate ACKs for a segment, it immediately retransmits the
presumed lost segment without waiting for a timeout. This signals a likely single packet loss,
not severe congestion.
Fast Recovery:
Used in conjunction with Fast Retransmit (e.g., in TCP Reno).
After a Fast Retransmit, cwnd is halved (similar to multiplicative decrease), and the sender
enters Fast Recovery, continuing to send new data while waiting for an ACK that
acknowledges the retransmitted segment. This avoids the drastic reduction of Slow Start.
Congestion Avoidance Techniques (Preventing Congestion):
Instead of waiting for queues to fill completely and dropping packets, RED probabilistically
drops packets when average queue length exceeds a certain threshold. This provides an early
warning to senders to reduce their rates before severe congestion occurs.
Source-Based Congestion Avoidance (e.g., TCP Vegas):
Monitors RTT and variations in RTT to infer queuing delays and predict congestion before
packet loss occurs.
Adjusts cwnd based on these measurements to maintain a stable, low queueing delay.
These techniques work together to ensure efficient and fair sharing of network resources,
adapting dynamically to varying network conditions
6. Describe the structure of the UDP Header and explain the concept of Quality of Service
(QoS) and its parameters. (C )
The UDP header is 8 bytes long and consists of four 16-bit fields: a Source
Port and Destination Port to identify applications, a Length field for the total datagram size,
and a Checksum field for error detection. Quality of Service (QoS) is a mechanism for
managing network traffic to prioritize critical applications by controlling parameters
like bandwidth, delay, jitter, and packet loss, ensuring predictable performance for
applications like VoIP and video conferencing.
Length (16 bits): Specifies the total length of the UDP header plus the data in bytes. The
maximum value is 65,535 bytes.
Checksum (16 bits): Used for error checking to detect errors in the UDP header and data.
Concept: QoS prioritizes certain types of traffic (like voice or video) over others (like general
web browsing) to guarantee performance, especially on congested networks.
Parameters:
o Bandwidth: The maximum rate at which data can be transmitted. QoS mechanisms ensure
that high-priority applications have sufficient bandwidth.
o Delay: The time it takes for a data packet to travel from source to destination. QoS aims to
minimize delay for time-sensitive traffic.
o Jitter: The variation in the delay of received packets. A consistent delay is essential for
applications like real-time voice and video, and QoS works to reduce jitter.
o Packet Loss: The percentage of packets that fail to arrive at their destination. QoS helps
minimize packet loss by prioritizing traffic and managing congestion.
Part A (2 Marks)
IP stands for Internet Protocol and v4 stands for Version Four (IPv4). IPv4 was the primary
version brought into action for production within the ARPANET in 1983. IP version four
addresses are 32-bit integers which will be expressed in decimal notation. In this article, we
will discuss about IPv4 datagram header.
IPv4 is a connectionless protocol used for packet-switched networks. Internet Protocol
Version 4 (IPv4) is the fourth revision of the Internet Protocol and a widely used protocol in
data communication over different kinds of networks. IPv4 is a connectionless protocol used
in packet-switched layer networks, such as Ethernet. It provides a logical connection
between network devices by providing identification for each device. There are many ways
to configure IPv4 with all kinds of devices – including manual and automatic configurations
– depending on the network type. IPv4 uses 32-bit addresses for Ethernet communication
in five classes: A, B, C, D and E. Classes A, B, and C have a different bit length for addressing
the network host. Class D addresses are reserved for multicasting, while class E addresses
are reserved for military purposes. IPv4 uses 32-bit (4-byte) addressing, which gives
232 addresses. IPv4 addresses are written in the dot-decimal notation, which comprises
four octets of the address expressed individually in decimal and separated by periods, for
instance, [Link].
Characteristics of IPv4
IPv4 could be a 32-Bit IP Address.
IPv4 could be a numeric address, and its bits are separated by a dot.
The number of header fields is twelve and the length of the header field is twenty.
It has Unicast, broadcast, and multicast style of addresses.
IPv4 supports VLSM (Virtual Length Subnet Mask).
IPv4 uses the Post Address Resolution Protocol to map to the MAC address.
RIP may be a routing protocol supported by the routed daemon.
Networks ought to be designed either manually or with DHCP.
Packet fragmentation permits from routers and causing host.
IPv4 Datagram Header
VERSION: Version of the IP protocol (4 bits), which is 4 for IPv4
HLEN: IP header length (4 bits), which is the number of 32 bit words in the header. The
minimum value for this field is 5 and the maximum is 15.
Type of service: Low Delay, High Throughput, Reliability (8 bits)
Total Length: Length of header + Data (16 bits), which has a minimum value 20 bytes
and the maximum is 65,535 bytes.
Identification: Unique Packet Id for identifying the group of fragments of a single IP
datagram (16 bits)
Flags: 3 flags of 1 bit each : reserved bit (must be zero), do not fragment flag, more
fragments flag (same order)
Fragment Offset: Represents the number of Data Bytes ahead of the particular fragment
in the particular Datagram. Specified in terms of number of 8 bytes, which has the
maximum value of 65,528 bytes.
Time to live: Datagram’s lifetime (8 bits), It prevents the datagram to loop through the
network by restricting the number of Hops taken by a Packet before delivering to the
Destination.
Protocol: Name of the protocol to which the data is to be passed (8 bits)
Header Checksum: 16 bits header checksum for checking errors in the datagram header
Source IP address: 32 bits IP address of the sender
Destination IP address: 32 bits IP address of the receiver
Option: Optional information such as source route, record route. Used by the Network
administrator to check whether a path is working or not.
[Link] the working of the Address Resolution Protocol (ARP) and the Reverse Address
Resolution Protocol (RARP) with a scenario diagram for each. (B)
ARP maps an IP address to a MAC address on a local network by broadcasting an ARP request,
and RARP maps a MAC address to an IP address by a diskless workstation broadcasting its
MAC address to a RARP server. ARP is used for communication between devices on the same
network, while RARP is used by devices, often diskless workstations, to discover their own IP
address at boot time.
Process:
1. A host wanting to send data on the local network needs the destination's MAC address.
2. The host broadcasts an ARP request packet with the destination IP address to all devices on
the local network.
3. The device with the matching IP address sends an ARP reply, including its MAC address, back
to the requesting host.
4. The requesting host stores the IP-to-MAC mapping in its local ARP cache for future use
Process:
1. A diskless workstation boots up and knows its MAC address but not its IP address.
2. The workstation sends a RARP request to a RARP server on the network, broadcasting its MAC
address.
3. The RARP server, which has a pre-configured table, looks up the MAC address and sends a
RARP reply with the corresponding IP address back to the requesting workstation.
4. Describe the Internet Control Message Protocol (ICMP) and the Dynamic Host
Configuration Protocol (DHCP), explaining their message types and primary functions.
(B)
ICMP is a network layer protocol for error reporting and diagnostics, with messages like Echo
Request/Reply for ping and Destination Unreachable to report network issues. DHCP is an
application layer protocol that automatically assigns IP addresses and other network
configuration parameters to devices, using a handshake process to manage IP address leasing
for hosts on a network.
Message Types:
o Echo Request/Reply: Used by the ping utility to test host reachability and latency. An Echo
Request is sent, and the destination responds with an Echo Reply if it is reachable.
o Destination Unreachable: Indicates that a packet could not be delivered to its destination.
Codes further specify the reason, such as "network unreachable," "host unreachable," or
"protocol unreachable".
o Redirect: Informs a host to send future packets for a specific destination through a different
router, providing a more efficient route.
o Time Exceeded: Used in utilities like traceroute to indicate that the time-to-live (TTL) field in
an IP packet has expired or that reassembly time has been exceeded.
How it Works: ICMP messages are encapsulated within IP datagrams to be sent across the
network.
o DHCP Discover: A broadcast message sent by a client to find a DHCP server on the network.
o DHCP Offer: Sent by a DHCP server in response to a Discover message, offering an available
IP address and other configuration details.
o DHCP Request: Sent by the client to request the specific IP address offered by a server.
o DHCP ACK (Acknowledge): The final message from the server, confirming the lease of the IP
address to the client.
How it Works: A device first sends a broadcast "Discover" message. The server responds with
an "Offer." The client then sends a "Request" to accept the offered address, and the server
replies with an "ACK" to complete the lease.
5. Compare Circuit Switching and Packet Switching in detail, highlighting the advantages
of Packet Switching in modern computer networks. (C )
Circuit switching dedicates a fixed, physical path for a connection, ensuring a constant and
reliable data stream but wasting bandwidth during inactivity. Packet switching breaks data
into smaller, independently routed packets, leading to efficient, dynamic use of network
resources and cost-effectiveness, making it the standard for modern data networks despite
potential minor delays or out-of-order packets. Packet switching's key advantages for modern
networks are its efficiency, scalability, and flexibility.
Data Continuous stream of data Data is divided into packets that travel
Transfer independently, potentially taking different
routes
Bandwidth Fixed and dedicated, regardless Dynamic and shared, allocated on-demand
of traffic
Efficiency Inefficient for bursty traffic due Highly efficient, as bandwidth is shared
to reserved, unused bandwidth among multiple users
Reliability High, with a constant and Less reliable on its own, as packets can be lost
guaranteed path or arrive out of order without protocols
Call Setup Required to establish a dedicated No call setup is required; data can be sent
circuit before sending data immediately
Overhead Low protocol overhead once the High overhead due to headers in each packet
circuit is established and dynamic routing
Use Case Traditional voice calls Internet, email, web browsing, and other
data-intensive applications
Scalability: It is more scalable because resources are allocated on demand, rather than being
fixed for each connection as in circuit switching. This allows networks to handle a massive
number of users and devices without needing a dedicated circuit for each one.
Cost-Effectiveness: The dynamic allocation of resources makes packet switching more cost-
effective than circuit switching, which requires a constant, dedicated connection.
Flexibility: Packet switching can handle a variety of data types, not just voice. While circuit
switching is optimized for constant, steady streams like voice, packet switching can carry data
for web browsing, email, video, and more, making it suitable for the diverse needs of the
internet
6. Illustrate the structure and advantages of IPv6 over IPv4, and explain the format of
the IPv6 datagram header. (C )
IPv6 uses 128-bit addresses, providing a massive address space, while IPv4 uses 32-bit
addresses. The advantages of IPv6 over IPv4 include a larger address pool, simplified
header for faster routing, built-in security features like IPsec, improved quality of
service (QoS) through the Flow Label field, and no need for Network Address
Translation (NAT). The IPv6 datagram header has a fixed 40-byte size with fields like
Version, Traffic Class, Flow Label, Payload Length, Next Header, Hop Limit, Source
Address, and Destination Address.
Part A (2 Marks)
1. Explain the working principle of the Distance Vector Routing algorithm (RIP) with a
suitable example and discuss its limitations and remedies. (A)
The Distance Vector Routing algorithm (RIP) works by having routers maintain a routing table
and periodically exchange their entire table with neighboring routers. Routers use this
information to update their tables, choosing the path with the lowest "distance" (metric),
usually the number of hops. Limitations include slow convergence and the "count-to-infinity"
problem, which can be partially remedied with techniques like split horizon, poison reverse,
and maximum hop counts.
Working principle
1. Routing table: Each router maintains a routing table with columns for the destination
network, the distance (metric) to that destination, and the next hop router to reach it.
2. Periodic updates: Routers send their entire routing table to their directly connected neighbors
at regular intervals (e.g., every 30 seconds in RIP).
3. Distance vector calculation: When a router receives an update from a neighbor, it calculates
the distance to all destinations through that neighbor. It compares the new path cost with the
existing path cost in its table.
4. Table update: If the new path through the neighbor is shorter (has a lower cost), the router
updates its table with the new, lower cost and the neighbor as the next hop.
5. Convergence: This process repeats until all routers have converged to the same routing
information, meaning they all agree on the shortest path to every destination.
Example
Consider a small network with routers A, B, C, and D. Router A wants to send data to network
D.
Initial state: Each router only knows about its direct neighbors.
A to B: Router A knows it can reach network D by going through B, with a cost of 2 hops (A-
>B->D).
A to C: Router A learns from router C that it can reach network D via C with a cost of 3 hops
(A->C->B->D).
Update: Router A compares the two paths and chooses the one with the lower hop count,
which is through B.
Count-to- When a link fails, a router Maximum hop count: Limit the maximum hop
infinity might continue to receive count to prevent routes from being advertised
updates about the broken indefinitely (e.g., RIP's limit is 15). Split horizon with
link from other routers, poison reverse: A router does not advertise a route
leading to an ever- back to the neighbor it learned it from. Poison
increasing (infinite) hop reverse sends the route back with an infinite metric
count. to explicitly mark it as unreachable.
Slow Because entire tables are Triggered updates: A router can send an update
convergence sent periodically (e.g., immediately when a change occurs to speed up
every 30 seconds), it takes convergence. Hold-down timers: A router
a long time for changes to temporarily suppresses route updates for a specific
propagate throughout the route after it goes down, preventing unstable
network. routes from being immediately re-advertised.
Scalability The need to send entire Use a different protocol: For larger and more
routing tables frequently complex networks, use more scalable protocols like
can consume significant OSPF or BGP, which use more efficient methods for
bandwidth, making the routing information exchange.
algorithm unsuitable for
large networks.
Broadcasts RIP uses broadcasts to Use RIPv2: This version uses multicasting to send
send updates, which can updates only to routers, which is more efficient.
be inefficient and
broadcast to all devices on
a subnet.
2. Describe the working principle of the Link State Routing algorithm (OSPF). Explain the
process of building the Shortest Path Tree (SPT). (A)
Link State Routing, exemplified by OSPF (Open Shortest Path First), operates on the principle
of each router maintaining a complete and consistent topological map of the network. This
differs from distance-vector protocols, which only maintain information about directly
connected neighbors. OSPF achieves this through the following steps:
Neighbor Discovery:
Each router generates LSAs containing information about its directly connected links,
including link state (up/down), cost, and connected neighbors. These LSAs are flooded
throughout the OSPF area, ensuring all routers receive a copy.
Each router compiles the received LSAs into a comprehensive LSDB, which represents a
complete map of the network topology. All routers within an OSPF area should have identical
LSDBs.
Each router independently runs the SPF algorithm (Dijkstra's algorithm) on its LSDB to
calculate the shortest path to every other destination in the network. The router itself is the
root of this calculation.
Routing Table Update:
The calculated shortest paths are then used to populate the router's IP routing table, directing
traffic along the most efficient routes.
Building the Shortest Path Tree (SPT)
The Shortest Path Tree (SPT) is constructed by each router using Dijkstra's algorithm, with the
router performing the calculation acting as the root of the tree. The process involves
iteratively building the tree by adding nodes (routers) with the lowest cumulative cost from
the root.
Initialization:
The source router (the router running the algorithm) is added to the set of "finalized" nodes
with a cost of 0.
All other nodes are initialized with an infinite cost and no predecessor.
Iteration:
From the set of "unfinalized" nodes, the node with the lowest current cost is selected.
If this tentative cost is lower than the neighbor's current recorded cost, update the neighbor's
cost and set its predecessor to the newly finalized node.
Termination:
This process continues until all nodes have been added to the "finalized" set, or until all
reachable nodes have been processed.
The resulting structure is a tree where each branch represents the shortest path from the
root (the calculating router) to a destination node, and the cost of each path is minimized.
An AS is a collection of interconnected networks that share a common routing policy and are
managed by a single organization, such as an internet service provider (ISP) or a large
company.
Internal routing: Routing within the AS is handled by an IGP. Routers within the AS use the
IGP to determine the best path to other destinations inside the AS.
Border routers: These are the routers that connect the AS to other autonomous systems on
the internet. They must run both an IGP to communicate with other routers in their own AS
and an EGP to communicate with other ASs.
Scope Route traffic within a single Route traffic between different autonomous
autonomous system. systems.
Purpose To find the most efficient To facilitate connectivity and exchange routing
path to a destination inside information between autonomous systems on the
the AS. internet.
Examples OSPF, IS-IS, RIP, EIGRP. Border Gateway Protocol (BGP) is the standard
EGP. The term "Exterior Gateway Protocol" also
refers to the general category, which the original,
obsolete EGP protocol was part of.
Complexity Generally less complex than More complex, as they must handle the scale of
EGPs. They focus on efficient the entire internet and implement policies to
path calculation within a manage trust and avoid network congestion
trusted environment. between ASs.
Decision Typically use metrics like hop Primarily use a policy-based approach to
Factors count, bandwidth, or delay to determine routes, considering factors like
find the shortest or fastest business agreements and traffic engineering
path. between ASs.
4. Describe the working of the Border Gateway Protocol (BGP), explaining its path
attributes and message types. (B)
BGP uses numerous path attributes to help its routers decide on the best path to a destination
network.
AS_PATH: A list of the autonomous systems (AS) a route must pass through to reach the
destination. This is crucial for loop prevention.
LOCAL_PREF: A locally significant value used by a router to determine the preferred outbound
path for traffic, even if the AS_PATH is the same.
ORIGIN: Indicates how the route information was learned (e.g., from an interior gateway
protocol, via redistribution, or originated within the AS).
NEXT_HOP: The IP address of the next-hop router to which the packet should be sent.
COMMUNITY: A well-known attribute used to signal special handling for a route, such as "no-
export" to prevent a route from being advertised outside an AS.
KEEPALIVE: Sent periodically to maintain the BGP session. If a KEEPALIVE is not received within
a certain time, the session is considered dead.
NOTIFICATION: Sent to indicate an error or special condition that requires the BGP session to
be closed.
5. Explain the different types of multicast routing (Source-based Tree and Shared Tree),
and describe the working of DVMRP. (C)
Source-based trees create a unique, shortest-path tree for each sender-group pair, while
shared trees use a single, shared tree for an entire group, with all traffic flowing through a
designated rendezvous point (RP). DVMRP is a Distance Vector Multicast Routing Protocol
that uses a flood-and-prune method to build these source-based trees and maintain them by
sending multicast traffic along the shortest path.
Types of multicast routing trees
1. Source-based tree (SBT)
2. Shared tree
Working of DVMRP
DVMRP operates by creating source-based trees using a flood-and-prune method.
1. Flood: When a router receives a multicast packet for a group it doesn't have a path
for, it floods the packet out of all interfaces except the one from which it was received.
This continues until the packet reaches a router that is already part of a multicast tree
for that group.
2. Reverse Path Forwarding (RPF): To prevent loops, a router only forwards a multicast
packet on an interface if it is the next-hop on the shortest path from the source to the
receiver. This is determined by checking the unicast routing table.
3. Prune: When a router receives a multicast packet on an interface where there are no
group members, it sends a prune message upstream to its neighbors to stop the
flooding for that branch of the tree. This prevents the router from receiving and
forwarding unnecessary traffic.
4. Maintenance: DVMRP routers periodically exchange routing information to build and
maintain their multicast routing tables. This ensures that the shortest path trees are
updated as network conditions change.
6. Compare and contrast Static Routing and Dynamic Routing, explaining the advantages
and disadvantages of each. (C )
Static routing uses manually configured, fixed paths, making it secure and resource-efficient
but difficult to manage in large networks and lacking automatic failover. Dynamic routing
automatically adjusts paths using algorithms, making it scalable and resilient for large
networks, but it uses more resources, is less secure, and is more complex to configure.
Static Routing
Feature Description
Failure Handling Link failure causes traffic interruption; requires manual rerouting.
Dynamic Routing
Feature Description
Failure Handling Automatic rerouting around failed links without manual intervention.
Use Static Routing for small, stable networks where simplicity, predictability, and security are
top priorities and changes are infrequent.
Use Dynamic Routing for large, complex, and frequently changing networks where scalability
and automatic failover are essential for maintaining connectivity.
📝 Part A (2 Marks)
1. Explain the different framing methods used in the Data Link Layer: Character Counting,
Byte Stuffing, and Bit Stuffing. (A)
1. Character Counting
Method: A field in the frame header explicitly states the number of characters or bytes that
constitute the frame.
Problem: If the count field is corrupted during transmission, the receiver loses track of all
subsequent frames, making it difficult to recover synchronization.
2. Byte Stuffing
Method: This is a character-oriented approach that uses a special flag byte (e.g., 01111110 )
to mark the beginning and end of each frame.
Stuffing: When a flag byte or an escape byte (ESC) appears in the data, a special ESC byte is
inserted before it to prevent the receiver from misinterpreting it as a control sequence.
De-stuffing: The receiver removes the ESC byte before passing the data to the next layer.
Limitation: It can be problematic if the data contains patterns that match the flag or ESC byte,
and it is generally limited to 8-bit character systems.
3. Bit Stuffing
Method: This is a bit-oriented approach where a special bit pattern, the flag
pattern (e.g., 01111110 ), is used to start and end a frame.
Stuffing: To prevent the flag pattern from appearing in the data and causing
misinterpretation, the sender inserts an extra 0 bit after every sequence of five
consecutive 1 s in the data stream.
De-stuffing: The receiver removes the extra 0 bit after a sequence of five 1 s.
Advantage: It can handle arbitrary bit patterns without needing an escape character.
2. Describe the Data Link Layer Protocols HDLC and PPP, highlighting the frame format
and key features of each. (A)
HDLC and PPP are data link layer protocols for transmitting data between nodes, but they
differ in flexibility and features. HDLC is a bit-oriented protocol used in Cisco's default serial
links and legacy systems, while PPP is a byte-oriented protocol commonly used for internet
connections and dial-up, supporting features like dynamic addressing and strong
authentication methods such as CHAP and PAP, which HDLC lacks. Both use a similar frame
format with flag fields, an address/protocol field, a control field, an information field, and a
frame check sequence (FCS) for error detection.
HDLC (High-Level Data Link Control)
Frame Format:
o Flag: Identifies the start and end of a frame (
0111111001111110
01111110
).
Frame Format:
o Flag: Identifies the start and end of a frame, similar to HDLC.
o Address: Usually set to all ones to indicate a broadcast, but can be set to other
values.
o Control: Contains a protocol field, which identifies the network layer protocol
being carried (e.g., IP, IPX).
o Information: Carries the payload from the network layer.
o Frame Check Sequence (FCS): Used for error detection, like in HDLC.
Key Features:
o Byte-oriented: Processes data in byte-sized chunks.
o Asynchronous and Synchronous: Can be used over both types of links,
including dial-up (asynchronous).
o Authentication: Supports authentication protocols like PAP and CHAP.
o Dynamic Addressing: Can dynamically configure network layer addresses.
o Uses: Widely used for dial-up internet connections and PPPoE (Point-to-Point
Protocol over Ethernet) connections.
3. Explain the working of CSMA/CD, detailing the exponential back-off algorithm used to
resolve collisions. (B)
CSMA/CD (Carrier Sense Multiple Access with Collision Detection) is a media access control
method used in Ethernet networks to manage how multiple devices share a common
transmission medium.
Working of CSMA/CD:
Carrier Sense:
Before transmitting, a station "listens" to the network medium to detect if another station is
currently transmitting. If the channel is busy, the station waits.
Multiple Access:
Once the channel is detected as idle, the station begins transmitting its data frame. Multiple
stations can attempt to access the medium, leading to potential collisions.
Collision Detection:
While transmitting, the station continuously monitors the medium to detect if its signal is
interfering with another station's signal, indicating a collision.
Collision Handling:
If a collision is detected, the transmitting station immediately stops transmission, transmits a
jam signal to ensure all other stations are aware of the collision, and then invokes the Binary
Exponential Back-off algorithm.
This algorithm is used to resolve collisions by determining a random waiting period (back-off
time) before a station attempts retransmission.
Collision Counter:
Back-off Calculation:
Upon a collision, c is incremented. The station then calculates a random back-off time based
on c and a defined "slot time" (typically twice the maximum round-trip propagation delay in
the network).
The station waits for the calculated back-off time. After the back-off period, it attempts
retransmission by re-initiating the CSMA/CD process (carrier sensing).
Exponential Increase:
With each successive collision for the same frame, c increases, exponentially expanding the
range of possible random values for k. This increases the average back-off time, reducing the
probability of repeated collisions between the same stations.
Retry Limit:
If the number of retransmission attempts for a frame reaches a predefined maximum limit
(e.g., 16), the station aborts the transmission, assuming a persistent network problem
4. Describe the IEEE 802.11 Wireless LAN architecture and its Medium Access Control
(MAC) method (CSMA/CA). (B)
The IEEE 802.11 Wireless LAN architecture is based on a layered model with the physical (PHY)
and MAC (Medium Access Control) layers defining its core functions, and is organized into
Basic Service Sets (BSSs) and Extended Service Sets (ESSs). Its MAC method, Carrier Sense
Multiple Access with Collision Avoidance (CSMA/CA), prevents data collisions by having
stations listen before transmitting and using a random backoff timer to delay transmissions if
the medium is busy.
Layers: The standard specifies the PHY and MAC layers for wireless communication, with the
PHY layer handling the physical transmission (e.g., using radio frequencies) and the MAC layer
managing access to the medium and other services.
Service Sets: Stations (wireless devices) are organized into BSSs, which are groups of stations
within a single BSS. Multiple BSSs can be interconnected to form an ESS, which provides a
larger coverage area and allows for seamless roaming between BSSs.
Modes:
o Infrastructure Mode: Stations connect to an Access Point (AP), which acts as a central hub
and provides a gateway to a wired network.
Carrier Sense: Before transmitting, a station "listens" to the medium to see if another station
is already sending data.
Collision Avoidance: If the medium is busy, the station waits for a random amount of time,
called the "backoff period," before it can transmit.
Random Backoff: The random backoff ensures that if multiple stations are waiting, they will
likely choose different backoff times, reducing the chance they will transmit at the same
moment.
RTS/CTS: The Request to Send/Clear to Send (RTS/CTS) mechanism is an optional feature used
to combat the hidden node problem, where two stations can't hear each other but can both
hear the AP.
.
5. Explain the concept of Virtual LANs (VLANs), their advantages, and the methods for
their implementation. (C)
A Virtual LAN (VLAN) is a logical segmentation that groups devices on a network, regardless
of their physical location, to create separate broadcast domains. This improves security,
performance, and manageability by isolating traffic, reducing congestion, and allowing for
more flexible network design without physical rewiring. VLANs are implemented through
methods like port-based assignment and IEEE 802.1Q tagging, where switches are configured
to handle traffic for multiple VLANs.
Concept
Logical segmentation: VLANs partition a single physical network switch into multiple logical
networks.
Broadcast domain isolation: Each VLAN is a separate broadcast domain, meaning a broadcast
from one VLAN does not reach another, unlike a traditional LAN where all devices on the same
switch are in the same broadcast domain.
Spanning across switches: A single VLAN can be extended across multiple physical switches,
allowing devices in different locations to be in the same logical network.
Advantages
Improved security: Isolates traffic between different groups of devices, limiting the attack
surface and allowing for the application of security policies to restrict access.
Cost savings: Reduces the need for extensive cabling and networking hardware since multiple
VLANs can share the same physical infrastructure.
Implementation methods
Port-based (Static) VLANs: This is the simplest method, where an administrator manually
assigns each switch port to a specific VLAN. All devices connected to that port are
automatically placed in that VLAN.
IEEE 802.1Q tagging: This method is used on trunk ports, which are configured to carry traffic
for multiple VLANs simultaneously.
o When a frame travels over a trunk port, a tag containing a unique VLAN ID is added to the
frame.
o The tag allows the switch to know which VLAN the data belongs to and forward it to the
correct destination.
o The tag is automatically removed before the frame is sent to an end device that is not
expecting tagged frames.
MAC-based VLANs: The switch assigns a device to a VLAN based on its unique Media Access
Control (MAC) address.
Protocol-based VLANs: The switch assigns a device to a VLAN based on the network protocol
it is using (e.g., IP, IPX).
.
6. Describe the different types of Transmission Media (Guided and Unguided) and their
characteristics.
Transmission media are either guided, which use physical cables like twisted pair, coaxial, and
fiber optic to direct signals, or unguided, which transmit wireless signals through the air or
vacuum using radio waves, microwaves, and infrared. Guided media offer more security and
reliability with higher bandwidth, while unguided media provide flexibility and mobility.
Characteristics:
o Security: Generally more secure because it requires physical access to the cables.
o Types:
o Twisted Pair Cable: Pairs of insulated wires twisted together to reduce crosstalk. Used in
Ethernet LANs, and offers speeds up to 10 Gbps over 100 meters at low cost.
o Fiber Optic Cable: Transmits data as pulses of light through glass or plastic fibers. Provides the
highest bandwidth (over 100 Tbps) and can cover distances of over 100 kilometers with
minimal signal loss.
Description: This is wireless communication that broadcasts signals through the air or vacuum
without physical guidance.
Characteristics:
o Security: Less secure as signals can be intercepted and are more susceptible to interference
from other devices and environmental factors.
o Direction: Signals are broadcasted in all directions (omnidirectional) or along a specific path
(directional).
o Types:
o Radio Waves: Omnidirectional and can penetrate walls. Used for long-distance broadcasting
like AM/FM radio, with a frequency range of 3 KHz to 1 GHz.
o Microwaves: Highly directional and are used for point-to-point communication, such as
satellite and microwave links.
o Infrared: Used for short-range communication, such as TV remotes and wireless mouse, and
is blocked by solid objects.