- TCP; Transmission Control Protocol - (1) TCP (2) TCP Interactive Data Flow (3) TCP Bulk Data Flow (4) TCP Data Retransmission (5) TCP Persist Timer (6) TCP Keep Alive Timer (7) 1
ping telnet ftp X traceroute tftp bootp smtp NFS/RPC TCP UDP ICMP IP IGMP Data-Link Ethernet FDDI SDH FR ATM 2
- TCP : Transmission Control Protocol - TCP (Transmission Control Protocol) end-to-end / Application TCP IP Network Interface Physical IP Network Interface Physical Application TCP IP Network Interface Physical 3
- TCP; Transmission Control Protocol - (1) TCP (2) TCP Interactive Data Flow (3) TCP Bulk Data Flow (4) TCP Data Retransmission (5) TCP Persist Timer (6) TCP Keep Alive Timer (7) 4
0 1 2 3 4 5 6 TCP Header Format 0 7 8 15 16 23 24 31 source port identifier destination port identifier Offset(4) Rsrvd(6) checksum sequence number ACK number control bits UR AK PH R T SY FN window size Urgent Pointer 20 Bytes Option Padding 5
TCP Header Format UR AK PH RT SY FN Urgent Pointer Field Significant (URG) Acknowledgement Field Significant (ACK) Push Function Reset the Connection Synchronize Sequence Numbers (SYN) No More Data From Sender (FIN) 6
TCP Features Stream Oriented Data Transmission Connection (Three-way-handshake) Connection ( Stream ) Identifier Socket {dst_ip_addr, dst_port, src_ip_addr, src_port} Sequence Number ; 32 bits 0 (2^32-1) 2^32 Sequence Number Wrap Full-Duplex Acknowledgement (ACK) ; (SN) (Segment retransmission) by Time-out, Dupilicated-ACK Sliding Window Control (*) Window_size 65,535 Bytes 7
TCP Port Allocation RFC1700) 1. Well-Known Ports ; 0-1,023 2. Registered Ports ; 1,024-49,151 3. Dynamic and/or Private Ports ; 49,152-65,535 : ftp://ftp.isi.edu/in-notes/iana/assignments/port-numbers 8
TCP Well-Known Ports Port Number Keyword Application 5 rje Remote Job Entry 20 ftp-data File Transfer [Default data] 21 ftp File Transfer [Control] 23 telnet Telnet 25 smtp Simple Management Protocol 39 rlp Resource Location Protocol 53 domain Domain Name Server 63 whois++ Whois++ 67 bootp Bootstrap Protocol Server 69 tftp Trivial File Transfer 70 gopher Gopher 79 finger Finger 80 http World Wide Web HTTP 110 pop3 Post Office Protocol - Version 3 111 sunrpc SUN Remote Procedure Call 119 nntp Network News Transfer Protocol 9
TCP Well-Known Ports Port Number Keyword Application 123 ntp Network Time Protocol 137 netbios-ns NetBIOS Name Service 138 netbios-dgm NetBIOS Datagram Service 139 netbios-ssn NetBIOS Session Service 179 bgp Border Gateway Protocol (BGP) 202 at-nbp AppleTalk Name Binding Protocol 213 ipx IPX 220 imap3 IMAP3 (Interactive Mail Access Protocol) 396 netware-ip Novell Netware over IP 540 uucp uucp daemon 546 dhcpv6-client DHCPv6 Client 547 dhcpv6-server DHCPv6 Server 560 rmonitor remote monitor daemon 10
TCP Connection / Log on the console; svr4% telnet bsdi discard Trying 140.252.13.35 Connected to bsdi. Escape character is ^]. ^] telnet> quit Connection closed. #port= 9 (server discard packet) tcpdump output 1 0.0 svr4.1037 > bsdi.discard: S 14155.14155(0) win 4096 <mss 1024> 2 0.024 (0.0024) bsdi.discard > svr4.1037: S 18239.18239(0) ack 14156 win 4096 <mss 1024> 3 0.007 (0.0048) svr4.1037 > bsdi.discard:. ack 18240 win 4096 4 4.155 (4.1482) svr4.1037 > bsdi.discard: F 14156:14156(0) ack 18240 win 4096 5 4.158 (0.0013) bsdi.discard > svr4.1037:. ack 14157 win 4096 6 4.159 (0.0014) bsdi.discard > svr4.1037: F 18240.18240(0) ack 14157 win 4096 7 4.189 (0.0225) svr4.1037 > bsdi.discard:. ack 18241 win 4096
TCP Connection / tcpdump output 1 0.0 svr4.1037 > bsdi.discard: S 14155.14155(0) win 4096 <mss 1024> 2 0.024 (0.0024) bsdi.discard > svr4.1037: S 18239.18239(0) ack 14156 win 4096 <mss 1024> 3 0.007 (0.0048) svr4.1037 > bsdi.discard:. ack 18240 win 4096 4 4.155 (4.1482) svr4.1037 > bsdi.discard: F 14156:14156(0) ack 18240 win 4096 5 4.158 (0.0013) bsdi.discard > svr4.1037:. ack 14157 win 4096 6 4.159 (0.0014) bsdi.discard > svr4.1037: F 18240.18240(0) ack 14157 win 4096 7 4.189 (0.0225) svr4.1037 > bsdi.discard:. ack 18241 win 4096 [ ] source.port > destination.port : flags SN_begin.SN_end(data_size) flags : S = SYN ; Synchronize sequence_number(sn) F = FIN ; Finish data transmission R = RST ; Reset connection P = PSH ; push data to receiving process asap. = ; none of above four flags is on SN_end = SN_begin + data_size win 4096 ; window size is 4096 mss 1024 ; maximum segment size is 1024 bytes 12
TCP Connection / svr4.1037 (client) segment 1 SYN 14155.14155(0) bsdi.discard(server) segment 3 (18239+1) SN SYN 18239.18239(0) ACK 14156 ACK 18240 segment 2 (14155+1) SN segment 4 FIN 14156:14156(0) ACK 18240 ACK 14157 segment 5 (14156+1) SN segment 6 segment 7 (18240+1) SN FIN 18240.18240(0) ACK 14157 ACK 18241 13
TCP Connection / svr4.1037 (client) bsdi.discard(server) Active open (appli. open : telnet) SYN_ACK(a+1,b) Passive open open SYN (a) ACK(b+1) open Active Close (application close: quit) half close FIN (m,s) ACK (m+1) FIN_ACK (m+1,s) ACK (s+1) EOF to Application Passive Close (application close) half close full close 14
SYN_RCVD appl: close send: FIN FIN_WAIT_1 recv: ACK send: <nothing> recvl: SYN send: SYN, ACK FIN_WAIT_2 recv: ACK send: <nothing> appl: close send: FIN appl: passive open send: <nothing> recv: FIN send: ACK recv: FIN,ACK send: ACK recv: FIN send: ACK Active close CLOSED LISTEN passive open Send : RST appl: send data send: SYN recv: SYN send: SYN,ACK (simultaneous open) ESTABLISHED simultaneous close CLOSING recv: ACK send: <nothing> TIME_WAIT 2 MSL timeout appl: active open send: SYN SYN_SENT recv: SYN,ACK send: ACK recv: FIN send: ACK Active open appl: close or timeout CLOSE_WAIT appl: close send: FIN LAST_ACK Passive close recv: ACK send: <nothing>
TCP Layer Interfaces Session OPEN SEND RECEIVE STATUS ABORT CLOSE Session Session Session TCP IP Send (Service_Type, TTL, ) Recieve send receive 16
TCP Layer Interfaces (1) OPEN Call ; ; Local_port, Destination_socket, Open_Mode(Active/Passive), [timeout_value] [Priority], [security], [Options] ; Local_Connection_Name TCP ; LISTEN(Passive_Open) ESTABLISHED(Active_Open) System calls; - socket(pf, type, protocol) - bind(socket, localaddr, adddrlen) - connect(socket, destaddr, addrlen) (2) SEND Call : ; Local_Connection_Name,, [PUSH], [URG], [ ] ; TCP ; (ESTASBLISHED) System calls ; write(socket, buffer, length) send(socket, message, length, flags) 17
TCP Layer Interfaces (3) RECEIVE Call : ; Local_Connection_Name, ;, URG, PUSH, [ ] TCP ; (ESTASBLISHED) System calls ; read(descriptor, buffer, length) recvfrom(socket, buffer, flags, fromaddr, addlen) recvmsg(socket, messagestruct, flags) (4) STATUS Call ; ; Local_Connection_Name ; Local_Socket, Destination_Socket, Local_Conenction_Name, window_size, window_size, Connection_state, ACK,, URG, Priority, Security, 18
TCP Layer Interfaces (5) ABORT Call : ; Local_Connection_Name ; TCP ; (CLOSED) (6) CLOSE Call : ; Local_Connection_Name ; TCP ; (CLOSED) System call ; close(socket) 19
- TCP; Transmission Control Protocol - (1) TCP (2) TCP Interactive Data Flow (3) TCP Bulk Data Flow (4) TCP Data Retransmission (5) TCP Persist Timer (6) TCP Keep Alive Timer (7) 20
TCP Interactive Data Flow - Default and Basic Procedure - Telnet client Telnet server key-stroke d data byte ack of data byte to telnet server process d echo to display process d echo of data byte ack of echo data byte echo from telnet server process d 21
TCP Interactive Data Flow - Delayed ACK - Telnet client Telnet server key-stroke d echo to display process d data byte ack of data byte echo of data byte to telnet server process d Aggregate message Delayed ACK echo from telnet server process d ack of echo data byte 22
TCP Interactive Data Flow - Delayed ACK : Piggy-Back - Telnet client Telnet server data byte delay window echo of data byte + ack of data byte ndow delay wi echo from telnet server process d ack of echo data byte 23
TCP Interactive Data Flow <Client> <Server> date n (6 bytes) => Sat Feb 6 07:52:17 MST 1993 n (30 bytes) d a t e n CR/LF svr4 1 0.0 bsdi.1023 > svr4.login: P 0:1(1) ack 1 2 0.016497 (0.0165) svr4.login > bsdi.1023: P 1:2(1) ack 1 3 0.139955 (0.1235) bsdi.1023 > svr4.login:. ack 2 4 0.458037 (0.3181) bsdi.1023 > svr4.login: P 1:2(1) ack 2 5 0.474386 (0.0163) svr4.login > bsdi.1023: P 2:3(1) ack 2 6 0.539943 (0.0656) bsdi.1023 > svr4.login:. ack 3 7 0.814582 (0.2746) bsdi.1023 > svr4.login: P 2:3(1) ack 3 8 0.831108 (0.0165) svr4.login > bsdi.1023: P 3:4(1) ack 3 9 0.940112 (0.1090) bsdi.1023 > svr4.login:. ack 4 10 1.191287 (0.2512) bsdi.1023 > svr4.login: P 3:4(1) ack 4 11 1.207701 (0.0164) svr4.login > bsdi.1023: P 4:5(1) ack 4 12 1.339994 (0.1323) bsdi.1023 > svr4.login:. ack 5 13 1.680646 (0.3407) bsdi.1023 > svr4.login: P 4:5(1) ack 5 14 1.697977 (0.0173) svr4.login > bsdi.1023: P 5:7(2) ack 5 15 1.739974 (0.0420) bsdi.1023 > svr4.login:. ack 7 16 1.799841 (0.0599) svr4.login > bsdi.1023: P 7:37(30) ack 5 17 1.940176 (0.1403) bsdi.1023 > svr4.login:. ack 37 18 1.944338 (0.0042) svr4.login > bsdi.1023: P 37:44(7) ack 5 19 2.140110 (0.1958) bsdi.1023 > svr4.login:. ack 44 24
D-ACK D-ACK D-ACK D-ACK D-ACK D-ACK bsdi.1023 1 3 4 6 7 9 10 12 13 15 17 19 PSH 0:1(1) ack 1 (d) PSH 1:2(1) ack 1 (echo d) PSH 1:2(1) ack 2 (a) PSH 2:3(1) ack 2 (echo a) PSH 2:3(1) ack 3 (t) PSH 3:4(1) ack 3 (echo t) PSH 3:4(1) ack 4 (e) PSH 4:5(1) ack 4 (echo e) PSH 4:5(1) ack 5 ( n) svr4.login ack 2 ack 3 ack 4 ack 5 PSH 5:7(2) ack 5 (echo CR/LF) ack 7 PSH 7:37(30) ack 5 (date ) ack 37 PSH 37:44(7) ack 5 (echo svr4%) ack 44 2 5 8 11 14 16 18 Delayed ACK Aggregate D-ACK ; 200 msec Piggy-back ; echo + ack segment 13 ; 1 byte data n segment 14 ; 2 byte date CR/LF
TCP Negle Algorithm (Sender) n e t Large RTT data packet flow a (Receiver) d aggregate payload te n + + n e t echo & ack packet flow (e.g., ack_of_ d & echo d ) : IP (20B) : TCP(20B) : Data 26
Negle Algorithm key-stroke (sn=1) c (sn=2) a (sn=3) t ack 2 OK sn=1 a + t at Telnet client ack 4 sn=4 (sn=3 ) 1 3 5 PSH 1:2(1) ack 2 PSH 2:3(1) ack 2 PSH 3:5(2) ack 4 PSH 2:4(2) ack 3 ack 5 Telnet server 2 4 echo c (sn=2) at (sn=3,4) ack 5 sn=5 (sn=4 ) 27
Disable Negle Algorithm F1 key (sn=1) ESC (sn=2) [ (sn=3) M ack 4 OK 1,2,3 sn= 5 missing 2,3,4 Telnet client 1 2 3 5 PSH 1:2(1) ack 2 PSH 2:3(1) ack 2 PSH 3:4(1) ack 2 PSH 2:5(3) ack 3 PSH 5:6(1) ack 4 ack 2 Telnet server M ^[[ 4 to telnet server ESC (sn=2) [ (sn=3) M (sn=4) ack 2 ^ timeout F1 key echo PSH 2:6(4) ack 4 ^]]M 6 ack 6 ack 2 ack 2 ^[[M 7 ack 6 OK 2,3,4,5 28
- TCP; Transmission Control Protocol - (1) TCP (2) TCP Interactive Data Flow (3) TCP Bulk Data Flow (4) TCP Data Retransmission (5) TCP Persist Timer (6) TCP Keep Alive Timer (7) 29
TCP Bulk Data Transmission - Sliding Window - Window Sliding Window (Receiver ) Congestion Window(Sender ) (1) ACK window (2) ACK Aggregation(ACK ) (3) Receiver window (4) ACK window 30
TCP Sliding Window Offered window (advertised by receiver) Unsent window 1 2 3 4 5 6 7 8 9 10 11 sent and ACKed sent but not ACKed Can send ASAP Can not send until window slides 31
TCP Sliding Window Sent 3 and 4 Offered window (advertised by receiver) Unsent window 1 2 3 4 5 6 7 8 9 10 11 sent and ACKed sent but not ACKed Can send ASAP Can not send until window slides Receive ack 5 from receiver 3+window=9 5+window=11 Receive ack 5 from receiver
TCP Sliding Window Window advertise by receiver shrink enlarge window closed by ACK reception = ACKed SN Opend by ACK reception (=ack+window) Slide window by ACK from receiver 33
bsdi.1023 1 3 4 5 6 9 11 12 13 15 17 20 SYN 0:0(0) win4096 <mss1024> SYN 3:3(0) ack 1 win4096 <mss1024> ack 4 win4096 PSH 1:1025(1024) ack 4 win4096 PSH 1025:2049(1024) ack 4 win4096 PSH 2049:3073(1024) ack 4 win4096 ack 2049 win4096 ack 3073 win3072 PSH 3073:4097(1024) ack 4 win4096 ack 4097 win4096 PSH 4097:5121(1024) ack 4 win4096 PSH 5121:6145(1024) ack 4 win4096 PSH 6145:7169(1024) ack 4 win4096 ack 6145 win4096 PSH 7169:8193(1024) ack 4 win4096 ack 8193 win4096 FI 8193:8193(0) ack 4 win4096 ack 8194 win4096 FIN 4:4(0) ack 8194 win4096 ack 5 win4096 svr4.discard 2 7 8 10 14 16 18 19 Window - window = 4096 - mss = 1024 4 segments ACK Window Shrink ; 7 4096 3072 (*) aggregate ACK - 7 4 & 5-10 6 & 9-14 11 & 12-16 13 & 15 34
bsdi.1023 svr4.discard 1 3 4 5 6 SYN 0:0(0) win4096 <mss1024> SYN 3:3(0) ack 1 win4096 <mss1024> ack 4 win4096 PSH 1:1025(1024) ack 4 win4096 PSH 1025:2049(1024) ack 4 win4096 PSH 2049:3073(1024) ack 4 win4096 PSH 3073:4097(1024) ack 4 win4096 10 11 12 13 ack 4097 win 0 ack 4097 win 4096 8 9 10 PSH 4097:5121(1024) ack 4 win4096 PSH 5121:6145(1024) ack 4 win4096 PSH 6145:7169(1024) ack 4 win4096 FIN PSH 7169:8193(1024) ack 4 win4096 17 ack 8193 win 0 ack 8193 win 4096 FIN 4:4(0) ack 8194 win4096 ack 8193 win4096 2 14 15 16 [Fast Sender Slow Receiver] Window shrink - 8 : 4096 0-14 : 4096 0 Window enlarge (= window update) - 9 : 0 4096-15 : 0 4096 (*) segment 13 : FIN Piggy-Back 35
TCP Congestion Window Offered window (advertised by receiver) Unsent window 1 2 3 4 5 6 7 8 9 10 11 sent and ACKed Congestion window ( cwnd =1 ) Shall not send ASAP Can not send until window slides sent but not ACKed 36
TCP Congestion Window Sent 3 Offered window (advertised by receiver) Unsent window 1 2 3 4 5 6 7 8 9 10 11 sent and ACKed Shall send without ACK ASAP; cwnd=2 (cwnd cwnd*2) Shall not send ASAP Can not send until window slides 3+window=9 4+window=10 Receive ack 4 from receiver Receive ack 4 from receiver
TCP Congestion Window Slow Start Policy (cwnd ; exponential increase) cwnd = 1 ; ) { for (not congestion) { for ( if ( ACK ) { cwnd = cnwd +1 } cwnd = 1 } (*) : Congestion Avoidance Sender Local 38
TCP Congestion Window advertised_window advertised_window congestion cwnd cwnd time < Congestion > time < Congestion > (*) Duplicated ACK 39
TCP Congestion Window(1) [ ] 1 [ ] [ ] [ ] 1 1 1 1 1 1 1 40
TCP Congestion Window(2) [ ] 2 [ ] [ ] 3 [ ] 2 3 2 3 2 2 3 3 2 2 3 2 3 41
TCP Congestion Window(3) [ ] 4 [ ] [ ] 7 6 5 [ ] 4 5 4 7 6 6 5 4 4 5 7 7 6 5 4 4 5 6 4 5 6 7 42
TCP Congestion Window(4) [ ] 8 [ ] [ ] 12 11 10 9 [ ] 5 6 7 8 9 8 13 12 11 10 6 7 10 9 8 8 9 14 13 12 11 7 11 10 9 8 8 9 10 15 14 13 12 8 9 10 11 43
cwnd =1 1 cwnd =2 cwnd =3 cwnd =4 cwnd =5 cwnd =6 bsdi.1029 3 4 6 7 9 10 13 18 1:513(512) ack1 win4096 ack 513 win 8192 513:1025(512) ack1 win4096 1025:1537(512) ack1 win4096 ack 1025 win 8192 1537:2049(512) ack1 win4096 2049:2561(512) ack1 win4096 ack 1537 win 8192 2561:3073(512) ack1 win4096 3037:3585(512) ack1 win4096 ack 2049 win 8192 ack 2561 win 8192 FIN PSH 3585:4097(512) ack 1 win4096 ack 3073 win 8192 ack 3585 win 8192 ack 4098 win 7680 FIN 1:1(0) ack 4098 win 8192 ack 2 win 4096 svr4.discard 2 5 8 11 12 14 15 16 17 44
TCP Congestion Window 1 Advertised Window by Receiver 2 Congestion Window (cwnd ) defined by sender (*) Window(Advertised window) (1) Congestion Avoidance (2) RTT x
- TCP; Transmission Control Protocol - (1) TCP (2) TCP Interactive Data Flow (3) TCP Bulk Data Flow (4) TCP Data Retransmission (5) TCP Persist Timer (6) TCP Keep Alive Timer (7) 46
TCP Data Retransmission (1) Expire of Retransmission Timeout (RTO) Value - RTO calculation using RTT - Exponential Back-off (Max. 64 sec.) (2) Reception of Duplicated ACK - Fast Retransmission / Fast Recovery (3) Congestion Window (cwnd ) Control - Slow Start (exponential increase) - Congestion Avoidance (liner increase) 47
RTO Expired Retransmission bsdi.1023 6 1.5 sec 7 3 sec 8 6 sec 9 64 sec 1 3 4 17 SYN 0:0(0) win4096 <mss1024> svr4.discard SYN 3:3(0) ack 1 win4096 <mss1024> ack 4 win4096 PSH 1:15(14) ack 4 win4096 ack 15 win 4096 PSH 15:23(8) ack 4 win4096 PSH 15:23(8) ack 4 win4096 PSH 15:23(8) ack 4 win4096 PSH 15:23(8) ack 4 win4096 PSH 15:23(8) ack 4 win4096 2 5 (RTO; ) RTO = 1.5 sec /* */ for ( 9 minutes) { if ( RTO expired) { retransmission; RTO=RTO x 2; RTO=min{64sec, RTO}; } } end /* */ 18 PSH 15:23(8) ack 4 win4096 48
RTO Expired Retransmission 1 0.0 bsdi.1029 > svr4.discard: S 1:1(0) win 4096 <mss 1024> 2 0.0048 ( 0.0048) svr4.discard > bsdi.1029: S 4:4(0) ack 2 3 0.0064 ( 0.0016) bsdi.1029 > svr4.discard:. ack 5 4 6.1022 ( 6.0958) bsdi.1029 > svr4.discard: P 1:15(14) ack 5 5 6.2594 ( 0.1571) svr4.discard > bsdi.1029:. ack 15 win 6 24.4801 (18.2207) bsdi.1029 > svr4.discard: P 15:23(8) ack 5 7 25.4937 ( 1.0136) bsdi.1029 > svr4.discard: P 15:23(8) ack 5 8 28.4937 ( 3.0001) bsdi.1029 > svr4.discard: P 15:23(8) ack 5 9 34.4937 ( 6.0002) bsdi.1029 > svr4.discard: P 15:23(8) ack 5 10 46.4844 (11.9905) bsdi.1029 > svr4.discard: P 15:23(8) ack 5 11 70.4851 (24.0007) bsdi.1029 > svr4.disacrd: P 15:23(8) ack 5 12 118.4864 (48.0013) bsdi.1029 > svr4.discard: P 15:23(8) ack 5 13 182.4881 (64.0018) bsdi.1029 > svr4.discard: P 15:23(8) ack 5 14 246.4899 (64.0018) bsdi.1029 > svr4.discard: P 15:28(8) ack 5 15 310.4910 (63.9917) bsdi.1029 > svr4.discard: P 15:23(8) ack 5 16 374.4934 (64.0018) bsdi.1029 > svr4.discard: P 15:23(8) ack 5 17 438.4951 (64.0015) bsdi.1029 > svr4.discard: P 15:23(8) ack 5 : : : : 49
RTO Expired Retransmission - RTO Exponential Back-Off - RTO 64 sec 48 sec 32 sec 16 sec (S) If (S 9 minutes) { continue; } else { abort; } 0 1 2 3 4 5 6 7 8 9 10 11 Retransmission 50
Timeout and Retransmission RTO (Retransmission TimeOut) (1) ; RTT - RTO = 2 x RTT where RTT = RTTp + (1- ) RTTM = 0.9xRTTp + 0.1xRTTM (2) ; -RTO = RTT + 4 x 51
Retransmission by Duplicated ACK (2) Reception of Duplicated ACK - Fast Retransmission / Fast Recovery Segment ; single (or few) segment(s) ACK Segments (3 ) 52
Fast Retransmission by Duplicated ACK 6401:6657(256) ack1 6657:6913(256) ack1 6913:7169(256) ack1 7169:7425(256) ack1 8193:8449(256) ack1 6657:6913(256) ack1 Fast Retransmission ack 5889 ack 6145 ack 6401 ack 6657 7425:7681(256) ack1 ack 6657 7681:7937(256) ack1 ack 6657 7937:8193 256) ack1 ack 6657 ack 6657 ack 6657 ack 6657 8449:8705(256) ack1 8705:8961(256) ack1 8961:9217(256) ack1 ack 8449 win5888 ack 8705 win5888
Congestion Window Control [ ] cwnd=1; cwnd for () cwnd { [1] cwnd (i) ssthresh cwnd Exponential increase (slow start) (ii) ssthresh cwnd Liner increase (congestion avoidance) [2] ssthresh (i) Timeout goto 1 (ii) Duplicated-ACK 1/2 ssthresh=65kb; if ( Timeout ) { cwnd=1; ssthresh = cwnd/2; } if ( duplicated ACK ) { ssthresh=cwnd / 2; cwnd=ssthresh; } if (cwnd ssthresh) { slow_start; /* exponential */ } else { congestion_avoidance; /* liner */ } } 54
Congestion Window Control ( ) ICMP (1) ICMP Source Quench cwnd = 1 ; ssthresh = as is ; (2) Host unreachable No Action ; 55
slow-start slow-start Congestion avoidance Congestion avoidance Congestion avoidance cwdn_1 cwdn_3 Target cnwd (cwnd_1) / 2 ssthresh (cwnd_3) / 2 cwnd Timeout Fast Recovery Fast Recovery 56
- TCP; Transmission Control Protocol - (1) TCP (2) TCP Interactive Data Flow (3) TCP Bulk Data Flow (4) TCP Data Retransmission (5) TCP Persist Timer (6) TCP Keep Alive Timer (7) 57
TCP Persist Timer [ ] Advertised window size = 0 1 Byte [ ] window= 0 [Timer ] Exponential Back-off (Max. 60 ) 58
TCP Persist Timer 1 bsdi.1027 > svr4.5555: P 1:1025(1024) ack 1 win 4906 2 ( 0.1920) svr4.5555 > bsdi.1027:. ack 1025 win 4906 3 ( 0.0050) bsdi.1027 > svr4.5555:. 1025:2049(1024) ack 1 win 4096 4 ( 0.0034) bsdi.1027 > svr4.5555:. 2049:3073(1024) ack 1 win 4096 5 ( 0.0072) svr4.5555 > bsdi.1027:. ack 3073 win 4096 6 ( 0.0052) bsdi.1027 > svr4.5555:. 3073:4097(1024) ack 1 win 4096 7 ( 0.0034) bsdi.1027 > svr4.5555: P 4097:5121(1024) ack 1 win 4096 8 ( 0.0039) bsdi.1027 > svr4.5555: P 5121:6145(1024) ack 1 win 4096 9 ( 0.0079) svr4.5555 > bsdi.1027:. ack 5121 win 4096 10 ( 0.0051) bsdi.1027 > svr4.5555: P 6145:7169(1024) ack 1 win 4096 11 ( 0.0040) bsdi.1027 > svr4.5555: P 7169:8193(1024) ack 1 win 4096 12 ( 0.0039) bsdi.1027 > svr4.5555: P 8193:9217(1027) ack 1 win 4096 13 ( 0.1612) svr4.5555 > bsdi.1027:. ack 9217 win 0 14 ( 4.9494) bsdi.1027 > svr4.5555:. 9217:9218(1) ack 1 win 4096 15 ( 0.0040) svr4.5555 > bsdi.1027:. ack 9217 win 0 16 ( 4.9961) bsdi.1027 > svr4.5555:. 9218:9219(1) ack 1 win 4096 17 ( 0.0040) svr4.5555 > bsdi.1027:. ack 9218 win 0 18 ( 5.9962) bsdi.1027 > svr4.5555:. 9219:9220(1) ack 1 win 4096 19 ( 0.0040) svr4.5555 > bsdi.1027:. ack 9219 win 0 20 (11.9964) bsdi.1027 > svr4.5555:. 9220:9221(1) ack 1 win 4096 21 ( 0.0040) svr4.5555 > bsdi.1027:. ack 9220 win 0 22 (23.9967) bsdi.1027 > svr4.5555:. 9221:9222(1) ack 1 win 4096 23 ( 0.0040) svr4.5555 > bsdi.1027:. ack 9221 win 0 59
- TCP; Transmission Control Protocol - (1) TCP (2) TCP Interactive Data Flow (3) TCP Bulk Data Flow (4) TCP Data Retransmission (5) TCP Persist Timer (6) TCP Keep Alive Timer (7) 60
Keep Alive Timer [ ] (*) TCP (i) (FIN segment) (ii) [ ] TCP -2 probe -10 (75 probe ) 61
TCP Keepalive Timer 1 bsdi.1055 > svr4.echo: P 1:14(13) ack 1 2 ( 0.0061) svr4.echo > bsdi.1055: P 1:14(13) ack 14 3 ( 0.0087) bsdi.1055 > svr4.echo:. ack 14 4 (7199.8797) arp who-has svr4 tell bsdi 5 ( 0.0021) arp reply svr4 is-at 0:0:c0:c2:9b:26 6 ( 0.0009) bsdi.1055 > svr4.echo:. ack 14 7 ( 0.0041) svr4.echo > bsdi.1055:. ack 14 8 (7200.1545) arp who-has svr4 tell bsdi 9 ( 0.0021) arp reply svr4 is-at 0:0:c0:c2:9b:26 10 ( 0.0009) bsdi.1055 > svr4.echo:. ack 14 11 ( 0.0040) svr4.echo > bsdi.1055:. ack 14 12 (7200.1769) arp who-has svr4 tell bsdi 13 ( 75.0021) arp who-has svr4 tell bsdi 14 ( 75.0020) arp who-has svr4 tell bsdi 15 ( 75.0021) arp who-has svr4 tell bsdi 16 ( 75.1123) arp who-has svr4 tell bsdi 17 ( 75.0021) arp who-has svr4 tell bsdi 18 ( 75.0020) arp who-has svr4 tell bsdi 19 ( 74.9920) arp who-has svr4 tell bsdi 20 ( 75.0018) arp who-has svr4 tell bsdi 21 ( 75.0021) arp who-has svr4 tell bsdi 62
- TCP; Transmission Control Protocol - (1) TCP (2) TCP Interactive Data Flow (3) TCP Bulk Data Flow (4) TCP Data Retransmission (5) TCP Persist Timer (6) TCP Keep Alive Timer (7) 63
- - (1) Silly Window Syndrome (2) MTU Discovery (3) Window scaling for long fat-pipe (4) T/TCP (Transaction TCP) (5) Rate Control (6) ECN(Explicit Congestion Notification) 64
Path MTU Discovery [ ] (Path MTU) [ ] ICMP (DF; Don t Fragment ) 10 65
1 (0.0 ) solaris.33016 > slip.discard: S 1:1(0) win 8760 <mss 1460> (DF) 2 (0.1016) slip.discard > solaris.33016: S 1:1(0) ack 1 win 4096 <mss 512> 3 (0.5290) solaris.33016 > slip.discard: P 1:513(512) ack 1 win 4096 <mss 512> 4 (0.0038) bsdi > solaris: icmp: slip unreachable - need to frag, mtu = 296 (DF) 5 (0.0259) solaris.33016 > slip.discard: F 513:513(0) ack 1 win 9216 (DF) 6 (0.0923) slip.discard > solaris.33016:. ack 1 win 4096 7 (0.3577) solaris.33016 > slip.discard: P 1:257(256) ack 1 win 9216 (DF) 8 (0.3290) slip.doscard > solaris.33016:. ack 257 win 3840 9 (0.3308) solaris.33016 > slip.discard: FP 257:513(256) ack 1 win 9216 (DF) 10 (0.3208) slip.discard > solaris.33016:. ack win 3840 11 (0.0422) slip.discard > solaris.33016: F 1:1(0) ack 514 win4096 12 (0.1719) slip.discard > splaris.33016:. ack 2 win 9216 (DF) <mss 1460> <mss 296> solaris bsdi slip 512 B (DF) ICMP too big (mss 296) 66
Window Scaling for Long Fat Pipe - RFC1323 - Network Bandwidth bps RTT ms BWxRTT B Ethernet 10.000 M 3 3,750 T1 1.544 M 60 11,580 T1 1,544 M 500 96,500 T3 45,000 M 60 337,500 OC12 2,400,000 M 60 7,500,000 Max. Window Size 2^(16) Bytes = 64KB Window Scaling ; wscale wscale=n 64 x 2^(n) window 67
Window Scaling for Long Fat Pipe 1 vangogh.4107 > bsdi.echo: S 1:1(0) win 65535 <mss 512, nop, wscale 1, nop, nop, timestamp, 995351> 2 ( 0.0031) bsdi.echo > vangogh.4107: S 1:1(0) ack 1 win 4906 <mss 512> 3 ( 0.2972) vangogh.4107 > bsdi.echo:. ack 1 win 65535 4 (16.6198) vangogh.4107 > bsdi.echo: P 1:14(13) ack 1 win 65535 5 ( 0.0030) bsdi.echo > vangogh.4107: P 1:14(13) ack 14 win 4096 6 ( 0.2971) vangogh.4107 > bsdi.echo:. ack 14 win 65535 7 ( 9.4202) vangogh.4107 > bsdi.echo: F 14:14(0) ack 14 win 65535 8 ( 0.0024) bsdi.echo > vangogh.4107:. ack 15 win 4096 9 ( 0.0013) bsdi.echo > vangogh.4107: F 14:14(0) ack 15 win 4096 10 ( 0.2363) vangogh.4107 > bsdi.echo:. ack 15 win 65535 11 (17.5200) vangogh.4107 > bsdi.echo: S 1:1(0) win 65535 <mss 512, nop, wscale 2, nop, nop, timestamp 995440> 12 ( 0.0031) bsdi.echo > vangogh.4107: S 1:1(0) ack 1 win 4096 <mss 512> 13 ( 0.2967) vangogh.4107 > bsdi.echo:. ack 1 win 65535 nop; no operation wscale ; window scale 68
RFC 1379 ; T/TCP - Transaction TCP - [ ] TCP [ ] CC (Connection Count) Option SYN Piggy-back ; half-synchronization (1) SYN, Data, FIN, CC (2) SYN, SYN-ACK, Data, FIN, FIN-ACK, CC, CC-Echo (3) FIN-ACK 69
Client SYN (a) SYN_ACK(a+1,b) RFC 1379 ; T/TCP ACK(b+1) Data (a+2) Data_ACK(a+2,b+1) Server Client SYN,Data,FIN,CC SYN,S-ack,Data, F,F-ack FIN-ACK Server FIN (m,s) ACK (m+1) FIN_ACK (m+1,s) ACK (s+1) 9 3 70
TCP Destination Node 1 Source Node 1 Window Line Speed with Window Rate Shaped Transmission with Window 71
Window Window Line Speed with Window TCP Rate Window Shaped Transmission with Window RED ECN RED ECN RED ECN 72
ECN(Explicit Congestion Notification) TOS for Differentiated Service - PHB(Per-Hop-Behavior) - CU(Currently Unused) => for ECN(Explicit Congestion Notification)? TOS : 0 1 2 3 4 5 6 7 PHB CU PHB: 000000 DE (Default Service) 101110 EF (Expedited Forwarding) Others AF (Assured Forwarding) xxxxx0 Standard Purpose xxxx11 Experimental Purpose xxxx01 Experimental Purpose 73
Explicit Congestion Notification (ECN) Congestion Node (Set ECN bit) (8) ECN=11 (2) ECN=01 Reduce Speed Destination Node 1 (7) ECN=10 (1) ECN=00 (5) ECN=11 (9) ECN=11 (3) ECN=01 (4) ECN=10 Source Node 1 (6) ECN=11 Reduce Speed ; 74