current position：Home>On network protocol - Introduction
On network protocol - Introduction
2022-02-03 00:40:11 【If white】
This paper discusses the introduction knowledge of network protocol from the perspective of developers , If you can have a good understanding of network protocols , So it is also very helpful for daily development .
1. TCP agreement
TCP - Transmission Control Protocol It's a kind of Connection oriented 、 reliable 、 Transport layer communication protocol based on byte stream , The main function is to ensure the reliability and integrity of data , To prevent packet loss . The control mode （ Packet number 、 Packet encapsulation 、 Transmission confirmation mechanism 、 Packet loss retransmission mechanism ）. Details refer to
2. IP agreement
IP-Internet Protocol agreement .IP The protocol is used to realize the data transmission between devices across LAN , You can get and define IP Address , Confirm whether the device crosses the network according to the subnet mask .
It provides a method of two-way communication between applications on different hosts in the network , Connect the application , Downlink network protocol , There is a set of TCP/IP Interface to protocol . stay unix perhaps linux In the system ,Socket It's just a file descriptor . Common programming methods ：
1、socket() 2、bind() 3、listen()、connect() 4、accept() 5、read()、write() 6、close() Copy code
4. Http A long connection , Short connection
A long connection ： Repeated use tcp Three handshakes , The connection between four waves transmits data (http 1.1, Connection:keep-alive). For example, visit Baidu .
keep-alive How does it work ？ Actually Http The long connection is through TCP Long connection to achieve ,TCP The long connection is realized by sending probe packets periodically , That is to say “ heartbeat ”, Of course, if you can't receive the heartbeat packet after a certain time ,http The connection will automatically disconnect , Otherwise, the application will be disconnected after the data transmission is completed （Content-Length）.
Short connection ： The established connection cannot be reused , After transmitting data once each time, forcibly disconnect and re-establish the connection .
MQTT It's the Internet of things standard protocol , It is characterized by lightweight , Based on publish subscribe mode . Usually based on TCP/IP Based on . And TCP The advantages of long connections ：
- MQTT The agreement is more standard , targeted , It is conducive to the development and implementation of third-party components .
- Add more functions and control mechanisms in the Internet of things scenario , Such as heartbeat mechanism 、 Publish and subscribe mechanism, etc .
6. Modbus agreement
Modbus The protocol belongs to the serial communication protocol of application layer message transmission , be based on Master/Slave framework ,request/response Pattern . Message types include ASCII、RTU、TCP Three . It is mostly used in data acquisition system and remote terminal control system RTU.
This is from the Internet , Just for communication and learning .
Reference link ：
author[If white],Please bring the original link to reprint, thank you.
The sidebar is recommended
- Tencent's 9 apps are gradually restored and updated: including QQ music, enterprise wechat, etc
- Release of anti food waste work plan: it is forbidden to produce audio and video such as eating mostly and overeating
- [Jieju] many countries secretly help Taiwan build submarines? No one dares to admit it
- A fire in a building in Osaka, Japan, has caused 27 people's lung function to stop
- Pingdingshan youth help! Official latest response
- Why did Shanghai's "wanghong" community stop selling from "10000 people grabbing"?
- Gaode map Lane level navigation adaptation oppo find n folding screen mobile phone
- Rivian's share price fell more than 11% after announcing its first financial report
- Suddenly lost contact! What kind of "Waterloo" has Wang Chaoyong, a 10 billion PE boss, experienced
- Alpha's smart city project was merged into Google's project, and the founder and CEO resigned
guess what you like
See unreasonable pressure again! The US Treasury will list eight Chinese science and technology enterprises in the "investment blacklist"
Autonomous vehicles hit pedestrians! Waymo clarified that the driver was driving manually
Reddit submitted an IPO application with a valuation of more than US $15 billion
The biggest acquisition in Oracle's history! It is said that it plans to buy Senna for us $30 billion
According to the industry chain news, Samsung has obtained the OEM order of Italian French semiconductor MCU for the next generation iPhone
US regulators investigate "buy before pay" service providers
Sources said that Facebook's acquisition of kustomer was approved by the European Union
Google joins hands with well-known female video creators to send her blessings
Openai taught gpt-3 how to surf the Internet, and the AI model of "omniscient and omnipotent" was launched
Shangtang is expected to restart its IPO next Monday, maintaining its target of $767 million
- This company makes AI technology and focuses on "people"
- AI's prediction of protein structure has reached the annual technological breakthrough of science and nature, and AI for science has infinite potential
- The Institute of automation of the Chinese Academy of Sciences and the Northern Institute of electronic equipment have proposed a multi input text face synthesis method, and the data code has been open source
- PKS "tens of thousands" ecological cooperation action plan will be released in late December
- Netease Ding Lei: the discussion and continuous exploration of the unknown world is the best moral character of mankind
- Micro step online selected in Gartner 2021 Global Threat Intelligence Market Guide
- Foreign media said that Japan had invited TSMC to invest and build a factory in 2019, but it was rejected
- Make a fortune in silence! This year, the share prices of these overseas upstream manufacturers far outperformed Tesla
- Why does Tesla stick to the pure visual route?
- Just a happy day! U.S. stock technology giants fell across the board, and they still can't escape the tightening storm of the federal reserve after all?
- Oracle plans to acquire Cerner, an electronic medical information company
- Can the mobile phone be used for a week without charging? Samsung and IBM launch new chip transistor
- Douban's recovery function was restored. It was suspended two weeks ago
- Rivian announced its first financial report after listing: a net loss of $1.233 billion in the third quarter, expanding year-on-year
- Cha Yan Yuese apologized for the salary dispute: managers will reflect and correct their misconduct and dereliction of duty
- India plans to spend $10 billion to attract semiconductor and display manufacturers
- Hungry? Upgrade the knight support system and improve the knight experience from five dimensions
- New value of quark app link from retrieval to ecological service
- US court approves US $460 million debt restructuring plan of Ruixing coffee
- Where is the next boundary of cloud services? Amazon cloud technology has sent cloud services into space
- CEO of cruise, GM's autonomous driving subsidiary, resigned
- Tearful eyes! Liu Yutan, thank you for coming
- Bona film applies for the trademark of shuimenqiao of Changjin Lake
- Convenience bee is accused of secretly photographing hundreds of thousands of pedestrian data
- Wangsu technology won the "China Patent Excellence Award"
- Tea Yan Yuese is exposed to salary civil strife, and the monthly salary of employees does not exceed 3000
- The divorce of the couple who are the actual controllers of saiteng shares involves the division of property of 3 billion yuan. The enterprise investigation shows that the profit in the first three quarters exceeded 100 million yuan
- The board of directors of Lianhua electronics approved US $2.7 billion in capital expenditure for the purchase of new equipment
- There are more than 570 companies in chayan Yuese commercial territory
- Join hands with Zeiss and other partners vivo 2021 vision + to convey "the joy of humanity" with images
- Enterprise investigation shows that China Post has added education consulting services to its business scope
- Nezha automobile will hold "New Year's tide play" on December 22
- one's fundamental views get totally twisted! Shanghai Baoma group's highly sought after "Disney celebrities" are sad at home
- Fairy's Thoughts on Friday (in memory of 2021)
- Hard core watch 488 Google called the NSO Pegasus vulnerability "the most technically complex vulnerability ever"
- Hungry? The application for the trademark of hungry meow was rejected
- He is only one meter tall, but he guards the health of more than 2000 people
- Shell once again responded to the muddy water short report: there are a lot of factual errors and lack of basic understanding of the industry
- Hikvision "supports", and the smart home ecology of fluorite network still needs to grow
- The second Ruixing coffee? Is it tenable for muddy water to short shells