0% found this document useful (0 votes)
6 views48 pages

Computer Networks: OSI & TCP/IP Models

Uploaded by

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

Computer Networks: OSI & TCP/IP Models

Uploaded by

hodaids
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CS3591 COMPUTER NETWORKS

YEAR/SEMESTER:III/V

Unit I: Introduction and Application Layer

Part A (2 Marks)

1. Define a Computer Network. (A)


o A computer network is a system of interconnected computers and peripheral
devices that can communicate with each other and share resources (like data,
hardware, and software).
2. What is a Protocol? (A)
o A protocol is a set of rules and conventions governing how data is exchanged
between two or more entities in a communication system. Key elements
include syntax, semantics, and timing.
3. Differentiate between IMAP and POP3. (B)
o POP3 (Post Office Protocol version 3) typically downloads the email from the
server to the local device and then deletes it from the server.
o IMAP (Internet Message Access Protocol) allows users to view and manage
emails directly on the server, keeping them synchronized across multiple
devices.
4. Why is HTTP referred to as a "stateless" protocol?(B)
o HTTP is stateless because the server does not retain any information (state)
about past client requests after a response is sent. Each request from the client
to the server is treated as a new, independent transaction.
5. List the four fundamental characteristics that a data communication system depends
on. (C )
o The four fundamental characteristics are Delivery, Accuracy, Timeliness, and
Jitter (variation in packet arrival time).

✍Part B (16 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 6: Presentation Layer: Handles data formatting, translation, encryption, and


compression.

 Layer 5: Session Layer: Manages communication sessions, including dialog control and
synchronization.

 Layer 4: Transport Layer: Ensures process-to-process delivery by segmenting data and


includes protocols like TCP and UDP.

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

TCP/IP Protocol Suite


The TCP/IP suite is the foundation of the modern internet and consists of the following four
layers:

 Application Layer: Provides network services directly to user applications and combines the
functions of the OSI model's Session, Presentation, and Application layers.

 Transport Layer: Responsible for end-to-end communication between applications, managing


reliability, and flow control. Examples include TCP (Transmission Control Protocol) and UDP
(User Datagram Protocol).

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

DNS is a hierarchical, distributed naming system that translates human-readable domain


names (like [Link] ) into machine-readable IP addresses (like [Link] ).
It acts as the internet's phonebook, enabling users to access websites and services without
needing to memorize IP addresses. DNS operates at the application layer of the OSI model
and uses the UDP protocol for its queries and responses.

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.

Role of DNS in a computer network

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

How DNS works to access a webpage

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.

DNS and the OSI model

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

 Port: Uses the server's port 21 to establish the connection.

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

How it works (step-by-step)

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.

3. Control Connection Establishment: Once authenticated, the control connection is


established, allowing the client to send commands.

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

5. Illustrate the architecture and working of HTTP (HyperText Transfer Protocol),


detailing its request and response messages. (C )

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.

Architecture: Client-Server Model

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

 Protocols: HTTP is an application-layer protocol that uses a transport-layer protocol, most


commonly Transmission Control Protocol (TCP), to ensure reliable data delivery.

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.

o Example: GET /[Link] HTTP/1.1

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

o Example: HTTP/1.1 200 OK


 Headers: Provide metadata about the response, such as Content-Type (type of
content), Content-Length (size of the content), and Set-Cookie .

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

 Pros: Cost-effective and easy to set up for small networks.

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

 Pros: Can be cost-effective for simple networks.

 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

 Description: A combination of two or more different network topologies, such as a star-bus


or star-ring network.

 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

Unit II: Transport Layer

Part A (2 Marks)

1. What are the main responsibilities of the Transport Layer? (A)


o The main responsibilities include Segmentation and reassembly, Multiplexing
and demultiplexing, Connection control, and ensuring Reliable data transfer (if
using TCP).
2. Differentiate between TCP and UDP.(A)
o TCP (Transmission Control Protocol) is connection-oriented and provides
reliable, ordered, and error-checked delivery.
o UDP (User Datagram Protocol) is connectionless and provides unreliable (best-
effort) delivery with minimal overhead.
3. What is Jitter in Quality of Service (QoS)? (B)
o Jitter refers to the variation in the packet arrival time. High jitter can negatively
affect real-time applications like VoIP and video conferencing.
4. What is the purpose of the Sequence Number field in the TCP header? (B)
o The Sequence Number identifies the first byte of data in the current segment
being sent. It is used for ordering the segments correctly at the receiver and
for implementing reliability and retransmission schemes.
5. List the three phases of the TCP connection management.(C )
o The three phases are Connection Establishment (using the three-way
handshake), Data Transfer, and Connection Termination (using the four-way
handshake).

✍ Part B (16 Marks)

1. Explain the services provided by the Transport Layer and illustrate the concept of
Transport Layer Multiplexing and Demultiplexing with examples. (A)

The Transport Layer provides process-to-process delivery of data by offering services


like segmentation, reassembly, flow control, and error control. It enables multiplexing by
combining data from multiple applications on the sending host into a single stream and
demultiplexing by directing incoming data to the correct application on the receiving host
using port numbers. For example, when you browse the web and receive a file at the same
time, multiplexing allows both your web browser and file transfer application to send and
receive data simultaneously, and demultiplexing ensures the data is delivered to the correct
application based on its port number.

Services provided by the Transport Layer


 Process-to-process delivery: The Transport Layer ensures that data reaches the correct
application process on the destination host, not just the destination host itself.

 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 and Demultiplexing with examples

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

Source Port 16 bits Identifies the port of the sending application.

Destination Port 16 bits Identifies the port of the receiving application.

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.

Reserved 6 bits Reserved for future use.

Flags 6 bits Contains six control bits, each 1 bit in size:


• URG: Indicates urgent data.
• ACK: Indicates acknowledgement number is valid.
• PSH: Pushes data to the receiving application
immediately.
• RST: Resets the connection.
• SYN: Synchronizes sequence numbers for connection
initiation.
• FIN: Indicates no more data will be sent.

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.

Padding If options are used, padding may be required to make the


header's length a multiple of 32 bits.

Data Variable The actual application data being transmitted.

3.
3. Illustrate the process of Connection Management in TCP, explaining the three-way
and four-way handshakes with state transition diagrams. (B)

TCP connection management uses a three-way handshake to establish a reliable connection


and a separate process to terminate it. The handshake involves the client sending a SYN, the
server responding with a SYN-ACK, and the client sending a final ACK to establish the
connection. Connection termination typically uses a four-way handshake, which involves
separate FIN and ACK messages from each side to close the connection gracefully.

Three-way handshake: Connection establishment

This process is used to establish a reliable connection between a client and a server.

 Step 1: SYN (Synchronize)

o The client sends a segment with the SYN flag set to the server, along with a randomly
generated initial sequence number.

o The client transitions to the SYN-SENT state.


 Step 2: SYN-ACK (Synchronize-Acknowledge)

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 server transitions to the SYN-RECEIVED state.

 Step 3: ACK (Acknowledge)

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.

Four-way handshake: Connection termination


This process is used to gracefully close a TCP connection, ensuring all data has been
transmitted.

 Step 1: FIN (Finish)

o The client sends a FIN segment to the server to indicate it has no more data to send.

o The client enters the FIN-WAIT-1 state.

 Step 2: ACK

o The server sends an ACK segment to acknowledge the client's FIN.

o The client enters the FIN-WAIT-2 state.

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

State transition diagrams


 Connection Establishment: The client transitions from CLOSED -> SYN-SENT -
> ESTABLISHED . The server transitions from LISTEN -> SYN-RECEIVED -> ESTABLISHED .

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

 Mechanism: TCP's primary flow control mechanism is the sliding window.

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 )

TCP employs a multi-faceted approach to manage and prevent network congestion,


combining congestion control and congestion avoidance techniques.

Congestion Control Techniques (Responding to Congestion):

 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):

 After cwnd exceeds ssthresh, the growth becomes linear.

 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):

 Explicit Congestion Notification (ECN):


 Routers explicitly mark packets to indicate impending congestion without dropping them.
 The receiver echoes this ECN mark to the sender, prompting the sender to reduce its
transmission rate proactively.
 Random Early Detection (RED):

 A queue management algorithm used by routers.

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

UDP Header Structure

 Source Port (16 bits): Identifies the sender's application port.

 Destination Port (16 bits): Identifies the receiver's application port.

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

Quality of Service (QoS)


Quality of Service (QoS) is a set of technologies that manage network traffic to ensure a
certain level of performance for specific applications or data flows.

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

Unit III: Network Layer

Part A (2 Marks)

1. What is the primary function of the Network Layer?(A)


o The primary function of the Network Layer is source-to-destination delivery of
packets across multiple networks (inter-networking) by implementing logical
addressing (IP addressing) and routing.
2. List two major differences between IPv4 and IPv6.(A)
o Address Size: IPv4 uses a 32-bit address; IPv6 uses a 128-bit address.
o Header: IPv4 has a variable-length header; IPv6 has a fixed-length, simpler
header.
3. Define Subnetting.(B)
o Subnetting is the practice of dividing a single large logical network (IP address
range) into smaller, more manageable logical sub-networks (subnets). This is
done by borrowing bits from the host ID portion of the IP address.
4. What is the purpose of the TTL field in an IPv4 header?(B)
o The Time-to-Live (TTL) field is an 8-bit field that limits the lifespan of a
datagram. Each router that processes the datagram decrements the TTL by
one. If the TTL reaches zero, the datagram is discarded to prevent it from
looping infinitely in the network.
5. State the function of ARP and RARP. (C )
o ARP (Address Resolution Protocol): Maps a logical IP address to its
corresponding physical MAC address.
o RARP (Reverse Address Resolution Protocol): Maps a physical MAC address to
its corresponding logical IP address (now mostly obsolete, replaced by DHCP).

✍ Part B (16 Marks)


1. Explain the structure and format of an IPv4 datagram header in detail with a diagram,
and discuss the function of its key fields. (A)

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.

2. Describe the various IP Addressing classes (Class A, B, C, D, E) and their respective


default subnet masks. Illustrate the concept of subnetting with a suitable example.(A)

IP addressing is divided into classes A, B, C (for unicast), D (multicast), and E (experimental),


each with a default subnet mask that determines the network and host portions of an
address. For example, a Class C address ( 192.168.1.x192.168 .1 X) the default subnet mask
([Link])

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

Address Resolution Protocol (ARP)

 Function: Maps a known IP address to a physical MAC address.

 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

Reverse Address Resolution Protocol (RARP)

 Function: Maps a known MAC address to a logical IP address.

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

Internet Control Message Protocol (ICMP)


 Primary Function: To report errors and provide operational information about IP packet
processing to the source host. Since IP itself lacks error-reporting, ICMP supports it by sending
error and control messages.

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

Dynamic Host Configuration Protocol (DHCP)


 Primary Function: To automatically assign an IP address and other network configuration
parameters (like subnet mask and default gateway) to devices, preventing the need for
manual configuration.

 Key Message Types (DHCP Handshake):

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.

Comparison of Circuit and Packet Switching


Feature Circuit Switching Packet Switching

Connection Dedicated, physical path No dedicated path; data is broken into


established before data transfer packets and sent independently

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

Advantages of Packet Switching in modern computer networks


 Efficiency: Packet switching is more efficient at utilizing network resources because
bandwidth is shared and only used when there is data to transmit. This is crucial for data
networks where traffic is often intermittent and "bursty".

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

Advantages of IPv6 over IPv4


Feature IPv6 Advantages Explanation
Solves the IPv4 address exhaustion problem by
providing over
Vastly larger (128-
Address Space
bit) 3.4×10383.4 cross 10 to the 38th power
3.4×1038
addresses.
A fixed 40-byte header is more efficient for routers to
Simpler, fixed-
Header Format process, with extension headers containing optional
length header
data.
Built-in IPsec Includes encryption and authentication for better
Security
support end-to-end security.
Routing & More efficient Fragmentation is handled only by the sender, and the
Forwarding routing streamlined header reduces processing time.
Quality of Enhanced traffic The "Flow Label" field allows for better identification
Service (QoS) prioritization and handling of real-time, delay-sensitive traffic.
Allows for easier network administration with
Address Stateless auto-
automatic address assignment, reducing the reliance
Configuration configuration
on DHCP for every device.
Replaced with Broadcast traffic is replaced with more efficient
Broadcasts
efficient multicast multicast and anycast communication.

IPv6 datagram header format


Field Length Description
Version 4 bits Indicates the IP version (value 6 for IPv6).
Used for traffic prioritization, replacing the IPv4 "Type of Service"
Traffic Class 8 bits
field.
Flow Label 20 bits Identifies packets that belong to the same flow for QoS purposes.
Payload Length 16 bits Specifies the length of the payload, including any extension headers.
Identifies the type of header immediately following the main header
Next Header 8 bits
(e.g., a transport layer protocol like TCP or an extension header).
Similar to IPv4's "Time to Live," it is the maximum number of hops a
Hop Limit 8 bits
packet can take before being discarded.
128
Source Address The IPv6 address of the sending device.
bits
Destination 128
The IPv6 address of the receiving device.
Address bits

Unit IV: Routing

Part A (2 Marks)

1. Define Routing and a Routing Metric. (A)


o Routing is the process of selecting the best path for network traffic to travel
from its source to its destination across multiple interconnected networks.
o A Routing Metric is a value (e.g., hop count, bandwidth, delay, cost) used by a
routing algorithm to determine the optimality of a path.
2. Differentiate between Unicast and Multicast Routing. (A)
o Unicast Routing: Delivers a packet from one source to one specific destination.
o Multicast Routing: Delivers a packet from one source to a group of interested
receivers simultaneously.
3. What is the Count-to-Infinity Problem in Distance Vector Routing? (B)
o The Count-to-Infinity Problem is a critical issue in Distance Vector Routing
where a network loop causes routers to indefinitely increase the metric (hop
count) to an unreachable network, preventing convergence. Split Horizon is
one solution.
4. Mention the key feature that differentiates OSPF from RIP. (B)
o RIP (Routing Information Protocol) is a Distance Vector protocol that uses hop
count as its only metric.
o OSPF (Open Shortest Path First) is a Link State protocol that uses Dijkstra's
algorithm and a composite metric (often based on bandwidth/cost), leading to
faster convergence and better route choices.
5. State the primary role of BGP.(C )
o The primary role of BGP (Border Gateway Protocol) is to perform inter-domain
routing (routing between different Autonomous Systems - AS) in the global
Internet, based on policies, paths, and reachability.

✍ Part B (16 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.

Limitations and remedies


Limitation Description Remedy

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)

Working Principle of Link State Routing (OSPF)

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:

Routers discover directly connected neighbors by exchanging "Hello" packets.

 Link-State Advertisement (LSA) Exchange:

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.

 Link-State Database (LSDB) Synchronization:

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.

 Shortest Path First (SPF) Calculation:

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.

Here's how the SPT is built:

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

 This selected node is then added to the "finalized" set.

 For each neighbor of the newly finalized node:


 Calculate the tentative cost to reach that neighbor through the newly finalized node (current
cost of finalized node + cost of link to neighbor).

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

3. Illustrate the architecture of an Autonomous System (AS) and differentiate between


Interior Gateway Protocols (IGPs) and Exterior Gateway Protocols (EGPs). (B)

An Autonomous System (AS) is a network or group of networks under a common


administration, connected to the internet through one or more border routers. Inside an
AS, Interior Gateway Protocols (IGPs) like OSPF and RIP route traffic, while Exterior Gateway
Protocols (EGPs), most commonly BGP, handle routing between different ASs.

Autonomous System (AS) architecture

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 networks: Each AS contains many smaller, interconnected networks.

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

 External routing: Routing between different ASs is managed by an EGP.

Interior Gateway Protocols (IGPs) vs. Exterior Gateway Protocols (EGPs)


Feature Interior Gateway Protocols Exterior Gateway Protocols (EGPs)
(IGPs)

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 (Border Gateway Protocol) works by having routers in different autonomous


systems establish TCP connections to exchange routing information, using messages like
OPEN, UPDATE, and KEEPALIVE to maintain sessions and a table of network prefixes and their
paths. It uses path attributes like AS_PATH, LOCAL_PREF, and others to select the best path
based on a decision process, ensuring loop-free, stable routing across the internet.

BGP Path Attributes

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.

 MULTI_EXIT_DISCRIMINATOR (MED): Used to influence how traffic enters another AS,


indicating the "cost" of entering the AS.

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

BGP Message Types


 OPEN: Sent by a BGP router to initiate a BGP session with a neighbor after a TCP connection
is established. It contains parameters for the session, such as the router's BGP ID and an AS
number.

 UPDATE: Carries routing information, including network reachability information (prefixes),


path attributes, and withdrawal messages for routes that are no longer valid.

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

 Description: A separate tree is built for each unique sender-group combination.


 Root: The source is the root of the tree.
 Paths: The tree is built using the shortest path from the source to all other members.
 Scaling: The number of trees increases with the number of sources (groups), which
can impact scalability in large networks.
 Protocols: DVMRP, PIM-DM (Protocol Independent Multicast-Dense Mode), and
MOSPF (Multicast Open Shortest Path First) use this approach.

2. Shared tree

 Description: All sources within a group share a single tree.


 Root: The tree is rooted at a single, designated router called the core or rendezvous
point (RP).
 Paths: Traffic from any source is sent to the RP, and the RP then forwards it along the
shared tree to the receivers.
 Scaling: Scales better in large networks because it avoids creating a separate tree for
every source.
 Protocols: CBT (Core-Based Trees) and PIM-SM (Protocol Independent Multicast-
Sparse Mode) use this method.

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

Configuration Manual; administrator configures each route.


Adaptability Non-adaptive; requires manual updates for any network change.

Scalability Not scalable; difficult to manage in large networks.

Performance Minimal CPU and bandwidth usage.

Security High security due to no route advertisement.

Failure Handling Link failure causes traffic interruption; requires manual rerouting.

Dynamic Routing
Feature Description

Configuration Automatic; routers use protocols to learn and update routes.

Adaptability Adaptive; automatically adjusts to network topology changes.

Scalability Highly scalable; ideal for large and complex networks.

Performance Uses more CPU, memory, and bandwidth.

Security Less secure due to route advertisements (e.g., using broadcasts).

Failure Handling Automatic rerouting around failed links without manual intervention.

When to use which

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

Unit V: Data Link and Physical Layers

📝 Part A (2 Marks)

1. What is Framing in the Data Link Layer? (A)


o Framing is the process of dividing the stream of bits from the Network Layer
into manageable, self-contained units called frames. This is essential for
synchronization, error control, and flow control.
2. Define Flow Control and Error Control. (A)
o Flow Control: A set of procedures used to restrict the amount of data the
sender can transmit before receiving an acknowledgment, preventing a fast
sender from overwhelming a slow receiver.
o Error Control: Methods for detecting and/or correcting corrupted or lost
frames, ensuring reliable delivery.
3. What is CSMA/CD and where is it used? (B)
o CSMA/CD (Carrier Sense Multiple Access with Collision Detection) is an access
method where a station listens to the medium (Carrier Sense) before
transmitting. If a collision occurs, all transmitting stations stop and wait a
random time before trying again. It is primarily used in wired Ethernet (IEEE
802.3).
4. State the function of VLANs (Virtual Local Area Networks). (B)
o A VLAN is a logical grouping of network devices (computers, servers) that are
not constrained by physical location. They are used to segment a network into
smaller, broadcast domains, improving performance and security.
5. Mention any two advantages of optical fiber over coaxial cable. (C )
o Higher Bandwidth/Data Rate: Optical fiber can carry much more data.
o Less Attenuation: Signal loss is much lower, allowing for longer distances.
o Immunity to EMI: Completely immune to electromagnetic interference (EMI).

✍Part B (16 Marks)

1. Explain the different framing methods used in the Data Link Layer: Character Counting,
Byte Stuffing, and Bit Stuffing. (A)

Framing methods use different techniques to define the boundaries of a data


frame. Character counting uses a field in the header to specify the number of characters in
the frame. Byte stuffing (character-oriented) inserts an "escape" byte before flag or escape
bytes within the data, and a unique flag byte is used at the beginning and end of each
frame. Bit stuffing (bit-oriented) inserts a zero bit after a sequence of five consecutive ones
to prevent it from being misinterpreted as a flag, ensuring the receiver can maintain
synchronization.

1. Character Counting

 Method: A field in the frame header explicitly states the number of characters or bytes that
constitute the frame.

 Delimiter: The character count itself acts as the frame delimiter.

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

 Disadvantage: It can lead to an unpredictable code rate

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

).

o Address: Specifies the destination.


o Control: Contains information about the frame type (I, S, or U-frame).
o Information: Carries user data (in I-frames).
o Frame Check Sequence (FCS): A cyclic redundancy check (CRC) for error
detection.
 Key Features:
o Bit-oriented: Processes data as a stream of bits.
o Synchronous: Transmits data synchronously, requiring a consistent clock
signal.
o Modes: Supports different modes, such as primary, secondary, and an
asynchronous balanced mode.
o Uses: Often used in legacy systems and as a framing method for other
protocols.
o Limitations: Does not inherently support dynamic addressing or authentication
schemes.

PPP (Point-to-Point Protocol)

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

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:

A retransmission counter, c, is initialized to 0 for each frame.

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

 A random integer k is chosen from the range [0, 2^c - 1].

 The back-off time is calculated as k * Slot_Time.


 Waiting and Retransmission:

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.

IEEE 802.11 architecture

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

o Ad-hoc Mode: Stations connect directly to each other without an AP.

CSMA/CA for Collision Avoidance

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

 Acknowledgments: To ensure reliable delivery, the receiver sends an acknowledgment (ACK)


frame back to the sender after a successful transmission. If the sender does not receive an
ACK, it assumes a collision occurred and will retransmit the packet.

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

 Inter-VLAN communication: Devices in different VLANs cannot communicate directly.


Communication between VLANs requires a router or a Layer 3 switch to perform Inter-VLAN
routing.

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.

 Enhanced performance: Reduces network congestion by containing broadcast traffic within


each VLAN, preventing devices from having to process irrelevant traffic.

 Greater flexibility: Enables network administrators to create logical groupings based on


function or security needs, without needing to physically move hardware or rewire cables.

 Simplified network management: Simplifies network design, deployment, and administration


by making it easier to manage users and resources in logical groups.

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

Guided (Wired) Transmission Media


 Description: These media use physical paths, such as cables, to guide the signal from the
source to the destination.

 Characteristics:

o Security: Generally more secure because it requires physical access to the cables.

o Reliability: Higher reliability and less susceptible to external interference.

o Direction: Signals are confined to a specific path.

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 Coaxial Cable: Features a central copper conductor surrounded by an insulator, a metallic


shield, and an outer cover. Offers better noise immunity than twisted pair and can extend to
500 meters with speeds up to 10 Gbps.

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.

Unguided (Wireless) Transmission Media

 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 Flexibility: Offers mobility and is cost-effective for wide-area coverage.

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.

You might also like