版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、Transport Layer,3-1,Chapter 3Transport Layer,Computer Networking: A Top Down Approach Featuring the Internet, 3rd edition. Jim Kurose, Keith RossAddison-Wesley, July 2004.,A note on the use of these ppt slides: Were making these slides freely available to all (faculty, students, readers). Theyre in
2、PowerPoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following: If you use these slides (e.g., in a class) in substantially unaltered form, that you
3、mention their source (after all, wed like people to use our book!) If you post any slides in substantially unaltered form on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material. Thanks and enjoy! JFK/KWR All material copy
4、right 1996-2005 J.F Kurose and K.W. Ross, All Rights Reserved,Transport Layer,3-2,Chapter 3: Transport Layer,Our goals: understand principles behind transport layer services: multiplexing/demultiplexing reliable data transfer flow control congestion control,learn about transport layer protocols in t
5、he Internet: UDP: connectionless transport TCP: connection-oriented transport TCP congestion control,Transport Layer,3-3,Chapter 3 outline,3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer,3.5 Connection-orient
6、ed transport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control,Transport Layer,3-4,Transport services and protocols,provide logical communication between app processes running on different hosts transport
7、protocols run in end systems send side: breaks app messages into segments, passes to network layer rcv side: reassembles segments into messages, passes to app layer more than one transport protocol available to apps Internet: TCP and UDP,Transport Layer,3-5,Transport vs. network layer,network layer:
8、 logical communication between hosts transport layer: logical communication between processes relies on, enhances, network layer services,Household analogy: 12 kids sending letters to 12 kids processes = kids app messages = letters in envelopes hosts = houses transport protocol = Ann and Bill networ
9、k-layer protocol = postal service,Transport Layer,3-6,Internet transport-layer protocols,reliable, in-order delivery (TCP) congestion control flow control connection setup unreliable, unordered delivery: UDP no-frills extension of “best-effort” IP services not available: delay guarantees bandwidth g
10、uarantees,Transport Layer,3-7,Chapter 3 outline,3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer,3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection manageme
11、nt 3.6 Principles of congestion control 3.7 TCP congestion control,Transport Layer,3-8,Multiplexing/demultiplexing,application,transport,network,link,physical,P1,application,transport,network,link,physical,application,transport,network,link,physical,P2,P3,P4,P1,host 1,host 2,host 3,= process,= socke
12、t,delivering received segments to correct socket,gathering data from multiple sockets, enveloping data with header (later used for demultiplexing),Transport Layer,3-9,How demultiplexing works,host receives IP datagrams each datagram has source IP address, destination IP address each datagram carries
13、 1 transport-layer segment each segment has source, destination port number host uses IP addresses DatagramSocket mySocket2 = new DatagramSocket(99222); UDP socket identified by two-tuple: (dest IP address, dest port number),When host receives UDP segment: checks destination port number in segment d
14、irects UDP segment to socket with that port number IP datagrams with different source IP addresses and/or source port numbers directed to same socket,Transport Layer,3-11,Connectionless demux (cont),DatagramSocket serverSocket = new DatagramSocket(6428);,SP provides “return address”,Transport Layer,
15、3-12,Connection-oriented demux,TCP socket identified by 4-tuple: source IP address source port number dest IP address dest port number recv host uses all four values to direct segment to appropriate socket,Server host may support many simultaneous TCP sockets: each socket identified by its own 4-tup
16、le Web servers have different sockets for each connecting client non-persistent HTTP will have different socket for each request,Transport Layer,3-13,Connection-oriented demux (cont),Client IP:B,server IP: C,SP: 9157,DP: 80,D-IP:C,S-IP: A,D-IP:C,S-IP: B,D-IP:C,S-IP: B,Transport Layer,3-14,Connection
17、-oriented demux: Threaded Web Server,Client IP:B,server IP: C,SP: 9157,DP: 80,P4,D-IP:C,S-IP: A,D-IP:C,S-IP: B,D-IP:C,S-IP: B,Transport Layer,3-15,Chapter 3 outline,3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data tran
18、sfer,3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control,Transport Layer,3-16,UDP: User Datagram Protocol RFC 768,“no frills,” “bare bones” Internet transport protocol “best
19、 effort” service, UDP segments may be: lost delivered out of order to app connectionless: no handshaking between UDP sender, receiver each UDP segment handled independently of others,Why is there a UDP? no connection establishment (which can add delay) simple: no connection state at sender, receiver
20、 small segment header no congestion control: UDP can blast away as fast as desired,Transport Layer,3-17,UDP: more,often used for streaming multimedia apps loss tolerant rate sensitive other UDP uses DNS SNMP reliable transfer over UDP: add reliability at application layer application-specific error
21、recovery!,source port #,dest port #,32 bits,Application data (message),UDP segment format,length,checksum,Length, in bytes of UDP segment, including header,Transport Layer,3-18,UDP checksum,Sender: treat segment contents as sequence of 16-bit integers checksum: addition (1s complement sum) of segmen
22、t contents sender puts checksum value into UDP checksum field,Receiver: compute checksum of received segment check if computed checksum equals checksum field value: NO - error detected YES - no error detected. But maybe errors nonetheless? More later .,Goal: detect “errors” (e.g., flipped bits) in t
23、ransmitted segment,Transport Layer,3-19,Internet Checksum Example,Note When adding numbers, a carryout from the most significant bit needs to be added to the result Example: add two 16-bit integers,1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1
24、1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1,wraparound,sum,checksum,Transport Layer,3-20,Chapter 3 outline,3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer,3.5 Connection-oriented trans
25、port: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control,Transport Layer,3-21,Principles of Reliable data transfer,important in app., transport, link layers top-10 list of important networking topics!,charac
26、teristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt),Transport Layer,3-22,Principles of Reliable data transfer,important in app., transport, link layers top-10 list of important networking topics!,characteristics of unreliable channel will determine comp
27、lexity of reliable data transfer protocol (rdt),Transport Layer,3-23,Principles of Reliable data transfer,important in app., transport, link layers top-10 list of important networking topics!,characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt),Tra
28、nsport Layer,3-24,Reliable data transfer: getting started,send side,receive side,Transport Layer,3-25,Reliable data transfer: getting started,Well: incrementally develop sender, receiver sides of reliable data transfer protocol (rdt) consider only unidirectional data transfer but control info will f
29、low on both directions! use finite state machines (FSM) to specify sender, receiver,event causing state transition,actions taken on state transition,state: when in this “state” next state uniquely determined by next event,Transport Layer,3-26,Rdt1.0: reliable transfer over a reliable channel,underly
30、ing channel perfectly reliable no bit errors no loss of packets separate FSMs for sender, receiver: sender sends data into underlying channel receiver read data from underlying channel,Wait for call from above,packet = make_pkt(data) udt_send(packet),rdt_send(data),extract (packet,data) deliver_data
31、(data),Wait for call from below,rdt_rcv(packet),sender,receiver,Transport Layer,3-27,Rdt2.0: channel with bit errors,underlying channel may flip bits in packet checksum to detect bit errors the question: how to recover from errors: acknowledgements (ACKs): receiver explicitly tells sender that pkt r
32、eceived OK negative acknowledgements (NAKs): receiver explicitly tells sender that pkt had errors sender retransmits pkt on receipt of NAK new mechanisms in rdt2.0 (beyond rdt1.0): error detection receiver feedback: control msgs (ACK,NAK) rcvr-sender,Transport Layer,3-28,rdt2.0: FSM specification,Wa
33、it for call from above,snkpkt = make_pkt(data, checksum) udt_send(sndpkt),extract(rcvpkt,data) deliver_data(data) udt_send(ACK),rdt_rcv(rcvpkt) y= 73, so the rcvrwants 73+ ;y SendBase, sothat new data is acked,Transport Layer,3-66,TCP: retransmission scenarios,Host A,Seq=100, 20 bytes data,ACK=100,p
34、remature 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,Transport Layer,3-67,TCP retransmission scenarios (more),SendBase = 120,Transport Layer,3-68,TCP ACK generation RFC 1122, RFC 2581,Event at Rec
35、eiver Arrival of in-order segment with expected seq #. All data up to expected seq # already ACKed Arrival of in-order segment with expected seq #. One other segment has ACK pending Arrival of out-of-order segment higher-than-expect seq. # . Gap detected Arrival of segment that partially or complete
36、ly fills gap,TCP Receiver action Delayed ACK. Wait up to 500ms for next segment. If no next segment, send ACK Immediately send single cumulative ACK, ACKing both in-order segments Immediately send duplicate ACK, indicating seq. # of next expected byte Immediate send ACK, provided that segment starts
37、at lower end of gap,Transport Layer,3-69,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, there will likely be many duplicate ACKs.,If sender recei
38、ves 3 ACKs for the same data, it supposes that segment after ACKed data was lost: fast retransmit: resend segment before timer expires,Transport Layer,3-70,event: ACK received, with ACK field value of y if (y SendBase) SendBase = y if (there are currently not-yet-acknowledged segments) start timer e
39、lse increment count of dup ACKs received for y if (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,Transport Layer,3-71,Chapter 3 outline,3.1 Transport-layer services 3.2 Multiplexing an
40、d demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer,3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control,Transport Layer,3-72,TCP Flow
41、 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,Transport Layer,3-73,TCP Flow control: how it works,(Suppose TCP receiver discards out-of-order segments) spare
42、 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 overflow,Transport Layer,3-74,Chapter 3 outline,3.1 Transport-layer services 3.2 Multipl
43、exing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer,3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control,Transport Layer,3-75,
44、TCP Connection Management,Recall: TCP sender, receiver establish “connection” before exchanging data segments initialize TCP variables: seq. #s buffers, flow control info (e.g. RcvWindow) client: connection initiator Socket clientSocket = new Socket(hostname,port number); server: contacted by client
45、 Socket connectionSocket = welcomeSocket.accept();,Three way handshake: Step 1: client host sends TCP 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 S
46、YNACK, replies with ACK segment, which may contain data,Transport Layer,3-76,TCP Connection Management (cont.),Closing 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 con
47、nection, sends FIN.,Transport Layer,3-77,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. Note: with small modification, can handle simultaneous FINs.,client,
48、FIN,server,ACK,ACK,FIN,closing,closing,closed,timed wait,closed,Transport Layer,3-78,TCP Connection Management (cont),TCP client lifecycle,TCP server lifecycle,Transport Layer,3-79,Chapter 3 outline,3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.
49、4 Principles of reliable data transfer,3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control,Transport Layer,3-80,Principles of Congestion Control,Congestion: informally: “too
50、 many sources sending too much data too fast for network to handle” different from flow control! manifestations: lost packets (buffer overflow at routers) long delays (queueing in router buffers) a top-10 problem!,Transport Layer,3-81,Causes/costs of congestion: scenario 1,two senders, two receivers
51、 one router, infinite buffers no retransmission,large delays when congested maximum achievable throughput,Transport Layer,3-82,Causes/costs of congestion: scenario 2,one router, finite buffers sender retransmission of lost packet,finite shared output link buffers,Host A,lin : original data,Host B,lo
52、ut,lin : original data, plus retransmitted data,Transport Layer,3-83,Causes/costs of congestion: scenario 2,always: (goodput) “perfect” retransmission only when loss: retransmission of delayed (not lost) packet makes larger (than perfect case) for same,“costs” of congestion: more work (retrans) for
53、given “goodput” unneeded retransmissions: link carries multiple copies of pkt,Transport Layer,3-84,Causes/costs of congestion: scenario 3,four senders multihop paths timeout/retransmit,Q: what happens as and increase ?,finite shared output link buffers,lin : original data,lout,lin : original data, p
54、lus retransmitted data,Transport Layer,3-85,Causes/costs of congestion: scenario 3,Another “cost” of congestion: when packet dropped, any “upstream transmission capacity used for that packet was wasted!,lout,Transport Layer,3-86,Approaches towards congestion control,End-end congestion control: no ex
55、plicit feedback from network congestion inferred from end-system observed loss, delay approach taken by TCP,Network-assisted congestion control: routers provide feedback to end systems single bit indicating congestion (SNA, DECbit, TCP/IP ECN, ATM) explicit rate sender should send at,Two broad appro
56、aches towards congestion control:,Transport Layer,3-87,Case study: ATM ABR congestion control,ABR: available bit rate: “elastic service” if senders path “underloaded”: sender should use available bandwidth if senders path congested: sender throttled to minimum guaranteed rate,RM (resource management
57、) cells: sent by sender, interspersed with data cells bits in RM cell set by switches (“network-assisted”) NI bit: no increase in rate (mild congestion) CI bit: congestion indication RM cells returned to sender by receiver, with bits intact,Transport Layer,3-88,Case study: ATM ABR congestion control
58、,two-byte ER (explicit rate) field in RM cell congested switch may lower ER value in cell sender send rate thus minimum supportable rate on path EFCI bit in data cells: set to 1 in congested switch if data cell preceding RM cell has EFCI set, sender sets CI bit in returned RM cell,Transport Layer,3-89,Chapter 3 outline,3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer,3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 P
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 家庭教育中的睡眠質(zhì)量與健康
- 2025年度三人區(qū)塊鏈技術(shù)應(yīng)用合作協(xié)議范本3篇
- 2025年度新能源車輛推廣與應(yīng)用連帶責(zé)任擔(dān)保合同3篇
- 小學(xué)數(shù)學(xué)教學(xué)評(píng)價(jià)體系與教研能力提高
- 心理健康教育在家庭教育中的多元融合與創(chuàng)新應(yīng)用研究報(bào)告
- 學(xué)校實(shí)驗(yàn)室建設(shè)的政策支持與資金保障
- 家長(zhǎng)會(huì)報(bào)告制作攻略培養(yǎng)孩子的社會(huì)責(zé)任感
- 探索安全意識(shí)教育在高校教育的角色
- 商業(yè)大廈LED節(jié)能照明系統(tǒng)建設(shè)方案
- 2025年度環(huán)保檢測(cè)試劑批發(fā)代理協(xié)議3篇
- (最新)信息科技風(fēng)險(xiǎn)管理辦法
- 大學(xué)英語(yǔ)教師試講20分鐘范例
- 雨雪天氣安全教育PPT
- 圍手術(shù)期血糖管理專家共識(shí)
- 環(huán)境社會(huì)學(xué)整本書(shū)課件完整版電子教案全套課件最全教學(xué)教程ppt(最新)
- 采購(gòu)管理實(shí)務(wù)全套教學(xué)課件
- 魯教版高中地理必修一第一學(xué)期總復(fù)習(xí)課件(共141張PPT)
- 酒店項(xiàng)目投資分析報(bào)告可行性報(bào)告
- 煙花爆竹零售店(點(diǎn))安全技術(shù)規(guī)范.ppt課件
- 視頻監(jiān)控臺(tái)賬參考模板
- 浦江郊野公園任務(wù)書(shū)
評(píng)論
0/150
提交評(píng)論