Bài giảng Mạng máy tính nâng cao: Chapter 3 - Lê Ngọc Sơn

111 83 0
Bài giảng Mạng máy tính nâng cao: Chapter 3 - Lê Ngọc Sơn

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Bài giảng Mạng máy tính nâng cao - Chapter 3: Transport layer cung cấp cho người học các kiến thức: Transport-layer services, uultiplexing and demultiplexing, principles of reliable data transfer,... mời các bạn cùng tham khảo.

Chapter Transport Layer A note on the use of these ppt slides: We’re making these slides freely available to all (faculty, students, readers) They’re in 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 mention their source (after all, we’d 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 Computer Networking: A Top Down Approach 5th edition Jim Kurose, Keith Ross Addison-Wesley, April 2009 Thanks and enjoy! JFK/KWR All material copyright 1996-2009 J.F Kurose and K.W Ross, All Rights Reserved Transport Layer CuuDuongThanCong.com https://fb.com/tailieudientucntt 3-1 Chapter 3: Transport Layer Our goals: understand principles behind transport layer services: multiplexing/demultiple xing reliable data transfer flow control congestion control learn about transport layer protocols in the Internet: UDP: connectionless transport TCP: connection-oriented transport TCP congestion control Transport Layer CuuDuongThanCong.com https://fb.com/tailieudientucntt 3-2 Chapter 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 Principles of congestion control 3.7 TCP congestion control Transport Layer CuuDuongThanCong.com https://fb.com/tailieudientucntt 3-3 Transport services and protocols cung cấp truyền thông logic [logical communication ] tiến trình ứng dụng chạy host khác Các giao thức vận chuyển chạy host Phía gửi: chia message tầng Transport thành segments, sau gửi segment xuống tầng Network Phía nhận: ráp segments thành message, sau gửi lên tầng Application Có nhiều giao thức vận chuyển để ứng dụng mạng sd Internet: TCP UDP CuuDuongThanCong.com application transport network data link physical application transport network data link physical Transport Layer https://fb.com/tailieudientucntt 3-4 Transport vs network layer Tầng Network: truyền Household analogy: 12 đứa trẻ gửi thư cho 12 đứa thông logic trẻ khác hosts Tầng Transport : truyền Tiến trình = đứa trẻ thơng logic Message tầng Ứng dụng = tiến trình thư phong bì relies on, enhances, hosts = gia đình network layer services Giao thức vận chuyển = Ann Bill Giao thức tầng mạng = Dịch vụ bưu Transport Layer CuuDuongThanCong.com https://fb.com/tailieudientucntt 3-5 Internet transport-layer protocols Vận chuyển bảo đảm [reliable], thứ tự [in-order] (TCP) congestion control flow control connection setup Vận chuyển ko bảo đảm [unreliable], không M1 thứ tự : UDP no-frills extension of “besteffort” IP application transport network data link physical network data link physical network data link physical network data link physicalnetwork data link physical network data link physical network data link physical application transport network data link physical Các dịch vụ ko cung cấp: delay guarantees bandwidth guarantees CuuDuongThanCong.com Transport Layer https://fb.com/tailieudientucntt 3-6 Slide M1 no-frills: bình dân? No-frills or no frills is a term used to describe any service or product for which the non-essential features have been removed to keep the price low MVC, 5/3/2010 CuuDuongThanCong.com https://fb.com/tailieudientucntt Chapter 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 Principles of congestion control 3.7 TCP congestion control Transport Layer CuuDuongThanCong.com https://fb.com/tailieudientucntt 3-7 Multiplexing/demultiplexing Multiplexing host gửi: Thu thập mẩu liệu từ socket, bao bọc mẩu liệu gói, có gắn thêm header (để dùng demultiplexing host nhận) Demultiplexing host nhận: Chuyển segment nhận đến socket = socket application = process P3 P1 P1 application P2 P4 application transport transport transport network network network link link link physical physical physical host host host Transport Layer CuuDuongThanCong.com https://fb.com/tailieudientucntt 3-8 How demultiplexing works Host bên nhận nhận IP datagrams Mỗi datagram có source IP address, destination IP address Mỗi datagram mang segment (là đơn vị liệu Tầng Transport) Mỗi segment có source port number, destination port number Host bên nhận sử dụng địa IP số hiệu port để chuyển giao segment đến socket tương ứng Hai cách demultiplexing khác ứng với cách truyền thông hướng kết nối (connection-oriented)và phi kết nối (connectionless) 32 bits source port # dest port # other header fields application data (message) TCP/UDP segment format Transport Layer CuuDuongThanCong.com https://fb.com/tailieudientucntt 3-9 TCP Congestion Control: more details Bên gửi giám cwnd có kiện “mất segment”, xảy khi: Đã timeout mà không nhận phản hồi Giảm cwnd Bên gửi tăng cwnd nhận ACK Giai đoạn slow-start Gia tăng theo hàm mũ Giai đoạn tránh tắc nghẽn Gia tăng tuyến tính Nhận ACK trùng Giảm cwnd nửa Transport Layer 3-95 CuuDuongThanCong.com https://fb.com/tailieudientucntt TCP Slow Start Khi kết nối bắt đầu, cwnd = MSS Làm điều cách tăng cwnd lên sau lần nhận ACK CuuDuongThanCong.com Host A Host B RTT VD: MSS = 500 bytes & RTT = 200 msec =>Tốc độ truyền = 20 kbps Năng lực đường truyền lớn MSS/RTT nhiều lần Có nhu cầu tăng nhanh đến tốc độ truyền phù hợp Gia tăng tốc độ truyền theo hàm mũ, có kiện “mất segment” xảy chạm ngưỡng Gấp đôi cwnd sau RTT time Transport Layer 3-96 https://fb.com/tailieudientucntt Transitioning into/out of slowstart ssthresh: biến lưu giá trị ngưỡng cwnd , TCP quản lý Khi “mất segment”: đặt ssthresh cwnd/2 ghi nhận lại nửa giá trị cwnd vào thời điểm ùn tắt trước Khi cwnd >= ssthresh: chuyển từ slowstart sang giai đoạn tránh ùn tắt duplicate ACK dupACKcount++ Λ cwnd = MSS ssthresh = 64 KB dupACKcount = timeout ssthresh = cwnd/2 cwnd = MSS dupACKcount = retransmit missing segment slow start new ACK cwnd = cwnd+MSS dupACKcount = transmit new segment(s),as allowed cwnd > ssthresh Λ timeout ssthresh = cwnd/2 cwnd = MSS dupACKcount = retransmit missing segment congestion avoidance Transport Layer 3-97 CuuDuongThanCong.com https://fb.com/tailieudientucntt TCP: congestion avoidance Khi cwnd > ssthresh gia tăng cwnd tuyến tính • Tăng cwnd thêm MSS sau RTT • Đạt tới điểm ùn tắt chậm slowstart • Cài đặt: với ACK nhận cwnd = cwnd + MSS/cwnd AIMD ACKs: increase cwnd by MSS per RTT: additive increase loss: cut cwnd in half (non-timeout-detected loss ): multiplicative decrease AIMD: Additive Increase Multiplicative Decrease Transport Layer 3-98 CuuDuongThanCong.com https://fb.com/tailieudientucntt Summary: congestion control algorithm ssthresh = ? (e,g, 64KB) cwnd = MSS /* slow start or exponential increase */ While (No Packet Loss and cwnd < ssthresh ) { send cwnd TCP segments for each ACK, cwnd = cwnd + MSS } /* congestion avoidance or linear increase */ While (No Packet Loss) { send cwnd TCP segments /* increase cwnd by MSS when cwnd ACKs are received */ for each ACK, cwnd = cwnd + MSS/cwnd } ssthresh = cwnd/2 If (3 Dup ACKs) cwnd = ssthresh; Else If (timeout) cwnd=1 MSS; Transport Layer 3-99 CuuDuongThanCong.com https://fb.com/tailieudientucntt cwnd window size (in segments) Popular “flavors” of TCP TCP Reno ssthresh ssthresh TCP Tahoe Transmission round Transport Layer 3-100 CuuDuongThanCong.com https://fb.com/tailieudientucntt TCP congestion control FSM: overview cwnd > ssthresh slow start loss: timeout congestion avoidance loss: timeout loss: timeout loss: 3dupACK new ACK loss: 3dupACK fast recovery Transport Layer 3-101 CuuDuongThanCong.com https://fb.com/tailieudientucntt TCP congestion control FSM: details duplicate ACK dupACKcount++ Λ cwnd = MSS ssthresh = 64 KB dupACKcount = slow start timeout ssthresh = cwnd/2 cwnd = MSS dupACKcount = retransmit missing segment dupACKcount == ssthresh= cwnd/2 cwnd = ssthresh + retransmit missing segment new ACK cwnd = cwnd+MSS dupACKcount = transmit new segment(s),as allowed cwnd > ssthresh Λ timeout ssthresh = cwnd/2 cwnd = MSS dupACKcount = retransmit missing segment timeout ssthresh = cwnd/2 cwnd = dupACKcount = retransmit missing segment new ACK cwnd = cwnd + MSS (MSS/cwnd) dupACKcount = transmit new segment(s),as allowed congestion avoidance duplicate ACK dupACKcount++ New ACK cwnd = ssthresh dupACKcount = dupACKcount == ssthresh= cwnd/2 cwnd = ssthresh + retransmit missing segment fast recovery duplicate ACK cwnd = cwnd + MSS transmit new segment(s), as allowed Transport Layer 3-102 CuuDuongThanCong.com https://fb.com/tailieudientucntt Summary: TCP Congestion Control Khi cwnd < ssthresh, bên gửi làm việc theo slowstart, cửa sổ cwnd tăng nhanh theo hàm mũ Khi cwnd >= ssthresh, bên gửi làm việc theo congestion-avoidance, cửa sổ cwnd tăng tuyến tính Khi nhận ACK trùng nhau, ssthresh := cwnd/2, cwnd := ssthresh Khi timeout xảy ra, ssthresh := cwnd/2, cwnd := MSS Transport Layer 3-103 CuuDuongThanCong.com https://fb.com/tailieudientucntt TCP throughput Q: Thông lượng trung bình TCP bao nhiêu, tính theo kích thước cửa sổ RTT? • Bỏ qua giai đoạn slow start Gọi W kích thước sổ có kiện “mất segment” • Khi kích thước cửa sổ W, thơng lượng W/RTT • Ngay sau segment, cửa sổ giảm xuống W/2, thông lượng giảm thành W/2RTT • Thơng lượng trung bình: 0.75 W/RTT Transport Layer 3-104 CuuDuongThanCong.com https://fb.com/tailieudientucntt TCP Futures: TCP over “long, fat pipes” VD: Xét kết nối TCP với segment kích thước 1500 byte, RTT= 100ms, muốn thông lượng 10 Gbps kết nối TCP Cần phải có cửa sổ với kích thước W = 83,333 inflight segments Thơng lượng tính theo tỷ lệ gói tin (loss rate L): 1.22 ⋅ MSS RTT L ➜ L = 2·10-10 Wow Phiên TCP dành cho mạng tốc độ cao Transport Layer 3-105 CuuDuongThanCong.com https://fb.com/tailieudientucntt TCP Fairness fairness goal: có K phiên truyền TCP chia sẻ kết nối TCP, phiên truyền có tốc độ truyền trung bình R/K TCP connection TCP connection bottleneck router capacity R Transport Layer 3-106 CuuDuongThanCong.com https://fb.com/tailieudientucntt Why is TCP fair? Two competing sessions: Additive increase gives slope of 1, as throughout increases multiplicative decrease decreases throughput proportionally equal bandwidth share R loss: decrease window by factor of congestion avoidance: additive increase loss: decrease window by factor of congestion avoidance: additive increase Connection throughput R Transport Layer 3-107 CuuDuongThanCong.com https://fb.com/tailieudientucntt Fairness (more) Fairness and parallel TCP connections Ko có ngăn cản ứng dụng mở nhiều kết nối song song host Ko muốn tốc độ truyền bị hạn chế chế web browsers làm điều congestion control VD: đường truyền băng Thay UDP: thông R phục vụ kết Truyền audio/video nối; Fairness and UDP Các ứng dụng multimedia thường ko sử dụng TCP tốc độ truyền khơng đổi, chấp nhận gói tin chút đỉnh Nếu ứd dùng kết nối TCP, nhận thơng R/10 Cịn ứd mở lúc 11 kết nối TCPs, nhận R/2 ! Transport Layer 3-108 CuuDuongThanCong.com https://fb.com/tailieudientucntt Chapter 3: Summary principles behind transport layer services: multiplexing, demultiplexing reliable data transfer flow control congestion control instantiation and implementation in the Internet UDP TCP Next: leaving the network “edge” (application, transport layers) into the network “core” Transport Layer 3-109 CuuDuongThanCong.com https://fb.com/tailieudientucntt ... tổng quan Selective Repeat: tổng quan Bên gửi: cho phép lên đến N Bên gửi: cho phép lên đến gói-tin-chưa-được-xác-nhận N gói-tin-chưa-được-xáctrong pipeline nhận pipeline Bên nhận: gửi Bên nhận:... Layer 3- 38 CuuDuongThanCong.com https://fb.com/tailieudientucntt rdt3.0 in action Transport Layer 3- 39 CuuDuongThanCong.com https://fb.com/tailieudientucntt rdt3.0 in action Transport Layer 3- 40... CuuDuongThanCong.com DP: 80 Client S-IP: B D-IP:C IP:B Transport Layer 3- 13 https://fb.com/tailieudientucntt Connection-oriented demux: Threaded Web Server P1 P2 P4 P1P3 SP: 5775 DP: 80 S-IP: B D-IP:C SP: 9157 client

Ngày đăng: 10/01/2020, 23:51

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan