Principle of TCP status change

Source: Internet
Author: User

I. Preface
I used protocol analysis tools for learning.TCP/IPHereinafter referred to"Learning"), See"Hope to provide other supplements again"You have always considered what to add, and there are a lot of things to add. After allTCP/TPProtocol cluster isInternetNo matter what services are running on the Internet, they are all built onTCP/TPThere are many things to learn based on the protocol,"Learning"This article provides an overview of the data transfer process.TCPThis article focuses on the changes in flag spaces.TCPStatus changes, ifTCPFor more information about the protocol, see"Learning"This article will not be repeated in the previous article.
Ii. Why do you want to learnTCPStatus changes
To clarify why, let's talk about the status first. For a simple example, generally a person"Smile"Yes"Happy"Status,"Cry"Yes"Sorrow"Status,"Roar"Yes"Angry"In other words, a person is in a certain state when performing an action. In fact, computers in the network are in different States at different stages during mutual communication,"Learning"Several data transmission processes mentioned in this Article establish connections, data transmission, and end connections.) In each process,TCPThey are in different States, so we can see that they are only very familiarTCPIn order to know the current status of your computer in the network, is it connected to another computer? Or are malicious people secretly connected to your machine to steal your stuff? Are you under attack? Which ports are open? Is there a trojan? And so on.TCPThis is learning.TCPStatus.
Iii. Learning Points
1, To have"Dynamic"Concept
The status changes with different situations. For example, a person"Smile"Yes"Happy"The status, he smiled and did not smile from"Happy"Is changed to another status. The status changes with different conditions and is dynamic. We can see from the following learning that at different stages,TCPThe signs of the Protocol are different, and the changes in the status are reflected.
2Which are the client status and the server status?
What is the client and server? When you are surfing the Internet, your computer is the client, and the server on which you access the website is the server. If you provideWwwService. At this time, your machine is the server, and the client is used to access your computer. A computer can be used as either a client or a server.
Some statuses are exclusive to the client, some are exclusive to the server, and some are exclusive. In the following learning, you must pay attention to the differences.
3,TCPIs actually the status of a port.
"Learning"Mentioned in the articleTCPThe source port and destination port are used for communication. The source port is opened on the local machine, and the destination port is the port of another computer that is communicating with the local machine, the source port is divided into active client ports and passive Connection Service ports. The local machine provides a service to open a port, for example: ProvideWwwThe service is enabled by default.80Port, provideE_mailThe service is enabled by default.25Port, provideFTPThe service is enabled by default.21Port, the Service port number is usually fixed, when other computers access yourWwwDuring service, the computer should open a random port(1024Take)With your80Port for communication. At this time, your80PortTCPThe status changes with different stages.21,25And other service ports will not be changed without being accessed.
Be clear when learningTCPIs actually the meaning of a port status.
Iv. Test Environment
For the test environment, see learning with protocol analysis tools.TCP/IPArticle.
Test Tool: Protocol Analysis ToolIRIS,Sniffer pro
There are a lot of protocol analysis tools, and there are also free tools, as long as you can grab the package.WindowsNetwork Monitor andLinuxBuilt-inTCPDUMPIt is also a good tool.
TCPStatus observation ToolTCPview, The software is very small only93KBAnd is a green software without installation. Many download locations, to the huajunDownOneHttp://www.onlinedown.net/soft/3483.htm.
V. Overview
Figure1And Graph2All are in 《TCP/IPThe book xiangjie is a very classicTCPThe status change diagram of the two graphs are very clear.TCPDetailed process of state change. I hope I can understand it after reading this articleTCPThese two graphs are burned into your mind.
Figure1The dotted line shows the normal status of the server:
SlaveCLOSED-> LISTIN-> ESTABLISHED-> CLOSE_WAIT-> LAST_ACK-> CLOSED-> LISTIN
The thick line is the normal status change of the client:
SlaveCLOSED-> SEND_SENT-> ESTABLISHED-> FIN_WAIT_1-> FIN_WAIT_2-> TIME_WAIT-> CLOSED
WhereCLOSEDThe status is a starting state, which cannot be viewed in actual observation)
A solid line is the status that may occur during data transmission.
<! -- [If! SupportLineBreakNewLine] -->
<! -- [Endif] -->


Figure2Is to display the status of the client and the server separately.
These two graphs are often used in the following learning.
<! -- [If! Vml] --> <! -- [Endif] -->
<! -- [If! SupportLineBreakNewLine] --> <! -- [Endif] -->

500) this. width = 500; "border = 0>

 

Figure1 TCPStatus change diagram
500) this. width = 500; "border = 0>


Figure2 TCPStatus corresponding to normal connection establishment and Termination


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.