If an old FIN is delivered, will TCP terminate the new connection?After TCP is established which BGP peer will send open message first?Continue to use the same connection after receiving [FIN, ACK]what is the difference between open TCP scan and half-open (stealth) TCP scan?Is application determined before or after TCP handshake?TCP - ack and retransmissions - Is this scenario possible?How would a firewall kill a TCP connection without RST or FIN?Does TCP open a new connection for every packet that is sent?TCP's three-way handshake and Denial of Service attackIs the first segment which is sent by the client in the 3 way handshake counted in the tcp congestion control?acknowledgment by TCP does not guarantee that the data has been delivered

Can EU citizens work on Iceland?

Would it be fair to use 1d30 (instead of rolling 2d20 and taking the higher die) for advantage rolls?

AD: OU for system administrator accounts

Cycling to work - 30mile return

Why does the U.S military use mercenaries?

Why is vowel phonology represented in a trapezoid instead of a square?

Why are there five extra turns in tournament Magic?

Do high-wing aircraft represent more difficult engineering challenges than low-wing aircraft?

Does Cersei deserve to be called a tyrant?

Physically unpleasant work environment

How does the Heat Metal spell interact with a follow-up Frostbite spell?

Can I pay my credit card?

How can I safely determine the output voltage and current of a transformer?

Why didn't Daenerys' advisers suggest assassinating Cersei?

What are the effects of eating many berries from the Goodberry spell per day?

How was the blinking terminal cursor invented?

Was the dragon prowess intentionally downplayed in S08E04?

How can I fix the label locations on my tikzcd diagram?

What kind of environment would favor hermaphroditism in a sentient species over regular, old sexes?

Roman Numerals Equation 2

What formula to chose a nonlinear formula?

Deleting the same lines from a list

Why is so much ransomware breakable?

How come Arya Stark didn't burn in Game of Thrones Season 8 Episode 5



If an old FIN is delivered, will TCP terminate the new connection?


After TCP is established which BGP peer will send open message first?Continue to use the same connection after receiving [FIN, ACK]what is the difference between open TCP scan and half-open (stealth) TCP scan?Is application determined before or after TCP handshake?TCP - ack and retransmissions - Is this scenario possible?How would a firewall kill a TCP connection without RST or FIN?Does TCP open a new connection for every packet that is sent?TCP's three-way handshake and Denial of Service attackIs the first segment which is sent by the client in the 3 way handshake counted in the tcp congestion control?acknowledgment by TCP does not guarantee that the data has been delivered













2















Two programs use a TCP connection (3-way handshake) to open, communicate, terminate the connection and open a new connection. If a FIN message sent to shut down the first connection is duplicated and delayed until the second connection has been established, then delivered, will the new connection be terminated?










share|improve this question




























    2















    Two programs use a TCP connection (3-way handshake) to open, communicate, terminate the connection and open a new connection. If a FIN message sent to shut down the first connection is duplicated and delayed until the second connection has been established, then delivered, will the new connection be terminated?










    share|improve this question


























      2












      2








      2








      Two programs use a TCP connection (3-way handshake) to open, communicate, terminate the connection and open a new connection. If a FIN message sent to shut down the first connection is duplicated and delayed until the second connection has been established, then delivered, will the new connection be terminated?










      share|improve this question
















      Two programs use a TCP connection (3-way handshake) to open, communicate, terminate the connection and open a new connection. If a FIN message sent to shut down the first connection is duplicated and delayed until the second connection has been established, then delivered, will the new connection be terminated?







      tcp protocol-theory transport-protocol layer4






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 5 at 1:34









      Ron Maupin

      70.4k1372130




      70.4k1372130










      asked May 5 at 1:13









      rpersilyrpersily

      132




      132




















          2 Answers
          2






          active

          oldest

          votes


















          1














          No for at least two reasons:



          • source and destination ports

          • sequence number

          Even though the pair source/destination ports is same as the first connection, the sequence number is unlikely to be same because the initial sequence number of a connection is supposed to be random.



          The RST flag isn't seq nb dependent. Assuming the pair src/dst ports is same, a previous RST flag would terminate the session.



          Thus, there is a very low probability that a duplicated FIN packet of another old already terminated session would terminate the new one.






          share|improve this answer

























          • You cannot even create a new session with the same socket pair until the full FIN handshake has finished, so there will not be a FIN from a previous connection.

            – Ron Maupin
            May 5 at 3:04











          • In theory, I agree, when everything goes well. In practice, bugs are present especially with custom stacks that don't fully respect the specs.

            – Alexis_FR_JP
            May 5 at 3:15












          • The actual host OS implementations are off-topic here. We can discuss protocol theory, but what a specific TCP implementation does in off-topic here, but may be asked on Server Fault or one of the OS-specific SE sites.

            – Ron Maupin
            May 5 at 3:21


















          1














          A FIN for one connection has nothing to do with a second connection. Remember that a connection is identified by two sockets (source and destination). Either you would have two separate connections where one of the sockets in the pair identifying the connection is different, in which case, the two sockets are completely separate, or you would be trying to establish an existing connection, which should result in a RST.



          Basically, your situation could not occur because the two connections are entirely separate, or the second connection could not be established until the first connection is completely closed.



          RFC 793, Transmission Control Protocol is the definition of TCP, and it explains how it works:




          Multiplexing:



          To allow for many processes within a single Host to use TCP
          communication facilities simultaneously, the TCP provides a set of
          addresses or ports within each host. Concatenated with the network and
          host addresses from the internet communication layer, this forms a
          socket. A pair of sockets uniquely identifies each connection. That
          is, a socket may be simultaneously used in multiple connections.



          The binding of ports to processes is handled independently by each
          Host. However, it proves useful to attach frequently used processes
          (e.g., a "logger" or timesharing service) to fixed sockets which are
          made known to the public. These services can then be accessed through
          the known addresses. Establishing and learning the port addresses of
          other processes may involve more dynamic mechanisms.



          Connections:



          The reliability and flow control mechanisms described above require
          that TCPs initialize and maintain certain status information for each
          data stream. The combination of this information, including sockets,
          sequence numbers, and window sizes, is called a connection. Each
          connection is uniquely specified by a pair of sockets identifying its
          two sides.



          When two processes wish to communicate, their TCP's must first
          establish a connection (initialize the status information on each
          side). When their communication is complete, the connection is
          terminated or closed to free the resources for other uses.



          Since connections must be established between unreliable hosts and
          over the unreliable internet communication system, a handshake
          mechanism with clock-based sequence numbers is used to avoid erroneous
          initialization of connections.




          -and-




          Reset Generation



          As a general rule, reset (RST) must be sent whenever a segment arrives
          which apparently is not intended for the current connection. A reset
          must not be sent if it is not clear that this is the case.



          There are three groups of states:




          1. If the connection does not exist (CLOSED) then a reset is sent in
            response to any incoming segment except another reset. In
            particular, SYNs addressed to a non-existent connection are rejected
            by this means.



            If the incoming segment has an ACK field, the reset takes its
            sequence number from the ACK field of the segment, otherwise the
            reset has sequence number zero and the ACK field is set to the sum
            of the sequence number and segment length of the incoming segment.
            The connection remains in the CLOSED state.




          2. If the connection is in any non-synchronized state (LISTEN,
            SYN-SENT, SYN-RECEIVED), and the incoming segment acknowledges
            something not yet sent (the segment carries an unacceptable ACK), or
            if an incoming segment has a security level or compartment which
            does not exactly match the level and compartment requested for the
            connection, a reset is sent.



            If our SYN has not been acknowledged and the precedence level of the
            incoming segment is higher than the precedence level requested then
            either raise the local precedence level (if allowed by the user and
            the system) or send a reset; or if the precedence level of the
            incoming segment is lower than the precedence level requested then
            continue as if the precedence matched exactly (if the remote TCP
            cannot raise the precedence level to match ours this will be
            detected in the next segment it sends, and the connection will be
            terminated then). If our SYN has been acknowledged (perhaps in this
            incoming segment) the precedence level of the incoming segment must
            match the local precedence level exactly, if it does not a reset
            must be sent.



            If the incoming segment has an ACK field, the reset takes its
            sequence number from the ACK field of the segment, otherwise the
            reset has sequence number zero and the ACK field is set to the sum
            of the sequence number and segment length of the incoming segment.
            The connection remains in the same state.




          3. If the connection is in a synchronized state (ESTABLISHED,
            FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT),
            any unacceptable segment (out of window sequence number or
            unacceptible acknowledgment number) must elicit only an empty
            acknowledgment segment containing the current send-sequence number
            and an acknowledgment indicating the next sequence number expected
            to be received, and the connection remains in the same state.



            If an incoming segment has a security level, or compartment, or
            precedence which does not exactly match the level, and compartment,
            and precedence requested for the connection,a reset is sent and
            connection goes to the CLOSED state. The reset takes its sequence
            number from the ACK field of the incoming segment.








          share|improve this answer

























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "496"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            noCode: true, onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fnetworkengineering.stackexchange.com%2fquestions%2f58907%2fif-an-old-fin-is-delivered-will-tcp-terminate-the-new-connection%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            No for at least two reasons:



            • source and destination ports

            • sequence number

            Even though the pair source/destination ports is same as the first connection, the sequence number is unlikely to be same because the initial sequence number of a connection is supposed to be random.



            The RST flag isn't seq nb dependent. Assuming the pair src/dst ports is same, a previous RST flag would terminate the session.



            Thus, there is a very low probability that a duplicated FIN packet of another old already terminated session would terminate the new one.






            share|improve this answer

























            • You cannot even create a new session with the same socket pair until the full FIN handshake has finished, so there will not be a FIN from a previous connection.

              – Ron Maupin
              May 5 at 3:04











            • In theory, I agree, when everything goes well. In practice, bugs are present especially with custom stacks that don't fully respect the specs.

              – Alexis_FR_JP
              May 5 at 3:15












            • The actual host OS implementations are off-topic here. We can discuss protocol theory, but what a specific TCP implementation does in off-topic here, but may be asked on Server Fault or one of the OS-specific SE sites.

              – Ron Maupin
              May 5 at 3:21















            1














            No for at least two reasons:



            • source and destination ports

            • sequence number

            Even though the pair source/destination ports is same as the first connection, the sequence number is unlikely to be same because the initial sequence number of a connection is supposed to be random.



            The RST flag isn't seq nb dependent. Assuming the pair src/dst ports is same, a previous RST flag would terminate the session.



            Thus, there is a very low probability that a duplicated FIN packet of another old already terminated session would terminate the new one.






            share|improve this answer

























            • You cannot even create a new session with the same socket pair until the full FIN handshake has finished, so there will not be a FIN from a previous connection.

              – Ron Maupin
              May 5 at 3:04











            • In theory, I agree, when everything goes well. In practice, bugs are present especially with custom stacks that don't fully respect the specs.

              – Alexis_FR_JP
              May 5 at 3:15












            • The actual host OS implementations are off-topic here. We can discuss protocol theory, but what a specific TCP implementation does in off-topic here, but may be asked on Server Fault or one of the OS-specific SE sites.

              – Ron Maupin
              May 5 at 3:21













            1












            1








            1







            No for at least two reasons:



            • source and destination ports

            • sequence number

            Even though the pair source/destination ports is same as the first connection, the sequence number is unlikely to be same because the initial sequence number of a connection is supposed to be random.



            The RST flag isn't seq nb dependent. Assuming the pair src/dst ports is same, a previous RST flag would terminate the session.



            Thus, there is a very low probability that a duplicated FIN packet of another old already terminated session would terminate the new one.






            share|improve this answer















            No for at least two reasons:



            • source and destination ports

            • sequence number

            Even though the pair source/destination ports is same as the first connection, the sequence number is unlikely to be same because the initial sequence number of a connection is supposed to be random.



            The RST flag isn't seq nb dependent. Assuming the pair src/dst ports is same, a previous RST flag would terminate the session.



            Thus, there is a very low probability that a duplicated FIN packet of another old already terminated session would terminate the new one.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited May 5 at 5:42

























            answered May 5 at 1:43









            Alexis_FR_JPAlexis_FR_JP

            21318




            21318












            • You cannot even create a new session with the same socket pair until the full FIN handshake has finished, so there will not be a FIN from a previous connection.

              – Ron Maupin
              May 5 at 3:04











            • In theory, I agree, when everything goes well. In practice, bugs are present especially with custom stacks that don't fully respect the specs.

              – Alexis_FR_JP
              May 5 at 3:15












            • The actual host OS implementations are off-topic here. We can discuss protocol theory, but what a specific TCP implementation does in off-topic here, but may be asked on Server Fault or one of the OS-specific SE sites.

              – Ron Maupin
              May 5 at 3:21

















            • You cannot even create a new session with the same socket pair until the full FIN handshake has finished, so there will not be a FIN from a previous connection.

              – Ron Maupin
              May 5 at 3:04











            • In theory, I agree, when everything goes well. In practice, bugs are present especially with custom stacks that don't fully respect the specs.

              – Alexis_FR_JP
              May 5 at 3:15












            • The actual host OS implementations are off-topic here. We can discuss protocol theory, but what a specific TCP implementation does in off-topic here, but may be asked on Server Fault or one of the OS-specific SE sites.

              – Ron Maupin
              May 5 at 3:21
















            You cannot even create a new session with the same socket pair until the full FIN handshake has finished, so there will not be a FIN from a previous connection.

            – Ron Maupin
            May 5 at 3:04





            You cannot even create a new session with the same socket pair until the full FIN handshake has finished, so there will not be a FIN from a previous connection.

            – Ron Maupin
            May 5 at 3:04













            In theory, I agree, when everything goes well. In practice, bugs are present especially with custom stacks that don't fully respect the specs.

            – Alexis_FR_JP
            May 5 at 3:15






            In theory, I agree, when everything goes well. In practice, bugs are present especially with custom stacks that don't fully respect the specs.

            – Alexis_FR_JP
            May 5 at 3:15














            The actual host OS implementations are off-topic here. We can discuss protocol theory, but what a specific TCP implementation does in off-topic here, but may be asked on Server Fault or one of the OS-specific SE sites.

            – Ron Maupin
            May 5 at 3:21





            The actual host OS implementations are off-topic here. We can discuss protocol theory, but what a specific TCP implementation does in off-topic here, but may be asked on Server Fault or one of the OS-specific SE sites.

            – Ron Maupin
            May 5 at 3:21











            1














            A FIN for one connection has nothing to do with a second connection. Remember that a connection is identified by two sockets (source and destination). Either you would have two separate connections where one of the sockets in the pair identifying the connection is different, in which case, the two sockets are completely separate, or you would be trying to establish an existing connection, which should result in a RST.



            Basically, your situation could not occur because the two connections are entirely separate, or the second connection could not be established until the first connection is completely closed.



            RFC 793, Transmission Control Protocol is the definition of TCP, and it explains how it works:




            Multiplexing:



            To allow for many processes within a single Host to use TCP
            communication facilities simultaneously, the TCP provides a set of
            addresses or ports within each host. Concatenated with the network and
            host addresses from the internet communication layer, this forms a
            socket. A pair of sockets uniquely identifies each connection. That
            is, a socket may be simultaneously used in multiple connections.



            The binding of ports to processes is handled independently by each
            Host. However, it proves useful to attach frequently used processes
            (e.g., a "logger" or timesharing service) to fixed sockets which are
            made known to the public. These services can then be accessed through
            the known addresses. Establishing and learning the port addresses of
            other processes may involve more dynamic mechanisms.



            Connections:



            The reliability and flow control mechanisms described above require
            that TCPs initialize and maintain certain status information for each
            data stream. The combination of this information, including sockets,
            sequence numbers, and window sizes, is called a connection. Each
            connection is uniquely specified by a pair of sockets identifying its
            two sides.



            When two processes wish to communicate, their TCP's must first
            establish a connection (initialize the status information on each
            side). When their communication is complete, the connection is
            terminated or closed to free the resources for other uses.



            Since connections must be established between unreliable hosts and
            over the unreliable internet communication system, a handshake
            mechanism with clock-based sequence numbers is used to avoid erroneous
            initialization of connections.




            -and-




            Reset Generation



            As a general rule, reset (RST) must be sent whenever a segment arrives
            which apparently is not intended for the current connection. A reset
            must not be sent if it is not clear that this is the case.



            There are three groups of states:




            1. If the connection does not exist (CLOSED) then a reset is sent in
              response to any incoming segment except another reset. In
              particular, SYNs addressed to a non-existent connection are rejected
              by this means.



              If the incoming segment has an ACK field, the reset takes its
              sequence number from the ACK field of the segment, otherwise the
              reset has sequence number zero and the ACK field is set to the sum
              of the sequence number and segment length of the incoming segment.
              The connection remains in the CLOSED state.




            2. If the connection is in any non-synchronized state (LISTEN,
              SYN-SENT, SYN-RECEIVED), and the incoming segment acknowledges
              something not yet sent (the segment carries an unacceptable ACK), or
              if an incoming segment has a security level or compartment which
              does not exactly match the level and compartment requested for the
              connection, a reset is sent.



              If our SYN has not been acknowledged and the precedence level of the
              incoming segment is higher than the precedence level requested then
              either raise the local precedence level (if allowed by the user and
              the system) or send a reset; or if the precedence level of the
              incoming segment is lower than the precedence level requested then
              continue as if the precedence matched exactly (if the remote TCP
              cannot raise the precedence level to match ours this will be
              detected in the next segment it sends, and the connection will be
              terminated then). If our SYN has been acknowledged (perhaps in this
              incoming segment) the precedence level of the incoming segment must
              match the local precedence level exactly, if it does not a reset
              must be sent.



              If the incoming segment has an ACK field, the reset takes its
              sequence number from the ACK field of the segment, otherwise the
              reset has sequence number zero and the ACK field is set to the sum
              of the sequence number and segment length of the incoming segment.
              The connection remains in the same state.




            3. If the connection is in a synchronized state (ESTABLISHED,
              FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT),
              any unacceptable segment (out of window sequence number or
              unacceptible acknowledgment number) must elicit only an empty
              acknowledgment segment containing the current send-sequence number
              and an acknowledgment indicating the next sequence number expected
              to be received, and the connection remains in the same state.



              If an incoming segment has a security level, or compartment, or
              precedence which does not exactly match the level, and compartment,
              and precedence requested for the connection,a reset is sent and
              connection goes to the CLOSED state. The reset takes its sequence
              number from the ACK field of the incoming segment.








            share|improve this answer





























              1














              A FIN for one connection has nothing to do with a second connection. Remember that a connection is identified by two sockets (source and destination). Either you would have two separate connections where one of the sockets in the pair identifying the connection is different, in which case, the two sockets are completely separate, or you would be trying to establish an existing connection, which should result in a RST.



              Basically, your situation could not occur because the two connections are entirely separate, or the second connection could not be established until the first connection is completely closed.



              RFC 793, Transmission Control Protocol is the definition of TCP, and it explains how it works:




              Multiplexing:



              To allow for many processes within a single Host to use TCP
              communication facilities simultaneously, the TCP provides a set of
              addresses or ports within each host. Concatenated with the network and
              host addresses from the internet communication layer, this forms a
              socket. A pair of sockets uniquely identifies each connection. That
              is, a socket may be simultaneously used in multiple connections.



              The binding of ports to processes is handled independently by each
              Host. However, it proves useful to attach frequently used processes
              (e.g., a "logger" or timesharing service) to fixed sockets which are
              made known to the public. These services can then be accessed through
              the known addresses. Establishing and learning the port addresses of
              other processes may involve more dynamic mechanisms.



              Connections:



              The reliability and flow control mechanisms described above require
              that TCPs initialize and maintain certain status information for each
              data stream. The combination of this information, including sockets,
              sequence numbers, and window sizes, is called a connection. Each
              connection is uniquely specified by a pair of sockets identifying its
              two sides.



              When two processes wish to communicate, their TCP's must first
              establish a connection (initialize the status information on each
              side). When their communication is complete, the connection is
              terminated or closed to free the resources for other uses.



              Since connections must be established between unreliable hosts and
              over the unreliable internet communication system, a handshake
              mechanism with clock-based sequence numbers is used to avoid erroneous
              initialization of connections.




              -and-




              Reset Generation



              As a general rule, reset (RST) must be sent whenever a segment arrives
              which apparently is not intended for the current connection. A reset
              must not be sent if it is not clear that this is the case.



              There are three groups of states:




              1. If the connection does not exist (CLOSED) then a reset is sent in
                response to any incoming segment except another reset. In
                particular, SYNs addressed to a non-existent connection are rejected
                by this means.



                If the incoming segment has an ACK field, the reset takes its
                sequence number from the ACK field of the segment, otherwise the
                reset has sequence number zero and the ACK field is set to the sum
                of the sequence number and segment length of the incoming segment.
                The connection remains in the CLOSED state.




              2. If the connection is in any non-synchronized state (LISTEN,
                SYN-SENT, SYN-RECEIVED), and the incoming segment acknowledges
                something not yet sent (the segment carries an unacceptable ACK), or
                if an incoming segment has a security level or compartment which
                does not exactly match the level and compartment requested for the
                connection, a reset is sent.



                If our SYN has not been acknowledged and the precedence level of the
                incoming segment is higher than the precedence level requested then
                either raise the local precedence level (if allowed by the user and
                the system) or send a reset; or if the precedence level of the
                incoming segment is lower than the precedence level requested then
                continue as if the precedence matched exactly (if the remote TCP
                cannot raise the precedence level to match ours this will be
                detected in the next segment it sends, and the connection will be
                terminated then). If our SYN has been acknowledged (perhaps in this
                incoming segment) the precedence level of the incoming segment must
                match the local precedence level exactly, if it does not a reset
                must be sent.



                If the incoming segment has an ACK field, the reset takes its
                sequence number from the ACK field of the segment, otherwise the
                reset has sequence number zero and the ACK field is set to the sum
                of the sequence number and segment length of the incoming segment.
                The connection remains in the same state.




              3. If the connection is in a synchronized state (ESTABLISHED,
                FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT),
                any unacceptable segment (out of window sequence number or
                unacceptible acknowledgment number) must elicit only an empty
                acknowledgment segment containing the current send-sequence number
                and an acknowledgment indicating the next sequence number expected
                to be received, and the connection remains in the same state.



                If an incoming segment has a security level, or compartment, or
                precedence which does not exactly match the level, and compartment,
                and precedence requested for the connection,a reset is sent and
                connection goes to the CLOSED state. The reset takes its sequence
                number from the ACK field of the incoming segment.








              share|improve this answer



























                1












                1








                1







                A FIN for one connection has nothing to do with a second connection. Remember that a connection is identified by two sockets (source and destination). Either you would have two separate connections where one of the sockets in the pair identifying the connection is different, in which case, the two sockets are completely separate, or you would be trying to establish an existing connection, which should result in a RST.



                Basically, your situation could not occur because the two connections are entirely separate, or the second connection could not be established until the first connection is completely closed.



                RFC 793, Transmission Control Protocol is the definition of TCP, and it explains how it works:




                Multiplexing:



                To allow for many processes within a single Host to use TCP
                communication facilities simultaneously, the TCP provides a set of
                addresses or ports within each host. Concatenated with the network and
                host addresses from the internet communication layer, this forms a
                socket. A pair of sockets uniquely identifies each connection. That
                is, a socket may be simultaneously used in multiple connections.



                The binding of ports to processes is handled independently by each
                Host. However, it proves useful to attach frequently used processes
                (e.g., a "logger" or timesharing service) to fixed sockets which are
                made known to the public. These services can then be accessed through
                the known addresses. Establishing and learning the port addresses of
                other processes may involve more dynamic mechanisms.



                Connections:



                The reliability and flow control mechanisms described above require
                that TCPs initialize and maintain certain status information for each
                data stream. The combination of this information, including sockets,
                sequence numbers, and window sizes, is called a connection. Each
                connection is uniquely specified by a pair of sockets identifying its
                two sides.



                When two processes wish to communicate, their TCP's must first
                establish a connection (initialize the status information on each
                side). When their communication is complete, the connection is
                terminated or closed to free the resources for other uses.



                Since connections must be established between unreliable hosts and
                over the unreliable internet communication system, a handshake
                mechanism with clock-based sequence numbers is used to avoid erroneous
                initialization of connections.




                -and-




                Reset Generation



                As a general rule, reset (RST) must be sent whenever a segment arrives
                which apparently is not intended for the current connection. A reset
                must not be sent if it is not clear that this is the case.



                There are three groups of states:




                1. If the connection does not exist (CLOSED) then a reset is sent in
                  response to any incoming segment except another reset. In
                  particular, SYNs addressed to a non-existent connection are rejected
                  by this means.



                  If the incoming segment has an ACK field, the reset takes its
                  sequence number from the ACK field of the segment, otherwise the
                  reset has sequence number zero and the ACK field is set to the sum
                  of the sequence number and segment length of the incoming segment.
                  The connection remains in the CLOSED state.




                2. If the connection is in any non-synchronized state (LISTEN,
                  SYN-SENT, SYN-RECEIVED), and the incoming segment acknowledges
                  something not yet sent (the segment carries an unacceptable ACK), or
                  if an incoming segment has a security level or compartment which
                  does not exactly match the level and compartment requested for the
                  connection, a reset is sent.



                  If our SYN has not been acknowledged and the precedence level of the
                  incoming segment is higher than the precedence level requested then
                  either raise the local precedence level (if allowed by the user and
                  the system) or send a reset; or if the precedence level of the
                  incoming segment is lower than the precedence level requested then
                  continue as if the precedence matched exactly (if the remote TCP
                  cannot raise the precedence level to match ours this will be
                  detected in the next segment it sends, and the connection will be
                  terminated then). If our SYN has been acknowledged (perhaps in this
                  incoming segment) the precedence level of the incoming segment must
                  match the local precedence level exactly, if it does not a reset
                  must be sent.



                  If the incoming segment has an ACK field, the reset takes its
                  sequence number from the ACK field of the segment, otherwise the
                  reset has sequence number zero and the ACK field is set to the sum
                  of the sequence number and segment length of the incoming segment.
                  The connection remains in the same state.




                3. If the connection is in a synchronized state (ESTABLISHED,
                  FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT),
                  any unacceptable segment (out of window sequence number or
                  unacceptible acknowledgment number) must elicit only an empty
                  acknowledgment segment containing the current send-sequence number
                  and an acknowledgment indicating the next sequence number expected
                  to be received, and the connection remains in the same state.



                  If an incoming segment has a security level, or compartment, or
                  precedence which does not exactly match the level, and compartment,
                  and precedence requested for the connection,a reset is sent and
                  connection goes to the CLOSED state. The reset takes its sequence
                  number from the ACK field of the incoming segment.








                share|improve this answer















                A FIN for one connection has nothing to do with a second connection. Remember that a connection is identified by two sockets (source and destination). Either you would have two separate connections where one of the sockets in the pair identifying the connection is different, in which case, the two sockets are completely separate, or you would be trying to establish an existing connection, which should result in a RST.



                Basically, your situation could not occur because the two connections are entirely separate, or the second connection could not be established until the first connection is completely closed.



                RFC 793, Transmission Control Protocol is the definition of TCP, and it explains how it works:




                Multiplexing:



                To allow for many processes within a single Host to use TCP
                communication facilities simultaneously, the TCP provides a set of
                addresses or ports within each host. Concatenated with the network and
                host addresses from the internet communication layer, this forms a
                socket. A pair of sockets uniquely identifies each connection. That
                is, a socket may be simultaneously used in multiple connections.



                The binding of ports to processes is handled independently by each
                Host. However, it proves useful to attach frequently used processes
                (e.g., a "logger" or timesharing service) to fixed sockets which are
                made known to the public. These services can then be accessed through
                the known addresses. Establishing and learning the port addresses of
                other processes may involve more dynamic mechanisms.



                Connections:



                The reliability and flow control mechanisms described above require
                that TCPs initialize and maintain certain status information for each
                data stream. The combination of this information, including sockets,
                sequence numbers, and window sizes, is called a connection. Each
                connection is uniquely specified by a pair of sockets identifying its
                two sides.



                When two processes wish to communicate, their TCP's must first
                establish a connection (initialize the status information on each
                side). When their communication is complete, the connection is
                terminated or closed to free the resources for other uses.



                Since connections must be established between unreliable hosts and
                over the unreliable internet communication system, a handshake
                mechanism with clock-based sequence numbers is used to avoid erroneous
                initialization of connections.




                -and-




                Reset Generation



                As a general rule, reset (RST) must be sent whenever a segment arrives
                which apparently is not intended for the current connection. A reset
                must not be sent if it is not clear that this is the case.



                There are three groups of states:




                1. If the connection does not exist (CLOSED) then a reset is sent in
                  response to any incoming segment except another reset. In
                  particular, SYNs addressed to a non-existent connection are rejected
                  by this means.



                  If the incoming segment has an ACK field, the reset takes its
                  sequence number from the ACK field of the segment, otherwise the
                  reset has sequence number zero and the ACK field is set to the sum
                  of the sequence number and segment length of the incoming segment.
                  The connection remains in the CLOSED state.




                2. If the connection is in any non-synchronized state (LISTEN,
                  SYN-SENT, SYN-RECEIVED), and the incoming segment acknowledges
                  something not yet sent (the segment carries an unacceptable ACK), or
                  if an incoming segment has a security level or compartment which
                  does not exactly match the level and compartment requested for the
                  connection, a reset is sent.



                  If our SYN has not been acknowledged and the precedence level of the
                  incoming segment is higher than the precedence level requested then
                  either raise the local precedence level (if allowed by the user and
                  the system) or send a reset; or if the precedence level of the
                  incoming segment is lower than the precedence level requested then
                  continue as if the precedence matched exactly (if the remote TCP
                  cannot raise the precedence level to match ours this will be
                  detected in the next segment it sends, and the connection will be
                  terminated then). If our SYN has been acknowledged (perhaps in this
                  incoming segment) the precedence level of the incoming segment must
                  match the local precedence level exactly, if it does not a reset
                  must be sent.



                  If the incoming segment has an ACK field, the reset takes its
                  sequence number from the ACK field of the segment, otherwise the
                  reset has sequence number zero and the ACK field is set to the sum
                  of the sequence number and segment length of the incoming segment.
                  The connection remains in the same state.




                3. If the connection is in a synchronized state (ESTABLISHED,
                  FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT),
                  any unacceptable segment (out of window sequence number or
                  unacceptible acknowledgment number) must elicit only an empty
                  acknowledgment segment containing the current send-sequence number
                  and an acknowledgment indicating the next sequence number expected
                  to be received, and the connection remains in the same state.



                  If an incoming segment has a security level, or compartment, or
                  precedence which does not exactly match the level, and compartment,
                  and precedence requested for the connection,a reset is sent and
                  connection goes to the CLOSED state. The reset takes its sequence
                  number from the ACK field of the incoming segment.









                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited May 5 at 1:33

























                answered May 5 at 1:22









                Ron MaupinRon Maupin

                70.4k1372130




                70.4k1372130



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Network Engineering Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fnetworkengineering.stackexchange.com%2fquestions%2f58907%2fif-an-old-fin-is-delivered-will-tcp-terminate-the-new-connection%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

                    Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

                    Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020