120 likes | 261 Views
STCP Implementation [TCP on UDP]. 김 영 준 , 백 일 우. sbuf. rbuf. timer. Event Queue. Event Queue. timer. Design. Client. Server. data transport. Application. Application. file. file. STCP API. STCP API. APPLICATION Layer. data & control transport. Event Handler.
E N D
STCP Implementation[TCP on UDP] 김 영 준 , 백 일 우
sbuf rbuf timer Event Queue Event Queue timer Design Client Server data transport Application Application file file STCP API STCP API APPLICATION Layer data & control transport Event Handler Event Handler STCP Input STCP Output STCP Output STCP Input STCP Layer sendto() recvfrom() UDP Transport Layer recvfrom() sendto()
Buffer Manager Header Header Data Data Data Size : MSS size Management File Read Buffer COPY COPY SendBuffer SEND
Client stcp_send( ) Application file stcp_send( ) APPLICATION Layer Sbuf에 header 추가 server client sbuf Timer Start Event queue에 send request message input timer Event Queue Event Handler Timer start STCP Output을 통해 sendto( ) 호출 STCP Input STCP Output STCP Layer sendto() UDP Transport Layer recvfrom() Stcp_send( ) #1
Client stcp_send( ) Application file stcp_send( ) APPLICATION Layer server client sbuf Timer Start Event queue에 recv request message input Timer Stop timer Event Queue Timer stop Event Handler STCP Output을 통해 sendto( ) 호출 Ack recv STCP Input STCP Output STCP Layer sendto() UDP Transport Layer recvfrom() Stcp_send( ) #2
Server stcp_recv( ) Application file saved data stcp_recv( ) APPLICATION Layer server client rbuf delayed ACK Start recv request message input Event Queue timer Event Handler delayed ACK Timer start STCP Output STCP Input STCP Layer recvfrom() UDP Transport Layer sendto() Stcp_recv( ) #1
Server stcp_recv( ) Application file stcp_recv( ) APPLICATION Layer server client rbuf delayed ACK Start send ACK message input delayed ACK Stop Event Queue timer Event Handler delayed ACK Timer stop STCP Output STCP Input STCP Layer recvfrom() UDP Transport Layer sendto() Stcp_recv( ) #2
Client RTO timeout Application file stcp_send( ) APPLICATION Layer Sbuf에서 ACKed seq 다음 seq부터 전송 server client sbuf Event queue에 RTO timeout message input X TIMEOUT TIMER START timer Event Queue Time out 발생 현재 rto의 2배로 Timer start Event Handler STCP Output을 통해 sendto( ) 호출 STCP Input STCP Output STCP Layer sendto() UDP Transport Layer recvfrom() RTO timeout
Expected Rcvd 2 Rcvd 1 Read Sliding Window Problem 1. Split A S W W A S & Split Situation S W A 2. Circular Acked Sent Written 3. What about Hole Should be spilt
TCP STATE define // TCP STATE DEFINE #define STCPS_CLOSED 0 /* closed */ #define STCPS_LISTEN 1 /* listening for connection */ #define STCPS_SYN_SENT 2 /* active, have sent syn */ #define STCPS_SYN_RECEIVED 3 /* have sent and received syn */ #define STCPS_ESTABLISHED 4 /* established */ #define STCPS_CLOSE_WAIT 5 /* rcvd fin, waiting for close */ #define STCPS_FIN_WAIT_1 6 /* have closed, sent fin */ #define STCPS_CLOSING 7 /* closed xchd FIN, awaik ACK*/ #define STCPS_LAST_ACK 8 /* had fin and close; FIN ACK*/ #define STCPS_FIN_WAIT_2 9 /* have closed, fin is acked */ #define STCPS_TIME_WAIT 10 /* in 2*msl quiet wait after close */
느낀점 • Receiver는 데이터를 받을 때마다 버퍼에 저장 시, 데이터가 버퍼에 저장되었다고, EventQue에 그때마다 넣어주어야 할까? • 해결 => 한 묶음의 데이터가 올 것을 예상하여, Advertise Window가 mss 1개의 크기가 되었을 때, EventQue에 넣어주었음