Как работает протокол связи TCP/IP сервера последовательного порта

As we all know, the serial port server is a data communication device that converts the serial port into a TPC/IP network interface. So what is TCP/IP?

Although TCP/IP communication (and collecting data from TCP/IP devices) may seem intimidating at first glance, it is actually a very simple communication tool.

What is TCP/IP and where did it come from?

TCP/IP stands for “Transmission Control Protocol/Internet Protocol”. It is basically a network protocol that defines the details of how data is sent and received through network adapters, hubs, switches, industrial routers, and other network communication hardware. Its purpose is to interconnect government computer systems through a global fault-tolerant network. The Department of Defense network was opened to research institutions and eventually to the public to create what is now the Internet. The TCP/IP protocol has also been placed in the public domain , so any software company can develop network software based on the protocol. Since it is the main protocol used on the Internet and is in the public domain.

How does TCP/IP work?

The TCP/IP protocol is designed so that every computer or device on the network has a unique “IP address” (Internet Protocol address), and each IP address can open and communicate through up to 65535 different “ports” , to send and receive data. An IP address uniquely identifies a computer or device on a network, and a “port number” identifies a specific connection between one computer or device and another (that is, between two IP addresses). A TCP/IP “port” can be thought of as a dedicated two-way communication line, where the port number is used to identify a unique connection between two devices.

The protocols of the TCP/IP model have significant advantages: they operate independently of hardware and underlying software. These protocols are standardized and can be used in any situation, regardless of the operating system or device communicating over the network.

The protocol includes layers 3 and 4 of the OSI model. The transport and link layers are directly responsible for connecting two devices in the network. For example, IP addresses and Internet protocols are used to send data packets to the correct recipient. TCP, on the other hand, is responsible for establishing a connection between two devices and maintaining the connection for data transfer. If packet transmission fails, the protocol will attempt to resend the packet.

TCP/IP model

Since TCP/IP is just an umbrella term for the most important Internet protocols, the term is used in other instances as well. This is why there is also a reference model that governs TCP/IP. Similar to the OSI model, this model aims to map all aspects of network communication. However, the TCP/IP model consists of four different layers, while the OSI model has seven layers. The layers in the TCP/IP model are assigned various tasks and therefore protocols.

● Network access layer: This layer is included in the reference model, but no specific protocols are defined. In practice, the Ethernet (wired) and IEEE 802.11 (wireless) protocols are mainly used. The network access layer is used to link different subnets for applications, such as connecting a home Wi-Fi network to the Internet through a router.

● Internet layer: Internet protocols run on this layer and ensure that transmitted data reaches the correct destination. Packets are routed through the network by IP address.

● Transport layer: TCP is used for transport in the reference model. This protocol allows end-to-end communication, which means it is responsible for the connection between two devices. Along with TCP, UDP is also part of this layer.

● Application layer: The top layer controls communication between applications in the entire network. Protocols like HTTP and FTP are critical to the application layer. Email communication protocols such as POP or SMTP also run on this layer.

TCP/IP client and server connections

A TCP/IP connection works similar to a phone call, where someone has to initiate the connection by making a phone call. Someone on the other end of the connection must first listen for the call and then answer the call when it comes in. In TCP/IP communications, an IP address is similar to a phone number and a port number is similar to a phone number. The specific extension to which the call was answered. The “client” in a TCP/IP connection is the computer or device that “makes the call” and the “server” is the computer that “listens” for incoming calls. In other words, the client needs to know the IP address of any server it wants to connect to once the connection is established, and it also needs to know the port number through which it wants to send and receive data.

Once a connection over a TCP/IP port is established between a TCP/IP client and a TCP/IP server, data can be sent in either direction in exactly the same way as you would send it through any other type of port on your PC . Data (serial, parallel, etc.). The only difference is that the data is sent over the network. The connection between client and server remains open until the client or server terminates the connection (ie hangs up the phone). A very nice benefit of the TCP/IP protocol is that the low-level drivers that implement the sending and receiving of data perform error checking on all data, so you can be sure that any data you send or receive is error-free.

Свяжитесь с нами