Application services

Download Report

Transcript Application services

Applications Layer Functionality
& Protocols
2017/4/6
1
Human Generates Data
2017/4/6
2
Convert communication to digital
format
2017/4/6
3
Application layer initiate data transfer
2017/4/6
4
OSI vs TCP/IP
2017/4/6
Application
Protocols
5
Well-known TCP/IP Application
Layer Protocols
2017/4/6
6
Who is in charge of TCP/IP protocols?
• IETF (Internet Engineering Task Force)
• Protocol forming process
– Proposal
– Internet Draft
– RFC (Requests for Comments)
• Example, RFC 2616 (Hypertext Transfer Protocol,
HTTP/1.1)
2017/4/6
7
Application layer software
• Two forms of software programs or
processes that provide access to the network:
– Applications
– Services
2017/4/6
8
Application Layer Software
• Application Programs
– Network-aware
• can communicate directly with the lower layers of
the protocol stack.
– Email clients, like Outlook Express
– Web browser, like Internet Explorer
– Non network-aware
• Excel, word, etc
2017/4/6
9
Application Layer Software
• Application Services
– Provide assistance to non network-aware
Application layer programs to use network
resources
• like file transfer or network print spooling.
– These services are the programs that interface
with the network and prepare the data for
transfer.
2017/4/6
10
Summary
• Application layer 就是由很多 Application
programs 與 Application services 等程式
(or processes) 所組成
• 而所謂 Application layer protocols 則實作
於上述 Application programs 與
Application services 等程式中
2017/4/6
11
Applications 與 Services 關係
• Applications provide the user interface
• Services follow protocols to prepare data
for the network
2017/4/6
12
Processes running in Windows OS
2017/4/6
13
補充
• svchost.exe
– 是從動態連結程式庫 (DLL) 執行之服務的一
般性主處理程序名稱
– 當電腦啟動時, svchost.exe 會檢查登錄中的
服務部分,以建立一份它需要載入的服務清
單。
– 多個 svchost.exe 可以同時執行,且每一個
svchost.exe 工作階段都可以包含一組服務。
2017/4/6
14
More on svchost.exe …
• Some time ago, Microsoft started moving all of
the functionality from internal Windows services
into .dll files instead of .exe files.
– From a programming perspective this makes more
sense for reusability…
– but the problem is that you can't launch a .dll file
directly from Windows, it has to be loaded up from a
running executable (.exe).
– Thus the svchost.exe process was born.
2017/4/6
15
Application layer protocol functions
• Application layer protocols are used by both
the source and destination devices during a
communication session
• In order for the communications to be
successful, the application layer protocols
implemented on the source and destination
host must match
2017/4/6
16
Application layer protocols
• Many different types of applications
communicate across data networks.
– Therefore, Application layer services must
implement multiple protocols to provide the
desired range of communication experiences.
– Each protocol has a specific purpose and
contains the characteristics required to meet
that purpose.
2017/4/6
17
Accessing remote information
• Modes of interaction
– Client-server model
– Peer-to-peer model
2017/4/6
18
The Client/Server model
• In the client/server model, the device
requesting the information is called a client
and the device responding to the request is
called a server.
• Client and server processes are considered
to be in the Application layer.
2017/4/6
19
Server
• Server runs a service, or process, sometimes called
a server daemon.
– Like most services, daemons typically run in the
background and are not under an end user's direct
control.
– Daemons are described as “listening” for a request from
a client, because they are programmed to respond
whenever the server receives a request for the service
provided by the daemon.
2017/4/6
20
2017/4/6
21
Peer-to-peer model
• Peer-to-peer networks
• Peer-to-peer applications
2017/4/6
22
Peer-to-peer networks
The roles of client and server
are set on a per request basis.
2017/4/6
23
Peer-to-peer applications
A device to act as both a client and a server
within the same communication
2017/4/6
24
Application Layer Protocol Examples
•
•
•
•
•
•
•
2017/4/6
DNS services & protocol
WWW services & HTTP
Email services & SMTP/POP protocols
FTP
DHCP
File sharing services & SMB protocol
Telnet
25
Application Layer
Protocols/Services & Port number
• Domain Name System (DNS) - TCP/UDP Port 53
• Hypertext Transfer Protocol (HTTP) - TCP Port 80
• Mail
– Simple Mail Transfer Protocol (SMTP) - TCP Port 25
– Post Office Protocol (POP) - UDP Port 110
• File Transfer Protocol (FTP)
– TCP Ports 20 and 21
• Dynamic Host Configuration Protocol - UDP Port 67
• SMB – 445
• Telnet - TCP Port 23
2017/4/6
26
DNS Protocol Procedure
2017/4/6
27
DNS Protocol Procedure
2017/4/6
28
Hierarchy of DNS Servers
2017/4/6
29
nslookup demo
• Name Server Lookup
2017/4/6
30
DNS Queries
• Recursive Queries
• Iterative (non-recursive) Queries
• Inverse Queries (obsolete)
2017/4/6
31
Resolver program or library
• Resolver 解析器
• Located on each host and provides a means
of translating a users request for, say,
www.thing.com into one or more queries to
DNS servers using UDP (or TCP) protocols
2017/4/6
32
Recursive Queries
1. Resolver  DNS server (www.test.com?)
2. DNS server found no answer
3. DNS  sends query to a root-server (www.test.com?)
4. The root-server replies with a “referral” to .com DNS
5. DNS  sends query to .com DNS
6. .com DNS replies with a referral to test.com DNS
7. DNS  sends query to test.com DNS
8. test.com DNS  DNS
9. DNS send response to original client resolver
2017/4/6
33
Iterative (non-recursive) Queries
1. Resolver  DNS server (www.test.com?)
2. DNS server found no answer
3. DNS  sends referral info (root-server)  Resolver
4. Resolver  root-server
5. Root server  resolver (referral info of .com server)
6. Resolver  .com server
7. …. (well, you get the picture …)
The resolver on Windows and most *nix systems is a stub resolver,
a minimal resolver which cannot follow referrals.
If you reconfigure your local PC or Workstation to point to a DNS server
that only supports Iterative queries - it will not work.
2017/4/6
34
HTTP
2017/4/6
35
HTTP message types
• The three common message types are
– GET
• a client request for data
• A web browser sends the GET message to request
pages from a web server
– POST, PUT
• send messages that upload data to the web server
2017/4/6
36
GET vs POST
• The HTML specifications technically define
the difference between "GET" and
"POST" so that
– GET means that form data is to be encoded (by
a browser) into a URL
– POST means that the form data is to appear
within a message body.
2017/4/6
37
Email related processes
• Mail User Agent (MUA)
– e-mail client
• like outlook express, etc
• Two processes of e-mail server
– Mail Transfer Agent (MTA)
– Mail Delivery Agent (MDA)
2017/4/6
38
Email related processes
2017/4/6
39
FTP
• To successfully transfer files, FTP requires
two connections between the client and
the server:
– one for commands and replies,
– the other for the actual file transfer.
2017/4/6
40
FTP
• The client establishes the first connection
to the server on TCP port 21.
– This connection is used for control traffic,
consisting of client commands and server
replies.
2017/4/6
41
FTP
• The client establishes the second
connection to the server over TCP port
20.
– This connection is for the actual file transfer
and is created every time there is a file
transferred.
2017/4/6
42
FTP
2017/4/6
43
DHCP
• The Dynamic Host Configuration Protocol
(DHCP) service enables devices on a
network to obtain IP addresses and other
information from a DHCP server.
– Like network mask, gateway, DNS, etc
2017/4/6
44
DHCP
2017/4/6
45
DHCP
2017/4/6
46
SMB
• The Server Message Block (SMB) is a
client/server file sharing protocol.
– IBM developed Server Message Block (SMB)
in the late 1980s
– to describe the structure of shared network
resources, such as directories, files, printers,
and serial ports.
– It is a request-response protocol.
2017/4/6
47
SMB
• Unlike the file sharing supported by FTP,
clients establish a long term connection to
servers.
• Once the connection is established, the user
of the client can access the resources on the
server as if the resource is local to the client
host.
2017/4/6
48
File sharing using SMB
2017/4/6
49
SMB & Microsoft
• SMB file-sharing and print services have
become the mainstay (支柱) of Microsoft
networking.
– In previous versions, the SMB services used a
non-TCP/IP protocol to implement name
resolution
– Beginning with Windows 2000, all subsequent
Microsoft products use DNS naming.
• This allows TCP/IP protocols to directly support
SMB resource sharing.
2017/4/6
50
SMB & Other OSs
• The LINUX and UNIX operating systems
also provide a method of sharing resources
with Microsoft networks using a version of
SMB called SAMBA.
• The Apple Macintosh operating systems
also support resource sharing using the
SMB protocol.
2017/4/6
51
Telnet services & protocol
• Long before desktop computers with sophisticated
graphical interfaces existed, people used textbased systems which were often just display
terminals physically attached to a central computer.
• Once networks were available, people needed a
way to remotely access the computer systems in
the same manner that they did with the directly
attached terminals
– Telnet was developed to meet that need.
2017/4/6
52
Telnet services & protocol
2017/4/6
53
Homework
• Verify what kind of DNS query your
resolver & DNS use
– Use WireShark
2017/4/6
54