Windows Socket Network Programming (1)

xiaoxiao2021-03-06  45

? Source: http: //www.vckbase.com/document/viewdoc/ id = 472Windows Socket network programming (a) - TCP / IP architecture, features and related terms Author: Kitty freezing studio

First, TCP / IP architecture and characteristics

1, TCP / IP architecture

The TCP / IP protocol is actually a complete set of network protocols on the physical website. Where TCP is a transport layer service, and IP is a network layer service. TCP / IP includes the following agreement: (Structure is shown in Figure 1.1)

(Figure 1.1)

IP: Internet Protocol is responsible for the route between the host data and the storage of data on the network. At the same time, ICMP, TCP, and UDP provide packet sending services. User processes usually do not need to involve this layer.

ARP: Address Resolution Protocol

This protocol maps the network address to the hardware address.

RARP: Reverse Address Resolution Protocol

This protocol maps the hardware address to the network address

ICMP: Internet Control Message Protocol

This protocol processes errors and transmission controls for the signals and hosts.

TCP: Transmission Control Protocol

This is a protocol that provides a reliable full-duplex byte flow of the user process. It is necessary to provide a virtual circuit service for the user process and establish an inspection for the data reliable transmission. (Note: Most network user programs use TCP)

UDP: User Dataset Agreement (User DataGram Protocol)

This is a connection protocol that provides the user's process for transmitting data without performing the correctness check.

FTP: File Transfer Protocol (File Transfer Protocol)

Allows users to communicate with another host with the way of file operation (file increase, deletion, changing, check, transfer, etc.).

SMTP: Simple Mail Transfer Protocol

The SMTP protocol transmits an email between the system.

Telnet: Terminal ProTol

Allow users to access remote hosts in virtually ending

HTTP: Hypertext Transfer ProTol

TFTP: Simple File Transfer ProtoCol, TRIVIAL FILE

2, TCP / IP Features

The core part of the TCP / IP protocol is the Transport Layer Protocol (TCP, UDP), Network Layer Protocol (IP), and physical interface layers, which are usually implemented in the operating system core. Therefore, the user is generally not involved. When programming, there are two forms of programming interface: 1. System calls directly provided by the internal core; Second, use various functions provided in library function. The former is realized in the nuclear, and the latter is realized by the nuclear. User Services To be implemented through an approved application, it is implemented using a socket.

Figure 1.2 is a diagram of the core and application of TCP / IP protocol.

(Figure 1.2)

Second, special terms

1, socket

It is the basic component of the network. It is a communication endpoint that can be named and addressed. Each socket in use has its type and one to listen to it. The socket is present in the communication area (communication area also known as the address cluster). Sockets are only swapped with sockets in the same area (when cross-zone, you need to perform a sum of the conversion processes). The socket in Windows only supports a domain-internet domain. Sockets have types.

Windows Socket 1.1 version supports two sockets: stream sleeve (SOCK_STREAM) and data sets (SOCK_DGRAM)

2, Windows Sockets implements a Windows Sockets implementation refers to a set of software that implements all features described in the Windows Sockets specification. Generally, 3, blocking hook, blocking hooks) are Windows Sockets to support blocking sockets, to support blocking socket function calls.

4, multiple access broadcasts (multicast, multi-point transfer or multicast) is a one-to-many transmission mode, transferring information to a set of recipients through a transmission, unicast and broadcasting (Broadcast) corresponds.

转载请注明原文地址:https://www.9cbs.com/read-55412.html

New Post(0)