Presentation is loading. Please wait.

Presentation is loading. Please wait.

TCP/IP. 2 경북대학교 이동통신망 연구실 Layering in a TCP/IP Internet Environment Application Transport Network Interface Internet Application Transport Network Interface.

Similar presentations


Presentation on theme: "TCP/IP. 2 경북대학교 이동통신망 연구실 Layering in a TCP/IP Internet Environment Application Transport Network Interface Internet Application Transport Network Interface."— Presentation transcript:

1 TCP/IP

2 2 경북대학교 이동통신망 연구실 Layering in a TCP/IP Internet Environment Application Transport Network Interface Internet Application Transport Network Interface Internet Host A Host B Internet Network Interface Physical Net 1 Router R identical message identical packet identical datagram identical frame identical datagram identical frame Physical Net 1

3 3 경북대학교 이동통신망 연구실 Two Boundaries in the TCP/IP Model High-level protocol address boundary  Application programs as well as all protocol s/w from the Internet layer upward use only IP addresses; the network interface layer handles physical addresses Operating system boundary Software outside the operating system Application Transport Internet Network Interface Conceptual Layer Hardware Boundary Software inside the operating system Only IP addresses used Physical addresses used High-level protocol address boundary Operating System boundary

4 4 경북대학교 이동통신망 연구실 TCP/IP Layering User Process User Process User Process User Process TCPUDP ICMPIP ARP Hardware Interface IGMP RARP application transport network link media

5 5 경북대학교 이동통신망 연구실 Encapsulation Application TCP Application Ethernet driver IP Ethernet Application TCP Application Ethernet driver IP User data Appl header Application data TCP header Application data TCP header IP header Application data TCP header IP header Ethernet trailer Ethernet header Application data TCP header IP header Ethernet trailer Ethernet header Application data TCP header User data Appl header User data

6 TCP (Transmission Control Protocol)

7 7 경북대학교 이동통신망 연구실 TCP three-way handshake Connection Request (SYN=1, seq=client_isn) ACK(SYN=0, seq=client_isn+1, ack=server_isn+1) Connection Response (SYN=1, seq=server_isn, ack=client_isn) Connection Establish

8 8 경북대학교 이동통신망 연구실 TCP three-way handshake Connection Termination FIN ACK FIN ACK Close Closed Timed wait

9 9 경북대학교 이동통신망 연구실 TCP Segment Format SOURCE PORTDESTINATION PORT SEQUENCE NUMBER ACKNOWLEDGEMENT NUMBER WINDOWHLENRESERVEDCODE BITS URGENT POINTERCHECKSUM OPTIONS (IF ANY)PADDING DATA SOURCE PORTDESTINATION PORTSOURCE PORT Identify the sending and receiving application SEQUENCE NUMBER ACKNOWLEDGEMENT NUMBER HLEN The length of the header in 32-bit words CODE BITS URG The urgent pointer is valid ACK The acknowledgment number is valid PSH The receiver should pass this data to the application as soon as possible RST Reset the connection SYN Synchronize sequence numbers to initiate a connection FIN The sender is finished sending data WINDOW The number of bytes, starting with the one specified by the acknowledgmnet number field, that the receiver is willing to accept CHECKSUM This is a mandatory filed that must be calculated and stored by the sender and than verified by the reciever URGENT POINTER Valid only if the URG flag is set Contains the next sequence number that the sender of the acknowledgment expects to receive Identifies the byte in the stream of data from the sending TCP to the receiving TCP that the first byte of data in this segment represents

10 10 경북대학교 이동통신망 연구실 Sliding windows … Offered window (advertised by receiver) Usable window Sent and acknowledged Sent, not ACKed Can send ASAP Window moves Can’t send until Window advertised by segment2 Data sent in Segments 4, 5, 6 Window advertised by segment7 ACKed by Segments 7 Data sent in Segments 11,12,13 Window advertised by segment10 ACKed by Segment 10 Data sent in Segments 9 Window ∼ segment8 ACKed by Segment 8 ACKed by Segments 14 Window ∼ segment14 Data sent in Segments 15

11 11 경북대학교 이동통신망 연구실 Congestion Control Transmission rate adjustment Transmission network Small-capacity receiver Large-capacity receiver Internal congestion Congestion: a condition of severe delay caused by an overload of datagrams at one or more switching point (e.g., at routers)  When the sum of the connection rates over a link is higher than the link’s rate segments can be dropped

12 12 경북대학교 이동통신망 연구실 Congestion Control To avoid congestion collapse, TCP must reduce transmission rates when congestion occurs Routers watch queue lengths and use techniques ICMP source quench to inform host that congestion has occurred TCP uses packet drops and timeout as congestion indication To avoid congestion in advance, the sender must adapt its transmission window to the available link bandwidth TCP connection’s rate is determined as transmission window/round trip time

13 13 경북대학교 이동통신망 연구실 Flow Control TCP views the data stream as a sequence of octets that it divides into segments for transmission TCP uses a sliding window mechanism to adjust the sender’s transmission speed to that of the receiver The sliding window permits the sending of multiple segments before waiting for an ACK -> efficient transmission ACK segments indicate the last correctly received byte and the number of bytes the receiver is still willing to accept A sender keeps three pointers associated with every connection current window

14 14 경북대학교 이동통신망 연구실 Flow Control TCP allows the window size to vary over time ACK contains a window advertisement that specifies how many additional octets of data the receiver is prepared to accept (receiver’s buffer size) In response to an increased(decreased) window advertisement, the sender increases(decreases) the size of its sliding window Variable size window provides flow control as well as reliable transfer Flow control mechanism is essential in Internet environment, where machines of various speeds and sizes communicate through networks and routers of various speed and capacities  End-to-end flow control: sliding window scheme  Congestion control: no explicit mechanism, implementation dependent

15 15 경북대학교 이동통신망 연구실 Slow Start CWND/rtt If CWND is less than or equal to SSTHRESTH : Slow start Slow start dictates that CWND start at one segment, and be incremented by one segment every time an ACK is received

16 16 경북대학교 이동통신망 연구실 CWND If (cwnd >= ssthreshod)  When Ack is received,  Cwnd = cwnd+(1/cwnd) The linear increase of CWND Round-trip time Cwnd segment Time out occurs Congestion avoidance

17 17 경북대학교 이동통신망 연구실 Congestion control & Avoidance Congestion window Slow start ssthresh time Cwnd = ssthres + 3 * segment Next ack arrives that acknowledges new segment Fast recovery Cwnd/2 [additive increase & multiplicative decrease] Fast retransmit ! Congestion avoidance

18 18 경북대학교 이동통신망 연구실 Congestion control & Avoidance Congestion window Slow start ssthresh Congestion avoidance Cwnd = 1, Ssthresh = current window size / 2 timeout Slow start time [Fast retransmit & fast recovery] Timeout occur By congestion! Congestion avoidance

19 19 경북대학교 이동통신망 연구실 Congestion control & Avoidance Congestion window Slow start ssthresh time ssthresh Fast retransmit ! Cwnd = ssthres + 3 * segment Next ack arrives that acknowledges new segment Fast recovery Cwnd/2 Congestion window Slow start ssthresh Congestion avoidance Timeout occur By congestion! Then, Cwnd = 1 Ssthresh = current window size / 2 timeout Slow start Congestio n avoidance time [additive increase & multiplicative decrease][Fast retransmit & fast recovery]

20 20 경북대학교 이동통신망 연구실 Fast Retransmit duplicate ACK The purpose is to let the other end know that a segment was received out of order, and to tell it what sequence number is expected Fast Retransmission When the third duplicate ACK is received - ssthresh : one-half of the minimum of the cwnd and the receiver’s advertised window - retransmit the missing segment - cwnd : ssthresh +3*the segment size

21 21 경북대학교 이동통신망 연구실 Fast Recovery Fast recovery -governs the re-transmission of new data until non-duplicate ACKs are received - When 3 duplicate ACKs are received ssthresh = max (FlightSize/2,2*SMSS) - Re-transmit the lost segment and CWND = SSTHRESH + 3 * SMSS - For each duplicate ACK, CWND += SMSS - Transmit a segment if allowed by the values of CWND and RWND When a non-duplicate ACK arrives, CWND = SSTHRESH Fast recovery Packet loss W W/2 1st Fast Retransmission Timeout CWND Inflate W/4 2nd Fast Retransmission Wait for Timeout Window Size

22 IP (Internet Protocol)

23 23 경북대학교 이동통신망 연구실 IP Service Model Datagram: each packet is independent of all others Best effort: packet may arrive or not after some time Internet architecture and philosophy Application Services Reliable Transport Service Connectionless Packet Delivery Service

24 24 경북대학교 이동통신망 연구실 IP Service Model A user thinks of an internet as a single virtual network that interconnects all hosts, and through which communication is possible; its underlying architecture is both hidden and irrelevant IP packet delivery service  Unreliable: lost, duplicated, delayed, or delivered out of order  Best-effort  Connectionless IP protocol provides three important definitions  Basic unit of data transfer  Routing function  A set of rules that embody the idea of unreliable packet delivery

25 25 경북대학교 이동통신망 연구실 IP Datagram Format VERSION TOTAL LENGTH IDENTIFICATION SOURCE IP ADDRESS data HEADER LENGTH TOS FRAGMENT OFFSETFLAGS HEADER CHECKSUMPROTOCOLTTL DESTINATION IP ADDRESS OPTIONS

26 26 경북대학교 이동통신망 연구실 Fragmentation Datagram Size, Network MTU, and Fragmentation  MTU: fixed upper bound on the amount data that can be transferred in one physical frame e.g.) Ethernet: 1500 octets, FDDI: 4470 octets  It is efficient to select a maximum datagram size such that a datagram would always fit into one frame  But, a datagram may travel across many types of physical networks  Limiting datagrams to fit the smallest possible MTU in the internet -- > inefficient transmission  Fragmentation: dividing large datagrams into smaller pieces when the datagram needs to traverse a network that has a small MTU  Fragments must be reassembled at the destination  If any fragments are lost, the datagram cannot be reassembled. cf) reassembly timer Fragmentation control  IDENTIFICATION  FLAGS: Don’t Fragment bit, More Fragments bit,  FRAGMENT OFFSET

27 27 경북대학교 이동통신망 연구실 Fragmentation (cont.) Example Host A MTU=1500 R1 Net 2 MTU=620 R2 Net 3 Net 1 Host B MTU=1500

28 28 경북대학교 이동통신망 연구실 Fragmentation (cont.) Datagram Header data1 600 octets data2 600 octets data3 200 octets Fragment 1 Header data1Fragment 1 (offset 0) Fragment 3 (offset 1200) Fragment 2 (offset 600) Fragment 2 Header data2 Fragment 3 Header data3

29 29 경북대학교 이동통신망 연구실 Internet Datagram Options Included primary for network testing or debugging Option code (1 octet) Option length (1 octet) Data (variable) Record route option Source route option  Strict source routing  Loose source routing Time stamp option (Rarely used not all routes support them) COPY OPTION CLASS OPTION NUMBER

30 30 경북대학교 이동통신망 연구실 IP Record Route Option Source creates empty list of <= 9 IP addresses Option: length, pointer, list of IP addresses Routers note outgoing interface in list

31 31 경북대학교 이동통신망 연구실 IP Source Route Options Source determines path taken by packets(<= 9 hops) Loose: any number of hops between Strict: every hop; if not directly connected, discard Same format as record route option route overwrites with address of outgoing interface Must be copied to fragments Destination should reverse route for return address Not too popular => degrade router performance

32 New TCP

33 33 경북대학교 이동통신망 연구실 1. Tahoe Time-out 또는 duplicate Ack 가 3 개 수신된 경우,  ssthreshold = cwnd/2  cwnd = 1(dup ack 3 개 수신시 fast retransmission 수행 ) 정상적인 Ack 인 경우  cwnd < ssthreshold, cwnd = cwnd + 1 : Slow Start 단계  그밖의 경우, cwnd = cwnd + 1/cwnd : 혼잡회피 단계 Fast retransmission Duplicate ack 3 개 수신시 Fast recovery 과정이 없다. Slow start, Congestion avoidance, Fast retransmission

34 34 경북대학교 이동통신망 연구실 Ack 도달 패킷손실 Fast recovery 2. Reno Duplicate Ack 가 3 개 수신된 경 우,  fast retransmission, cwnd=ssthresh+3(ssthresh = cwnd/2), fast recovery, cwnd = ssthreshold - slow start 를 수 행하지 않음 Time-out 시  ssthreshold = cwnd/2, cwnd =1(slow start 수행 ) 정상적인 Ack 인 경우  cwnd < ssthreshold, cwnd = cwnd + 1 : Slow Start 단계  cwnd = cwnd + 1/cwnd : 혼 잡회피 단계 Tahoe + fast recovery 송신기 정지

35 35 경북대학교 이동통신망 연구실 3. New Reno 한 윈도우 내에서 다수의 패킷손실이 발생할 때, 송신기의 재전송 타이머가 종료될 때까지, 송신기가 정 지되는 문제를 해결한 알고리즘. Duplicate Ack 가 3 개 수신된 경우, fast retransmission, cwnd=ssthresh+3(ssthresh = cwnd/2), fast recovery, duplicate ack 없이 RTT 마다 손실된 패킷을 전송, cwnd = ssthreshold - congestion avoidance 수행. Time-out 시 ssthreshold = cwnd/2, cwnd =1(slow start 수행 ) Partial ack : 송신기가 손실된 패킷을 재전 송하여 수신기에 수신되어 발생된 ack 로 cwnd 의 크기를 변화시키지 않으며 fast recovery 를 유지한다. Tahoe + fast recovery

36 36 경북대학교 이동통신망 연구실 4. Vegas Reno + new slow start new congestion avoidance new retransmission modified timeout ( 정교한 time tick 사용 )  40-70% 의 throughput 개선, 1/2-1/5 의 loss 감소

37 37 경북대학교 이동통신망 연구실 5. Vegas 의 주요 특징 new slow start : rtt 마다 기존의 방식을 따르되, expected rate 가 실제 전송율에 비해 특정값보다 크면 ssthresh 와 무관하게 congestion avoidance 수행. new retransmission : 1st duplcate 수신시, rtt 값이 타임아웃값보다 크면 재전송 수행. new congestion avoidance : 예측한 전송율을 기준으로 측한 전송율을 기준으로 실제 측정한 전송율이 크 면 윈도우를 증가시키고, 실제 측정한 전송율이 작으면 윈도우를 감소시킴으로써 망의 혼잡을 피하여 패킷손실을 줄일 수 있다. Diff=expected rate-actual rate Diff<  : 윈도우 증가 Diff>  : 윈도우 감소 

38 38 경북대학교 이동통신망 연구실 6. SACK (Selective Ack) 한 윈도우 내에서 다수의 패킷손 실이 발생한 상황에서 한 RTT 내에서 손실패킷을 전부 재전송 하는 알고리즘. SACK Option 으로 수신한 패킷 상태를 송신기에게 알리고, 송신 기는 손실된 패킷만을 재전송하 므로 타임아웃의 발생확률이 적 다. Sack permitted( 송신기 )  Sack option( 수신기 ) SS, Fast recovery, multiple Retransmission, Congestion avoidance

39 39 경북대학교 이동통신망 연구실 Characteristics of Wireless Media Channel Losses Low Bandwidth Signal Fading Movement across Cells Channel Asymmetry Link Latency

40 40 경북대학교 이동통신망 연구실 Selective Acknowledgments receiver informs sender of contiguous and isolated blocks of data that have been successfully received and queued Receiver’s Buffer ACK 200 SACK ACK ACK 200 SACK , sender receive r

41 41 경북대학교 이동통신망 연구실 SMART Retransmission Build bitmask at sender Receiver sends both cumulative ack and packet that caused ack (6,6)(6,8)(6,10) Send 7Send

42 42 경북대학교 이동통신망 연구실 TCP-Probing Three distinct tactics in response to the error detected  Slow Start (for congestion detected by timeout)  Fast Recovery (for moderated congestion detected by three duplicated acks)  Immediate Recovery (for congestion-free path): more effective than Reno and Tahoe when the sending window is not too small. ESTAB PR1_SENTPR2_SENT PR1_RCVD 3 Dack or Timeout PR1_ACK PR2_ACK Probe Timeout PROBE1 PROBE2 Probing State Transition Diagram

43 43 경북대학교 이동통신망 연구실 Negative Acknowledgments Negative ACKs  in the options field of TCP header  Explicitly indicate which packet has been received in error  The sender can retransmit the packet without modifying the congestion window size

44 44 경북대학교 이동통신망 연구실 ACK pacing The goal of pacing  to evenly spread the transmission of a window of packets across the entire duration of the round trip time. A rate based approach to ACK generation at the receiver. Advantage vs drawbacks  Avoid bursty traffic  Not distinguish between congestion losses and wireless losses  Delayed congestion signal  Queue situation

45 45 경북대학교 이동통신망 연구실 Explicit Bad State Notification Sending EBSN messages whenever the base station is unsuccessful in transmitting a packet over the wireless network Not pure End-to-end TCP Receiver TCP Sender Base Station EBSN Reset restart the TCP timer something is wrong in wireless link~!!! Local recovery

46 46 경북대학교 이동통신망 연구실 Explicit Loss Notification Strategies Not pure End-to-end A base station  Monitoring TCP packets in either direction.  Set ELN bit, to inform the sender that the packet has been lost on the wireless link. TCP Receiver TCP Sender Base Station ACK with ELN Retransmission loss packet. Packet has been loss on the wireless link. Ok… retransmit packet but Not reduce congestion window

47 47 경북대학교 이동통신망 연구실 Indirect TCP Two separate connections  Violating the end-to-end semantics of TCP  Flow/error control protocols, packet size, time-out, may be different for each part Need Handoff mechanism TCP Receiver TCP Sender Base Station application transport network link physical application transport network link physical

48 48 경북대학교 이동통신망 연구실 Delayed Duplicated ACKs It is a TCP unaware scheme. TCP receiver reduces interference between TCP and link level retransmission by delaying third and subsequent dupacks for interval d. The base station implements a link level retransmission scheme for lost packets. It is preferred over snoop in IPSEC Link level ack ’ s are used to trigger link level retransmission Dupacks for further consecutive packets are delayed for duration d  not use general congestion control algorithm application transport network link physical application transport network link physical retransmission Wait interval d


Download ppt "TCP/IP. 2 경북대학교 이동통신망 연구실 Layering in a TCP/IP Internet Environment Application Transport Network Interface Internet Application Transport Network Interface."

Similar presentations


Ads by Google