TCP/IP network Programming learning Note _4--osi seven-layer network model

Source: Internet
Author: User

This section summarizes the overall framework of network communication and its underlying process.

    • We have learned about the creation and application of sockets, in fact, we are only using sockets this tool, the underlying details of which we are shielded. To complete the data transmission through the Internet, in fact, not only software can be solved, but also need to build hardware systems. Therefore, in order to solve this problem, many experts gathered together, these people are hardware, systems, routing algorithms and other fields of the top experts. They divide the network communication into many modules, and through the hierarchical structure, divide the big problem into several small problems. Each layer has a set of well-defined communication standards (protocols) that are transferred from top to bottom and from bottom to top in this hierarchy. The example diagram is as follows (OSI layer Seven Network model):
    • TCP/IP stack: the protocol stack used in data communication is divided into 7 layers, but the TCP/IP protocol stack is only 4 layers, and this series of tutorials is mainly about TCP/IP protocol. For programmers, mastering the 4-tier protocol stack is sufficient. They include: link layer, network layer, Transport layer, application layer.
      1, Link layer: Network card and other hardware devices and drivers, specifically defined Lan,wan,man and other network standards.
      2, Network layer: Also called IP layer, the path of data transmission selection. The IP itself is a message-oriented, unreliable protocol. Each time the data is transferred, it will help us select the path, but not the same. If a path error occurs in the transmission, a different path is selected, but it cannot be resolved if data loss or error occurs. In other words, the IP protocol cannot handle data errors.
      3, the Transport layer: the TCP/UDP layer, which exists on the IP layer, determines the data transmission between the host. If the TCP protocol is confirmed, reliability is given to the unreliable IP protocol. TCP sends each data to and from the receiving end, and if the receiving side confirms that it sends the next data, it will resend it.
      4, Application layer: The socket communication process is automatically processed, such as the above transmission path selection, data validation process, etc. are hidden inside the socket. In short, for us, sockets are the tools that are provided to us, and we only need to use sockets to program them. In the process of writing software, it is necessary to determine the data transfer rules between the service and customer base according to the program characteristics, which is the application layer protocol. most of the content of network programming is to design and implement application layer protocol. such as: Hypertext Transfer Protocol HTTP, Mail delivery protocol SMTP and so on.
      Note: The application layer is provided to our programmers to design the protocol according to the requirements of the project, that is, the other layer has defined the various data transmission standards to choose from (such as the transport layer of TCP and UDP protocol selection), the application layer is based on the other layer of protocol, select the appropriate rules to write the protocol. That is, we often say that we implement the network communication framework.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

TCP/IP network Programming learning Note _4--osi seven-layer network model

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.