ImageVerifierCode 换一换
格式:PPT , 页数:29 ,大小:351KB ,
资源ID:378417      下载积分:2000 积分
快捷下载
登录下载
邮箱/手机:
温馨提示:
如需开发票,请勿充值!快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝扫码支付 微信扫码支付   
注意:如需开发票,请勿充值!
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【http://www.mydoc123.com/d-378417.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(Announcement.ppt)为本站会员(boatfragile160)主动上传,麦多课文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文库(发送邮件至master@mydoc123.com或直接QQ联系客服),我们立即给予删除!

Announcement.ppt

1、1,Announcement,Project 2 out Much harder than project 1, start early!Homework 2 due next Tuesday,2,Previous Lecture,Reliable transfer protocols rdt 2.0: data corruption - ACK/NAK rdt2.1: ACK/NAK corruption - Seq # in data rdt2.2: a NAK-free protocol - Seq # in ACKs rdt3.0: channels with errors and l

2、oss Retransmission timeout Pipelined protocols Go-back-N Selective repeat,3,Go-Back-N,Sender: k-bit seq # in pkt header (the range of 0 , 2k - 1) “window” of up to N, consecutive unacked pkts allowed,ACK(n): ACKs all pkts up to, including seq # n - “cumulative ACK” may deceive duplicate ACKs (see re

3、ceiver) One timer for all packets in-flight timeout: retransmit all packets in flight,4,Selective repeat: sender, receiver windows,5,Outline,Connection-oriented transport: TCP Overview and segment structure Reliable data transfer Flow control Connection management,6,TCP: Overview RFCs: 793, 1122, 13

4、23, 2018, 2581,full duplex data: bi-directional data flow in same connection MSS: maximum segment size connection-oriented: handshaking (exchange of control msgs) inits sender, receiver state before data exchange flow controlled: sender will not overwhelm receiver,point-to-point: one sender, one rec

5、eiver reliable, in-order byte steam: no “message boundaries” pipelined: TCP congestion and flow control set window size send & receive buffers,7,TCP segment structure,URG: urgent data (generally not used),ACK: ACK # valid,PSH: push data now (generally not used),RST, SYN, FIN: connection estab (setup

6、, teardown commands),# bytes rcvr willing to accept,counting by bytes of data (not segments!),Internet checksum (as in UDP),8,TCP seq. #s and ACKs,Seq. #s: byte stream “number” of first byte in segments data ACKs: seq # of next byte expected from other side cumulative ACK Q: how receiver handles out

7、-of-order segments A: TCP spec doesnt say, - up to implementor,Host A,Host B,Seq=42, ACK=79, data = C,Seq=79, ACK=43, data = C,Seq=43, ACK=80,User types C,host ACKs receipt of echoed C,host ACKs receipt of C, echoes back C,simple telnet scenario,9,TCP Round Trip Time and Timeout,Q: how to set TCP ti

8、meout value? longer than RTT but RTT varies too short: premature timeout unnecessary retransmissions too long: slow reaction to segment loss,Q: how to estimate RTT? SampleRTT: measured time from segment transmission until ACK receipt ignore retransmissions SampleRTT will vary, want estimated RTT “sm

9、oother” average several recent measurements, not just current SampleRTT,10,TCP Round Trip Time and Timeout,EstimatedRTT = (1- )*EstimatedRTT + *SampleRTT,Exponential weighted moving average influence of past sample decreases exponentially fast typical value: = 0.125The weighted average puts more wei

10、ght on recent samples which better reflect the current congestion,11,Example RTT estimation:,12,TCP Round Trip Time and Timeout,Setting the timeout EstimtedRTT plus “safety margin” large variation in EstimatedRTT - larger safety margin first estimate of how much SampleRTT deviates from EstimatedRTT:

11、,TimeoutInterval = EstimatedRTT + 4*DevRTT,DevRTT = (1-)*DevRTT +*|SampleRTT-EstimatedRTT|(typically, = 0.25),Then set timeout interval:,13,Outline,Connection-oriented transport: TCP Overview and segment structure Reliable data transfer Flow control Connection management,14,TCP reliable data transfe

12、r,TCP creates rdt service on top of IPs unreliable service Pipelined segments Cumulative acks TCP uses single retransmission timer,Retransmissions are triggered by: timeout events duplicate acks Initially consider simplified TCP sender:ignore duplicate acks Use only timeout ignore flow control, cong

13、estion control,15,TCP sender events:,data rcvd from app: Create segment with seq # seq # is byte-stream number of first data byte in segment start timer if not already running (think of timer as for oldest unacked segment),timeout: retransmit segment that caused timeout restart timerAck rcvd: If ack

14、nowledges previously unacked segments update what is known to be acked start timer if there are outstanding segments,16,TCP sender (simplified),NextSeqNum = InitialSeqNumSendBase = InitialSeqNumloop (forever) switch(event) event: data received from application above create TCP segment with sequence

15、number NextSeqNum if (timer currently not running)start timerpass segment to IP NextSeqNum = NextSeqNum + length(data) event: timer timeoutretransmit not-yet-acknowledged segment with smallest sequence numberstart timerevent: ACK received, with ACK field value of y if (y SendBase) SendBase = yif (th

16、ere are currently not-yet-acknowledged segments)start timer /* end of loop forever */,Comment:SendBase-1: last cumulatively acked byte Example:SendBase-1 = 71; y= 73, so the rcvr wants 73+ ; y SendBase, so that new data is acked,17,TCP: retransmission scenarios,Host A,Seq=100, 20 bytes data,ACK=100,

17、premature timeout,Host B,Seq=92, 8 bytes data,ACK=120,Seq=92, 8 bytes data,ACK=120,Seq=92 timeout,SendBase = 100,SendBase = 120,SendBase = 120,Sendbase = 100,18,TCP retransmission scenarios (more),SendBase = 120,timeout: When timeout expires after T0 no packet was received for the last TO period Cou

18、ld be a congestion TO=2*TO,19,TCP ACK generation RFC 1122, RFC 2581,Event at ReceiverArrival of in-order segment with expected seq #. All data up to expected seq # already ACKedArrival of in-order segment with expected seq #. One other segment has ACK pendingArrival of out-of-order segment higher-th

19、an-expect seq. # . Gap detectedArrival of segment that partially or completely fills gap,TCP Receiver actionDelayed ACK. Wait up to 500ms for next segment. If no next segment, send ACKImmediately send single cumulative ACK, ACKing both in-order segments Immediately send duplicate ACK, indicating seq

20、. # of next expected byteImmediate send ACK, provided that segment starts at lower end of gap,20,Fast Retransmit,Time-out period often relatively long: long delay before resending lost packet Detect lost segments via duplicate ACKs. Sender often sends many segments back-to-back If segment is lost, t

21、here will likely be many duplicate ACKs.,If sender receives 3 ACKs for the same data, it supposes that segment after ACKed data was lost: fast retransmit: resend segment before timer expires,21,event: ACK received, with ACK field value of y if (y SendBase) SendBase = yif (there are currently not-yet

22、-acknowledged segments)start timer else increment count of dup ACKs received for yif (count of dup ACKs received for y = 3) resend segment with sequence number y,Fast retransmit algorithm:,a duplicate ACK for already ACKed segment,fast retransmit,22,Outline,Connection-oriented transport: TCP Overvie

23、w and segment structure Reliable data transfer Flow control Connection management,23,TCP Flow Control,receive side of TCP connection has a receive buffer:,speed-matching service: matching the send rate to the receiving apps drain rate,app process may be slow at reading from buffer,24,TCP Flow contro

24、l: how it works,(Suppose TCP receiver discards out-of-order segments) spare room in buffer = RcvWindow = RcvBuffer-LastByteRcvd - LastByteRead,Rcvr advertises spare room by including value of RcvWindow in segments Sender limits unACKed data to RcvWindow guarantees receive buffer doesnt overflowPatho

25、logical scenario RcvWindow=0 Sender has no packets to send,25,Outline,Connection-oriented transport: TCP Overview and segment structure Reliable data transfer Flow control Connection management,26,TCP Connection Management,Recall: TCP sender, receiver establish “connection” before exchanging data se

26、gments initialize TCP variables: seq. #s buffers, flow control info (e.g. RcvWindow) client: connection initiatorSocket clientSocket = new Socket(“hostname“,“port number“); server: contacted by clientSocket connectionSocket = welcomeSocket.accept();,Three way handshake: Step 1: client host sends TCP

27、 SYN segment to server specifies initial seq # no data Step 2: server host receives SYN, replies with SYNACK segment server allocates buffers specifies server initial seq. # Step 3: client receives SYNACK, replies with ACK segment, which may contain data,27,TCP Connection Management (cont.),Closing

28、a connection: client closes socket: clientSocket.close(); Step 1: client end system sends TCP FIN control segment to server Step 2: server receives FIN, replies with ACK. Closes connection, sends FIN.,28,TCP Connection Management (cont.),Step 3: client receives FIN, replies with ACK. Enters “timed wait” - will respond with ACK to received FINs Step 4: server, receives ACK. Connection closed.,client,FIN,server,ACK,ACK,FIN,closing,closing,closed,timed wait,closed,29,TCP Connection Management (cont),TCP client lifecycle,TCP server lifecycle,

copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1