Chapter 2 Application Layer

Chapter 2 Application Layer

1. Application layer protocol principle:

  • C/S
  • P2P
  • C/S and p2p hybrid

2. Two major services at the application layer:

  • TCP service: connection-oriented and reliable data transmission
  • UDP service: connectionless, unreliable transmission

3. Application layer protocol classification: (the following three are all TCP connections)

  • Web's HTTP protocol:
    HTTP's two types of connections (persistent and non-persistent),
    HTTP's two types of messages (request messages, response messages),
    Cookies technology,
    web caching technology
  • FTP protocol for file transfer: FTP process
  • E-mail protocol: mail sending protocol (SMTP protocol-MIME protocol) and mail access protocol (POP3 protocol)

4. DNS introduction: two kinds of queries (recursive, iterative)
5. P2P application




1. Application layer protocol principle

1. The application layer is the application you touch most frequently, such as: email, Web, P2P, remote login, real-time video conferencing, etc.

2. The core of developing web applications: write programs that can run on different end systems and communicate with each other through the network.
For example, if you want to develop a web service, you need web server software and browser software to communicate

3. No application software runs on the core equipment of the network
(that is, there is no application layer on routers and switches. This design method promotes the development of applications, because you only need to consider the same layer of communication. )

4. Network application program architecture:

  • Client/server architecture
  • P2P architecture
  • Client/server and P2P hybrid architecture

5. Client/Server Architecture
Server:

  • Always open host
  • Have a fixed, well-known IP address
  • Host clusters are often used to create powerful virtual servers

Client computer:

  • Communicate with the server
  • Can be connected to the server intermittently and can have a dynamic IP address
  • Clients do not communicate directly with each other

6. Pure P2P architecture

  • There is no always open server
  • Any pair of hosts communicate directly with each other
  • The peer is connected intermittently and can change the IP address, for example: Gnutella
  • Advantages: self-scalability
  • Disadvantages: difficult to manage

7. Client/server and P2P hybrid architecture:
instant messaging:

  • P2P between two chat users
  • Register and query through the server
  • Register on the central server when users go online
  • The user contacts the central server to find an online partner

Napster.

  • Files are exchanged directly between peers
  • File search through the server
  • Central server records peer content
  • The peer queries the central server to determine the required file location

8. Process communication

  • Process: A program running in the end system
  • Two processes on the same host communicate through the internal process communication mechanism
  • Processes on different hosts communicate with each other by exchanging messages

Client process: the process that initiates communication; server process: the process waiting for contact

  • Note: The application with P2P architecture has both client process and server process.
    Insert picture description here
    Insert picture description here
    Insert picture description here
    Insert picture description here
    Insert picture description here
    Insert picture description here
    Insert picture description here
    Insert picture description here
    9. Application layer protocol
    Insert picture description here
    Insert picture description here
    Insert picture description here
    10. Two major services:
    Insert picture description here
    Insert picture description here
    Insert picture description here



2. HTTP overview

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here




3. Non-persistent connection and persistent connection

1. Two HTTP connections
Insert picture description here
2. Non-persistent connection
Insert picture description here
Insert picture description here
Insert picture description here
3. Response time model
Insert picture description here
Insert picture description here
3. Persistent HTTP connection

Insert picture description here




4. HTTP message format

1. HTTP two types of messages
Insert picture description here
2. HTTP request message
Insert picture description here
Insert picture description here
3. Request method type
Insert picture description here
Insert picture description here
4. HTTP response message format
Insert picture description here
Insert picture description here




5. Interaction between user and server: cookies

Insert picture description here
Traditional HTTP cannot satisfy high-speed interaction, so cookies are used
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here




6.web cache

1. The concept of
Insert picture description here
Insert picture description here
Insert picture description here
web caching 2. Examples of web caching

Insert picture description here
Solution 1:
Insert picture description here
Solution 2:
Insert picture description here
3. Conditional get method

Insert picture description here
Insert picture description here




7. File transfer protocol


1. Process
Insert picture description here
Insert picture description here
2. Data establishment mode
Insert picture description here
3. Data transmission mode
Insert picture description here




8. SMTP protocol

1. Three major components
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
2. Mail sending protocol SMTP
Insert picture description here

Insert picture description here
Insert picture description here
Insert picture description here




9. Mail message format and MIME

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
The above is how you actually use SMTP to send mail




10. Mail access agreement

The mail sending protocol is sending mail, and the mail access protocol is receiving mail.
Insert picture description here
Insert picture description here
Insert picture description here
Operation example:
Insert picture description here
Insert picture description here




11. DNS system introduction

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

  • Each host needs to be configured with a local DNS server in order to access the Internet normally
  • When the host sends a DNS request, the request is sent to the local DNS server

12. DNS working mechanism

1. DNS query method 2.
Insert picture description here
Insert picture description here
DNS cache

3. DNS record
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
4. DNS protocol
Insert picture description here

Insert picture description here
Insert picture description here
5. DNS security issues
Insert picture description here




P2P application

Restudy! ! !

Guess you like

Origin blog.csdn.net/weixin_45014721/article/details/111563009