This is the first day of my participation in Gwen Challenge

TCL/IP protocol family

The network we use is based on the TCP/IP protocol family. HTTP is a subset of that.

Protocol concept: for computers and network devices to communicate with each other, they must be based on the same method. For example. How to detect the communication target, which side initiates the communication first, which language is used for communication, and how to end the communication need to be determined in advance. We call these rules agreements.

TCP/IP is the general name of various protocol families related to the Internet

TCP/IP layer

It is mainly divided into four layers:

  • The application layer
  • The transport layer
  • The network layer
  • Data link layer

The benefits of layering are:

When the protocol needs to be changed, it only needs to replace the changed layer, and the interior of each layer can be designed freely without considering the influence of other parts.

The application layer

Determines the service that communicates when the service is provided to the user.

Typical protocols are:

  • FTP(File Transfer Protocol, file Transfer protocol)
  • DNS(Domain Name System, domain name System)
  • HTTP

The transport layer

Provides data transfer between two computers in a network connection

Typical protocols are:

  • TCP(Transmission Control Protocol, Transmission Control Protocol)
  • UDP(User Data Protocol, User datagram Protocol)

The network layer

Used to process packets of data as they flow across the network.

Packet: refers to the smallest unit of data transmitted over the network.

This layer defines the path to the other computer and the packet to the other computer.

The link layer

Used to handle the part of the hardware connected to the network. Hardware categories are within the scope of the link layer.

TCP/IP protocol

Internet Protocol (IP) is located at the network layer by layer. Some people may confuse IP with IP address. IP is actually the name of a Protocol.

It is used to send various data packets to the peer party. To ensure that data packets are actually transmitted to the peer party, two conditions are met: IP Address and MAC Address.

IP address: Specifies the IP address assigned to a node

MAC address: fixed IP address of the NIC

The communication between IP addresses depends on MAC addresses. During data transmission, the MAC address of the next station device is used to search for the next secondary school target. In this case, THE ARP protocol is used.

TCP protocol

Hierarchically located in the transport layer to provide reliable byte stream service.

Byte stream service: Manages packets by dividing large chunks of data into packet segments

Reliable transport service – three – way handshake strategy

To ensure secure and reliable data transfer to the other party, the three-way handshake policy is adopted.

  1. The sender first sends a packet with the SYB flag to the peer.
  2. The receiver sends back a message withSYN/ACKFlag a packet to confirm communication.
  3. After the message is sent, the sender sends back a tapeACKFlag for the packet that represents the end of the handshake.

Of course, TCP has other means of ensuring reliable communication besides the three-way handshake.

DNS service

Located at the application layer, it provides resolution services between IP addresses and domain names.

For example, we often use www.baidu.com to visit Baidu, but the computer can not understand such a domain name, the need to resolve the domain name into 180.76.76.76 such IP address form

Association between protocols

URI

Let’s start with the full names of these two words

  • URI(Uniform Resource Identifier) : Uniform Resource Identifier (URI)
  • URL(Uniform Resource Locator) : Uniform resource locator

A URI is a location identifier for a resource represented by a protocol scheme. To understand this sentence, break it down into three parts:

  • A protocol scheme: For example, if HTTP is used, the protocol scheme is HTTPftp,telnet,fileAnd so on.
  • Resources: the text, images, etc that we want to access
  • Location identifier: is a string of characters, such aswww.baidu.com