Computer basics and web related knowledge points

Computer Basics

1. Operating system

1. What is a memory leak? What is a memory overflow? What is the difference between the two?

OutOfMemory-OOM: It means that your application's memory is no longer sufficient for normal use, and the stack has reached the maximum value set by the system, which leads to a crash. This is a description of the result.

Memory Leak: Refers to your application's failure to release resources in time after using resources, resulting in unnecessary resources being held in application memory. This is a state description.

1. What is a local area network, a wide area network?

1. Local area network

Local Area Network (Local Area Network), abbreviated as LAN, refers to a group of computers interconnected by multiple computers in a certain area. "A certain area" refers to the same office, the same building, the same company and the same school, etc., generally within a radius of several kilometers. LAN can realize files

Functions such as management, application software sharing, printer sharing, scanner sharing, workgroup scheduling, e-mail and fax communication services. The local area network is closed and can be composed of two computers in an office, or it can be composed of thousands of computers in a company.

2. WAN

Wide Area Network (Wide Area Network), abbreviated as WAN, is a collection of computer networks that span large and regional areas. Usually across provinces, cities, or even a country. The wide area network includes subnets of different sizes. The subnet can be a local area network or a small wide area network.

2. What does 10M broadband mean? What is the theoretical download speed?

First of all, we must understand the difference. The operator said 10M, the complete unit should be 10Mbps (bps: bit rate), and the download speed unit we are talking about is MB. Although they all read megabytes, they are not the same.

The conversion relationship between them is: 1MB=8×1Mbps, look at it another way: 1Mbps÷8=128KB, that is to say, the 10M broadband that operators call, the actual speed is 10Mbps÷8=1280KB, about 1.25MB.

3. What is an IP address?

IP address refers to Internet Protocol Address (English: Internet Protocol Address, also translated as Internet Protocol Address), which is the abbreviation of IP Address. The IP address is a unified address format provided by the IP protocol. It assigns a logical address to each network and each host on the Internet to shield the differences in physical addresses.

4. What is the division of OSI seven-layer network model?

5. What is the difference between TCP and UDP?

 

TCP

UDP

Whether to connect

Connection-oriented

Connection-oriented

Transmission reliability

reliable

Unreliable

Application occasion

Big amount of data

Little data

speed

slow

fast

Data sequence

Guarantee

do not guarantee

 

 

 

6. Which layer of protocol does HTTP belong to?

HTTP protocol is an application layer protocol

7. What is the difference between HTTP and HTTPS?

  1. In plaintext transmission, the data is unencrypted and the security is poor. The S (SSL+) data transmission process is encrypted and the security is better.
  • The HTTPS protocol requires a CA (Certificate Authority) to apply for a certificate. Generally, there are fewer free certificates, so a certain fee is required. Certificate authorities such as Symantec, Comodo, GoDaddy and GlobalSign etc.
  1. The page response speed is faster than S, mainly because the TCP three-way handshake is used to establish a connection. The client and server need to exchange 3 packets. In addition to the three TCP packets, HTTPS also adds 9 packets required for the ssl handshake, so a total of It is 12 packs.
  1. It uses a completely different connection method with s, and uses different ports. The former is 80 and the latter is 443.
  1. In fact, it is the HTTP protocol based on SSL/TLS, so it consumes more server resources than HTTP.

8. What is the difference between cookies and session?

the difference

Cookie and session are both methods or means used to save user status information

The main differences between the two are:

        1. Save location: cookie is saved on the client, session is saved on the server

        2. Security: cookie security is poor, session security is high

        3. Life cycle: Both will disappear after the browser is closed without setting conditions

        (You can set the cookie lifetime on the client side , or you can set the session lifetime on the server side )

         Relationship between the two --session by cookie achieved 

Note: If the client disables cookies , the session will not work (solution: re- URL , add ;JSESSIONID=<%=session.getId()%> after the URL )

9. What is the difference between HTTP get request and post request?

(1) On the client side, the Get method is to submit the data through the URL, and the data can be seen in the URL; the POST method, the data is placed in the HTML HEADER and submitted.

(2) The data submitted by GET method can only have a maximum of 1024 bytes, while POST has no such limitation.

(3) Security issues. As mentioned in (1), when using Get, the parameters will be displayed on the address bar, but Post will not. Therefore, if the data is Chinese data and non-sensitive data, then use get; if the data entered by the user is not Chinese characters and contains sensitive data, then it is better to use post.

(4) Safe and idempotent. The so-called safe means that the operation is used to obtain information rather than modify information. Idempotent means that multiple requests to the same URL should return the same result

10 How HTTPS works

We all know that HTTPS can encrypt information to prevent sensitive information from being obtained by a third party. Therefore, many banking websites or e-mail addresses and other services with higher security levels will use the HTTPS protocol.

1. The client initiates an HTTPS request

There is nothing to say about this, that is, the user enters an https URL in the browser, and then connects to port 443 of the server.

2. Server configuration

The server that adopts the HTTPS protocol must have a set of digital certificates, which can be made by yourself or applied to the organization. The difference is that the certificates issued by yourself need to be verified by the client before you can continue to access, while the certificate applied by a trusted company does not A prompt page will pop up (startssl is a good choice, with 1 year of free service).

This set of certificates is actually a pair of public and private keys. If you don’t understand the public key and the private key, you can imagine it as a key and a lock. It’s just that you are the only person in the world who has this key, and you can lock it. Give it to someone else, who can use this lock to lock important things, and then send it to you, because only you have this key, so only you can see what is locked by this lock.

3. Send the certificate

This certificate is actually a public key, it just contains a lot of information, such as the issuing authority of the certificate, expiration time and so on.

4. The client resolves the certificate

This part of the work is done by the client's TLS. First, it will verify whether the public key is valid, such as the issuing authority, expiration time, etc. If an abnormality is found, a warning box will pop up, indicating that there is a problem with the certificate.

If there is no problem with the certificate, then generate a random value, and then use the certificate to encrypt the random value, as mentioned above, lock the random value with a lock, so that unless you have a key, you cannot see the locked content.

5. Transmit encrypted information

This part of the transmission is the random value encrypted with the certificate, the purpose is to let the server get this random value, and the communication between the client and the server can be encrypted and decrypted through this random value.

6. The server decrypts the information

After the server decrypts with the private key, it obtains the random value (private key) passed by the client, and then encrypts the content symmetrically through this value. The so-called symmetric encryption is to mix the information and the private key through a certain algorithm. In this way, unless the private key is known, the content cannot be obtained, and it happens that both the client and the server know the private key, so as long as the encryption algorithm is strong enough and the private key is complex enough, the data is safe enough.

7. Transmission of encrypted information

This part of the information is the information encrypted by the private key of the service segment and can be restored on the client.

8. The client decrypts the information

The client uses the previously generated private key to decrypt the information transmitted from the service segment, and then obtains the decrypted content. Even if the third party listens to the data during the whole process, it is helpless.

11 Type the URL in the browser address bar, then press Enter to go through the following process:

1. The browser requests the DNS server to resolve the IP address corresponding to the domain name in the URL;

2. After the IP address is resolved, establish a TCP connection with the server based on the IP address and the default port 80 ;

3. The browser sends an HTTP request to read the file (the file corresponding to the domain name in the URL), and the request message is  sent to the server as the data of the third message in the TCP three-way handshake ;

4. The server responds to the browser request and sends the corresponding html text to the browser;

5. Release the  TCP connection ;

6. The browser will display the html text and content;

12 HTTP status code

The status code consists of three digits. The first digit defines the response category, which is divided into five categories:

1xx: Indication information-indicates that the request has been received, continue processing

2xx: Success-indicates that the request has been successfully received, understood, and accepted

3xx: Redirect-further action must be taken to complete the request

4xx: Client error-the request has a syntax error or the request cannot be fulfilled

5xx: server-side error-the server failed to fulfill a legal request

Common status codes:

200 OK //Client request is successful

400 Bad Request //The client request has a syntax error and cannot be understood by the server

401 Unauthorized //The request is unauthorized. This status code must be used with the WWW-Authenticate header field

403 Forbidden //The server received the request, but refused to provide service 4

04 Not Found //The requested resource does not exist, eg: the wrong URL is entered

500 Internal Server Error //An unexpected error occurred on the server

503 Server Unavailable //The server is currently unable to process the client's request and may return to normal after a period of time

More status codes http://www.runoob.com/http/http-status-codes.html

Guess you like

Origin blog.csdn.net/yipianfeng_ye/article/details/102928781