翻译waiting me 翻译a four-way handshake

TCP, relative to the SOCKET developers create process and link remove process consists of the TCP/IP protocol stack is automatically created. So the developer doesn't need to control this process. But to understand TCP the underlying mechanism is quite helpful.
And for a network protocol engineer such as written, is almost mandatory content. Enterprise enthusiasm high, on the problem to my surprise: -).Emphasized this question before the interview in the morning, sometimes speak and repeat once, almost every one in the afternoon was asked about the problem.
So here to explain it in detail the two processes.
The TCP three-way handshake
The so-called three-way Handshake (Three - way Handshake), refers to establish a TCP connection, the need to the client and the server a total of Three packages sent.
Three-way handshake aims to connect to the server specified port, to establish a TCP connection, and synchronous connection of both serial number and confirmation number and information exchange of the TCP window size. In socket programming, the client performs the connect ().Will trigger the three-way handshake.
The SYN attack
In three times handshake process, the server sends a SYN - after an ACK, before an ACK is received on the client side of a TCP connection is called half connection (half - open the connect). At this point the server at Syn_RECV state. When after an ACK is received, the server into the ESTABLISHED state.
Syn attack is against the client in a short period of time the IP address of the forged a lot does not exist, sends a Syn packet to the server constantly server reply to confirm the package, and wait for customers confirmation, because the source address is not exist, the server needs to continually resend straight to timeout, the forgery of the Syn packet will occupy not connected for a long time queue, normal Syn requests are discarded, the target system run slowly, serious cause network congestion and even system paralysis.
The Syn attack is a typical DDOS attack.Detect SYN attack is very convenient, when you see so many half connection state on the server, especially the source IP address is random, basically may conclude that this is a SYN attack. Under Linux can be tested to the following commands are SYN attack
netstat -n -p TCP | grep SYN_RECV
Generally, a new TCP/IP protocol stack are to modify the process to prevent the Syn attacks, modified TCP protocol implementation.Main methods are SynAttackProtect protection mechanism, SYN cookies technology, increased the most of the connection, and shorten the timeout time, etc.
But can not completely prevent the syn attacks.
TCP four wave
The removal of TCP connection needs to be sent four packages, and so called four wave (four - way handshake).Client or server can initiate to wave action, in socket programming, any one party performs the close () operation can produce wave operation.
See the wireshark caught, the measured wave caught the results did not strictly according to the sequence.I estimate is the time interval is too short.
, to set up the connection protocol (three-way handshake)
(1) the client sends a TCP packet with the SYN mark to the server.This is in the process of three-way handshake packet 1.
(2) the response to the client on the server, this is the second of three times handshake packet, the packet with the SYN and ACK flags logo at the same time.It said to the client of the SYN Mark the SYN again at the same time to the client, ask the client if ready for data communications.
(3) the customer must respond again service period of an ACK message, this is a message section 3.
Wave, connection termination agreement (four times)
Since TCP connection is full-duplex, so every direction must be independently closed.This principle is when one party after done with its data can be sent to end the direction of a FIN.Receive a FIN only means no data on this direction flow, a TCP connection after receiving a FIN can send data.First close party will perform the initiative, while the other performs passive closure.
(1) the TCP client sends a FIN, used to close the client to the server data transfer (packet 4).
(2) the server receives the FIN, it sends back an ACK, confirm the serial number to receive the serial number + 1 (paragraph 5) message.Like the SYN, a FIN will take up a serial number.
(3) the server is shut down the client connection, sending a FIN to the client (section 6) message.
(4) the customer sends back an ACK message confirmation, and will confirm the serial number is set to receive the serial number + 1 (paragraph 7) message.
CLOSED: this have nothing to say, according to its original state.
LISTEN: this state is also very easy to understand a, said a SOCKET in a listening state on the server that can accept connections.
SYN_RCVD: this status indicates that have received a SYN packet, in normal circumstances, the state is a TCP connection to the server SOCKET in the handshake session three times in the process of an intermediate state, very short, basically use netstat to you is difficult to see this status, unless you deliberately wrote a client test program, deliberately TCP handshake process three times in the final ACK packet will not be sent.So this kind of state, when client after an ACK packet is received, it will enter the ESTABLISHED state.
SYN_SENT: this state and SYN_RCVD imagine echo, when the client SOCKET when performing the CONNECT link it first sends a SYN packet, so then it will be into the state SYN_SENT, and wait for the server send the second message in the three-way handshake.State SYN_SENT said the client sent the SYN packet.
ESTABLISHED: that's easy to understand, said the connection has been ESTABLISHED.
FIN_WAIT_1: this state to explain well, in fact FIN_WAIT_1 and FIN_WAIT_2 state true meaning is waiting for the other side of the FIN packet.And this is the difference between two states: FIN_WAIT_1 state is, in fact, when the SOCKET in the ESTABLISHED state, it want to voluntarily close connection, the send the FIN a message to the other party, the SOCKET that is into FIN_WAIT_1 state at this time.And when a response after an ACK packet, then enter the FIN_WAIT_2 state, of course in the actual under normal circumstances, no matter what kind of situation, each other should be immediately respond to an ACK packet, so FIN_WAIT_1 state is usually difficult to see, and FIN_WAIT_2 state and can often use netstat to see.
FIN_WAIT_2: it has been explained in detail in this state, in fact FIN_WAIT_2 state of the SOCKET, said half connection, which is a request for the close connection, but also tell each other, I still have some data need to be sent to you, later again close the connection.
TIME_WAIT: said received the other side of the FIN packet, and send the ACK packet, just after 2 MSL available can be returned to the CLOSED state.If FIN_WAIT_1, received each other at the same time with FIN marks and ACK packet, can directly into the TIME_WAIT state, without having to pass FIN_WAIT_2 state.
CLOSING: this state is more special, in the actual situation should be very rare, belongs to a state of relatively rare exception.Under normal circumstances, when you send a FIN packet, it is morally should first receive an ACK packet (or received) at the same time each other, from the other side of the FIN message again.But after CLOSING state said you send FIN packet, and did not get the other side of the ACK packet, it has also received the FIN message each other.What circumstances appear this kind of situation?Actually consider, also it is not difficult to conclude that it is almost at the same time if the two sides to close a SOCKET, then appeared on both sides at the same time send FIN packet, that there will be a CLOSING state, said the two sides are about to close the SOCKET connection.
CLOSE_WAIT: the meaning of this state is actually said waiting for closure.How to understand?When close a SOCKET send FIN after message to yourself, your system will no doubt in response to an ACK message to each other, at this time, enter the CLOSE_WAIT state.Next, in fact, you really need to consider the thing is to see whether you have the data sent to the other party, if not, then you can close the SOCKET send FIN message to each other, which is close the connection.In CLOSE_WAIT state, so you need to do is waiting for you to close the connection.
LAST_ACK: this state is relatively easy to understand, it is a passive closing side FIN message after it was sent, wait for the final ACK packet.When receipt of ACK packet, which can enter to the CLOSED state is available.
The last two questions, I analysis after the conclusion (100% correct) doesn't necessarily guarantee
1, why to establish the connection protocol is three times handshake, shake hands and closing connections is four times?
This is because the server SOCKET under the LISTEN state when the SYN packet is received even after the request of building, it can put the SYN and ACK (ACK response function, and plays a role of synchronous SYN) in a message to send.But when closing a connection, when I received the other side of the FIN message notification, it just means no data is sAll but not necessarily all of your data is sent to each other, so you can not necessarily immediately close the SOCKET, or you may also need to send some data to each other, after send the FIN message to each other to indicate you agree to can close the connection now, so it is the ACK packet and FIN packet in most cases are sent separately.
2, why the TIME_WAIT state still need to wait for 2 to return to the CLOSED state after MSL?
This is because, although both sides have agreed to close the connection, and shook hands with coordination and send 4 packets are finished, arguably can direct return to the CLOSED state (like from SYN_SEND state to ESTABLISH state);But because we have to be supposed the network is not reliable, you can't guarantee that you will finally send an ACK packet must be received, so the other SOCKET LAST_ACK conditions may because timeout ACK message is not received, and retransmission FIN packet, so the TIME_WAIT state function is used to resend may missing ACK message.
Views(...) Comments()讲述翻译大师学习翻译的心路历程
  不要着急
  ??i'm in love with you from theday i knew you till now ? 我爱你爱了整整一个曾经--------------------------------------Il y une musique chaque, comment vous avez mené pour écouter le coeur.(每一首音乐都有它的精华,就看你抱着如何的心情去听它。)Je ne sais pas pour le retrait de vous, je ne vous même sceau.(我不知道,为了你,我的退出,算不算是成全你.) Ne savoir que l’interprétation, qui ne sont pas à nous regretterons.(说着不知道,其实不过是诠释着不想再去怀念的。)L’évolution de vous et de No&l, son récit, avec sa ressemblance frappante.(淋漓尽致的演进你和她的故事,多么逼真,多么旖旎。)Dessin postes au mur, homme de main et je ne la solitude(在墙上画个小人和自己拉手,宣告着我不孤独)Grandir lentement, mais, le sentiment, de comprendre, mais pas joyeux.(慢慢的,长大了,却感觉变沉默了,懂得多了,却不快乐了。)&A l’occasion, la vie malice vous et à un croisement de cache-cache.(机会像个顽皮的孩子,在人生的某一个岔口和你捉迷藏。)&Elégance et talent qui sait si lourd, les sentiments des larmes sourire.(有谁知道风华背后的沉重,又能否感受微笑背后的眼泪。)-  -  The soul cannot live without love.   灵魂不能没有爱而存在。  Brief is life, but love is long.   生命虽短,爱却绵长。  Love, we must trust, love can be a long time.  爱,就要信任,爱情才得以长久。  The darkness is no darkness with thee.   有了你,黑暗不再是黑暗。  A heart that loves is always young.   有爱的心永远年轻  It takes time for men to love their women.  男人要花点时间才会真正爱上他们的女人。  My make-up may be flaking,but my smile stays on.  我的妆容可能脱落,但我的笑容依然。  Oh deer,I need you now.Ok baby,come.  亲爱的,我想要你了。好的,宝贝,来吧。  If I see you next to never,how can we say forever.  若你我今生无法再见,又怎说相约到永远。  We cease loving ourselves if no one loves us.   如果没有人爱我们,我们也就不会再爱自己了。  When love is not madness, it is not love.   如果爱不疯狂就不是爱了。  Love is a vine that grows into our hearts.   爱是长在我们心里的藤蔓。  If I know what love is, it is because of you.   因为你,我懂得了爱。  Love is the greatest refreshment in life.   爱情是生活最好的提神剂。  At the touch of love everyone becomes a poet.   每一个沐浴在爱河中的人都是诗人。  Look into my eyes - you will see what you mean to me.   看看我的眼睛,,你会发现你对我而言意味着什么。  Distance makes the hearts grow fonder.   距离使两颗心靠得更近。  I need him like I need the air to breathe.   我需要他,正如我需要呼吸空气。  If equal affection cannot be, let the more loving be me.   如果没有相等的爱,那就让我爱多一些吧。  here there is great love, there arealways miracles.   哪里有真爱存在,哪里就有奇迹。  I like you,but I'm just not interested in you in that way.  我喜欢你,但我对你的感情不是那种恋人情感。  Women are like wine.They only get better with age.  女人嘛,就像老酒一样,只会越陈越香。  There are 4 steps to happiness:1 you 2 me 3 our hearts 4 together.  通过四步就能幸福1你 2我 3我们的心 4在一起。  Do you have a map?Because I just keep losting in your eyes.  你有地图吗?因为我刚在你的眼神中迷失了。  Can you stay with me all the time?all the timeall the time...  你可以一直陪伴着我吗?一直一直...  I took for granted,all the times,that I thought would last somehow.  我一直以为,你我会爱到地老天荒。  I don' t know how to love you. Looking at you is the only way I know      我一路上, 踏着悲伤的纹路, 只是为了寻找你哀伤的起点.  Marching along the way I am sad lines just to find your starting point  我喜欢你不是你是是怎样的人. 而是和你在一起的感觉  &I love you not because of who you are, but because of who I am when I am with you. ☺&  他就那样的 笑着说 &我们都会一天天 变老 然后死掉 多好&  Meeting you was fate,and falling in love with you was out of my control.  遇见你是命运的安排,而爱上你是我情不自禁。  There are two reasons why I wake up in the morning:my alarm clock and you.  我早上愿意醒来有两个理由:闹钟和你。  Love is like the moon, when it does not increase, it decreases.   爱情就像月亮,不增则减。  Who travels for love finds a thousand miles not longer than one.   在爱人眼里,,一千里的旅程不过一里。  Love is like a butterfly. It goes where it pleases and it pleases where it goes.   爱情就像一只蝴蝶,它喜欢飞到哪里,就把欢乐带到哪里。  Within you I lose myself, without you I find myself wanting to be lost again.   有了你,我迷失了自我。失去你,我多么希望自己再度迷失。  Fall Creek because t www.qqgxqm.org Choi received a broader life.  尔溪因为有大海的信任;财获得更广阔的生命。  Trust is a feeling of life, is a noble sentiment, it is also a connecting link between people.  信任是一种有生命的感觉,也是一种高尚的情感,更是一种连接人与人之间的纽带。  When two men in the battle to the back to each other, and that is the highest confidence.  当两人能在战斗中把后背交给对方,那就是最高的信任。  He was laughing, just like that,&We will all grow old with the passing of each day, and die. Isn' t that great?&  如果爱你会让你幸福,那么我就爱你.如果爱你会让你不幸福,那么我就只是喜欢你  He is truly happy who makes others happy.   使他人幸福的人,是真正的幸福  The most clear voice www.qqkelong.net to prove that I love you  最清晰的声音,证明我很爱你。  Non ho pianto, qqkelong.net sto solo in lacrime  我没有哭,我只是在流泪  Some pain can not tell until you can slowly forget  有些爱 不能坚持 即使不舍 也只能够潇洒放弃           01:56:50 来自: QQ个性签名网(www.qqgxqm.org) Don't cry because it is over, smile because it happened.   不要因为结束而哭泣,微笑吧,为你的曾经拥有。   Don't try to hard, the best things come when you least expect them to.   不要着急,爱情英文签名最好的总会在最不经意的时候出现。   I love you not because of who you are, but because of who I am when I am withyou.   我爱你,不是因为你是一个怎样的人,而是因为我喜欢与你在一起时的感觉。   To the world you may be one person, but to one person you may be the world.   对于世界而言,你是一个人;但是对于某人,你是他的整个世界。   Don't waste your time on a man/woman, who isn't willing to waste their time on you.   不要为那些不愿在你身上花费时间的人而浪费你的时间。   The worst way to miss someone is to be sitting right beside them knowing you can't have them.   失去某人,最糟糕的莫过于,他近在身旁,却犹如远在天边。   No man or woman is worth your tears, www.qqgxqm.net and the one who is ,won't make you cry.   没有人值得你流泪,值得让你这么做的人不会让你哭泣。   Never frown, even when you are sad, because you never know who is falling in love with your smile.   纵然伤心,也不要悉眉不展,因为你不知是谁会爱上你的笑容。   Just because someone doesn't love you the way you want them to, doesn't mean they don't love you with all they have   爱你的人如果没有按你所希望的方式爱你,那并不代表他们没有全心全意地爱你。   Maybe God wants us to meet a few wrong people before meeting the right one, so that when we finally meet the person, we will know how to be grateful.   在遇到梦中人之前,上天也许会安排我们先遇到别人;在我们终于遇见心仪的人时,便应当心存感激。   I like the subtle fresh green budding from the branches of the tree-the herald of spring,ushering in the dawn...   我喜欢这种淡淡的感觉,我喜欢看树枝上那淡淡的嫩绿,它是春天的使者,它是一天清晨的开始...   I like the subtle wind.In spring,it stealin autumn,in summer,it bringsin winter'it carries a crisp chilliness...   我喜欢淡淡的风。春风轻吻脸颊,秋风抚面温柔,夏风送来凉爽,冬天的风带来清凉...   I like the subtle taste of tea that last long after a sip.The subtle bitter is what it is meant to be...   我喜欢喝淡淡的茶,淡淡之中才能品出它余味的清香,淡淡的苦,才是它原本的味道...   I like the subtle friendship that does not hold people together.In stead,an occasional greeting spreads our longings far beyond...   我喜欢追求淡淡的友谊,彼此不需要天天在一起,偶尔一句:你好吗?思念就像发芽一样蔓延开来...   I like the subtle longing for a friend,when I sink deeply in a couch,mind wandering in memories of the past...   我喜欢淡淡地思念一个人,静静地将自己包围在沙发之中,任思绪在回忆里飘荡...   Love should also be subtle,without enslaving the ones fallen into her arms.Not a bit less nor a bit more...   爱也要淡淡的。爱,不要成囚。少是愁多是忧...   Subtlsubtle ssusubtle wishes come from the bottom of your heart...   淡淡的一点友谊很真,淡淡的一点问候很醇,淡淡的一点依恋很清,淡淡的一点孤独很美,淡淡的一点思念很深,淡淡的一点祝福最真...   My little love hurt you.  翻译:我那微不足道的爱伤害到了你。  Our relationship, too ambiguous.  翻译:我们的关系 、太过暧昧 。  Some people even go and I also hate.  翻译:有些人就算走了我也还恨。  ※ ◇ ? God to destroy, they first ask who is crazy ?  翻译:※ ◇?上帝让谁灭亡,必先叫谁疯狂?  He said: time will prove it all  翻译:他说:时间会证明这一切  Mouth slightly higher, showing the beauty of your  翻译:嘴角微微上扬, 显出你的美  Who do not do next, so the first Rhizoma,  翻译:不做下一个谁、做第一个莪、  We should be greedy to enjoy the sun each day, happy to die.  翻译:我们应该贪婪地享受每一天的阳光,快乐地等死。  Virtuous woman was changing when the ladies of the time when the rude bitch  翻译:女人得多变 该贤惠的时候淑女 该粗鲁的时候泼妇  If, day 1 to E are again from 'E are the treasure. Okay,?  翻译:如果,天让?们又在1起 ' ?们就好好珍惜 。好吗,?  Handshake that link, is not really able to hold onto life  翻译:握手说不放,是不是真的能一辈子不放  ___ The United States is the most touching distance ?  翻译:___ 最动人的美是距离?QQ英文个性签名  He put words to her, they heard, felt moved  翻译:他对她说得话,她们听了,都觉得感动  He asked her and said: if she bad mood, how to comfort  翻译:他问她,说:她如果情绪不好,该如何安慰  ∮ ∮ not in the mood to mood, asked me how to live '  翻译:∮∮没有心情的心情,叫我如何过'  They said: You can easily emotional  翻译:他们说:你很容易情绪化  I always believe, &Wear a smile, nothing cross it.&  翻译:我始终相信“笑一笑,没有什么事情过不去。”  You know I never stopped loving you even though I have lost you  翻译:你知道吗 我从来没有停止过爱你 即使我已经失去了你  A bed, two pillows (one pillow, a hold), sleep enough ...  翻译:一张床、两个枕头(一个枕,一个抱)、睡一觉就够了...  I like to sleep before hand on your chest so I would not have nightmares of the  翻译:我喜欢睡觉前把手放在你的胸口上 那样我就不会做噩梦了  You have her. Why bother to disturb my heart?  翻译:你有了她。何必还来扰乱我的心?  You can break up waiting for me waiting for you I can still break up  翻译:你可以等着我分手 我依然也可以等着你分手  Say too much, think too much, finally away from me  翻译:说太多 、想太多 、最后都是离我而去  Last to their own comfort is in tears,  翻译:最后给自己的安慰是流泪、  Pain men and women can not understand  翻译:男人的痛 ,女人无法理解  Have disappeared before the small cherish in your betrayal.  翻译:以前的小惜 已经消失在你的背叛里。  I like a thorn, thorn to you at any time may ? so we asked you away from me ?  翻译:我就像是一根刺,随时都有可能刺到你们? 所以就请你们离我远一点?  I like to curl up in a dark corner, singing our song  -翻译:- 我喜欢蜷缩在黑暗的角落里唱着我们的歌  Love is like shoes, you still like but do not fit is not allowed.  -翻译:爱情就像鞋子、你再喜欢但是不合脚也是不可以的。  Sunflower, until the day of the dead, it will only toward the sun っ  -翻译:向 日 葵 , 直 到 死 去 的 那 天 ,也 只 会 向 着 太 阳っ

我要回帖

更多关于 waiting me 翻译 的文章

 

随机推荐