티스토리 뷰

기타 Storage

TCP: 3-Way/4-Way Handshake(SYN, SYN-ACK, ACK)

rhyshan

3-Way Handshake




TCP: 3-Way Handshake(SYN, SYN-ACK, ACK) by http://www.inetdaemon.com/


 The TCP three-way handshake in Transmission Control Protocol (also called the TCP-handshake; three message handshake and/or SYN-SYN-ACK) is the method used by TCP set up a TCP/IP connection over an Internet Protocol based network. TCP's three way handshaking technique is often referred to as "SYN-SYN-ACK" (or more accurately SYN, SYN-ACK, ACK) because there are three messages transmitted by TCP to negotiate and start a TCP session between two computers. The TCP handshaking mechanism is designed so that two computers attempting to communicate can negotiate the parameters of the network TCP socket connection before transmitting data such as SSH and HTTP web browser requests. This 3-way handshake process is also designed so that both ends can initiate and negotiate separate TCP socket connections at the same time. Being able to negotiate multiple TCP socket connections in both directions at the same time allows a single physical network interface, such as ethernet, to be multiplexed to transfer multiple streams of TCP data simultaneously.



3-웨이 핸드셰이크 - TCP의 신뢰성 있는 통신

신뢰성 있는 연결을 만들기 위해 패킷을 3번 교환하여 확인하는 과정


Client → Server: TCP SYN J

Server → Client: TCP SYN K + ACK J+1

Client → Server: TCP ACK K+1


양쪽 모두 데이터를 전송할 준비가 되어 있다는 것을 보장하고, 데이터 전달이 시작되기 전 다른 쪽이 준비되었다는 것을 알 수 있다.





3-Way & 4-Way Handshake




Four-Way Handshake Definition by techopedia.com

A four-way handshake is a type of network authentication protocol established by IEEE-802.11i that involves standards set up for the construction and use of wireless local area networks (WLANs). The four-way handshake provides a secure authentication strategy for data delivered through network architectures.



4-웨이 핸드셰이크

세션을 종료하기 위해 수행되는 절차. 클라이언트나 서버가 close() 함수를 호출할 시 진행됨.

물어본 뒤 종료할 준비가 되었다는 메세지를 받으면 ACK를 전송하여 종료.

종료하면 안될 경우엔 남아있는 정보를 보낸 뒤, FIN 메세지를 보냄.


Client → Server: TCP FIN M

Server → Client: TCP ACK M+1 [TIME_WAIT]

Server → Client: TCP FIN N

Client → Server: TCP ACK N+1



출처

http://www.inetdaemon.com/tutorials/internet/tcp/3-way_handshake.shtml

http://www.cis.temple.edu/~giorgio/cis307/readings/unix4.html





댓글
댓글쓰기 폼