Unit - 4 Network Applications
Unit - 4 Network Applications
DNS Basics
The Domain Name System (DNS) is an application–layer protocol that is part of the standard
TCP/IP protocol suite. This protocol implements the DNS naming service, which is the naming
service used on the Internet.
This section introduces the basic DNS concepts. It assumes that you have some familiarity with
network administration, particularly TCP/IP, and some exposure to other naming services, such as
NIS+ and NIS.
What is DNS?
The Domain Name System (DNS) is the phonebook of the Internet. Humans access information
online through domain names, like nytimes.com or espn.com. Web browsers interact through
Internet Protocol (IP) addresses. DNS translates domain names to IP addresses so browsers can load
Internet resources.
Each device connected to the Internet has a unique IP address which other machines use to find the
device. DNS servers eliminate the need for humans to memorize IP addresses such as 192.168.1.1
(in IPv4), or more complex newer alphanumeric IP addresses such as 2400:cb00:2048:1::c629:d7a2
(in IPv6).
IP Address
IP address is a unique logical address assigned to a machine over the network. An IP address
exhibits the following properties:
IP address is 32-bit number while on the other hand domain names are easy to remember names.
For example, when we enter an email address we always enter a symbolic string such as
webmaster@tutorialspoint.com.
Characteristics of DNS
The Domain Name System allows you to access remote systems by entering human-readable device
host names rather than IP addresses. DNS works by creating a mapping between a domain name,
such as “www.alliedtelesis.com”, and its IP address. These mappings are held on DNS servers.
DNS translates meaningful domain names into IP addresses for networking equipment to locate and
address these devices. The characteristics of DNS are given bellow:
Highly configurable
Simple DNS Plus has options to configure all aspects of the DNS services, including many unique
but important options not found in competing products such as the ability to limit recursion by IP
address. Of course the software comes preconfigured with settings that are appropriate for most
users.
Working Of DNS
DNS Definition
The domain name system (DNS) connects URLs with their IP address. With DNS, it’s possible to
type words instead of a string of numbers into a browser, allowing people to search for websites and
send emails using familiar names.
The internet is a huge network of computers. Each device connected to the internet is assigned a
unique IP address which helps other computers identify it.This IP address is a string of numbers
with periods that looks like this: 192.124.249.166
Now imagine if you had to remember such long strings of numbers to visit your favorite websites.
They are hard to remember and don’t tell you anything about the website you’ll see if you enter
them in a browser.
Domain names were invented to solve this problem by using alphabets and allowing users to select
easy to remember names for their websites.
DNS or Domain Name System basically translates those domain names into IP addresses and points
your device in the right direction.A domain name and its matching IP address is called a “DNS
record”.
1. You open your browser and type www.wpbeginner.com in the address bar and hit Enter on the
keyboard. Immediately there is a quick check to see if you have visited our website previously.
If the DNS records are found in your computer’s DNS cache, then the rest of the DNS lookup is
skipped and you will be taken directly to www.wpbeginner.com.
2. If no DNS records are found, then a query is sent to your local DNS server. Typically this is your
Internet provider’s server and is often called a “resolving nameserver”.
3. If the records are not cached on the resolving nameserver, then the request is forwarded to what’s
called a “root nameserver” to locate the DNS records. Root nameservers are designated servers
around the world that are responsible for storing DNS data and keeping the system working
smoothly. Once the DNS record is found on the root nameserver, it’s cached by your computer.
4. Now that the DNS records are located, a connection to the server where the website is stored will
be opened and www.wpbeginner.com will be displayed on your screen.
DNS Hierarchy
5|P ag e SHREE ADARSH BCA COLLEGE - BOTAD
A DNS server is also a web server. Its primary objective is to interact with the aforementioned
database. These DNS servers translate the domain name entered into the URL area of a web
browser to the corresponding IP address. There are thousands of DNS servers worldwide which
form the Domain Name System which currently is the largest digital database.
DNS uses a hierarchy to manage its distributed database system. The DNS hierarchy, also called the
domain name space, is an inverted tree structure, much like Tree Directory.
The DNS tree has a single domain at the top of the structure called the root domain. A period or
dot (.) is the designation for the root domain. Below the root domain are the top-level domains that
divide the DNS hierarchy into segments.
Listed below are the top-level DNS domains and the types of organizations that use them. Below
the top-level domains, the domain name space is further divided into sub domains representing
individual organizations.
Domain Used by
Additional top-level domains organize domain name space geographically. For example, the top-
level domain for France is fr. DNS Hierarchy illustrates the DNS hierarchy.
Sub-domain
The sub-domain is the next level in the DNS hierarchy. The sub-domain can be defined as the
domain that is a part of the main domain. The only domain that is not also a sub-domain is the root
domain. Suppose two domains. one.example.com and two.example.com. Here, both the domains
are the sub-domains of the main domain example.com and the example.com is also a subdomain of
the com top level domain.
FTP is a client-server protocol where a client will ask for a file, and a local or remote server
will provide it.
The end-users machine is typically called the local host machine, which is connected via the
internet to the remote host—which is the second machine running the FTP software.
Anonymous FTP is a type of FTP that allows users to access files and other data without
needing an ID or password. Some websites will allow visitors to use a guest ID or
password- anonymous FTP allows this.
File transfer protocol (FTP) is a way to download, upload, and transfer files from one
location to another on the internet and between computer systems.
File transfer protocol (FTP) enables computers on the internet to transfer files back and
forth, and is an essential tool for those building and maintaining websites today.
Many file transfer protocol (FTP) clients are available for free to download, although most
websites (and web browsers) that offer downloads already have the FTP built-in, so
downloading a separate piece of software isn't always required.
Objectives of FTP
It provides the sharing of files.
It is used to encourage the use of remote computers.
Why FTP?
Although transferring files from one system to another is very simple and straightforward, but
sometimes it can cause problems. For example, two systems may have different file conventions.
Two systems may have different ways to represent text and data. Two systems may have different
directory structures. FTP protocol overcomes these problems by establishing two connections
between hosts. One connection is used for data transfer, and another connection is used for the
control connection.
FTP Modes
FTP may operate in an active or a passive mode, which determines how a data connection is
established. In both cases, a client creates a TCP control connection to an FTP server command port
21. This is a standard outgoing connection, as with any other file transfer protocol (SFTP, SCP,
WebDAV) or any other TCP client application (e.g. web browser). So, usually there are no
problems when opening the control connection.
Where FTP protocol is more complicated comparing to the other file transfer protocols are file
transfers. While the other protocols use the same connection for both session control and file (data)
transfers, the FTP protocol uses a separate connection for the file transfers and directory listings.
In the active mode, the client starts listening on a random port for incoming data connections from
the server (the client sends the FTP command PORT to inform the server on which port it is
listening). Nowadays, it is typical that the client is behind a firewall (e.g. built-in Windows firewall)
or NAT router (e.g. ADSL modem), unable to accept incoming TCP connections.
Among the two modes, Active mode is the older one. It was the mode introduced in the early days
of computing when mainframes were more common and attacks to information security were not as
prevalent.
Here's a simplified explanation on how an active mode connection is carried out, summarized in
two steps. Some relevant steps (e.g. ACK replies) have been omitted to simplify things.
In passive mode, the client still initiates a command channel connection to the server. However,
instead of sending the PORT command, it sends the PASV command, which is basically a request
for a server port to connect to for data transmission. When the FTP server replies, it indicates what
port number it has opened for the ensuing data transfer.
1. The client connects from a random port to port 21 on the server and issues the PASV
command. The server replies, indicating which (random) port it has opened for data
transfer.
2. The client connects from another random port to the random port specified in the server's
response. Once connection is established, data transfers are made through these client and
server ports.
FTP Commands
11 | P a g e SHREE ADARSH BCA COLLEGE - BOTAD
FTP (File Transfer Protocol) is a standard network protocol used to exchange files between
computers on a private network or through the Internet. There are three ways in which FTP is
commonly accessed:
1. Command-line FTP client.
2. Web browser.
3. Graphical FTP clients.
The first two are straightforward methods that allow you to directly use a Web browser (such as
Google Chrome, Firefox, Internet Explorer) or an FTP client application to connect to the FTP
server to exchange files. Using the command-line interface, you need to enter a set of commands to
send or receive files from other computers.
Windows, Mac OS X, and Linux operating systems have built-in command-line clients that can be
used for establishing an FTP connection. To initiate an FTP connection from Windows, type ftp at
the command prompt, and press enter.Here is a list of the most commonly used FTP commands in
the Windows command-line prompt.
FTP commands
PASS: Password
This command sends the user password to the server. This command must be immediately preceded
by the user name command, and, for some sites, completes the user's identification for access
control. The password is case sensitive.
ALLO: allocate
This command may be required by some servers to reserve sufficient storage to accommodate the
new file to be transferred.
RNTO: rename to
This command specifies the new pathname of the file specified in the immediately preceding
"rename from" command. Together the two commands cause a file to be renamed.
DELE: delete
This command causes the file specified in the pathname to be deleted at the server site.
LIST: list
This command causes a list to be sent from the server to the passive DTP. If the pathname specifies
a directory or other group of files, the server should transfer a list of files in the specified directory.
If the pathname specifies a file then the server should send current information on the file
SYST: system
This command is used to find out the type of operating system at the server.
STAT: status
This command shall cause a status response to be sent over the control connection in the form of a
reply.
HELP: help
This command shall cause the server to send helpful information regarding its implementation
status over the control connection to the user. The command may take an argument (e.g. any
command name) and return more specific information as a response.
Disadvantages of FTP:
The standard requirement of the industry is that all the FTP transmissions should be
encrypted. However, not all the FTP providers are equal and not all the providers offer
encryption. So, we will have to look out for the FTP providers that provide encryption.
FTP serves two operations, i.e., to send and receive large files on a network. However, the
size limit of the file is 2GB that can be sent. It also doesn't allow you to run simultaneous
transfers to multiple receivers.
Passwords and file contents are sent in clear text that allows unwanted eavesdropping. So, it
is quite possible that attackers can carry out the brute force attack by trying to guess the FTP
password.
It is not compatible with every system.
E-Mail Address
Each user of email is assigned a unique name for his email account. This name is known as E-mail
address. Different users can send and receive messages according to the e-mail address.
The username and the domain name are separated by @ (at) symbol.
E-mail addresses are not case sensitive.
Spaces are not allowed in e-mail address.
Email Structure
The Header
The email header gives us common details about the message such as the unique identity of the
message. The details of the users of the ‘from’ and ‘to’ ends are also stored here. The email header
consists of the following parts. However, the exact contents of the header can vary according to the
email systems that generate the email message.
1) Subject
2) Sender (From:)
4) Reply-to
5) Recipient (To:)
7) Attachments
8) CC
Subject
The Subject field indicates the purpose of e-mail. It should be precise and to the point. The subject
part is the topic of the message. In most email systems, if the content view of the folders is set to
view each messages separately, the subject part also will be visible with the user’s name. These
subject fields are scanned by the spam scanners to evaluate the messages.
Sender (From:)
The from field indicates the sender’s address i.e. who sent the e-mail. This will specify the sender’s
email address.
Reply-to
This field describes the email address that will become the recipient of the reply to the particular
email. When you reply, it will go to this email address despite the sender email address.
Recipient (To:)
The To field indicates the recipient’s address i.e. to whom the e-mail is sent.
Attachments
Some emails could be attached with files such as text, image, audio, video etc. These files are
specified here.
CC: CC stands for Carbon copy. This is optional. The people who were mailed copies of the
message. The recipients of the message will know to whom all the copies have been sent.
BCC: Its stands for Black Carbon Copy. Itis used when we do not want one or more of the
recipients to know that someone else was copied on the message. This is optional.
Body
The actual content is stored in this part. This will be in the format of text. The email body is the
main part of anemail message. It contains the message’s text, images and other data (such as
attachments). The email’s body is distinct from its header, which contains control information and
data about the message (such as its sender, the recipient and the path an email took to reach its
destination).
Greeting
Greeting is the opening of the actual message. Eg. Hi Sir or Hi Guys etc.
Signature
This is the final part of an e-mail message. It includes Name of Sender, Address, and Contact Number.
Advantages:
• Reliable: Because it notifies the senderif not delivered.
Global: E-mail can be sent and received by a person sitting across the globe.
Generality: It is also possible to send graphics, programs and sounds with an e-mail.
Disadvantages:
• Forgery: Anyone who hacks thepassword of the sender can send a message to
anyone.
• Junk: Junk emails are not intendedmails and is inappropriate also. Junk emails are
sometimes referred to as spam.
No Response: It may be frustrating when the recipient does not read the e-mail and respond on a
regular basis.
The diagram down below describes the path that email takes from your computer to the intended
recipient . This shows the path of the email from sending to receiving ends. There are also many
logical machines in the email delivery process. Please have a look at the diagram before proceeding.
Post Office Protocol version 3 (POP3) is a standard mail protocol used to receive emails
from a remote server to a local email client.
POP3 allows you to download email messages on your local computer and read them even
when you are offline.
Note, that when you use POP3 to connect to your email account, messages are downloaded
locally and removed from the email server.
This means that if you access your account from multiple locations that may not be the best
option for you.
On the other hand, if you use POP3, your messages are stored on your local computer,
which reduces the space your email account uses on your web server.
Port 995 – this is the port you need to use if you want to connect using POP3 securely.
Function of POP:
Retrieve message from an ISP and whether to delete or not to delete it on the server,
depends on users’ decision.
Detect whether new message has arrived but not retrieving it from the server, meaning the
messages will be stored at the server until the user choose to retrieve it from the server.
To see whether the message is worth retrieving, POP will peek at the few sentences of the
message before retrieving it.
Gmail is an example of a mail server which uses IMAP protocol. Email clients like Microsoft
Outlook may be used to access these emails directly on the server and the local machine after
downloading. Again, users may use IE to access these emails.
As the name suggests, SMTP is a simple, text-based protocol that works best when devices
are interconnected to each other. However, SMTP protocol can only be used to send emails.
Unlike POP3 and IMAP protocols, SMTP does not provide the functionality to the users to
retrieve emails from the server.
UNIX systems and simple applications like "mailsend" make use of SMTP protocol. Commercial
applications don't use SMTP to a great extent.
Functions of SMTP:
To enable the client side to send email message to a receiver (an email address which already exist),
SMTP would perform the following functions:
1. User authentication
To verify the sender who is using SMTP server to send an email message has the right to do
so.
2. User notification
After delivering the message to the destination, SMTP will check whether the message has
been successfully delivered.
If the message does not delivered successfully, SMTP notifies sender by using an error
messages and the message that was not successfully delivered will be delivered back to the
sender.
Growing demand for Email Message as people also want to express in terms of Multimedia. So,
MIME another email application is introduced as it is not restricted to textual data.
MIME transforms non-ASCII data at sender side to NVT 7-bit data and delivers it to the client
SMTP. The message at receiver side is transferred back to the original data. As well as we can send
video and audio data using MIME as it transfers them also in 7-bit ASCII data.
Features of MIME –
The protocols that are used to transfer hypertext between two computers is known as
HyperText Transfer Protocol.
It is an application layer protocol.
HTTP provides standard between a web browser and web server to establish
communication.
It is set of rules for transferring data from one computer to another. Data such as text,
images file,HTML files, query results, etc. and other multimedia files are shared on the
World Wide Web.
Whenever a web user opens their web browser, user will indirectly uses HTTP. It is an
application protocol which is used for distributed, collaborative, hypermedia information
systems.
Purpose-
It is mainly used for the retrieval of data from websites throughout the internet.
History:
Tim Berners Lee and his team at CERN gets credit for inventing original HTTP and associated
technologies.
In 1996, RFC 1945 (Request For Comments) was introduced in HTTP version 1.0.
In January 1997, RFC 2068 was introduced in HTTP version 1.1. Improvements and
updates to HTTP version 1.1 standards were released under RFC 2616 in June 1999.
The HTTP version 2.0 specifications were published as RFC 7540 on May 14, 2015.
HTTP version 3.0 is based on previous RFC draft. It is renamed as HyperText Transfer
Protocol QUIC which is a transport layer network protocol developed by Google.
How it works?
First of all, whenever we want to open any website then first we open web browser after that we
will type URL of that website (e.g., www.facebook.com ). This URL is now sent to Domain Name
Server (DNS). Then DNS first check records for this URL in their database, then DNS will return
IP address to web browser corresponding to this URL. Now browser is able to sent request to actual
server.
After server sends data to client, connection will be closed. If we want something else from server
we should have to re-establish connection between client and server.
HTTP opens a connection between the client and server through TCP.
HTTP sends a request to the server which collects the requested data.
HTTP sends the response with the objects back to the client.
HTTP closes the connection.
Basic Architecture
The following diagram shows a very basic architecture of a web application and depicts where
HTTP sits:
The HTTP protocol is a request/response protocol based on the client/server based architecture
where web browsers, robots and search engines, etc. act like HTTP clients, and the Web server acts
as a server.
Client
The HTTP client sends a request to the server in the form of a request method, URI, and protocol
version, followed by a MIME-like message containing request modifiers, client information, and
possible body content over a TCP/IP connection.
Server
The HTTP server responds with a status line, including the message's protocol version and a
success or error code, followed by a MIME-like message containing server information, entity meta
information, and possible entity-body content.
Features of HTTP:
Connectionless protocol: HTTP is a connectionless protocol. HTTP client initiates a request and
waits for a response from the server. When the server receives the request, the server processes the
request and sends back the response to the HTTP client after which the client disconnects the
Media independent: HTTP protocol is a media independent as data can be sent as long as both the
client and server know how to handle the data content. It is required for both the client and server to
specify the content type in MIME-type header.
Stateless: HTTP is a stateless protocol as both the client and server know each other only during
the current request. Due to this nature of the protocol, both the client and server do not retain the
information between various requests of the web pages.
HTTP Connections-
HTTP connections can be of two types-
1. Non-persistent HTTP connection
2. Persistent HTTP connection
A new separate TCP connection is used for A single TCP connection is used for sending
each object. multiple objects one after the other.
HTTP 1.0 supports non-persistent connections HTTP 1.1 supports persistent connections by
by default. default.
Advantages:
Memory usage and CPU usage are low because of less simultaneous connections.
Since there are few TCP connections hence network congestion are less.
Since handshaking is done at initial connection stage, then latency is reduced because there
is no further need of handshaking for subsequent requests.
The error can be reports without closing connection.
HTTP allows HTTP pipe-lining of request or response.
Disadvantages:
HTTP requires high power to establish communication and transfer data.
HTTP is less secure, because it does not uses any encryption method like https use TLS to
encrypt normal http requests and response.
HTTP is not optimized for cellular phone and it is too gabby.
HTTP does not offer genuine exchange of data because it is less secure.
Client does not close connection until it receives complete data from server and hence server
needs to wait for data completion and cannot be available for other clients during this time.
UDP Protocol
In computer networking, the UDP stands for User Datagram Protocol. The David P. Reed
developed the UDP protocol in 1980.User Datagram Protocol (UDP) – a communications protocol
that facilitates the exchange of messages between computing devices in a network. It’s an
alternative to the transmission control protocol (TCP). In a network that uses the Internet Protocol
(IP), it is sometimes referred to as UDP/IP.
UDP divides messages into packets, called datagram, which can then be forwarded by the
devices in the network – switches, routers, security gateways – to the destination
application/server.
The User Datagram Protocol (UDP) is simplest Transport Layer communication protocol
available of the TCP/IP protocol suite.
In UDP, the header size is 8 bytes, and the packet size is upto 65,535 bytes. But this packet size is
not possible as the data needs to be encapsulated in the IP datagram, and an IP packet, the header
27 | P a g e SHREE ADARSH BCA COLLEGE - BOTAD
size can be 20 bytes; therefore, the maximum of UDP would be 65,535 minus 20. The size of the
data that the UDP packet can carry would be 65,535 minus 28 as 8 bytes for the header of the UDP
packet and 20 bytes for IP header.
Source port number: It is 16-bit information that identifies which port is going t send the packet.
Destination port number: It identifies which port is going to accept the information. It is 16-bit
information which is used to identify application-level service on the destination machine.
Length: It is 16-bit field that specifies the entire length of the UDP packet that includes the header
also. The minimum value would be 8-byte as the size of the header is 8 bytes.
Checksum - This field stores the checksum value generated by the sender before sending. IPv4 has
this field as optional so when checksum field does not contain any value it is made 0 and all its bits
are set to zero.
UDP application
Advantages of UDP:
Broadcast and multicast transmission are available with UDP which is not the case with
TCP.
It doesn't restrict to a connection based communication model, so startup latency in
distributed applications is much lower, as is operating system overhead FAST.
It does not require connection to be established and maintained.
Also absence of acknowledgement field in UDP makes it faster as it need not have to wait
on ACK or need not have to hold data in memory until they are ACKed.
28 | P a g e SHREE ADARSH BCA COLLEGE - BOTAD
It uses checksum with all the packets for error detection.
It can be used in events where a single packet of data needs to be exchanged between the
hosts.
Much faster than TCP.
Disadvantages of UDP:
Thee are no guarantees with UDP.
It is connectionless and unreliable transport protocol. There is no windowing and no
function to ensure data is received in the same order as it was transmitted.
It does not use any error control. Hence if UDP detects any error in the received packet, it
silently drops it.
There is no congestion control. Hence large number of users transmitting lots of data via
UDP can cause congestion and no one can do anything about it.
There is no flow control and no acknowledgement for received data.
Only application layer deals with error recovery. Hence applications can simply turn to the
user to send the message again.
Routers can be careless with UDP. They do not retransmit a UDP datagram after collision
and will often discard UDP packets before TCP packets.
UDP suffers from worse packet loss than TCP.