This is the 16th day of my participation in the August More Text Challenge

 

What are the seven layers of the OSI model

Physical layer: the transmission medium is used to provide physical connection for the data link layer to realize the transparent transmission of bitstream.

Data link layer: Receives bitstream data from the physical layer, encapsulates it into frames, and transmits it to the upper layer

Network layer: the network address is translated into the corresponding physical address, and the routing algorithm is used to select the most appropriate path for the packet to pass through the communication subnet.

Transport layer: Provides reliable and transparent data transfer between source and destination

Session layer: Responsible for establishing, maintaining, and terminating communication between two nodes in the network

Presentation layer: dealing with the presentation of user information, data encoding, compression and decompression, data encryption and decryption

Application layer: Provides network communication services for user application processes

 

The difference between HTTP long and short connections

Short connections are used by default in HTTP/1.0. That is, each time the client and server perform an HTTP operation, a connection is established and broken at the end of the task. From HTTP/1.1 onwards, long connections are used by default to preserve the connection feature. What is TCP sticky/unpack? What causes it? Solution A complete service may be divided into multiple packets and sent by TCP, or multiple small packets may be encapsulated into one large packet and sent. This is the problem of TCP packet unpacking and sticky packets.

The reason:

  1. The size of bytes written by the application is greater than the size of the socket send buffer.
  2. Perform TCP segmentation of MSS size. (MSS=TCP packet segment length -TCP header length)
  3. Ethernet payload is larger than MTU for IP fragmentation. (MTU refers to the maximum size of packets that can pass through a layer of a communication protocol.)

Solution:

  1. Message length fixed.
  2. Special characters such as carriage return or space characters are added to the end of the package for segmentation
  3. Divide messages into headers and tails.
  4. Use other complex protocols such as RTMP.