8/2009
Hanoi University of Technology
8/2009
Hanoi University of Technology
TCP/IP
Faculty of Electronics and Telecommunications
TCP/IP
Faculty of Electronics and Telecommunications
1
8/2009
Hanoi University of Technology
8/2009
Hanoi University of Technology
TCP/IP
Faculty of Electronics and Telecommunications
TCP/IP
Faculty of Electronics and Telecommunications
2
8/2009
TCP/IP
Reset function - Chuyển về trạng thái Listen nếu đang ở trạng thái SYN-RECEIVED - Chuyển về trạng thái CLOSE với các trường hợp khác Hanoi University of Technology
8/2009
Faculty of Electronics and Telecommunications
TCP/IP
Transmission Control Block
Hanoi University of Technology
Faculty of Electronics and Telecommunications
3
8/2009
TCP/IP
- Khởi tạo giá trị SYN (ISN – Initial Sequence Number): tăng 1 đơn vị sau 4 microsecond - MSS (Maximum Segment Size): gửi khi khởi tạo kết nối; mặc định = 536 Hanoi University of Technology
8/2009
Faculty of Electronics and Telecommunications
TCP/IP
MSL=120s Hanoi University of Technology
Faculty of Electronics and Telecommunications
4
8/2009
Hanoi University of Technology
8/2009
TCP/IP
Faculty of Electronics and Telecommunications
TCP/IP
Quản lý thông tin tại Sender/Receiver -Cửa sổ gửi: 4 nhóm - Cửa sổ nhận: 3 nhóm - Con trỏ gửi (sender pointer)
Hanoi University of Technology
Faculty of Electronics and Telecommunications
5
8/2009
TCP/IP
-Con trỏ nhận (receiver pointer)
- SND.UNA= SQ - RCV.NXT=ACK - SND.WND=REV.WND=Window Hanoi University of Technology
8/2009
Faculty of Electronics and Telecommunications
TCP/IP
-Client: -SQ=0; - Receive Windows size = 200 - Server: -SQ=240 -Receive Windows size = 360 - MSS: 536
Hanoi University of Technology
Faculty of Electronics and Telecommunications
6
8/2009
TCP/IP
-Client gửi yêu cầu tới server (140 byte)
-Phía client chưa có data để gửi thêm. Server nhận được yêu cầu và gửi 80 byte tới client
- Client nhận được 80 byte chính xác và ACK cho server. Server có nhu cầu gửi 280 byte tới client. Tuy nhiên nó chỉ được phép gửi 120 byte
Hanoi University of Technology
8/2009
Faculty of Electronics and Telecommunications
TCP/IP
-Client nhận dữ liệu từ server và ACK. Server được lập trình không gửi dữ liệu nhỏ hơn 100 byte.
- Server nhận được ACK.
- Server gửi 160 byte còn lại.
Hanoi University of Technology
Faculty of Electronics and Telecommunications
7
8/2009
TCP/IP
-Client nhận dữ liệu từ server và ACK
- Server nhận ACK và kết thúc truyền
Hanoi University of Technology
8/2009
Hanoi University of Technology
Faculty of Electronics and Telecommunications
TCP/IP
Faculty of Electronics and Telecommunications
8
8/2009
TCP/IP
- Retransmission Queue - Resend segment - Retransmit only time out segment - Retransmit all outstanding segment -SACK -Timer? Æ Adaptive retransmission -New RTT=(α *old RTT+ ((1- α) Newest RTT Measurement) -Karn’ Algorithm
Hanoi University of Technology
8/2009
Hanoi University of Technology
Faculty of Electronics and Telecommunications
TCP/IP
Faculty of Electronics and Telecommunications
9
8/2009
TCP/IP
Hanoi University of Technology
Faculty of Electronics and Telecommunications
8/2009
TCP/IP
- Window size và Flow Control - Giảm cửa sổ để giảm tốc độ truyền - Giảm cửa sổ để dừng truyền dữ liệu mới - Đóng cửa sổ gửi
Hanoi University of Technology
Faculty of Electronics and Telecommunications
10
8/2009
TCP/IP
Hanoi University of Technology
Faculty of Electronics and Telecommunications
8/2009
TCP/IP
- TCP window management -“Shrinking” TCP Window - Gửi bản tin thăm dò (probe segment) khi cửa sổ đóng
Hanoi University of Technology
Faculty of Electronics and Telecommunications
11
8/2009
TCP/IP
Hanoi University of Technology
Faculty of Electronics and Telecommunications
8/2009
TCP/IP
- TCP “Silly window syndrome” - SWS -Khắc phục: -Receiver SWS avoidance -Sender SWS avoidance (Nagle’s Algorithm) -Không có bản tin chưa được ACK hoặc ứng dụng yêu cầu-> truyền ngay - Còn bản tin chưa được ACK -> chỉ truyền khi đã nhận được ACK hoặc bộ đệm phát =MSS
Hanoi University of Technology
Faculty of Electronics and Telecommunications
12
8/2009
TCP/IP
Hanoi University of Technology
8/2009
Faculty of Electronics and Telecommunications
TCP/IP
- TCP Congestion - Slow Start - Congestion Avoidance - Fast Retransmit - Fast Recovery
Hanoi University of Technology
Faculty of Electronics and Telecommunications
13