Professional Documents
Culture Documents
CN Report - 5-2
CN Report - 5-2
CN Report - 5-2
Subject Activity-Report
Computer Networks(21CS52)
2023-2024
Mission
To impart high quality education in Engineering, Technology and
Management with a Difference, Enabling Students to Excel in their Career by
1. Attracting quality Students and preparing them with a strong foundation in
fundamentals soastoachievedistinctionsinvariouswalksoflifeleadingto outstanding
contributions.
2. Imparting value based, need based, choice based and skill based professional education to
the aspiring youth and carving them into disciplined, World class Professionals with social
responsibility.
3. Promoting excellence in Teaching, Research and Consultancy that galvanizes
academic consciousness among Faculty and Students.
4. Exposing Students to emerging frontiers of knowledge in various domains and make them
suitable for Industry, Entrepreneurship,Higher studies, and Research & Development.
5. Providing freedom of action and choice for all the Stakeholders with better visibility.
VISIONANDMISSIONOF CSEDEPARTMENT
Vision
Preparingbettercomputerprofessionalsforarealworld
Mission
The Department of Computer Science and Engineering will make every effort to
promote an intellectual and an ethical environment in which the strengths and skills of
Computer Professionals will flourish by
1. ImpartingSolidfoundationsandAppliedaspectsinbothComputerScienceTheoryandProgramm
ingpractices.
2. ProvidingTrainingandencouragingR&DandConsultancyServicesinfrontierareasofComputer
Science witha Globaloutlook.
3. FosteringthehighestidealsofEthics,ValuesandcreatingAwarenessontheroleofComputingin
GlobalEnvironment.
4. Educatingandpreparingthegraduates,highlySought-after,Productive,andWell-
respectedfortheir workculture.
5. Supportingand inducingLifelongLearningpractice
Table of Contents
Internet Checksum:
The Internet Checksum algorithm works with 16-bit data packet words.
The packet is segmented into 16-bit segments, with the sum of these
segments being computed.
The resulting sum is then complemented using the ones' complement
method to derive the checksum.
The checksum value is included in the packet header and sent along with
the data during transmission.
Page|4
Upon reception of the packet, the receiver conducts a similar computation
and contrasts the computed checksum with the transmitted checksum. If
they coincide, the data is deemed valid; if not, it signifies potential data
corruption.
Page|5
2. Hamming Code Error Detection Technique in Computer Networks
Calculating Parity Bits: The quantity and placement of parity bits are
established in accordance with the quantity of data bits. Parity bits are
positioned at locations corresponding to powers of 2 (1, 2, 4, 8, etc.).
Incorporating Parity Bits: The computed parity bits are appended to the
original data bits to construct the Hamming Code word. Subsequently, this
resultant Hamming Code word is transmitted across the network.
Page|6
3. Significance of Hamming Code
4. Conclusion
Page|7
3. DIjkstras Algorithm
Page|8
Variations and Extensions
1. Bidirectional Dijkstra's Algorithm: This variant conducts two
simultaneous searches, originating one forward from the source and the
other backward from the target. These searches converge midway, often
notably diminishing the search area and enhancing runtime, particularly in
dense graphs.
2. A* Search Algorithm*: Extending Dijkstra's algorithm, A* incorporates
a heuristic to direct the search more efficiently toward the target,
potentially reducing the number of explored nodes. A* finds particular
utility in game development and robotics for pathfinding within a
predictable environment.
3. Dynamic Graphs: In scenarios where graphs undergo changes over time,
such as edge or node additions or removals, or alterations in weights,
maintaining the shortest path efficiency presents a challenge. Incremental
or dynamic iterations of Dijkstra's algorithm are tailored to update shortest
paths without necessitating a complete recomputation.
Page|9
4. Stop-and-Wait Protocol:
The Stop-and-Wait protocol represents a fundamental approach to flow
control and error control within data communication, primarily utilized in
scenarios where the communication channel's reliability is questionable. It
serves as a cornerstone in computer networks, ensuring the dependable
transfer of data.
Operation:
• Sender Side: The sender dispatches a frame (data packet) and then halts,
awaiting an acknowledgment (ACK) from the receiver before proceeding
to transmit the subsequent frame.
• Receiver Side: Upon receipt of a frame, the receiver dispatches an ACK
if the frame is devoid of errors. In cases where the frame is received
erroneously (e.g., due to data errors), the receiver may issue a negative
acknowledgment (NACK) or opt not to acknowledge the frame altogether,
contingent on the specific protocol implementation.
• Timeouts: Each frame transmitted by the sender is accompanied by a
timeout. If the timeout elapses before an ACK is received, the sender
initiates a retransmission of the frame.
Characteristics:
• Simplicity: While its implementation is uncomplicated, its efficiency
diminishes, particularly across channels characterized by high latency, as
the sender is compelled to await acknowledgment before transmitting
additional data.
• Reliability: Ensures a dependable delivery mechanism by mandating
acknowledgment for each frame before progression. Despite its ease of
comprehension and analysis, this simplicity renders it less efficient
compared to more intricate protocols such as sliding window protocols.
Applications:
• Employed in early telecommunication protocols and educational settings
to demonstrate fundamental concepts of dependable data transfer within
computer networks.
• Although seldom utilized in contemporary high-speed networks owing to
its inefficiency, the principles underpinning Stop-and-Wait serve as the
cornerstone for more sophisticated protocols proficient in managing flow
and error control more effectively, such as the sliding window protocols
employed in TCP (Transmission Control Protocol).
Advanced Aspects of Stop-and-Wait Protocol:
Page|10
Efficiency in Low-latency Networks: Although typically deemed
inefficient because it necessitates the sender to await
acknowledgment before transmitting the subsequent frame, Stop-
and-Wait can exhibit relatively high efficiency in environments
characterized by very low round-trip time (RTT). In such
circumstances, the simplicity of Stop-and-Wait renders it an
attractive option for guaranteeing reliability without the added
complexity of more advanced sliding window protocols.
Role in Historical and Educational Contexts: In addition to its
practical utility, the Stop-and-Wait protocol holds significance as a
valuable educational resource within computer networking courses. It
familiarizes students with fundamental concepts of dependable data
transfer, encompassing error detection, acknowledgments (ACKs),
negative acknowledgments (NACKs), and timeouts. This
foundational understanding forms an essential basis for
comprehending more intricate protocols.
Implementation Simplicity: Stop-and-Wait ARQ continues to be a
subject of discussion, partly due to its simplicity of implementation.
Requiring minimal buffering at both the sender and receiver, it
emerges as a straightforward option for uncomplicated or resource-
constrained systems, particularly in scenarios where memory
resources are scarce and data transmission volumes are modest.
Timeout Calculation: The effectiveness of Stop-and-Wait is greatly
influenced by the method of calculating the timeout. A timeout set
too briefly could result in unnecessary retransmissions, whereas one
set too long might decrease network throughput. Determining the
optimal timeout often requires dynamic adjustment algorithms that
account for the network's present conditions, including congestion
levels and fluctuating round-trip times.
Use in Satellite and Deep Space Communication: Although
inefficient over links with high latency, adaptations of the Stop-and-
Wait protocol have been utilized in satellite and deep space
communications. In these contexts, the protocol's simplicity and
reliability are prioritized over latency concerns. Given the high cost
Page|11
and complexity of communication in such scenarios, ensuring highly
reliable transmission methods takes precedence, even if they may not
offer optimal throughput efficiency.
Protocol Enhancements: Over time, numerous enhancements have
been suggested to boost the efficiency of the Stop-and-Wait protocol
without substantially raising its complexity. These enhancements
encompass employing selective acknowledgments to handle out-of-
order frames and integrating error correction codes, enabling the
receiver to rectify specific errors without necessitating
retransmissions.
Integration with Other Protocols: In practical applications, Stop-
and-Wait ARQ is often integrated with additional protocols to
achieve a harmonious balance between simplicity and efficiency. For
example, it may be coupled with higher-level protocols tasked with
managing session establishment, data segmentation, and reassembly.
This combined approach facilitates dependable data transmission
while simultaneously optimizing for both throughput and latency.
Page|12
5. Go Back-N
Fundamental Principle:
Sender Side: The sender manages a sliding window comprising frames
destined for transmission. It dispatches multiple frames successively
without pausing for individual acknowledgments.
Operation:
Sender Behavior:
The sender initiates transmission with a window of frames starting from
the base sequence number.
Page|13
It continues sending frames within the window until reaching the window's
end or exhausting available frames for transmission.
Following transmission, it awaits acknowledgments.
Upon receiving acknowledgments, it adjusts the window size based on the
acknowledgment received and shifts the base sequence number
accordingly.
Retransmission:
Should the sender's timer expire before receiving acknowledgments for
frames within the window, it infers potential frame loss or damage and
proceeds to retransmit all frames within the window, commencing from
the base sequence number.
Advantages:
Efficiency: Go-Back-N enables frame pipelining, enhancing efficiency by
obviating the need for the sender to await individual acknowledgments
before sending subsequent frames.
Limitations:
Potential Bandwidth Inefficiency: In cases of a single lost frame, all
subsequent frames within the window necessitate retransmission,
potentially leading to inefficient bandwidth utilization.
Increased Buffering Requirements: The receiver is compelled to
buffer out-of-order frames until missing frames are received,
potentially augmenting memory requirements.
In summary, the Go-Back-N protocol offers a direct approach to reliable
data transmission in error-prone networks, facilitating the efficient
transmission of multiple frames before awaiting acknowledgments.
Nonetheless, it is subject to certain limitations concerning bandwidth
efficiency and buffer requirements.
Page|14
6. Selective Repeat Protocol
Selective Repeat represents another form of automatic repeat request
(ARQ) protocol utilized in computer networks to ensure reliable data
transmission, akin to Go-Back-N. However, unlike Go-Back-N, Selective
Repeat exclusively retransmits individual lost or corrupted frames, rather
than retransmitting an entire window of frames.
Basic Concept:
Sender Behavior: The sender manages a window of frames intended for
transmission and dispatches them sequentially. It awaits acknowledgments
for each frame individually before transmitting the subsequent frame.
Operation:
Sender Behavior:
The sender transmits frames sequentially within its designated window.
Following the transmission of each frame, it awaits acknowledgment.
In the event that acknowledgment for a frame is not received within a
specified timeout interval, the sender solely retransmits that particular
frame.
Receiver Behavior:
The receiver accepts frames in sequential order within its designated
receiving window.
Acknowledgments are dispatched for accurately received frames,
indicating the highest in-order frame received.
Out-of-order frames are buffered until the missing frames are received.
Frames received with errors are discarded, with no acknowledgment
issued, thereby prompting the sender to retransmit the specific frame.
Advantages:
Efficiency: Selective Repeat has the potential for greater efficiency in
terms of bandwidth utilization compared to Go-Back-N since it retransmits
only the lost frames rather than an entire window of frames.
Page|15
Reduced Retransmission Overhead: Because Selective Repeat solely
retransmits individual lost frames, it has the potential to diminish
retransmission overhead in contrast to Go-Back-N, particularly in
situations characterized by sporadic errors.
Limitations:
Complexity: Implementing Selective Repeat is more intricate than Go-
Back-N because it necessitates individual acknowledgments and the
buffering of out-of-order frames.
Page|16
7. Socket Programming Using TCP in Computer Networks
Page|17
Socket programming using TCP offers several advantages in computer
networks:
Page|18
8. Socket Programming using UDP
At the core of UDP socket programming lies the concept of sockets, which
serve as endpoints for communication between two machines. A socket
comprises an IP address and a port number. In UDP, a socket facilitates
both the transmission and reception of datagrams, which represent discrete
units of data.
The steps involved in UDP socket programming include:
python
import socket
udp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
2. Binding the Socket (Server): After the socket is created on the server
side, it must be associated with a particular IP address and port number.
This enables the server to await incoming datagrams on the specified port.
python
udp_socket.bind(("0.0.0.0", 8080))
Page|19
python
udp_socket.sendto(b"Hello, server!", ("server_ip", 8080))
5. Handling Data (Server): Upon receiving the data, the server proceeds
to process it accordingly. This may entail parsing the data, conducting
calculations, or executing designated actions depending on the content of
the datagram.
6. Closing the Socket: Upon completion of the communication process,
both the client and server are advised to terminate their sockets utilizing
the close() function to relinquish allocated resources.
python
udp_socket.close()
Page|20
Limited Packet Size: UDP packets are constrained in size, typically
reaching up to 64KB, a limitation that may prove inadequate for extensive
data transfers.
Page|21
9. Distributed Denial of Service
Page|23
10. HTTP Protocol
1. Introduction:
The Hypertext Transfer Protocol (HTTP) is a fundamental protocol
used for communication on the World Wide Web. It serves as the
foundation for data communication in the form of text, images, videos,
and other multimedia content across the internet. Understanding HTTP
is crucial for anyone working with web technologies, as it governs the
exchange of information between clients and servers.
2. Overview:
HTTP operates as a request-response protocol within the client-
server computing model. It facilitates the transfer of hypertext, which
includes HTML documents, images, and other resources. The protocol
operates on top of the TCP/IP protocol suite, utilizing TCP port 80 by
default for communication.
3. Key Concepts:
1. Request-Response Cycle: HTTP follows a simple request-response
cycle. A client, typically a web browser, sends an HTTP request to a
server, which then processes the request and returns an HTTP
response containing the requested resource or an error message.
Page|24
4. Versions:
Over the years, several versions of HTTP have been developed, with
each iteration introducing improvements and enhancements. The most
widely used versions include HTTP/1.1 and HTTP/2. The latter introduces
features like multiplexing, header compression, and server push, aimed at
improving performance and efficiency.
5. Security Considerations:
Security is a critical aspect of web communication. HTTP does not
inherently provide encryption or data integrity mechanisms, making it
vulnerable to various attacks, such as eavesdropping and tampering. To
address these concerns, HTTPS (HTTP Secure) employs encryption via
SSL/TLS protocols to secure data transmission.
6. Conclusion:
In conclusion, HTTP is the backbone of communication on the
World Wide Web, facilitating the exchange of resources between clients
and servers. Its simplicity and versatility have contributed to the growth
and evolution of the internet. As technology advances, HTTP continues to
adapt to meet the demands of modern web applications, emphasizing
performance, security, and reliability.
Page|25
Team pictures:
Page|26
Page|27