OSI seven-layer network model simple tutorial

If you read computer science, or studied communications network, then you must have heard of the OSI model, it has many times let you headaches. OSI is Open System Interconnection acronym, translated as "Open Systems Interconnection."

OSI model divides network communications into seven working layers, from bottom to top are a physical layer, data link layer, network layer, transport layer, session layer, presentation layer and application layer.

OSI existed only in a conceptual and theoretical model, its disadvantage is too hierarchical, increasing the complexity of the network to work, so there is no large-scale applications. Later, people OSI has been simplified, consolidated a number of layers, eventually leaving only the four layers, from bottom to top are the interface layer, network layer, transport layer and application layer, which is the famous TCP / IP model.
 

Comparison of the OSI network model and TCP / IP four-layer network model
Comparison of the OSI network model and TCP / IP four-layer network model: FIG 1


The network model is actually doing it? Briefly data is encapsulated.

Program (or software) that we normally use to access the network is generally through the application layer, the data generated by the program will transfer down layer by layer, until the final network interface layer, it is sent through the network cable to the Internet go up . Each layer of data to go down, it will be an additional layer of packaging this layer protocol, until sent to the Internet, it has been more than four packaging than the original data. Process the entire data package like a Russian doll.

When another computer receives the packet, it will then transmit one level up from the network interface layer, transport layer to open each package layer, until the final application layer, to obtain the most primitive data, this is the data you want to use.

Plus the packaging process to the data, the data is actually in the head increased a sign (a data block), represents the data after this one, I've dealt with before. Unpacking the data of the process is reversed, is to remove the flag data of the head, it gradually show his true colors.

You see, a data transmission over the Internet just how complicated yes ah, we do not feel that this place is powerful network model. We only need to call a function in your code, you can let the network layer below all the work for us.

We are talking about  socket  programming, is standing on the underlying transport layer, so you can use TCP / UDP protocol, but can not do such a thing, "visit page" because http protocol to access web pages require the application layer.

When two computers communicate, you must comply with the following principles:

  • It must be the same level of communication, for example, transport layer and application layer B A computer can not communicate on the computer, because they would not in a hierarchical unpacking, data encountered problems.
  • Function of each layer must be the same, that is to have the exact same network model. If the network model is different, that does not messed up, who do not know who.
  • Data transfer can only step by step, not thermocline.
  • Each layer can use the services provided by the lower layer, and provide services to the upper layer.

Guess you like

Origin blog.csdn.net/Qsir/article/details/93738098