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

Unit - 2 Application Layer

This document provides an overview of the Computer Networks course for the 5th semester at New L J Institute of Engineering and Technology. It covers the syllabus for Unit 2 on the Application Layer, which will discuss principles of computer applications, email protocols, FTP, DNS, HTTP, and socket programming. Reference books for the course are also listed. The document then provides details on various internet applications like voice calls, online shopping, stock updates, and social networking. It describes client-server and peer-to-peer network application architectures. Finally, it discusses the client-server model as the first principle of computer applications.

Uploaded by

memonabrar8460
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)
58 views

Unit - 2 Application Layer

This document provides an overview of the Computer Networks course for the 5th semester at New L J Institute of Engineering and Technology. It covers the syllabus for Unit 2 on the Application Layer, which will discuss principles of computer applications, email protocols, FTP, DNS, HTTP, and socket programming. Reference books for the course are also listed. The document then provides details on various internet applications like voice calls, online shopping, stock updates, and social networking. It describes client-server and peer-to-peer network application architectures. Finally, it discusses the client-server model as the first principle of computer applications.

Uploaded by

memonabrar8460
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/ 58

9/4/2023

New L J Institute of Engineering and Technology


(AICTE approved and GTU affiliated )

Unit - 2 Application Layer

SUBJECT CODE:3150710
SEMESTER: 5TH FACULTY NAME: Prof. Bhaumik Gelani
Email id: bhaumik.gelani@ljku.edu.in
SUBJECT NAME: Computer Networks Mobile : +91 99092 49440
DEPARETMENT: CSE & IT

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Subject Overview

Unit No. Unit Title %


1 Introduction to Computer Networks and Internet 15

2 Application Layer 17
3 Transport Layer 25
4 Network Layer 25
5 The Link layer and Local area networks 18

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

1
9/4/2023

Reference Books
Sr. No. Book Name Author Publication
1 Computer Networking- A Top-Down approach, Kurose and Pearson
5th edition Ross
2 Computer Networks- A Top-Down approach, Behrouz Mc Graw Hill
Forouzan
3 Computer Networks (4th edition) Andrew Prentice Hall
Tanenbaum

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Unit - 2
Application Layer
1. Principles of Computer Applications
2. Electronic Mail (SMTP, MIME) & Management
3. FTP
4. DNS
5. WWW (WEB)
6. HTTP
7. Socket Programming with TCP and UDP

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

2
9/4/2023

Internet Applications

• Internet Applications can be described as the type of applications that use the
internet for operating successfully, that is, by using the internet for fetching,
sharing and displaying the information from the respective server systems.

• These applications can be classified as electronic devices based, automated


digital technology, industrial internet, smartphones based, smart home-based,
smart grids, smart city, and other major applications.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

1. Internet telephony :
• Internet telephony (e.g. Skype) is another common communications
service made possible by the creation of the Internet.
• VoIP stands for Voice-over-Internet Protocol, referring to the protocol that
underlies all Internet communication.
2. Job search:
• Nowadays, many people search for their jobs online as it is quicker and
there is a larger variety of job vacancies present.
• People can publish resume online for prospective job.
• Some of the web sites providing this service are naukri.com, monster.com,
summerjob.com, recuritmentindia.com etc.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

3
9/4/2023

Cont..
3. Online Shopping:
• The internet has also facilitated the introduction of a new market concept
consisting of virtual shops.
• They provide information about products or services for sale through
www servers.
• Using the internet services customers can submit specific product queries
and request specific sales quotes.
• For example amazon.com
4. Stock market updates:
• Selling or buying shares sitting on computer through internet.
• Several websites like ndtvprofit.com, moneypore.com, provide
information regarding investment

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

5. Travel:
• One can use internet to gather information about various tourist place.
• It can be used for booking Holiday tours, hotels, train, bus, flights and
cabs.
• Some of the web sites providing this service are goibibo.com,
makemytrip.com, olacabs.com.
6. Voicemail:
• Voicemail is a system of sending messages over the phone.
• Calls are answered by a machine which connects you to the person you
want to leave a message for, and they can listen to their messages later.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

4
9/4/2023

Cont..

7. Research:
• Research papers are present online which helps in the researcher doing
aliterature review.
8. Video conferencing:
• It enables direct face-to-face communication across networks via web
cameras, microphones, and other communication tools.
• Video conferencing can enable individuals in distant locations to
participate in meetings on short notice, with time and money savings.
• The technology is also used for telecommuting, in which employees work
from home.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

9. Online payments:
• The rising boom of online payments in India has given way to many new
entrants in the industry such as Paytm etc who are majorly wallet driven
payment companies.
• This growth has been driven by rapid adoption led by the increasing use of
smartphones, tablets and speedy access to internet through broadband, 4G
etc
10. Social Networking:
• Social networking is the use of internet-based social media programs to
make connections with friends, family, classmates, customers and clients.
• Social networking can be done for social purposes, business purposes or
both.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari Unit – 2

5
9/4/2023

Network Application Architecture

• Application architecture is different from the network architecture.


• The network architecture is fixed and provides a set of services to applications.
• The application architecture, on the other hand, is designed by the application developer
and defines how the application should be structured over the various end systems.

1) Client-Server architecture
2) P2P (Peer to Peer) architecture

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

1) Client-Server Architecture:

• An application program running on the


local machine sends a request to another
application program is known as a
client, and a program that serves a
request is known as a server.

• For example, when a web server


receives a request from the client host, it
responds to the request to the client host.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

6
9/4/2023

Cont..

2) P2P Architecture:
• It has no dedicated server in a data
center. The peers are the computers
which are not owned by the service
provider.
• Most of the peers reside in the homes,
offices, schools, and universities.
• The peers communicate with each other
without passing the information through
a dedicated server, this architecture is
known as peer-to-peer architecture.
• The applications based on P2P
architecture includes file sharing and
internet telephony.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari Unit – 2

1. Principles of Computer Applications

• Client and Server model:


• A client and server networking model is a model in which computers such as servers
provide the network services to the other computers such as clients to perform a user
based tasks.

• This model is known as client-server networking model.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

7
9/4/2023

Cont..

• An application program is known as a client program, running on the local


machine that requests for a service from an application program known as a
server program, running on the remote machine.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• A client program runs only when it requests for a service from the server while the server
program runs all time as it does not know when its service is required.
• A server provides a service for many clients not just for a single client.
• Therefore, we can say that client-server follows the many-to-one relationship. Many
clients can use the service of one server.

• Client:
• A client is a program that runs on the local machine requesting service from the
server.
• A client program is a finite program means that the service started by the user and
terminates when the service is completed.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

8
9/4/2023

Cont..

• Server:
• A server is a program that runs on the remote machine providing services to
the clients.
• When the client requests for a service, then the server opens the door for the
incoming requests, but it never initiates the service.
• A server program is an infinite program means that when it starts, it runs
infinitely unless the problem arises.
• The server waits for the incoming requests from the clients.
• When the request arrives at the server, then it responds to the request.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..
• P2P (Peer to Peer ) model:
• The peer to peer computing architecture contains nodes that are equal
participants in data sharing.
• All the tasks are equally divided between all the nodes.
• The nodes interact with each other as required as share resources.
• A diagram to better understand peer to peer computing is as follows:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

9
9/4/2023

Cont..
• Peer to peer networks are usually formed by groups of a dozen or less computers.
• These computers all store their data using individual security but also share data
with all the other nodes.
• The nodes in peer to peer networks both use resources and provide resources.
• So, if the nodes increase, then the resource sharing capacity of the peer to peer
network increases.
• This is different than client server networks where the server gets overwhelmed
if the nodes increase.
• Since nodes in peer to peer networks act as both clients and servers, it is difficult
to provide adequate security for the nodes. This can lead to denial of service
attacks.
• Most modern operating systems such as Windows and Mac OS contain software
to implement peer to peer networks.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari Unit – 2

2. Electronic Mail
(SMTP, MIME) & Management

• Electronic mail is often referred to as E-mail and it is a method used


for exchanging digital messages.
• Electronic mail is mainly designed for human use.
• It allows a message to includes text, image, audio as well as video.
• This service allows one message to be sent to one or more than one
recipient.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

10
9/4/2023

Cont..

• The E-mail systems are mainly based on the store-and-forward


model where the E-mail server system accepts, forwards, deliver and store
the messages on behalf of users who only need to connect to the
infrastructure of the Email.

• The Person who sends the email is referred to as the Sender while the
person who receives an email is referred to as the Recipient.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• Need of an Email:
1. We can send the same message to several peoples at the same time.
2. It is a very fast and efficient way of transferring information.
3. The email system is very fast as compared to the Postal system.
4. Information can be easily forwarded to coworkers without retyping it.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

11
9/4/2023

Cont..

• Structure of Email:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• The message mainly consists of two parts:


1.Header
2.Body

• Header
• The header part of the email generally contains the sender's address as
well as the receiver's address and the subject of the message.

• Body
• The Body of the message contains the actual information that is meant for
the receiver.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

12
9/4/2023

Cont..

• Email Address:
• In order to deliver the email, the mail handling system must make use
of an addressing system with unique addresses.

• The address consists of two parts:


• Local part
• Domain Name

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• Local Part
• It is used to define the name of the special file, which is commonly
called a user mailbox; it is the place where all the mails received for
the user is stored for retrieval by the Message Access Agent.

• Domain Name
• It is the second part of the address is Domain Name.
• Both local part and domain name are separated with the help of @.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari Unit – 2

13
9/4/2023

Cont..
• Working of E-mail:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• Email working follows the client server approach. In this client is the
mailer i.e. the mail application or mail program and server is a device that
manages emails.

• Following example will take you through the basic steps involved in
sending and receiving emails and will give you a better understanding of
working of email system:

1. Suppose person A wants to send an email message to person B.

2. Person A composes the messages using a mailer program i.e. mail client
and then select Send option.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

14
9/4/2023

Cont..

3. The message is routed to Simple Mail Transfer Protocol to person B’s


mail server.
4. The mail server stores the email message on disk in an area designated for
person B.
The disk space area on mail server is called mail spool.
5. Now, suppose person B is running a POP client and knows how to
communicate with B’s mail server.
6. It will periodically poll the POP server to check if any new email has
arrived for B.As in this case, person B has sent an email for person B, so
email is forwarded over the network to B’s PC. This is message is now
stored on person B’s PC.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari Unit – 2

Cont..

• Email Protocols:
1. SMTP
2. MIME
3. POP3
4. IMAP

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

15
9/4/2023

Cont..

• SMTP:

• SMTP stands for Simple Mail Transfer Protocol.

• SMTP is a set of communication guidelines that allow software to transmit


an electronic mail over the internet is called Simple Mail Transfer
Protocol.

• It is a program used for sending messages to other computer users based


on e-mail addresses.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• It provides a mail exchange between users on the same or different


computers, and it also supports:

• It can send a single message to one or more recipients.


• Sending message can include text, voice, video or graphics.
• It can also send the messages on networks outside the internet.
• The main purpose of SMTP is used to set up communication rules
between servers.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

16
9/4/2023

Cont..

• The servers have a way of identifying themselves and announcing what


kind of communication they are trying to perform.

• They also have a way of handling the errors such as incorrect email
address.

• For example, if the recipient address is wrong, then receiving server reply
with an error message of some kind.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• Components of SMTP:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

17
9/4/2023

Cont..
• First, we will break the SMTP client and SMTP server into two
components such as user agent (UA) and mail transfer agent (MTA).
• The user agent (UA) prepares the message, creates the envelope and then
puts the message in the envelope. The mail transfer agent (MTA) transfers
this mail across the internet.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..
• SMTP allows a more complex system by adding a relaying system.
• Instead of just having one MTA at sending side and one at receiving side,
more MTAs can be added, acting either as a client or server to relay the
email.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

18
9/4/2023

Cont..

• The relaying system without TCP/IP protocol can also be used to send the
emails to users, and this is achieved by the use of the mail gateway.
• The mail gateway is a relay MTA that can be used to receive an email.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

• MIME:
• MIME stands for Multipurpose Internet Mail Extensions.
• It is used to extend the capabilities of Internet e-mail protocols such as
SMTP.
• The MIME protocol allows the users to exchange various types of digital
content such as:
• Pictures, audio, video, and various types of documents and files in the
e-mail.
• MIME is an e-mail extension protocol, i.e., it does not operate
independently, but it helps to extend the capabilities of e-mail in
collaboration with other protocols such as SMTP.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

19
9/4/2023

Cont..

• MIME Header:
• MIME adds five additional fields to the header portion of the actual e-mail to
extend the properties of the simple email protocol.

• These fields are as follows:


1. MIME Version
2. Content Type
3. Content Type Encoding
4. Content Id
5. Content description

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• MIME Header:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

20
9/4/2023

Cont..
• MIME-Version:
• Defines the version of the MIME protocol.
• It must have the parameter Value 1.0, which indicates that message is
formatted using MIME.

• Content-Type:
• Type of data used in the body of the message.
• They are of different types like text data (plain, HTML), audio content, or
video content.

• Content-Type Encoding:
• It defines the method used for encoding the message.
• Like 7-bit encoding, 8-bit encoding, etc.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• Content Id:
• It is used for uniquely identifying the message.

• Content description:
• It defines whether the body is actually an image, video, or audio.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

21
9/4/2023

Cont..

• Working Diagram of MIME Protocol:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• Features of MIME Protocol


1. It supports multiple attachments in a single e-mail.
2. It supports the non-ASCII characters.
3. It supports unlimited e-mail length.
4. It supports multiple languages.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari Unit – 2

22
9/4/2023

Cont..

• Advantage of the MIME:


1. It is capable of sending various types of files in a message, such as text,
audio, video files.
2. It also provides the facility to send and receive emails in different
languages like Hindi, French, Japanese, Chinese etc.
3. It also provides the facility of connecting HTML and CSS to email, due to
which people can design email as per their requirement and make it
attractive and beautiful.
4. It is capable of sending the information contained in an email regardless of
its length.
5. It assigns a unique id to all e-mails.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

• POP & IMAP


• POP: Post Office Protocol – Version 3
• IMAP: Internet Mail Access Protocol

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

23
9/4/2023

Cont..

• POP3 and IMAP are the protocols that are used to retrieve mail from the mailbox
at the mail server to the recipient’s computer. Both are message accessing agents
(MAA).

• The two protocols POP3 and IMAP are used when both the sender and recipient
of mail are connected to the mail server by WAN or LAN.

• The SMTP protocol transfers the mail from client’s computer to the mail server
and from one mail server to another mail server.

• POP3 has a limited functionality whereas, the IMAP has extra features over
POP3.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• IMAP General Operation:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

24
9/4/2023

Cont..

• The IMAP is a client-server protocol like POP3 and most other TCP/IP
application protocols.
• The IMAP4 protocol functions only when the IMAP4 must reside on the server
where the user mailboxes are located.
• In c the POP3 does not necessarily require the same physical server that provides
the SMTP services.
• Therefore, in the case of the IMAP protocol, the mailbox must be accessible to
both SMTP for incoming mails and IMAP for retrieval and modifications.
• The IMAP uses the Transmission Control Protocol (TCP) for communication to
ensure the delivery of data and also received in the order.
• The IMAP4 listens on a well-known port, i.e., port number 143, for an incoming
connection request from the IMAP4 client.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• IMAP follows Client-server Architecture and is the most commonly used email
protocol.

• It is a combination of client and server process running on other computers that


are connected through a network.

• This protocol resides over the TCP/IP protocol for communication.

• Once the communication is set up the server listens on port 143 by default which
is non-encrypted.

• For the secure encrypted communication port, 993 is used.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

25
9/4/2023

Cont..

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..
• POP3 Vs IMAP
BASIS FOR
POP3 IMAP
COMPARISON
Basic To read the mail ithas to be downloaded first. The mail content can be checked partially
before downloading.
Organize The user can not organize mails in the mailbox The user can organize the mails on the server.
of the mail server.
Folder The user can not create, delete or rename The user can create, delete or rename
mailboxes on a mail server. mailboxes on the mail server.

Content A user can not search the content of mail for A user can search the content of mail for
prior downloading. specific string of character before
downloading.
Partial Download The user has to download the mail for The user can partially download the mail if
accessing it. bandwidth is limited.
Functions POP3 is simple and has limited functions. IMAP is more powerful, more complex and
has more features over POP3.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari Unit – 2

26
9/4/2023

3. FTP

• FTP stands for File transfer protocol.


• FTP is a standard internet protocol provided by TCP/IP used for transmitting the
files from one host to another.

• It is mainly used for transferring the web page files from their creator to the
computer that acts as a server for other computers on the internet.

• It is also used for downloading the files to computer from other servers.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• Objectives of FTP
1. It provides the sharing of files.
2. It is used to encourage the use of remote computers.
3. It transfers the data more reliably and efficiently.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

27
9/4/2023

Cont..

• Mechanism of FTP:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• The FTP client has three components:


• The user interface, control process, and data transfer process.
• The server has two components:
• The server control process and the server data transfer process.
• There are two types of connections in FTP:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

28
9/4/2023

Cont..

• Control Connection:
• The control connection uses very simple rules for communication.
• Through control connection, we can transfer a line of command or line
of response at a time.

• The control connection is made between the control processes.


• The control connection remains connected during the entire interactive
FTP session.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• Data Connection:
• The Data Connection uses very complex rules as data types may vary.
• The data connection is made between data transfer processes.
• The data connection opens when a command comes for transferring
the files and closes when the file is transferred.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

29
9/4/2023

Cont..

• FTP Clients
• FTP client is a program that implements a file transfer protocol which
allows you to transfer files between two hosts on the internet.
• It allows a user to connect to a remote host and upload or download
the files.
• It has a set of commands that we can use to connect to a host, transfer
the files between you and your host and close the connection.
• The FTP program is also available as a built-in component in a Web
browser.
• This GUI based FTP client makes the file transfer very easy and also
does not require to remember the FTP commands.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..
• Advantages of FTP:
• Speed:
• One of the biggest advantages of FTP is speed.
• The FTP is one of the fastest way to transfer the files from one computer to
another computer.
• Efficient:
• It is more efficient as we do not need to complete all the operations to get the
entire file.
• Security:
• To access the FTP server, we need to login with the username and password.
• Therefore, we can say that FTP is more secure.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari Unit – 2

30
9/4/2023

TFTP
• Trivial File Transfer Protocol (TFTP) is a simple protocol used for
transferring files.

• TFTP uses the User Datagram Protocol (UDP) which enables data to be
sent between communication partners without sharing a fixed connection.

• TFTP is mostly used to read and write files/mail to or from a remote


server.

• It is also possible to implement the TFTP based on other protocols.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• TFTP is a simpler version of FTP and it doesn’t have all its functions for
example, you cannot list, delete or rename files or directories on a remote
server.

• In fact, TFTP can only be used to send and receive files between the two
computers.

• TFTP doesn’t support user authentication and all data is sent in clear text.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

31
9/4/2023

Cont..

• TFTP messages:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• TFTP messages come in five types:


• RRQ (read request): to request devices to read files
• WRQ (write request): to request devices to write files
• DATA: to carry file blocks
• ACK (acknowledge): to acknowledge received file blocks
• ERROR: to tell the sending device when an operation cannot be
performed.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

32
9/4/2023

Cont..
• Advantages and Disadvantages of TFTP:
• Advantages:
1. It utilizes the User Datagram Protocol (UDP) protocol.
2. It is very easy to use and implement.
3. It needs minimum coding.
4. It needs minimum memory utilization.
5. It is a faster file transfer protocol.
• Disadvantages
1. It doesn't offer file security as compared to FTP.
2. It doesn't list the directory's contents.
3. It is an unsecured FTP.
4. There is no encryption or authentication mechanism.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari Unit – 2

• Difference Between FTP and TFTP


COMPARISON FTP TFTP
Full-Form File Transfer Protocol. Trivial File Transfer Protocol.
Authentication is required in FTP for No authentication is required in
Authentication communication between client and TFTP.
server.

Service FTP uses TCP service which is a TFTP uses UDP service which is
connection-oriented service. connection-less service.
FTP software is larger than TFTP. TFTP software is smaller than FTP
Software and fits into readonly memory of the
diskless workstation.

Commands/Message FTP have many commands. TFTP have only five messages.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

33
9/4/2023

Cont..

COMPARISON FTP TFTP


Connection FTP establishes two connections one TFTP establishes a single connection
for data(TCP port no. 21) and one for for its file transfer (UDP port no. 69).
control(TCP port no. 20).

Complexity FTP is more complex TFTP is less complex.

Security Encrypts data transfer Does not encrypt data transfer

Error handling Can recover from errors during transfer Does not have error recovery

Supports both ASCII and binary


File transfer mode Only supports binary transfer mode
transfer modes

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari Unit – 2

4. DNS

• DNS stands for Domain Name System.


• DNS is a directory service that provides a mapping between the name
of a host on the network and its numerical address.

• Each node in a tree has a domain name, and a full domain name is a
sequence of symbols specified by (.) dots.

• DNS is a service that translates the domain name into IP addresses.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

34
9/4/2023

Cont..

• Domain Name System(DNS):

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• Domain Names and Labels:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

35
9/4/2023

Cont..

• DNS is a TCP/IP protocol used on different platforms.

• The domain name space is divided into three different sections:


1. Generic Domains.
2. Country Domains.
3. Inverse Domain.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• Generic Domains:
• It defines the registered hosts according to their generic behavior.

• Each node in a tree defines the domain name, which is an index to the DNS
database.

• It uses three-character labels, and these labels describe the organization


type.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

36
9/4/2023

Cont..

• Generic Domains:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..
• Generic domain labels:
Label Description

.com Commercial organizations

.edu Educational institutions

.gov Government institutions

.int International organizations

.mil Military groups

.net Network support centers

.org Nonprofit organizations

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

37
9/4/2023

Cont..

• Country Domains:
• The format of country domain is same as a generic domain, but it uses two-
character country abbreviations (e.g., us for the United States) in place of
three character organizational abbreviations.

• Country domain uses two character country abbreviations.

• Second labels can be more specific, national designation.

• For example,
• Australia the country domain is “.au”, Inida is “.in” and UK is “.uk”etc.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• Country Domains :

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

38
9/4/2023

Cont..
• Generic domain labels:
Label Description

.ar Argentina

.am Armenia

.au Australia

.br Brazil

.ge Germany

.in India

.jp Japan

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• Inverse Domains:
• The inverse domain is used for mapping an address to a name.

• When the server has received a request from the client, and the server
contains the files of only authorized clients.

• To determine whether the client is on the authorized list or not, it sends a


query to the DNS server and ask for mapping an address to the name.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

39
9/4/2023

Cont..

• Inverse Domains :

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari Unit – 2

5. WWW (WEB)

• WWW Stand for World Wide Web.


• World Wide Web, which is also known as a Web, is a collection of websites or
web pages stored in web servers and connected to local computers through
the internet.
• These websites contain text pages, digital images, audios, videos, etc.
• Users can access the content of these sites from any part of the world over the
internet using their devices such as computers, laptops, cell phones, etc.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

40
9/4/2023

Cont..

• The WWW, along with internet, enables the retrieval and display of text
and media to your device.
• Components of the Web:
• There are 3 components of the web:
1. Uniform Resource Locator (URL):
• serves as a system for resources on the web.
2. HyperText Transfer Protocol (HTTP):
• specifies communication of browser and server.
3. Hyper Text Markup Language (HTML):
• defines the structure, organization and content of a webpage.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..
• World Wide Web Works:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

41
9/4/2023

Cont..

• World Wide Web Works:


• The Web works as per the internet's basic client-server format as shown in
the following image.
• The servers store and transfer web pages or information to user's computers
on the network when requested by the users.
• A web server is a software program which serves the web pages requested by
web users using a browser.
• The computer of a user who requests documents from a server is known as a
client.
• Browser, which is installed on the user' computer, allows users to view the
retrieved documents.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• All the websites are stored in web servers.


• Just as someone lives on rent in a house, a website occupies a space in a server
and remains stored in it.
• The server hosts the website whenever a user requests its WebPages, and the
website owner has to pay the hosting price for the same.
• The moment you open the browser and type a URL in the address bar or search
something on Google, the WWW starts working.
• There are three main technologies involved in transferring information (web
pages) from servers to clients (computers of users).
• These technologies include Hypertext Markup Language (HTML), Hypertext
Transfer Protocol (HTTP) and Web browsers.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari Unit – 2

42
9/4/2023

6. HTTP

• HTTP is one of the protocols used at the Application Layer.


• The HTTP is similar to FTP because HTTP is used to transfer the files
and it mainly uses the services of TCP.
• Also, HTTP is much simpler than FTP because there is only one TCP
connection.
• In HTTP, there is no separate control connection, as only data is
transferred between the client and the server.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• SMTP messages are stored and then forwarded while


the HTTP messages are delivered immediately.

• The HTTP mainly uses the services of the TCP on the well-known port
that is port 80.

• HTTP is a stateless protocol.


• In HTTP, the client initializes the transaction by sending a request
message, and the server replies by sending a response.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

43
9/4/2023

Cont..

• Working of HTTP:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• The HTTP makes use of Client-server architecture.


• As we have already told you that the browser acts as the HTTP client and
this client mainly communicates with the webserver that is hosting the
website.

• The format of the request and the response message is similar.


• The Request Message mainly consists of a request line, a header, and a
body sometimes.

• A Response message consists of the status line, a header, and sometimes a


body.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

44
9/4/2023

Cont..

• At the time when a client makes a request for some information (say client
clicks on the hyperlink) to the webserver.
• The browser then sends a request message to the HTTP server for the
requested objects.
• After that the following things happen:
1. There is a connection that becomes open between the client and the
webserver through the TCP.
2. After that, the HTTP sends a request to the server that mainly collects
the requested data.
3. The response with the objects is sent back to the client by HTTP
4. At last, HTTP closes the connection.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• Let us take a look at the format of the request message and response
message:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

45
9/4/2023

Cont..

• Request Line and Status line


• The first line in the Request message is known as the request line,
while the first line in the Response message is known as the Status
line.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..
• Request Type
• This field is used in the request line.
• The are several request types that are defined and these are mentioned
in the table given below;
Name of Method Actions
GET • This method is used to request a document from the server.
• This method mainly requests information about a document and not the
HEAD
document itself
POST • This method sends some information from the client to the server.
PUT • This method sends a document from the server to the client.
TRACE • This method echoes the incoming request.
CONNECT • This method means reserved
OPTION • In order to inquire about the available options.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

46
9/4/2023

Cont..
• URL:
• URL is a Uniform Resource locator and it is mainly a standard way of
specifying any kind of information on the Internet.
• HTTP Version:
• The current version of the HTTP is 1.1.
• Status Code:
• The status code is the field of the response message.The status code
consists of three digits.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• Status Phrase:
• This field is also used in the response message and it is used to explain
the status code in the form of text.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

47
9/4/2023

Cont..

• Advantages of HTTP
1. There is no runtime support required to run properly.
2. HTTP is usable over the firewalls and global application is possible.
3. HTTP is platform-independent.
4. HTTP reports the errors without closing the TCP connection.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari Unit – 2

• Types of HTTP Connections


• HTTP connections are broadly categorized into two types:
1. Persistent
2. Non-Persistent

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

48
9/4/2023

Cont..
• Difference between Persistent and Non-Persistent Connections:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• Persistent Connection:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

49
9/4/2023

Cont..

• Non-Persistent Connection:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari Unit – 2

7. Socket Programming with TCP and UDP

• Addresses and Ports Host (NIC card) identified by unique IP address.


• Network application/process identified by port number.
• Network connection identified by a 5-tuple:
(src ip, src port, dst ip, dst port, protocol).
• Two kinds of Internet transport services provided to applications.
• Connection-oriented (TCP)
• Connectionless (UDP)

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

50
9/4/2023

Cont..

• Socket
• “A socket is one endpoint of a two-way communication link between two
programs running on the network.”

• An Socket is combination of an IP address and a port number.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• Client – Server Communication:


1. Two machines must connect
2. Server waits for connection
3. Client initiates connection
4. Server responds to the client request

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

51
9/4/2023

Cont..

• Socket Programming Goal:


• Learn how to build client/server applications that communicate using sockets
• Socket:
• Door between application process and end-end- transport protocol

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• TCP/IP ServerSocket Class:


• The ServerSocket class (java.net) can be used to create a server socket.
• This object is used to establish communication with the clients.
• Constructor:
ServerSocket(int port) Creates a server socket, bound to the specified port.

• Method:
public Socket accept() returns the socket and establish a connection between server
and client.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

52
9/4/2023

Cont..

• TCP/IP Server Socket:


• Syntax:
ServerSocket ss;

ss=new ServerSocket(Port_no);

• Example:
ServerSocket ss=new ServerSocket(1111);

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• TCP/IP Server Program:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

53
9/4/2023

Cont..

• TCP/IP ClientSocket Class:


• The client in socket programming must know two information:
1. IP Address of Server
2. Port number.
• Syntax:
Socket myClient; //Creates object of Socket Class
myClient = new Socket("Machine name", PortNumber);

• Example: DNS or IP Port Number is the port


Address (a number) on which
Socket s;
the server you are
s=new Socket("localhost",1111); trying to connect.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• TCP/IP Client Program:

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

54
9/4/2023

Cont..

• Datagrams (UDP) : DatagramSocket class


• DatagramSocket class represents a connection-less socket for sending and
receiving datagram packets.
• A datagram is basically an information but there is no guarantee of its
content, arrival or arrival time.
• Constructor:
DatagramSocket() • it creates a datagram socket and binds it with the
available Port Number on the localhost machine.
DatagramSocket(intport) • it creates a datagram socket and binds it with the given
Port Number.
DatagramSocket(intport, • it creates a datagram socket and binds it with the
InetAddress address) specified port number and host address.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• Datagrams: DatagramPacket class


• Java DatagramPacket is a message that can be sent or received.
• If you send multiple packet, it may arrive in any order.
• Additionally, packet delivery is not guaranteed.
Buffer for holding the incoming Number of
datagram. bytes to read.
• Constructor:
DatagramPacket(byte[] barr, int length) • It creates a datagram packet.
• This constructor is used to receive the packets.
DatagramPacket(byte[] barr, int length, InetAddress • It creates a datagram packet.
address, int port) • This constructor is used to send the packets.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

55
9/4/2023

Cont..

• Example of Sending DatagramPacket by DatagramSocket

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..

• Example of Receiving DatagramPacket by DatagramSocket

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari Unit – 2

56
9/4/2023

QUESTIONS
1. What is Internet? List and explain Internet Applications.

2. Explain Principles of Computer Applications.

3. Write a short note: E- Mail. OR Q. Explain Structure of Email.

4. Explain Working of E-mail.

5. Write a short note: Electronic Mail Protocols (SMTP and MIME).

6. Explain Components of SMTP.

7. Explain MIME Header.

8. Draw and explain Working Diagram of MIME Protocol.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

Cont..
9. Write a short note:POP3 and IMAP.

10. Write a short note: DNS and FTP.


11. What is DNS? List and explain types of DNS.

12. Write a short note: WWW and HTTP.

13. Explain Types of HTTP Connections.


14. Explain Request Line and Status line

15. Explain Socket Programming with TCP and UDP.


16. Difference Between:
1. FTP and TFTP
2. Persistent Connections and Non-Persistent Connections.
3. POP3 and IMAP.

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari Unit – 2

57
9/4/2023

Subject Overview

Unit No. Unit Title %


1 Introduction to Computer Networks and Internet 15

2 Application Layer 17
3 Transport Layer 25
4 Network Layer 25
5 The Link layer and Local area networks 18

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

New L J Institute of Engineering and Technology


(AICTE approved and GTU affiliated )

Prof. Bhaumik Gelani


Email id: bhaumik.gelani@ljku.edu.in
Mobile : +91 99092 49440
Unit – 2

Prof. Bhaumik Gelani & Prof. Shilpi Tiwari

58

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