Presentation is loading. Please wait.

Presentation is loading. Please wait.


Similar presentations

Presentation on theme: "TCP/IP."— Presentation transcript:


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

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 Conceptual Layer Boundary Application Software outside the operating system Operating System boundary Transport Software inside the operating system Internet Only IP addresses used High-level protocol address boundary Network Interface Physical addresses used Hardware 경북대학교 이동통신망 연구실

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

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

6 TCP (Transmission Control Protocol)

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

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

TCP Segment Format 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 Identify the sending and receiving application 4 10 16 24 31 SOURCE PORT SOURCE PORT SOURCE PORT DESTINATION PORT DESTINATION PORT 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 SEQUENCE NUMBER SEQUENCE NUMBER SEQUENCE NUMBER ACKNOWLEDGEMENT NUMBER ACKNOWLEDGEMENT NUMBER ACKNOWLEDGEMENT NUMBER Contains the next sequence number that the sender of the acknowledgment expects to receive HLEN HLEN RESERVED CODE BITS CODE BITS WINDOW WINDOW CHECKSUM CHECKSUM URGENT POINTER URGENT POINTER OPTIONS (IF ANY) The number of bytes, starting with the one specified by the acknowledgmnet number field, that the receiver is willing to accept PADDING The length of the header in 32-bit words Valid only if the URG flag is set DATA This is a mandatory filed that must be calculated and stored by the sender and than verified by the reciever . . . 경북대학교 이동통신망 연구실

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

11 Congestion Control 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 Transmission rate adjustment Transmission network Internal congestion Small-capacity receiver Large-capacity receiver 경북대학교 이동통신망 연구실

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 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 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 Slow Start 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 CWND/rtt 경북대학교 이동통신망 연구실

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

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

19 Congestion control & Avoidance
Congestion window Slow start ssthresh time 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 time [additive increase & multiplicative decrease] [Fast retransmit & fast recovery] 경북대학교 이동통신망 연구실

20 Fast Retransmit duplicate ACK When the third duplicate ACK is received
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 Fast Recovery 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 Wait for Window Size 경북대학교 이동통신망 연구실

22 IP (Internet Protocol)

23 Reliable Transport Service Connectionless Packet Delivery Service
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 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 경북대학교 이동통신망 연구실


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 Fragmentation (cont.) Example B Host A Net 3 Net 1 MTU=1500 Net 2
경북대학교 이동통신망 연구실

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

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 1 2 3 4 5 6 7 경북대학교 이동통신망 연구실

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 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 1. Tahoe  Slow start, Congestion avoidance, Fast retransmission
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 : 혼잡회피 단계 Duplicate ack 3개 수신시 Fast retransmission Fast recovery 과정이 없다. 경북대학교 이동통신망 연구실

34 2. Reno  Tahoe + fast recovery Duplicate Ack가 3개 수신된 경우, Time-out시
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 : 혼잡회피 단계 Ack도달 패킷손실 Fast recovery 송신기 정지 경북대학교 이동통신망 연구실

35 3. New Reno  Tahoe + fast recovery
한 윈도우 내에서 다수의 패킷손실이 발생할 때, 송신기의 재전송 타이머가 종료될 때까지, 송신기가 정지되는 문제를 해결한 알고리즘. 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를 유지한다. 경북대학교 이동통신망 연구실

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

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

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

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 sender receiver ACK 200 SACK ACK 200 SACK , 경북대학교 이동통신망 연구실

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

42 Probing State Transition Diagram
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. PR1_RCVD PROBE1 PROBE2 ESTAB 3 Dack or Timeout PR2_ACK PR1_SENT PR2_SENT PR1_ACK Probe Timeout Timeout Probing State Transition Diagram 경북대학교 이동통신망 연구실

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 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 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 Reset restart the TCP timer something is wrong in wireless link~!!! TCP Receiver TCP Sender Base Station EBSN Local recovery 경북대학교 이동통신망 연구실

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. Ok… retransmit packet but Not reduce congestion window Retransmission loss packet. Packet has been loss on the wireless link. 4 3 2 1 4 3 2 1 TCP Receiver TCP Sender Base Station ACK with ELN 1 1 경북대학교 이동통신망 연구실

47 Indirect TCP Two separate connections Need Handoff mechanism
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 application transport network link physical application transport network link physical TCP Receiver TCP Sender Base Station 경북대학교 이동통신망 연구실

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 retransmission Wait interval d 경북대학교 이동통신망 연구실

Download ppt "TCP/IP."

Similar presentations

Ads by Google