0% found this document useful (0 votes)
3 views9 pages

ASSnIGNMENT 5

Haha Babananansnsns

Uploaded by

Abhinav Banswal
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)
3 views9 pages

ASSnIGNMENT 5

Haha Babananansnsns

Uploaded by

Abhinav Banswal
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
You are on page 1/ 9

ASSIGNMENT-5

QUE-1 Explain the Remote Procedure Call (RPC)? Explain advantage and
disadvantage of RPC.
ANS:- A Remote Procedure Call (RPC) is a communication protocol that allows a
program to request a service from a program located on another computer or
server on a network. In simpler terms, it allows a client to execute code or
functions (procedures) on a remote server without having to explicitly manage
the details of the network communication.
The process of an RPC typically involves:
1. Client-side Call: The client invokes a function in a program that runs
locally, but it is set up to actually call a remote function on a server.
2. Marshalling: The client’s request is packaged (or marshaled) into a
standard format for transmission over the network.
3. Transport: The request is sent over the network to the remote server
Advantages of RPC
1. Abstraction of Network Details:
o RPC abstracts the underlying communication details. The client
and server communicate seamlessly as if they are calling local
functions, without needing to manage the intricacies of the
network.
2. Language Independence:
o RPC can be implemented in various programming languages. As
long as both the client and server use a compatible protocol (e.g.,
XML-RPC, JSON-RPC, gRPC), communication can occur even
between different languages and platforms.
Disadvantages of RPC
1. Performance Overhead:
o RPC involves additional overhead compared to local function calls
because of the network latency, the process of
marshalling/unmarshalling data, and the transport layer. This can
lead to performance issues, especially in high-latency or low-
bandwidth environments.
2. Network Failures:
o RPC relies on network communication, so if the network fails or
there is a connection problem, the RPC call may fail. This is
especially true for synchronous RPC, where the client is blocked
waiting for the server response.

QUE-2 Explain in detail the Simple Mail transfer Protocol (SMTP).


ANS:- Simple Mail Transfer Protocol (SMTP) is a protocol used to send, receive,
and relay email messages across networks, primarily over the Internet. It is a
text-based protocol that facilitates the transfer of email messages from one
server to another. SMTP is the standard protocol used by most email systems
for sending emails from a client to a server or between mail servers.
SMTP operates as a push protocol. It pushes emails from the sender’s mail
server to the recipient’s mail server. However, SMTP only deals with the
sending and routing of emails; it doesn't handle email retrieval, which is
handled by protocols like IMAP (Internet Message Access Protocol) or POP3
(Post Office Protocol 3).
Key Functions of SMTP
1. Sending Emails:
o When a user sends an email, the email client (like Outlook, Gmail,
or Thunderbird) sends the message to an SMTP server. The SMTP
server then processes and forwards the message to the recipient’s
SMTP server if necessary, eventually reaching the recipient's
mailbox.
2. Relay Email Messages:
o SMTP servers can relay email messages to other mail servers. This
allows the message to traverse various networks and mail servers
until it reaches its final destination.
3. Message Routing:
o SMTP helps in determining the correct mail server for the recipient
using MX records (Mail Exchange records) from the Domain Name
System (DNS). These records specify the mail servers responsible
for receiving email for a given domain.
How SMTP Works
Here’s a step-by-step breakdown of how SMTP works:
1. Client to SMTP Server:
o A user creates and sends an email using an email client. The client
communicates with the SMTP server, often on port 25, using a
text-based protocol.
o The client connects to the server, authenticates itself (if
necessary), and sends the email data (recipient address, subject,
message body, etc.).
2. Server to Server (Message Relay):
o If the recipient's server is not the same as the sender’s server, the
SMTP server will relay the message to the next SMTP server in the
routing path, using DNS to find the recipient’s server.
o The receiving SMTP server also uses DNS to look up the recipient's
domain name and finds the corresponding MX records to
determine the proper mail server.

QUE-3 Explain HTTP and HTTPS in details, what are port their port numbers.
ANS:- HTTP (Hypertext Transfer Protocol) and HTTPS (Hypertext Transfer
Protocol Secure) – Detailed Explanation
HTTP and HTTPS are protocols used for transferring data over the World Wide
Web. They are the foundation of communication for most web applications,
allowing the retrieval of web pages, sending data to servers, and enabling
other interactions on the Internet.
HTTP (Hypertext Transfer Protocol)
HTTP is a protocol used for transmitting data over the web. It defines how
messages are formatted and transmitted between clients (such as web
browsers) and servers, and it also describes how web servers and browsers
should respond to various commands.
Key Features of HTTP:
1. Request-Response Model:
o HTTP operates using a request-response model. A client (typically
a web browser) sends an HTTP request to the server, and the
server sends an HTTP response back to the client. For example,
when you open a website, your browser sends an HTTP request to
the server hosting that website, and the server responds with the
content (HTML, images, etc.).
2. Stateless:
o HTTP is stateless, meaning each request is independent, and the
server doesn't retain any memory of past requests. After a
response is sent, the connection is closed, and the server forgets
about the request. For this reason, cookies and other mechanisms
are often used to maintain session state.
3. Methods:
o HTTP defines several methods (also called HTTP verbs) to perform
actions on resources (web pages, images, etc.). Some common
HTTP methods include:
▪ GET: Requests data from a server (e.g., fetching a web
page).
▪ POST: Sends data to the server (e.g., submitting a form).

4. Status Codes:
o HTTP responses come with a three-digit status code that indicates
the result of the request. Some common status codes include:

HTTP Ports:
• Port 80: HTTP uses port 80 by default for communication. When you visit
a website (e.g., http://example.com), your browser connects to the
server on port 80 unless specified otherwise.
HTTPS (Hypertext Transfer Protocol Secure)
HTTPS is the secure version of HTTP. It is used to encrypt data during
transmission, ensuring privacy and security, which is especially important for
sensitive transactions like online banking, shopping, and login pages. HTTPS
uses SSL (Secure Sockets Layer) or its more modern version TLS (Transport
Layer Security) to provide encryption.
How HTTPS Works (Overview)
1. Client Requests Connection: When a client (browser) connects to a
server using HTTPS (e.g., https://example.com), it sends a request to
establish a secure connection.
2. Server Sends SSL/TLS Certificate: The server responds with its SSL/TLS
certificate, which contains the server's public key and other details. The
certificate is issued by a trusted Certificate Authority (CA).

Conclusion
• HTTP is the foundational protocol for transferring data on the web but
lacks security features like encryption and authentication. It is
appropriate for non-sensitive browsing, but it leaves the data vulnerable
to interception or tampering.
• HTTPS builds on HTTP by adding a layer of security using SSL/TLS
encryption, ensuring that data is kept secure, and verifying the
authenticity of websites. It is essential for any website that handles
sensitive data, such as online banking, e-commerce, and user
authentication.
The use of HTTPS has become the standard for most websites, especially with
growing concerns about privacy and data security. As a result, websites without
HTTPS may be flagged as insecure in modern web browsers, impacting user
trust and engagement.

QUE- 4 Differentiate TCP and UDP?


ANS:- TCP (Transmission Control Protocol) vs UDP (User Datagram Protocol)
Both TCP and UDP are transport layer protocols used for communication over
IP networks. They are responsible for transferring data between devices on a
network, but they do so in different ways, with distinct characteristics that
make them suitable for different applications.
Here is a detailed comparison of TCP and UDP:
Key Differences Explained

1. Connection Establishment:

o TCP is connection-oriented: A connection must be established between the sender


and receiver before any data is transmitted. This process is called the TCP handshake
(SYN, SYN-ACK, ACK).

o UDP is connectionless: There is no need to establish a connection before sending


data. It sends data packets (datagrams) directly without any handshake.

2. Reliability:

o TCP ensures reliable data transfer. If a packet is lost, corrupted, or delayed, the
receiver can request the sender to retransmit it. TCP guarantees that the data will be
received correctly and in the right order, or the connection is terminated.

o UDP does not guarantee reliability. There is no acknowledgment of received


packets, no retransmission in case of packet loss, and no guarantee of the correct
order of arrival.

3. Flow Control:

o TCP provides flow control to prevent the sender from overwhelming the receiver
with too much data at once. This is done using window size and acknowledgments.
o UDP does not provide flow control, meaning it can potentially send data at a faster
rate, which could lead to data loss if the network or receiver is overwhelmed.

4. Ordering of Data:

o TCP guarantees the order of data delivery. If the packets arrive out of order, TCP will
rearrange them into the correct sequence before passing them to the application
layer.

o UDP does not guarantee the order of data. Packets may arrive in any order, and it is
up to the application layer to handle ordering if required.

5. Speed:

o TCP is generally slower due to the overhead of maintaining the connection, ensuring
reliability, and performing error-checking.

o UDP is faster because it does not have the overhead of maintaining a connection or
ensuring reliability, making it suitable for real-time applications where low latency is
important.

6. Error Handling:

o TCP provides error detection and correction. If a packet is lost or corrupted, it is


retransmitted. It also uses checksums for error detection and maintains data
integrity throughout transmission.

o UDP only performs error detection using checksums but does not handle error
correction. If a packet is lost or corrupted, it is not retransmitted.

7. Header Size:

o TCP headers are larger (20–60 bytes), containing fields for sequence numbers,
acknowledgments, flow control, and error detection.

o UDP headers are much smaller (8 bytes) because they only contain the necessary
information to identify the source and destination of the packet.

Use Cases

TCP is used when:

• Data integrity, reliability, and order are essential.

• Examples:

o Web Browsing (HTTP/HTTPS): Websites require guaranteed delivery of resources in


the correct order.

o File Transfer (FTP): Large files need to be transferred without corruption, and
retransmission of lost data is necessary.

o Email (SMTP, IMAP, POP3): Ensures that emails are reliably sent and received
without loss or duplication.

UDP is used when:


• Speed and low latency are more important than reliability.

• Examples:

o Streaming (Audio/Video): For real-time streaming, such as live video conferences or


media streaming, a small delay (or occasional lost packets) is often acceptable.

o Online Gaming: Requires fast transmission of game data (position updates, scores)
with minimal latency, and can tolerate some packet loss.

o DNS (Domain Name System): The quick query-response nature of DNS requests
benefits from the low overhead of UDP.

Conclusion

• TCP is ideal for applications where data integrity, reliability, and correct ordering are crucial,
such as web browsing, file transfers, and emails.

• UDP, on the other hand, is ideal for applications where speed is critical, and occasional
packet loss is acceptable, such as real-time communication, online gaming, and video
streaming.

The choice between TCP and UDP largely depends on the specific requirements of the application,
such as whether reliability or speed is more important.

4o mini

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy