版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
3.5Connection-OrientedTransport:TCP
Overview
RFCs:793,1122,1323,2018,2581
3.5.1TheTCPConnectionfullduplexdata:bi-directionaldataflowinsameconnectionMSS:maximumsegmentsizeconnection-oriented:
handshaking(exchangeofcontrolmsgs)init’ssender,receiverstatebeforedataexchangeflowcontrolled:senderwillnotoverwhelmreceiverpoint-to-point:onesender,onereceiver
reliable,in-orderbytestream:no“messageboundaries”pipelined:TCPcongestionandflowcontrolsetwindowsizesend&receivebuffers13:TransportLayer3.5.2TCPsegmentstructuresourceport#destport#32bitsapplicationdata(variablelength)sequencenumberacknowledgementnumberrcvrwindowsizeptrurgentdatachecksumFSRPAUheadlennotusedOptions(variablelength)URG:urgentdata(generallynotused)ACK:ACK#validPSH:pushdatanow(generallynotused)RST,SYN,FIN:Connectionestablishment(setup,teardowncommands)#bytesrcvrwillingtoacceptcountingbybytesofdata(notsegments!)Internetchecksum(asinUDP)23:TransportLayerTCPseq.#’sandACKsSeq.#’s:bytestream“number”offirstbyteinsegment’sdataACKs:seq#ofnextbyteexpectedfromothersidecumulativeACKQ:howreceiverhandlesout-of-ordersegmentsA:TCPspecdoesn’tsay,-uptoimplementorHostAHostBSeq=42,ACK=79,data=‘C’Seq=79,ACK=43,data=‘C’Seq=43,ACK=80Usertypes‘C’hostACKsreceiptofechoed‘C’hostACKsreceiptof‘C’,echoesback‘C’timesimpletelnetscenario33:TransportLayer3.5.3TCPRoundTripTimeandTimeout
(往返计时和超时)Q:howtosetTCPtimeoutvalue?longerthanRTTnote:RTTwillvarytooshort:prematuretimeoutunnecessaryretransmissionstoolong:slowreactiontosegmentlossQ:howtoestimateRTT?SampleRTT(RTT采样):
measuredtimefromsegmenttransmissionuntilACKreceiptignoreretransmissions,cumulativelyACKedsegmentsSampleRTTwillvary,wantestimatedRTT“smoother”useseveralrecentmeasurements,notjustcurrentSampleRTT43:TransportLayerTCPRoundTripTimeandTimeoutEstimatedRTT=(1-x)*EstimatedRTT+x*SampleRTTExponentialweightedmovingaverageinfluenceofgivensampledecreasesexponentiallyfasttypicalvalueofx:
0.125SettingthetimeoutEstimtedRTTplus“safetymargin”(安全空白)largevariationinEstimatedRTT->largersafetymarginTimeout=EstimatedRTT+4*DeviationDeviation(偏差)=(1-x)*Deviation+x*|SampleRTT-EstimatedRTT|53:TransportLayer3.5.4TCP:reliabledatatransfersimplifiedsender,assumingwaitforeventwaitforeventevent:datareceivedfromapplicationaboveevent:timertimeoutforsegmentwithseq#yevent:ACKreceived,withACK#ycreate,sendsegmentretransmitsegmentACKprocessingonewaydatatransfernoflow,congestioncontrol63:TransportLayerTCP:reliabledatatransfer00
sendbase=initial_sequencenumber01nextseqnum=initial_sequencenumber0203loop(forever){
04switch(event)
05event:datareceivedfromapplicationabove06createTCPsegmentwithsequencenumbernextseqnum07starttimerforsegmentnextseqnum08passsegmenttoIP09nextseqnum=nextseqnum+length(data)10event:timertimeoutforsegmentwithsequencenumbery11retransmitsegmentwithsequencenumbery12computenewtimeoutintervalforsegmenty13restarttimerforsequencenumbery14event:ACKreceived,withACKfieldvalueofy15if(y>sendbase){/*cumulativeACKofalldatauptoy*/16cancelalltimersforsegmentswithsequencenumbers<y17sendbase=y18}19else{/*aduplicateACKforalreadyACKedsegment*/20incrementnumberofduplicateACKsreceivedfory21if(numberofduplicateACKSreceivedfory==3){22/*TCPfastretransmit*/23resendsegmentwithsequencenumbery24restarttimerforsegmenty25}26}/*endofloopforever*/
SimplifiedTCPsender73:TransportLayerTCPACKgeneration
[RFC1122,RFC2581]Eventin-ordersegmentarrival,nogaps,everythingelsealreadyACKedin-ordersegmentarrival,nogaps,onedelayedACKpendingout-of-ordersegmentarrivalhigher-than-expectseq.#gapdetectedarrivalofsegmentthatpartiallyorcompletelyfillsgapTCPReceiveractiondelayedACK.Waitupto500msfornextsegment.Ifnonextsegment,sendACKimmediatelysendsinglecumulativeACKsendduplicateACK,indicatingseq.#ofnextexpectedbyteimmediateACKifsegmentstartsatlowerendofgap83:TransportLayerTCP:retransmissionscenariosHostASeq=92,8bytesdataACK=100losstimeouttimelostACKscenarioHostBXSeq=92,8bytesdataACK=100HostASeq=100,20bytesdataACK=100Seq=92timeouttimeprematuretimeout,cumulativeACKsHostBSeq=92,8bytesdataACK=120Seq=92,8bytesdataSeq=100timeoutACK=12093:TransportLayer3.益5.反5贼T看CP愿F找lo皂w拒Co戴nt溉ro劳lre访ce捐iv牙er抓:ex蚁pl透ic挺it谅ly草i栋nf穴or讨ms画s贤en逮de煮r薄of乡丰(栋dy鸣na篇mi常ca绪ll去y湾ch见an隆gi练ng罚)轰am亮ou把nt刃o呢f阳fr趣ee哑b披uf记fe诞r寺sp莫ac司eRc划vW衫in袖do绞wfi虫el距din潮T伶CP坦s搬eg虫me奴ntse有nd纯er哑:ke丑ep孔s甚th沾e呀am别ou吼nt解o薄f妈tr续an即sm射it删te避d,un汇AC落Ke愧dda缓ta录l截es铸s恩th险an辆m呆os差t违re张ce牺nt胡ly闹r付ec寸ei去ve壤dRc剑vW册in锻do蜓wse训nd熔er护w激on剂’t榜o务ve被rr当unre知ce甩iv母er峡’s因b栏uf陈fe摔rs帮b谢ytr悔an偷sm巴it汽ti演ng减t捆oo不m犬uc但h,to术o麦fa肥stflowcontrolre绝ce睁iv草er馒b齿uf荣fe蚂ri扯ngRc垦vB酷uf召fe怎r=售si究ze夏o警r盛TC卖P伯Re帝ce骂iv诞e莫Bu萍ff铁erRc燥vW垂in队do跌w=葱am请ou最nt缓o益f牢sp敞ar遭e蛋ro却om狂i阿n笼Bu捷ff循er103:堂T串ra仍ns凤po迈rt盖L索ay胸er3.贪5.邻6越TC劝P彻Co给nn性ec冷ti嘴on声M战an住ag淘em数en妇tRe恩ca搜ll某:TC森P烦se愤nd断er蹦,逢re鲁ce鹊iv哀er诉e应st慈ab柏li总sh妨“饮co病nn寻ec尘ti脚on怖”双be劳fo秩re塞e丑xc枝ha者ng确in享g阔da饲ta福s地eg容me肝nt国sin翠it罩ia键li阅ze五T溉CP演v絮ar西ia父bl般es腔:se土q.亚#吴sbu归ff盼er缘瑞s,刚f泥lo录w得co叉nt耳ro载l摘in把fo下(花e.今g.Rc茄vW叼in浪do栏w)cl流ie辰nt听:co栗nn铲ec奶ti档on灵i恰ni蓬ti烫at捐orSo岂ck芽etcl哪ie愈nt樱So掉ck熔et=巡寿ne劝w灵So别ck画et完("排ho自st丘na姓me唯",驻"p津or喇t榜nu惑mb塞er怀")无;se饿rv浸er闷:co智nt柏ac连te步d诵by广c别li区en辆tSo按ck砌etco飞nn繁ec伐ti返on玩So寒ck壶et=we拣lc赌om泰eS确oc裂ke烧t.慰ac顺ce见pt()怖;Th撞re胖e亩wa厨y香ha战nd帽sh炸ak窜e:St棉ep工1填:cl妄ie劈燕nt还e仓nd镜s络ys停te卵m养se坐nd畜s伪TC翠P旦SY代N问co富nt荐ro究l扬se座gm区en漫t习to逆s穗er包ve诸rsp棋ec钟if宝ie细s策in午it庭ia锻lse星q#St诞ep扫2权:se尊rv静er批e苹nd净s督ys漂te纱m奔re踏ce精iv捎es民S犁YN忽,拴re押pl页ie西s插wi庭th枪S档YN道AC啊K脸co坏nt隔ro衔l陈se吐gm限en躲tAC背Ksre谈ce宝iv朝ed僵S钩YNal秒lo挥ca性te强s听bu饭ff腾er葛ssp暴ec轮if臭ie管s土se忠rv拆er舍->闭r抛ec都ei估ve栽r测in基it顿ia炮l炊se纳q.也#St驾ep谦3图:cl烧ie某nt驼e掏nd科s变ys纹te桂m坚se绳nd拌s验AC仓K俭co认nt弊ro岂l搞se符gm宏en萄t懒to崇s疫er递ve咏ral筛lo签ca作te校s触bu张ff闸er丧s113:技T感ra榜ns托po缘瑞rt宰L御ay灿erTh替re单e栽wa重y室ha育nd恼sh谷ak俘e:clientSYN(seq=x)serverSYNACK(seq=y,ack=x+1)ACK(ack=y+1)InitiateaconnectionAcceptandacknowledgeAcceptSYNACKandacknowledge123:竭T熟ra绸ns厚po腾rt指L局ay肾erTC浅P淋Co技nn营ec穴ti钩on诞M终an饼ag沙em丑en茄t禁(c推on奇t.批)Cl磨os田in刊g怕a召co找nn这ec列ti握on阻:cl圾ie倚nt院c著lo酒se梳s桥so遍ck辟et辩:cl叔ie刘nt益So兄ck种et涉.c掠lo好se()垂;St怕ep虾1晶:cl沾ie岂nten猎d场sy图st估em话s荷en缎ds亿T限CP集F呢IN氧c辟on脾tr谊ol惯s状eg抱me率nt肆t慕o眼se芝rv躲erSt驻ep嚼2编:se聚rv狭erre本ce委iv心es牢F窑IN鸭,沟re陵pl芝ie酿s纽奉wi蓬th演A捆CK渔.盟Cl绢os冷es曲c束on皂ne裂ct絮io难n,商s民en拜ds朵F野IN羞.clientFINserverACKACKFINclosecloseclosedtimedwait133:秤T机ra掏ns拍po多rt悄L质ay检erTC念P夫Co召nn况ec认ti俗on广M脉an结ag须em愧en喷t街(c嫌on鞭t.恶)St此ep蛛3田:cl占ie屈ntre权ce嗽iv颠es丝式F味IN担,哈re封pl壤ie巡寿s妇wi怨th想A欲CK汗.En动te题rs饼“夏ti挂me膏d绑wa批it桶”废-止wi颠ll莲r野es盐po喷nd下w菜it兵h净AC悲K贵to羞r彼ec竿ei但ve荐dFI次NsSt医ep括4茎:se蜻rv狭erre离ce垄iv严es太A滨CK页.交C败on嚼ne做ct户io熟n纲cl写os森ed西.No萍te眯:wi校th突s艇ma鸡ll饼m掠od腥if餐ic茄at梨io室n,咽c倚an玩h宣an欺dl饰e孤si恐mu没lt剪an丑eo变usFI溜Ns.cl醉ie滔ntFI沫Nse挤rv售erAC挽KAC棒KFI坚Ncl颂os奖in骗gcl聪os总in斗gcl黄os筛edti体me虾d匪wa卡itcl限os亏ed143:豆T译ra钓ns首po王rt筝L看ay吨erTC摔P韵Co拐nn喂ec套ti锡on系M债an顶ag铜em欣en晨t水(c李on并t)TC闻P姜cl叔ie族ntli忙fe突cy尤cl苍eTC猪P甩se督rv货erli痒fe翁cy宝cl脉e153:售T浩ra衡ns禽po总rt绪L扬ay连er3.项6转Pr蓝in攻ci阁pl属es议o侦f俊Co押ng技es戒ti删on艺C锣on慢tr迟olCo滚ng闸es宫ti右on剑:in害fo北rm漆al霉ly缘瑞:招“t腐oo战m难an冻y央so枝ur华ce削s伍se伏nd祝in与g图to近o疤mu巨ch生d太at识a株to普o途fa权st虎f昆orne床tw愤or学kto谜h调an醒dl江e”di身ff蹄er掩en吐t小fr拍om林f锄lo腹w辣co希nt齿ro汁l!ma杜ni枣fe跟st悼at非io效ns爬:lo嘉st滋p严ac涂ke薯ts极(掌bu鞋ff柳er痒o勒ve缓rf谷lo仙w沾at站r浮ou鲜te骄rs亩)lo舌ng冒d及el犁ay昂s梨(q王ue请ui杜ng适i剃n呼ro屋ut艰er萍b纯uf染fe告rs希)a枕to字p-醋10雾p怜ro蒙bl逝em躁!163:史T荣ra晃ns随po康rt钢L膊ay仪er3.寸7胸TC慌P艇Co刊ng枪es守ti暂on慕C境on维tr桐olen上d-凑en塘d斥co邻nt装ro印l渗(n晚o杰ne桃tw煤or节k催as蕉si鉴st立an揪ce饮)tr星an证sm伪is遇si冲on注r辰at仓e魔li训mi慎te连d拥by权c土on毙ge策st刮io味n悬wi职nd摇ow易s筛iz材e,Co倚ng端wi软n,显ov闯er溜s买eg峰me偶nt哲s:w铁se槐gm竞en总ts海,狗ea晃ch增w寸it德h尼MS伐S杨by坐te呜s灾se叙nt鸟i驰n逢on续e掌RT功T:throughput=
w*MSS
RTT
Bytes/secCo筐ng喇wi影n173:当T欠ra暑ns亏po枪rt源L响ay宫erTC岔P塞co惰ng准es艇ti内on亏c著on颗tr安ol袍:tw地o延“p曲ha世se颤s”sl粮ow御s呆ta男rtco今ng扇es齐ti隔on殃a至vo叹id唤an乞ceim笨po峰rt俊an发t械va新ri逗ab朽le融s:Co看ng扒wi蒜nth客re犁sh阶ol乒d:de虎fi闪ne惊s佣th捧re李sh包ol双d圣be伟tw引ee谣n预tw逼o羞sl消ow殃s洒ta丈rt委p赠ha御se雁,姨co救ng疫es滴ti坊on围c塘on冤tr仍ol司p拖ha马se“pr抵ob双in摧g”fo户r毙us危ab平le芒b哲an砖dw杀id照th肚:id菜ea金ll颜y:tr旬an躺sm贱it苗a砌s旺fa须st揪a卖s闸po停ss裁ib鼓le医(Co遮ng绵wi研nas劈燕l钻ar召ge霜a脉s返po融ss送ib鞋le巾)罩wi微th疯ou情t什lo判ssin梢cr皇ea贺seCo剂ng讽wi蚀nun坡ti缴l畅lo抓ss狭(血co父ng配es峡ti揭on流)lo钱ss送:de钉cr蝴ea配seCo麦ng遭wi世n,码th蓝en颂b涝eg巧in部p复ro扑bi喉ng呜(洒in灰cr诱ea孩si皇ng也)月ag狗ai疑n183:奸T氧ra护ns声po不rt馋L面ay鼓erTC置PSl霜ow岛st猴ar怖tex继po誉ne缝nt响ia很l悬in窃cr押ea线se肝(吊pe占r忆RT哲T)跟i春n杯wi鱼nd偶ow号s绞iz匀e漂(n钞ot舅s蓄o惯sl型ow劣!)lo敲ss融e白ve柜nt档:障ti朱me遇ou临t量(T绳ah燃oe台T较CP家)匆an姓d/迁or遍o慈r盖th剂re薄e艇du桑pl伏ic惰at秘eAC恢Ks(R你en宫o谣TC月P)in仿it躲ia创li喜ze喇:Co到ng琴wi惠n=蒙1fo嫩r耐(e刷ac想h拌se挡gm万en蚂tAC铲Ke郑d)Co篇ng微wi只n++un精ti司l纱(l期os厚s令ev域en旱t副ORCo塑ng组Wi扑n>敢th舒re躲sh器ol寸d)SlowstartalgorithmHo居st业Aon粘e冤se遣gm逗en勿tRT澡THo之st枕Btimetw崖o挂se部gm疤en绍tsfo叹ur夏s虏eg年me洞nt款s193:侧T防ra鸣ns沙po出rt窑L狗ay投erTC域P雀Co沈ng啄es壤ti垮on袜A底vo催id沫an州ce/*sl汉ow狠st织ar翠tis卖o脚ve设r清*竹//*Co忧ng粘wi苗n>犁th每re虽sh初ol芳d吊*/Un见ti微l药(l怜os失s荐ev造en传t)但{ev周er姜y登w禾se燃gm拒en弓tsAC讯Ke肿d:Co火ng林wi柱n++}th仪re匹sh榆ol火d灿=茅Co建ng饥wi科n/惨2Co丧ng悟wi乐n=赤1pe么rf绝or决msl茫ow伟st用ar愿tCo蒙ng裙es泰ti脖on葬a危vo料id测an丛ce1203:彻T酬ra命ns昏po数rt柜L层ay纤erTC趟P晋Fa桨ir导ne批ssFa两ir吧ne彼ss尸g畜oa思l:if朗N亿T维CP消s躲es豆si庆on哗s卖sh找ar茫e喝sa妻me紧b吸ot炮tl塌en胆ec愤k栽li盏nk燥,笼ea溉ch散s达ho铁ul陡d贵ge晒t刑1/别N奶of亩l森in军k怒ca己pa垄ci已tyTC尼P煎co胳ng至es础ti胁on挽a炸vo结id负an偏ce享:AI雕MD眯:ad甘di温ti托ve陵i要nc己re帆as甜e,熄m扬ul忆ti倡pl踢ic滩at北iv驱e奴de锹cr击ea驳sein咳cr享ea纤se扯w矮in碍do乏w劝by熊1汇p狮er笔R翠TTde我cr涂ea味se裹w也in损do衫w约by资f诸ac蚂to者r隆of惧2责o疮n需lo冤ss受e续ve垃ntAI津MDTC细P肤co岩nn虑ec志ti之on梨1bo款tt洁le己ne坡ckro将ut亦erca恳pa给ci纲ty六RTC疾Pco系nn蜂ec捆ti家on践2213:扮T菠ra怕ns区po袋rt常L星ay吩erWh侧y乓is驶T闹CP并f拆ai绪r?Tw火o共co症mp释et追in庸g蔬se耽ss馅io垄ns托:Ad晓di捷ti域ve往i饮nc袄re保as伯e稿gi降ve瓦s督sl颜op砖e舒of酒1央,漆as美t奴hr铲ou丧
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 高考数学全真模拟试题第12571期
- 江苏省徐州市铜山区2023-2024学年九年级上学期期中物理试卷(含答案解析)
- 2024至2030年中国早茶点心车数据监测研究报告
- 2024至2030年中国手动平移气调库门行业投资前景及策略咨询研究报告
- 2010-2012年非离子表面活性剂市场研究及预测分析报告
- 2024至2030年中国塑料马甲袋数据监测研究报告
- 2024至2030年中国单筒紫外线净水器数据监测研究报告
- 2024至2030年中国冲孔新型板数据监测研究报告
- 2024年新疆维吾尔自治区中考语文试题含解析
- 2024年中国镜架配件市场调查研究报告
- 绵阳市高中2022级(2025届)高三第一次诊断性考试(一诊)语文试卷(含答案)
- 自然资源调查监测劳动和技能竞赛
- 6.1 我对谁负责 谁对我负责 课件-2024-2025学年统编版道德与法治八年级上册
- 2023-2024学年天津市经开区国际学校八年级(上)期末物理试卷
- DB23T 3842-2024 一般化工企业安全生产标准化评定规范
- 期中模拟押题卷(1-3单元)(试题)-2024-2025学年苏教版数学六年级上册
- 环氧树脂项目可行性研究报告项目报告
- 阜阳职业技术学院2024年教师招聘招聘历年高频500题难、易错点模拟试题附带答案详解
- 江西省住宅工程开裂、渗漏等质量常见问题防治技术指南
- 多囊卵巢综合征的诊断和治疗-课件
- 上海初中生综合素质评价典型事例范文通用6篇
评论
0/150
提交评论