The Internet provides many services, including WWW (Web service), FTP (file transfer), E-mail (E-mail), Telnet (remote login), and so on. Because WWW is to use a browser to access the web page service, so in the previous site’s home page before the domain name is the need to add WWW. With the increase of website service type, different secondary or tertiary domain name corresponding to different business, and business processing tasks will be assigned to multiple servers, so, no longer need to use WWW to mark the home page, many sites will also do DNS resolution WWW, the reason is to respect user habits. (Foreign websites rarely use WWW to mark their homepage github).

WWW protocol -> Web service Protocol

DNS Resolution DNS: Domain Name Server Functions: Domain Name Server features: The DNS stores a table of Domain names and CORRESPONDING IP addresses. One Domain Name can correspond to only one IP address, and one IP address can correspond to multiple Domain names

GTLD: generic top-level DNS Server Indicates all the.com and.net…… DNS servers Suffix does domain name resolution server

Description: Internet Protocol Address assigned to users for accessing the Internet category: IPv4 IPv6 format: 192.168.0.1 (32-bit (4 bytes) in decimal notation) (IPv4) (0-255 x 4)

V: version The advantages of IPv6 are as follows: 1. The IPv6 address space is larger (8 groups (128 bits), hexadecimal) 2. Smaller routing table 3. Enhanced multicast and flow support 4. Support for automatic configuration 5. Higher security 6. For example: the ABCD: EF01:2345-6789: the ABCD: EF01:2345, 6789 (4 * 8)

IP PORT Number PORT a PORT number corresponds to a service on a server. Accessing different ports on a server means accessing different services. The default HTTP port is 80, HTTPS port is 443, and FTP port is 20/21

TCP

TCP:Transmission Control Protocol

Features: Connection-oriented (reliable connections must be established before sending and receiving data)

The foundation for establishing a connection: three handshakes

Application scenario: Data must be sent and received accurately

HTTP requests, FTP file transfer, and email sending and receiving

Advantages: stability, retransmission mechanism, congestion control mechanism, disconnection

Disadvantages: Slow, inefficient, resource-intensive, vulnerable to attack (three-way handshake -> DOS/DDOS attacks)

TCP/IP protocol group: provides the point-to-point connection mechanism and sets standards for data encapsulation, addressing, transmission, routing, and data reception

UDP

Features: Connectionless (unreliable protocol, stateless transport mechanism) connectionless message sending mechanism

Application scenario: High speed and complete information are not required to ensure communication quality

Message sending and receiving, voice calling, live broadcasting (QQ)

Advantages: Secure, fast, and less vulnerability (UDP flood attacks)

Disadvantages: unreliable, unstable, easy to lose packets

Conclusion: As long as the destination source address, port number, address, and port number are determined, information packets can be directly sent, but complete data cannot be guaranteed to be received.

HTTP and HTTPS

HTTP: HyperText Transfer Protocol

Definition: a standard for client and server requests and responses, a transport protocol used to transfer hypertext from a WEB server to a local browser.

HTTP request: a request first sent to the WEB server for hypertext transmission to the local browser according to protocol rules

HTTPS: HyperText Transfer Protocol Secure

Definition: SECURE version of HTTP (security based on SSL/TLS)

SSL: Secure Sockets Layer

TLS: Transport Layer Security Transport Layer Security

A secure protocol that provides security and data integrity for network communications and encrypts network connections

Differences between HTTP and HTTPS

1.HTTP is insecure (listening and man-in-the-middle attacks are used to obtain website account information and sensitive information). HTTPS can prevent attacks. Neither the client nor the server can verify the identity of the other. 3. All data transmitted over HTTPS is encrypted by SSL or TLS and runs over SSL or TLS, which ensures secure data transmission.

Three-way handshake before TCP connection

1. First handshake: The client sends a TCP packet to the server. In the packet, the SYN flag is 1 and the initial sequence number of the client ISN (or SEQ) is specified. The client is in the SYN_Send state.

2. Second handshake: After receiving a SYN packet from the client, the server also sends a TCP packet (setting the SYN and ACK to 1), and specifies its initial SEQUENCE ISN(which is also a random sequence number). The ISN + 1 of the client is used as the ACK sequence number, indicating that the server has received the SYN from the client. The server is in the SYN_REVD state.

Third handshake: After receiving a SYN packet, the client sends an ACK packet. Similarly, the ISN + 1 of the server is used as an ACK value to indicate that the client has received a SYN packet from the server. In this case, the client is in the Establised state.

4. After receiving the ACK message, the server is also in establised state, at this point, both parties establish a link.

ACK=1, confirm that the serial number is valid; SYN=1, the connection is new; FIN=1. End the connection