0% found this document useful (0 votes)
8 views

Network Mo

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)
8 views

Network Mo

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/ 10

Name: Mahmoud Abbas Mohamed

Subject: Network Programming


Task (1)
1. Explain Domain Name System (DNS) Client/Server module in
that application.
Let's take HTTP as an example and Microsoft Azure as our cloud platform.
Introduction:
HTTP (Hypertext Transfer Protocol) is a widely used protocol for communication on the
World Wide Web. It allows clients to send requests to servers, which then respond with
the requested resources, such as web pages and images. Microsoft Azure provides
various services that enable developers to build and deploy HTTP-based applications in
the cloud.
Configuration options:
When setting up an HTTP service in Microsoft Azure, the configuration options include
selecting a port number for incoming requests, choosing a communication protocol (TCP
or UDP), and specifying a transport layer protocol (such as SSL or TLS).
Service flow diagram:
The typical flow of an HTTP request and response looks like this:
1. The client sends an HTTP request to the server.
2. The server receives the request and processes it.
3. The server sends an HTTP response back to the client.
4. The client receives the response and displays it to the user.
DNS Client/Server module:
In order for the client to make a request to the server, it needs to know the server's IP
address. This is where the DNS (Domain Name System) client/server module comes into
play.
DNS is a hierarchical system that maps domain names to IP addresses. When a client
wants to access a website, it sends a request to a DNS server to resolve the domain
name to an IP address. The DNS server checks its cache first to see if it has the IP address
for the requested domain name. If it does, it returns the IP address to the client. If it
doesn't, it contacts other DNS servers in the hierarchy until it finds the IP address and
returns it to the client.
In the case of an HTTP service hosted in Microsoft Azure, the client would typically query
a DNS server to resolve the domain name of the service, such as
"example.azurewebsites.net", to an IP address. Once it has the IP address, it can send
an HTTP request to the server using that IP address.
Network programming example:
Here's an example of how a client in Python could use DNS to resolve a domain name
to an IP address:

This code uses the `gethostbyname` function from the `socket` module to resolve the
domain name "example.azurewebsites.net" to an IP address. The resulting IP address is
then printed to the console.
Conclusion:
In summary, the DNS client/server module plays a crucial role in allowing clients to
access HTTP services hosted in the cloud. By resolving domain names to IP addresses,
clients can communicate with servers and receive the resources they need.

2. Explain the HTTP Protocol and the Web content transfer


services in that application.
HTTP stands for Hypertext Transfer Protocol, which is a protocol used for
transferring data between a client (such as a web browser) and a server over the
internet. It is a request-response protocol, meaning that a client sends a request
to a server, and the server responds with data.
In terms of Cloud platforms, both Google Cloud Platform and Microsoft Azure
offer HTTP-based services for building and deploying web applications. These
services typically include options for configuring port numbers, communication
protocols (such as TCP or UDP), and transport layer protocols (such as SSL/TLS).
The most common use case for HTTP in cloud applications is for serving web
pages and other resources to clients over the internet. This involves the transfer
of web content from the server to the client using HTTP requests and responses.
The client sends an HTTP request to the server, specifying the URL of the resource
it wants to access. The server then processes the request and sends back an HTTP
response containing the requested resource (such as an HTML file, image, or
video).
To illustrate this process using network programming, here's an example Python
script that sends an HTTP request to a server and prints out the response:

This script uses the `http.client` module in Python to create an HTTPS connection
to the server at `www.example.com`. It then sends an HTTP GET request for the
root resource ("/"), and reads the response from the server. The response status
code and message are printed to the console, along with the contents of the
response body.
In conclusion, HTTP is a fundamental protocol used for web content transfer
services in cloud applications. It allows clients and servers to communicate over
the internet, enabling the transfer of web resources such as HTML pages, images,
and videos. Understanding the technical details of HTTP and how it is used in
cloud applications is essential for building and deploying modern web
applications.
3. Explore the application protocols used for Multithreading and
electronic mail services. And explain one of them that related to
that application.
Let's take Microsoft Exchange Server as an example. Microsoft Exchange Server
is a popular email server used by many businesses for managing their email,
calendar, and contacts. It uses a variety of application protocols, including
multithreading, to handle incoming email messages efficiently.
Multithreading in Microsoft Exchange Server:
Microsoft Exchange Server uses multithreading to manage the various
components involved in processing an incoming email message. When an email
message arrives, it is processed by the Transport Service component, which
creates multiple threads to handle different aspects of the message delivery
process. For example, one thread may handle the initial SMTP connection, while
another thread is responsible for performing spam filtering. By using multiple
threads, Exchange Server can handle a large number of email messages
simultaneously, improving overall performance and scalability.
Electronic Mail Services in Microsoft Exchange Server:
In addition to using multithreading, Microsoft Exchange Server also supports a
variety of email-related protocols, including Simple Mail Transfer Protocol
(SMTP), Post Office Protocol (POP3), and Internet Message Access Protocol
(IMAP). These protocols are used to transfer email messages between servers
and clients, allowing users to access their email from anywhere with an internet
connection.
Configuration Options in Microsoft Exchange Server:
When configuring Microsoft Exchange Server, several options must be
considered, including:
1. Port Numbers: The default port numbers for SMTP, POP3, and IMAP are 25,
110, and 143, respectively. However, other port numbers may be used depending
on network configuration and security requirements.
2. Communication Protocols: Microsoft Exchange Server uses TCP/IP for
communication between clients and servers. Additionally, secure versions of
SMTP, POP3, and IMAP, such as SSL/TLS, can be used to encrypt data during
transmission.
3. Service Flow Diagram: The flow diagram for Microsoft Exchange Server is
shown below:
Client Request -> SMTP -> Exchange Server -> POP3/IMAP -> Client Response
In this flow, the client sends an email message to the Exchange Server using SMTP.
The Exchange Server then processes the message and stores it in a mailbox. When
the client wants to read their email, they connect to the server using either the
POP3 or IMAP protocol.
Conclusion:
In conclusion, Microsoft Exchange Server is an example of a program that uses
multithreading and electronic mail services to efficiently handle incoming email
messages. It supports a variety of application protocols, including SMTP, POP3,
and IMAP, and can be configured using various options such as port numbers and
communication protocols. By using multithreading and other techniques,
Microsoft Exchange Server is able to provide businesses with a scalable and
efficient email management solution.

4. Present a technical report to analyze the techniques and


algorithms for one of network application services such as: email,
FTP, and HTTP in google application, discuss the techniques and
algorithms, then give some real-world application examples.
Introduction:
In this technical report, we will analyze the techniques and algorithms used in
email, a network application service that enables the exchange of messages over
the internet. We will discuss its configuration options, service flow diagram,
network programming examples, and real-world applications.
Email Description:
Email stands for Electronic Mail and is used to send and receive messages
between users over the internet. It is a client-server protocol where the client
sends a message to the server, and the server delivers the message to the
recipient's server or mailbox. Email is used for personal and business
communications, file attachments, and other types of message transfers.
Configuration Options:
The default port number for email is 25 for Simple Mail Transfer Protocol (SMTP)
and 143 for Internet Message Access Protocol (IMAP). However, SMTP over
SSL/TLS uses port 465, and IMAP over SSL/TLS uses port 993. Email uses TCP as
its communication protocol and can work with various transport layer protocols
like TCP/IP, UDP, and SCTP.
Service Flow Diagram:
The service flow diagram for email is relatively complex compared to HTTP. The
client establishes a connection with the server using SMTP or Post Office Protocol
(POP), authenticates itself if required, and sends the message to the server. The
server then processes the message, checks for spam or malware, and delivers it
to the recipient's server. The recipient's server receives the message, stores it in
a mailbox, and notifies the recipient of the new message. The recipient then
retrieves the message from their mailbox using IMAP or POP.
Email Techniques and Algorithms:
Email supports various techniques and algorithms to improve its performance,
security, and reliability. These include:
1. Encryption: Email encryption using Secure/Multipurpose Internet Mail
Extensions (S/MIME) or Pretty Good Privacy (PGP) can protect the message
content and attachments from eavesdropping and tampering.
2. Authentication: Email authentication using DomainKeys Identified Mail (DKIM)
or Sender Policy Framework (SPF) can verify the authenticity of the sender's
domain and prevent email spoofing and phishing attacks.
3. Filtering: Email filtering using content-based filters, blacklists, and whitelists
can prevent spam, malware, and unwanted messages from reaching the
recipient's mailbox.
4. Archiving: Email archiving using tools like MailStore or GFI Archiver can help
organizations to comply with legal and regulatory requirements and retain
important business records.
Network Programming Examples:
Let's take an example of sending an email using Python. We can use the smtplib
library to connect to an SMTP server and send the message as follows:
Real-World Applications:
Email is a ubiquitous communication tool used in personal and business settings
worldwide. Here are some real-world examples of email in action:
1. Gmail: Google's email service, Gmail, provides a user-friendly web interface for
sending and receiving emails. It also supports advanced features like labels,
filters, and integration with other Google services.
2. Microsoft Outlook: Microsoft's email client, Outlook, is widely used in business
settings and provides features like calendar, contacts, and task management.
3. Amazon SES: Amazon Simple Email Service (SES) is a cloud-based email service
that allows businesses to send marketing, transactional, and notification emails
at scale.
Conclusion:
Email is a vital network application service that enables the exchange of
messages over the internet. It supports various techniques and algorithms to
improve its performance, security, and reliability. Real-world examples
demonstrate the widespread use and importance of email in personal and
business communications.
Task 2
Design an efficient computer program for of one service used in
Google or Microsoft cloud platforms as shown in Figure 1.
import smtplib

server = smtplib.SMTP("smtp.gmail.com",587)

server.ehlo()

server.starttls()

# set smtp server for your Email and password

server.login("[email protected]","")

try:

subject="Assignment 2"

body = "Hello"

message= 'Subject: {}\n\n{}'.format(subject,body)

server.sendmail("[email protected]","mahmoudabbasmohamed
[email protected]",message)

print("Finished send message")

except Exception as e:

print("Failed to send message")

server.quit()

output
2. Evaluate the Client/Server modules for your design with Google
or Microsoft cloud platforms as shown in Figures 2, 3.

You might also like