because TCP Connection is full duplex , Therefore, each direction must be closed separately . This principle is that when a party completes its data transmission task, it can send a FIN To terminate the connection in this direction . Receive a FIN It just means there's no data flow in this direction ,

One TCP Connect to receive a FIN Can still send data after . Active shutdown will be performed by the first party to close , And the other party performs a passive shutdown .

(1) client A Send a FIN, Used to close customers A To the server B Data transfer of ( Message segment 4).

(2) The server B Receiving this FIN, It sends back a ACK, The confirmation serial number is the received serial number plus 1( Message segment 5). and SYN equally , One FIN Will occupy a sequence number .

(3) The server B Shut down and client A The connection of , Send a FIN To the client A( Message segment 6).

(4) client A remand ACK Message confirmation , And set the confirmation serial number to the received serial number plus 1( Message segment 7).

TCP More about the four waves of

  1. Talk about TCP Four waves

    “ wave ” To terminate the connection ,TCP The flow chart of the four waves is as follows : ( stay socket Programming , It can be done by client or server close Operation ) In the following figure, the client actively closes the connection MSL What is it? ? Maximum segment life ------ ...

  2. TCP Use four waves to close the connection, as shown in the figure, why establishing the connection protocol is three handshakes , And closing the connection is four handshakes ?

    tcp Four waves , because TCP Connection is full duplex , Therefore, each direction must be closed separately . because TCP Connection is full duplex , Therefore, each direction must be closed separately . This principle is that when a party completes its data transmission task, it can send a FIN To end this ...

  3. tcp/ip Four waves

    Four breakups : because TCP Connection is full duplex , Therefore, each direction must be closed separately . This principle is that when a party completes its data transmission task, it can send a FIN To terminate the connection in this direction . Receive a  FIN It just means there's no data flow in this direction , One ...

  4. 2020-04-09:TCP Why do you have to have TIME_WAIT state ?

    TIME_WAIT There are two reasons why states exist .<1> Reliable termination TCP Connect . If the last one ACK The message is discarded because of the network , here server Because I didn't receive it. ACK And timeout retransmission FIN message , be in TIME_WAIT state ...

  5. TCP Three handshakes of ( Establishing a connection ) And four waves ( Close the connection )

    reference : http://course.ccniit.com/CSTD/Linux/reference/files/018.PDF http://hi.baidu.com/raycomer/item/94 ...

  6. TCP Three handshakes , The data transfer , Four waves

    TCP Package structure One TCP The package structure is as follows : One TCP The bag is mainly made up of TCP Baotou and data part are composed of , The fixed part of Baotou is 20 byte , The options and data section are set to 4N(N It can be for 0) byte . 1.16bit Source and destination port numbers , it ...

  7. TCP Three handshakes and four waves

    Reprint  http://www.cnblogs.com/zmlctt/p/3690998.html be relative to SOCKET developer ,TCP The creation process and link reduction process are performed by TCP/IP The protocol stack is created automatically . So developers don't have to ...

  8. TCP The common timers are three handshakes and four waves

    1.TCP Common timers stay TCP Sometimes, the protocol needs to trigger an event regularly or according to an algorithm , So at this point ,TCP The protocol is implemented using timers . stay TCP in , There will be seven kinds of timers : Set up the connection timer (connecti ...

  9. 【HTTP agreement 】---TCP Three handshakes and four waves

    TCP Three handshakes and four waves First we know that HTTP Agreements are usually carried on TCP The agreement above ,HTTPS Carried on TLS or SSL Above the protocol layer From the picture above, we can see that .      stay Http Before work ,Web Browser through the network and W ...

Random recommendation

  1. mysql Learning links

    1 Spreading wisdom Podcast PHP train . Liu Daocheng .PHP Video tutorial .mysql http://down.51cto.com/zt/887

  2. ASP.NET MVC Filter Thinking

    Think about it AOP The concrete realization of , Later I thought of ASP.NET MVC The filter is actually AOP A kind of , So from the Filter Start studying AOP. For the time being AuthorizationFilter,ActionFilter,R ...

  3. Tomcat series (7)——Tomcat Class loading mechanism

    1. The core part of the 1.  Class loader : Get the binary byte stream that describes a class by its fully qualified name . For any class , All need to be established by the class loader that loads it and the class itself Java Uniqueness in virtual machines , Every classloader , All have a ...

  4. Section 17 ,OpenCV( Study six ) Image contour detection

    1. Detect contour Contour detection is often used in image processing ,OpenCV-Python Used in the interface cv2.findContours() Function to find the contour of the detected object . cv2.findContours(image, mode ...

  5. Setup script exited with error: command &#39;x86_64-linux-gnu-gcc&#39; failed with exit status 1 terms of settlement

    In today's Ubuntu16.04 Installation on python When the package , There's the problem of cheating dad : terms of settlement , The content is summarized as follows This is the case , The error was reported because the dependency package was not completely installed , The error report is shown in the figure below : terms of settlement , Install some necessary dependencies first : ...

  6. C# Invulnerability and covariance in generics

    stay .net4 Before , Generic interfaces are immutable ..net4 An important extension is added to generic interfaces and generic delegates through covariance and invulnerability 1. be resistant to change : If the generic type uses out Keyword annotation , Generic interfaces are covariant . This also means that the return type can only be T. example : ...

  7. C Scope in language , Link properties and storage types

    Scope When a variable is declared in a part of a program , He can only be accessed in a certain fishing area of the program , The compiler can confirm 4 There are two different types of scopes : File scope , Function scope , Code block scope and prototype scope 1. Code block scope : Between a pair of curly braces ...

  8. Linux Server installation deployment redis

    Reference address : redis course :http://www.runoob.com/redis/redis-tutorial.html redis Baidu Encyclopedia :https://baike.baidu.com/item ...

  9. Security concept :DMZ( Demilitarized zone , Isolation zone )

    DMZ It's English “demilitarized zone” Abbreviation , Chinese name is “ Isolation zone ”, Also known as “ Demilitarized zone ”. It is to solve the problem that the external network cannot access the internal network server after installing the firewall , Between a non security system and a security system ...

  10. IO Model IO Multiplexing

    Blocking IO use socket It must be used accept recv recvfrom These methods normally accept recv recvfrom It's all blocked Non blocking IO If setblocking(False) ...