当前位置:网站首页>Tcp/ip protocol

Tcp/ip protocol

2022-07-06 08:37:00 Learning programming a

TCP/IP—— High concurrent load balancing colony

  • OSI
    open system interconnect Open system interconnection model , This model divides the network communication work into seven layers , The physical layer 、 Data link layer 、 The network layer 、 The session layer 、 The presentation layer 、 application layer ( Theoretical reference ).
     Insert picture description here

  • OSI 7 Layer reference model ( Reference resources 、 Unrealized )
    (1) Why layering ? The interface between layers is stable , Expose interfaces , Direct interface adjustment , Internal methods 、 Logic is replaceable ; Can understand Europe , If there is no stratification, the European quota is higher , It costs a lot to change everything .

  • TCP/IP agreement ( Defined Logic 、 Parameters 、 Implementation method )
     Insert picture description here
    (2) Introduce : There are two types of regional programs in computers ——Linux kernel kernel( Version maintenance )+ The system runs in the background demo Programs are user space application Program .
    (3) difference : Why are some layers placed in the kernel , Such as qq、 WeChat 、 When the game transmits communication data, many codes do not need to be developed repeatedly , The use of common resources is designed by kernel developers , There are rules, resource management and the process of establishing connections in the kernel . Other different procedures , Send a representation of data 、 reliability 、 Whether the security is encrypted Develop in the personalization of the program , The application layer . So there are two levels of classification .
    (4)nc: Establishing a connection ——net connect,nc After sending the agreement in a human way , Both parties can transmit data through connection , You can correctly request the data back , The request function ends .
    (5) There are agreements at every level : The application layer contains http agreement 、fdp Agreements, etc .
    (6) Transport control layer :tcp—— oriented Connect Of , Reliable transmission ( Commonly used )、udp agreement .

  • TCP The stage of :
    Establish a connection with three handshakes , Then data transmission , The last four breakups .
     Insert picture description here
    (1) Achieve three handshakes : Network communication I/O Communication is two-way , When there is an output, there is an input , After three times, the client and server know that their input and output are connected .
     Insert picture description here
    ack:acknowledge Indicates that a packet has been received , got it ;
    Connect : Open up resources in the memory of both sides , Switch state , The process of connection is the process of instantaneous packet interaction ;

IO Model —— file system io、 The Internet io

IO Model essentially : Kernel exposed to program api Derived from socket packing

原网站

版权声明
本文为[Learning programming a]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207060832062218.html