✨ Internet communication process

This is the seventh day of my participation in the August More text Challenge. For details, see:August is more challenging.

👨🎓 By The Java Academic Party

🏦 repositories: Github, Gitee

✏️ blogs: CSDN, Nuggets, InfoQ, Cloud + Community

💌 Public account: Java Academic Party

🚫 special statement: the original is not easy, shall not be reproduced without authorization or plagiarism, if need to be reproduced can contact xiaobian authorization.

🙏 Copyright notice: some of the text or pictures in this article are from the Internet and Baidu Encyclopedia. If there is any infringement, please contact xiaobian as soon as possible. Wechat search public account Java Academic party contact xiaobian.

☠️ Daily poison chicken soup: different circles, do not have to melt.

👋 Hello everyone! I am your old friend Java academic party, today is Tanabata festival, I wish everyone happy Tanabata Festival a ~🤩🤩 today continue to share with you about the process of Internet communication, simple, quick to understand the principle. Internet means the Internet, also known as the Internet network, according to transliteration is also called the Internet (Internet), the Internet, is the network and network of the huge network. These networks are connected by a common set of protocols, forming a logically single and huge global network, in which there are switches, routers and other network equipment, a variety of different connection links, a variety of servers, and countless computers and terminals. Using the Internet, which can send information instantly to people thousands of miles away, is the foundation of the information society.

What is the Internet

The act of sharing files between two computers over a network is called Internet communication.

All files transferred over the network are in binary form.

Because the flow in the network can only be electromagnetic signals, electromagnetic signals only have positive and negative poles, 0101011010

2. Role division of Internet communication process

  1. Client computer: the computer used to send requests for resource files
  2. Server machine: the machine that receives the request and provides the corresponding resource file

3. Internet communication model

  1. C/S communication model:

    C,client software

    • The client software is specifically installed on the client computer

    • Helps client computers send requests to specified server computers for resource files

    • Helps the client computer to parse the binary data sent back by the server computer into

      [Words, numbers, pictures, videos, commands]

    S, server software

    • Server software is installed specifically on the server computer

    • The server is used to receive send requests from specific client software

    • Upon receiving the request, the server software automatically locates the resource file to be accessed on the server computer.

    • The server software automatically parses the located file content into binary data and sends it back over the network to the originators of the request

      On the client.

    Usage scenario: C/S communication model is widely used in individual entertainment market, such as [wechat, Taobao, JD, video]

    The corporate office space is relatively small.

    Advantages:

  • High security

  • Effectively reduce the working pressure of server computer

    Disadvantages:

  • Increases the service cost of customer acquisition

  • Updating is cumbersome

High concurrency solution under B/S communication: put several server computers. (money)

10. Interface functions

  • Specify the rules
  • Reduce coupling between class files in Java projects. To reduce maintenance costs

11. Differences between the JAVAEE specification and the Java ase specification

  • JAVASE: Refers to the syntax rules that need to be followed when Java classes are executed separately to process business separately.

    For example: inheritance, access rights, interface implementation, control statements, identifier naming…

  • Java EE: Java business development rules to follow.

    In business development rules, play often requires Java classes to communicate with different servers to solve the current business.

    Because Java needs to communicate with 13 different servers in commercial development, SUN is based on

    The 13 server characteristics specify 13 sets of interfaces, collectively referred to as the JAVAEE specification.

12. New Internet communication flow chart

FRM is a table file format in a database.

Mysql is based on the C/S architecture and cannot be accessed directly from a browser. Instead, you can use DOS Windows and Java classes (which can mimic client programs).

The HTTP server is used to connect to the browser. However, the HTTP server cannot access the table files in the database, which can only be accessed by the mysql database server.

13. Internal space of HTTP request protocol packets

HTTP is on demand

  1. According to the top-down division, divided into four Spaces

  2. Space division:

    Note:

    • The GET request mode requires the browser to keep our request parameters in the HTTP request header

    • The POST request mode requires the browser to keep our request parameters in the body of the HTTP request packet

    • In the browser, you can only see the request line and the request header, not the blank line and the request body.

    Request:

    Url: request address (http://192.168.100.2:8080/index.html)

    Method: Request mode (POST/GET)

    Request header:

    Request parameter information [GET]

    Blank lines:

    Without any content, it acts as an isolation between the request header and the request body.

    Request body:

Request parameter Information [POST]

14. Internal structure of the HTTP response protocol packet

  1. According to the top-down division, divided into four Spaces

  2. Space division:

    Note: The response header displays the following information: The text content in the response file has an HTML tag. If it is text, interpret it using UTF-8 encoding.

    Content-Type: text/html; charset=utf-8

    • ** Status line ** : [

      The HTTP status code

      ​ ]

    • ** Response header ** : [

      Content-type: specifies the browser uses the corresponding compiler,

      Compile the binary data of the response body [text, picture, video].

      ​ ]

    • Blank line: [

      Without any content, play a role of isolation

      ​ ]

    • Response body: [

      It may be the content of a static resource file being accessed

      It may be a static resource file command being accessed

      It may be the result of running an accessed dynamic resource file

      It’s all in binary.

      ​ ]

15. The server

A server is a resource file scheduler that is installed on the server computer. Each server specifically accepts a specific request protocol. Call management for specific files. The Mysql server that we learned earlier is a type of server that specifically manages calls to FRM files, which are table files.

16. HTTP server

  • The HTTP server is widely used in B/S communication mode.

  • An HTTP server is a type of server whose behavior is related to the HTTP protocol

  • The HTTP server can receive the HTTP request protocol from the browser and automatically parse the data in the request protocol packet.

  • After parsing, the accessed file is automatically located and the content of the located file is written to the HTTP response protocol packet.

  • Finally, it is responsible for pushing the HTTP response protocol packet back to the browser that initiated the request.

Note: Request packets sent over HTTP can only be received by the HTTP server.

17. Classification of HTTP servers

  • JBOSS server: Usually used with Tomcat binding, relatively primitive.
  • Glassfish Server: Free to use in any business application. (May replace Tomcat in the future)
  • Jetty Server: Is an HTTP server developed by Java Technology.
  • Weblogic server: an HTTP server developed by Oracle.
  • Webspere server: a server developed by IBM. Currently used in e-commerce.
  • Tomcat server: a core project of the Apache Software Foundation. Developed with Java technology.

Today to share here, tomorrow to continue to share with you, pay attention to do not get lost, we see tomorrow 😊. Search 🔍 wechat public number: Java academic party, 📭 send HTTP, free to send everyone project source code, code is tested by xiaobian 🔧, absolutely reliable, free to use.

—–💘 after watching the big guys can pay attention to xiaobian, will always update tips, free to share with you!! 💝 — — — — — –

———✨ daily wallpaper :(free), like what style of wallpaper can be private message xiaobian yo!! ✨ — — — — — — — —