当前位置:网站首页>Network foundation (1)
Network foundation (1)
2022-07-07 11:06:00 【Exy-】
Catalog
6. Network communication protocol
8. The transport layer TCP And UDP agreement
One . Network development background
1. Switch :
According to the record of the connected computer mac( Physical network card address ), Data exchange .
shortcoming : It is impossible to send to which host you want .
2. Router
A function is added to the technology of data exchange --- Network identification , For every piece of data in the network , Choose a suitable path , Send to the target host , It has realized the function of sending it to whoever you want , The router will recognize the network choice of the destination host sent to .( Path selection , Data forwarding )
3. Division of network
LAN ( The coverage is 1000m)
Metropolitan area network ( The coverage is 20km)
Wide area network ( Greater than 20km)
The Internet we usually use / The Internet belongs to a larger international wide area network , It is a complex star network , More disaster tolerant .
Ethernet / Token ring network is a networking method
4.IP Address
uint32_t --- Unsigned 4 Byte integer
As the unique identification of the host in the network --- Location between hosts in the network ( Which host communicates with which host )-- adopt IP Address identification
Every data in the network will contain Source side IP Address / To the end IP Address
ipv4: uint32_t( Less than 43 Billion , It's not enough ) ipv6:uint8_t addr[16]-- The promotion degree is very low
DHCP: Dynamic address assignment -> Who surf the Internet to whom IP Address NAT: stay DHCP after , There are still many people , Let many people use the same IP Address to surf the Internet
5. Port number
uint16_t Unsigned 2 An integer of bytes
Uniquely identify a process on a host , When writing communication programs , You have to tell the computer , Which port should I handle the data sent to
A port can only be occupied by one process , However, a process can use multiple ports
Every piece of data in network communication contains --- Source port and peer port --- It means which process this data is sent from , Which process should be handed over to handle
6. Network communication protocol
Data format convention in network communication
Follow the unified communication protocol standard , To achieve substantial communication , Realize network interconnection .
There are many communication protocols in the whole network communication environment --- Each protocol deals with different communication scenarios
Protocol layer : According to different communication scenarios , The services are different , The protocols used are divided into different levels
Typical protocol layering :
OSI Seven layer reference model : application layer / The presentation layer / The session layer / Transport layer / The network layer / The link layer / The physical layer
TCP/IP Five layer model : application layer / Transport layer / The network layer / The link layer / The physical layer
application layer : Responsible for how to communicate between applications ;HTTP/FTP/DNS/DHCP......
Transport layer : Responsible for data transmission between processes ;TCP/UDP
The network layer : Responsible for address management and routing ;IP; Router
The link layer : Responsible for data transmission between adjacent devices ; Ethernet protocol ; Switch
The physical layer : Responsible for the transmission of physical photoelectric signals ; Ethernet protocol ; A hub
7. Network byte order
Byte order :cpu The access order of data in bytes in memory
Host byte order : The size of a host byte order depends on cpu framework
Byte order is divided into big end byte order and small end byte order ; Big endian byte order : The low address stores the high address ; Small endian byte order : The low address stores the low address
The communication between hosts with different host byte order is easy to cause data ambiguity , Byte order standard in network communication ( Convert the byte order of your own data into standard byte order before transmission ) To avoid data ambiguity caused by different byte order
8. The transport layer TCP And UDP agreement
TCP--- Transmission control protocol --- Connection oriented , Reliable transmission , Byte stream oriented
UDP-- User datagram protocol --- There is no connection , unreliable , For datagram
difference :TCP Ensure reliable transmission , But the transmission speed is not UDP fast ;
TCP Applied to high security scenarios ,UDP Applied to scenes with high real-time requirements
边栏推荐
猜你喜欢
[recommendation system 01] rechub
Find the greatest common divisor and the least common multiple (C language)
seata 1.3.0 四種模式解决分布式事務(AT、TCC、SAGA、XA)
[machine learning 03] Lagrange multiplier method
[untitled]
2021-05-21
Using tansformer to segment three-dimensional abdominal multiple organs -- actual battle of unetr
【pyqt】tableWidget里的cellWidget使用信号与槽机制
如何顺利通过下半年的高级系统架构设计师?
Wallhaven壁纸桌面版
随机推荐
想考中级软考,一般需要多少复习时间?
2021-04-23
The seventh training assignment
Use of dotween
Records on the use of easyflash v3.3
Use load_ decathlon_ Datalist (Monai) fast loading JSON data
ADB utility commands (network package, log, tuning related)
1324: [example 6.6] integer interval
[pro test feasible] error while loading shared libraries solution
[untitled]
Which securities company is the best and safest to open an account for the subscription of new shares
The gun startles the dragon, and the crowd "locks" Zhou Zhi
Online hard core tools
PHP \ newline cannot be output
Deep understanding of Apache Hudi asynchronous indexing mechanism
Openinstall and Hupu have reached a cooperation to mine the data value of sports culture industry
[untitled]
Static semantic check of clang tidy in cicd
Shardingsphere sub database and table examples (logical table, real table, binding table, broadcast table, single table)
Rolling puddle Uni_ App (VIII)