In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article is to share with you what the basics of windows network programming are. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
I. computer network
A computer network is a collection of independent and autonomous computers connected to each other. The simplest form of network is as follows:
First of all, when computer An and computer B communicate, you must know what the IP address of both computers is, and then the port number, that is, which application you want to communicate with on the computer. The communication between the two computers cannot communicate as much as they want, and the two sides must agree to abide by the same communication protocol.
2. IP address
A. Each host in the IP network must have a unique IP address.
B, IP address is a logical address.
C. The IP address on the Internet is globally unique.
D, 32-bit, 4-byte, commonly used dotted decimal format.
III. Agreement
A, a rule, standard, or convention established for network communication.
B. Different layers have different protocols.
4. ISO/ OSI seven-layer reference model
The International Organization for Standardization (ISO) proposed a seven-layer reference model of OSI (Open System Interconnection). As shown in the following table:
PS:
A. OSI reference pattern is an abstract network reference model, which is only a division of functions.
B, when conducting a network communication, each layer provides the services of this layer for this communication, and direct communication is not allowed between the peer layers of the communication entities.
C. There is a strict one-way dependence between the layers.
D. The upper layer uses the services provided by the lower layer, and the lower layer provides services to the upper layer.
When two communication entities communicate, the data emitted by the application layer passes through the presentation layer, the session layer, the transport layer, the network layer, and the data link layer, and finally reaches the physical layer, where it is transmitted to the physical layer of another entity through the physical line. The data is then passed up in turn to the application layer of another entity.
5. Data encapsulation
To send data to another computer, one computer must first package the data. The process of packaging is called encapsulation. Encapsulation is to add a specific protocol header in front of the data. The picture is as follows:
6. TCP/IP model
Because of the complexity of OSI seven-layer reference model, TCP/IP model is widely used at present, which includes four layers: application layer, transport layer, network layer and network interface layer.
7. Port
The transport layer provides the ability of process communication. In order to identify the process in the communication entity, TCP/IP protocol puts forward the protocol port, which is called port for short.
A port is an abstract software architecture (including some data structures and Icano buffers). After the application establishes a link with a port through a system call, the data transmitted by the transport layer to the port is received by the corresponding process, and the data sent by the corresponding process to the transport layer is output through the port.
The port is represented by an integer identifier, that is, the port number. The port number is related to the protocol. The two protocols TCP and UDP of the TCP/IP transport layer are completely independent software modules, so their port numbers are independent of each other, that is to say, different network programs based on TCP and UDP protocols can have the same port number. The port is represented by a 16-digit number, and its range is reserved for predefined services with port numbers below 0such 65535 and 1024.
8. Sockets
Sockets exist in the communication area. The communication area, also known as address cluster, is an abstract concept that is mainly used to synthesize the common characteristics of processes that communicate through sockets. Sockets usually exchange data only with sockets in the same area. Windows sockets supports only one communication area: the internetwork domain AF_INET, which is used by processes that communicate using the Internet protocol suite.
IX. Network byte order
In order to ensure the correctness of the data, the network byte order needs to be specified in the network protocol. TCP/IP protocol uses the high-order pre-memory format of 16-bit integers and 32-bit integers. Because different computers store data bytes in different order, after the sender sends the data, even if the receiver receives the data, it may not be able to view the received data. Therefore, when communicating between different hosts in the network, the network byte order should be adopted uniformly.
Thank you for reading! This is the end of this article on "what are the basic knowledge of windows network programming". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.