1 department of computer and it engineering university of kurdistan computer networks ii transport...
TRANSCRIPT
![Page 1: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/1.jpg)
1
Department of Computer and IT EngineeringDepartment of Computer and IT EngineeringUniversity of KurdistanUniversity of Kurdistan
Computer Networks IITransport Layer (UDP and TCP)
By: Dr. Alireza AbdollahpouriBy: Dr. Alireza Abdollahpouri
![Page 2: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/2.jpg)
2
TCP/IP protocol suite
![Page 3: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/3.jpg)
The transport layer is responsible for process-to-process delivery.
The transport layer is responsible for process-to-process delivery.
Transport Layer
3
![Page 4: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/4.jpg)
provide logical communication between application processes running on different hosts
transport protocols run in end systems sending side: breaks app
messagesmessages into segments, passes to network layer
receiving side: reassembles segments into messagesmessages, passes to application layer
more than one transport protocol available to applications. Internet: TCP and UDP
provide logical communication between application processes running on different hosts
transport protocols run in end systems sending side: breaks app
messagesmessages into segments, passes to network layer
receiving side: reassembles segments into messagesmessages, passes to application layer
more than one transport protocol available to applications. Internet: TCP and UDP
networkdata linkphysical
Logical Logical end to end end to end transporttransport
Transport Layer
application
transportnetworkdata linkphysical
application
transportnetworkdata linkphysical
4
![Page 5: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/5.jpg)
Ht
Message
applicationHa Message
transport Ht Ht Ht
network
App. Process decides to send a message to its counterpart
App. Layer adds its header, sends the message to transport layer
Transport layer breaks down the message into several parts,
add its header to each part And makes segments.
It sends one-by-one segments to network layer
Protocol layering and data
App. ProcessApp. ProcessApp. ProcessApp. Process
5
![Page 6: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/6.jpg)
Port numbers
6
![Page 7: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/7.jpg)
IP addresses versus port numbers
7
![Page 8: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/8.jpg)
IANA ranges for port numbers
8
![Page 9: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/9.jpg)
Socket address
9
![Page 10: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/10.jpg)
Multiplexing and demultiplexing
10
![Page 11: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/11.jpg)
11
TCP/IP protocol suite
![Page 12: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/12.jpg)
UDP is a connectionless, unreliable protocol that has no flow and error
control. It uses port numbers to multiplex data from the application
layer.
UDP
12
![Page 13: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/13.jpg)
Some Well-known ports used by UDP
Port Protocol Description
13 Daytime Returns the date and the time
17 Quote Returns a quote of the day
53 Nameserver Domain Name Service
67 Bootps Server port to download bootstrap information
68 Bootpc Client port to download bootstrap information
69 TFTP Trivial File Transfer Protocol
111 RPC Remote Procedure Call
123 NTP Network Time Protocol
161 SNMP Simple Network Management Protocol
13
![Page 14: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/14.jpg)
User datagram format
The calculation of checksum and its inclusion in the user datagram are optional.
The calculation of checksum and its inclusion in the user datagram are optional.
14
![Page 15: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/15.jpg)
Popular Applications That Use UDP
Multimedia streaming Retransmitting lost/corrupted packets is not
worthwhile By the time the packet is retransmitted, it’s too late E.g., telephone calls, video conferencing, gaming
Simple query protocols like Domain Name System Overhead of connection establishment is overkill Easier to have the application retransmit if needed
“Address for www.cnn.com?”
“12.3.4.15”15
![Page 16: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/16.jpg)
16
TCP/IP protocol suite
![Page 17: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/17.jpg)
Transmission Control Protocol (TCP)
Connection oriented Explicit set-up and tear-down of TCP session
Stream-of-bytes service Sends and receives a stream of bytes, not messages
Reliable, in-order delivery Checksums to detect corrupted data Acknowledgments & retransmissions for reliable delivery Sequence numbers to detect losses and reorder data
Flow control Prevent overflow of the receiver’s buffer space
Congestion control Adapt to network congestion for the greater good
17
![Page 18: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/18.jpg)
18
Stream delivery
TCP محیطی را فراهم می آورد که گویی دوپروسه به وسیله یک لوله فرضی به همدیگر
متصل شده اند
TCP محیطی را فراهم می آورد که گویی دوپروسه به وسیله یک لوله فرضی به همدیگر
متصل شده اند
![Page 19: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/19.jpg)
19
Sending and receiving buffers
TCP در دو طرف فرستنده و گیرنده یک بافربرای ارسال و دریافت دارد
TCP در دو طرف فرستنده و گیرنده یک بافربرای ارسال و دریافت دارد
![Page 20: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/20.jpg)
20
TCP segments
TCP جریانی از بایتها را در قالب سگمنت هاارسال می کند
الیه باالتر چیزی در موردسگمنتها و محدوده آنها نمیداند
TCP جریانی از بایتها را در قالب سگمنت هاارسال می کند
الیه باالتر چیزی در موردسگمنتها و محدوده آنها نمیداند
1. Write 100 bytes2. Write 20 bytes
1. Read 40 bytes2. Read 40 bytes3. Read 40 bytes
![Page 21: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/21.jpg)
21
The bytes of data being transferred in each connection are numbered by TCP. The numbering starts with a randomly
generated number.
Note:Note:
![Page 22: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/22.jpg)
22
Suppose a TCP connection is transferring a file of 5000 bytes. The first byte is numbered 10001. What are the sequence numbers for each segment if data is sent in five segments, each carrying 1000 bytes?
Example of Byte numbering and sequence numbers
SolutionThe following shows the sequence number for each segment:
Segment 1 ➡ Sequence Number: 10,001 (range: 10,001 to 11,000)
Segment 2 ➡ Sequence Number: 11,001 (range: 11,001 to 12,000)
Segment 3 ➡ Sequence Number: 12,001 (range: 12,001 to 13,000)
Segment 4 ➡ Sequence Number: 13,001 (range: 13,001 to 14,000)
Segment 5 ➡ Sequence Number: 14,001 (range: 14,001 to 15,000)
![Page 23: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/23.jpg)
23
The value in the sequence number field of a segment defines the number
of the first data byte containedin that segment.
Note:Note:
![Page 24: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/24.jpg)
24
The value of the acknowledgment field in a segment defines the number of the
next byte a party expects to receive.
The acknowledgment number is cumulative.
Note:Note:
![Page 25: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/25.jpg)
TCP
IP
Applications
23 10480Ports:
TCP
IP
Applications
7 1680 Ports:
A pair <IP address, port number> identifies one endpoint of a connection. Two pairs <client IP address, server port number> and <server IP address, server port number> identify a TCP connection.
49123
TCP connection
25
![Page 26: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/26.jpg)
Seq
=001
Seq
=1001
Seq
=2001
Seq
=3001
Seq
=4001
Seq
=5001
Byte
data
1 2 … 1001 … 2001 … 3001 … 4001 … 5001…
Data is broken into 6 1000-Byte-segments.
TCP Header
26
![Page 27: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/27.jpg)
27
TCP Header
شماره ترتیب اولین بایتی که در قسمت داده قرار
داردشماره ترتیب
بایتی که منتظر دریافت
آن است
20 B
ytes
![Page 28: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/28.jpg)
28
TCP Header
طول هدر بر 4حسب کلمه
بایتی
![Page 29: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/29.jpg)
29
TCP Header
اندازه پنجره دریافت- مورد استفاده در مکانیسم کنترل
جریان
این فیلد به عنوان یک اشاره گر موقعیت داده هاي اضطراری را درون
سگمنت معین میکند
![Page 30: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/30.jpg)
30
II
Description of flags in the control field
برای برقراری و قطع ACK و FINو SYNبیتهای اتصال استفاده می شوند
برای برقراری و قطع ACK و FINو SYNبیتهای اتصال استفاده می شوند
![Page 31: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/31.jpg)
31
Connection establishment using “three-way handshaking”
A SYN segment cannot carry data, but it consumes one sequence number.
A SYN segment cannot carry data, but it consumes one sequence number.
![Page 32: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/32.jpg)
32
A SYN + ACK segment cannot carry data, but does consume one
sequence number.
Note:Note:
An ACK segment, if carrying no data, consumes no sequence number.
![Page 33: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/33.jpg)
33
Data transfer
![Page 34: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/34.jpg)
34
Connection termination
The FIN and (FIN+ACK) segments consume one sequence number if they do not carry data.
The FIN and (FIN+ACK) segments consume one sequence number if they do not carry data.
![Page 35: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/35.jpg)
35
States for TCP
![Page 36: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/36.jpg)
TCP states
TCP client lifecycle
TCP server lifecycle
Used in case ACK gets lost. It is implementation-dependent (e.g. 30
seconds, 1 minute, 2 minutes
Connection formally closes – all resources (e.g. port numbers) are
released
1
2
3
4
5
6
7
8
9
10
11
12
36
![Page 37: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/37.jpg)
TCP flow control and congestion control
37
![Page 38: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/38.jpg)
38
TCP Flow Control
1 2 3 4 5 6 7 8 9 10 11
Advertised window
sent but notacknowledged can be sent
USABLEWINDOW
sent andacknowledged
can't sent
TCP« پنجره برای کنترل جریان از مکانیزم« استفاده میکند.لغزان
TCP« پنجره برای کنترل جریان از مکانیزم« استفاده میکند.لغزان
![Page 39: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/39.jpg)
1 2 3 4 5 6 7 8 9 10 11
1 2 3 4 5 6 7 8 9 10 11
Transmit Byte 6
1 2 3 4 5 6 7 8 9 10 11
AckNo = 5, Win = 4is received
• Transmission of a single byte (with SeqNo = 6) and acknowledgement is received (AckNo = 5, Win=4):
TCP Flow Control
گیرندهفرستندهSegment
ACK
39
![Page 40: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/40.jpg)
1 2 3 4 5 6 7 8 9 10 11
1 2 3 4 5 6 7 8 9 10 11
AckNo = 5, Win = 6is received
• Acknowledgement is received that enlarges the window to the right (AckNo = 5, Win=6):
TCP Flow Control
40
![Page 41: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/41.jpg)
Sliding Window: Example
3K
ReceiverBuffer
0 4KSendersends 2Kof data
2K
Sendersends 2Kof data
4K
Sender blocked
41
![Page 42: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/42.jpg)
42
![Page 43: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/43.jpg)
43acknowledged sent to be sent outside window
Source PortSource Port Dest. PortDest. Port
Sequence NumberSequence Number
AcknowledgmentAcknowledgment
HL/FlagsHL/Flags WindowWindow
D. ChecksumD. Checksum Urgent PointerUrgent Pointer
Options…Options…
Source PortSource Port Dest. PortDest. Port
Sequence NumberSequence Number
AcknowledgmentAcknowledgment
HL/FlagsHL/Flags WindowWindow
D. ChecksumD. Checksum Urgent PointerUrgent Pointer
Options...Options...
Segment Sent Segment Received
App write
Window Flow Control: Sender Side
![Page 44: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/44.jpg)
Sliding Window Protocols
Go Back nاز بسته خراب شده به بعد مجددا ارسال شوند
Selective Repeatفقط بسته خراب شده مجددا ارسال شود
در مورد این پروتکلها و تحلیل کارایی آنها در درس توضیح داده شده است1شبکه
در مورد این پروتکلها و تحلیل کارایی آنها در درس توضیح داده شده است1شبکه
مشابه پروتکلهای کنترل جریان در الیه پیوند داده
44
![Page 45: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/45.jpg)
TCP limit sending rate as a function of perceived network congestion little traffic – increase sending rate much traffic – reduce sending rate
Congestion algorithm has three major “components”: additive-increase, multiplicative-decrease (AIMD) slow-start reaction to timeout events
TCP Congestion Control
45
![Page 46: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/46.jpg)
46
Router queues
اگرنرخ ورودي بسته ها، از سرعت پردازش بسته ها در داخل مسیریاب بیشتر باشد، صفهاي ورودي
طوالنی خواهند شد. اگرنرخ حرکت بسته ها در صفهاي خروجی کمتر از
نرخ پردازش آنها باشد، صفهاي خروجی طوالنی خواهند شد.
در صورت پر شدن بافر، مسیریاب مجبور به دور ریختن بسته میشود.
![Page 47: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/47.jpg)
47
هنگامی که بار بیش از ظرفیت میگردد، تاخیر به سمت بینهایت میرود. در این حالت بسته ها به مقصد نمیرسند و صفها طوالنی و طوالنیتر خواهند شد. از طرف دیگر، فرستنده بسته ها نیز به دلیل
اینکه پیام تصدیقی از جانب گیرنده دریافت نمیکند، اقدام به ارسال مجدد بسته ها نموده و به بدتر شدن شرایط کمک مینماید.
![Page 48: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/48.jpg)
Queue
SinkOutbound LinkRouterInbound Link
Sink
TCP
TCP AQM
TCP in action
Queue
SinkOutbound LinkRouterInbound Link
Sink
TCP
TCP
ACK…
ACK…
Queue
SinkOutbound LinkRouterInbound Link
Sink
TCP
TCP
ACK…
ACK…
Queue
SinkOutbound LinkRouterInbound Link
Sink
TCP
TCP
ACK…
Drop!!!
Queue
SinkOutbound LinkRouterInbound Link
Sink
TCP
TCP
Congestion Notification…
ACK…
48
![Page 49: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/49.jpg)
49
Slow start, exponential increase
![Page 50: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/50.jpg)
A B
cwnd=1
cwnd=2
cwnd=3cwnd=4
cwnd=5cwnd=6
cwnd=8cwnd=7
cwnd=9
cwnd=16
Slow Start
A B
cwnd=1
cwnd=2
cwnd=3cwnd=4
cwnd=5cwnd=6
cwnd=8cwnd=7
cwnd=9
cwnd=16
20
15
0
10
1 2 3 4
5
...
.
.
CWND/rtt
If CWND is less than or equal to SSTHRESTH : Slow start Slow start dictates that CWND start at one segment, and be
incremented by one segment every time an ACK is received
A B
cwnd=1
cwnd=2
cwnd=3cwnd=4
cwnd=5cwnd=6
cwnd=8cwnd=7
cwnd=9
cwnd=16
A B
cwnd=1
cwnd=2
cwnd=3cwnd=4
cwnd=5cwnd=6
cwnd=8cwnd=7
cwnd=9
cwnd=16
50
![Page 51: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/51.jpg)
51
In the slow start algorithm, the size of the congestion window increases exponentially until it reaches a
threshold.
Note:Note:
![Page 52: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/52.jpg)
52
Additive increase
![Page 53: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/53.jpg)
53
In the congestion avoidance algorithm the size of the congestion window
increases additively until congestion is detected.
Note:Note:
![Page 54: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/54.jpg)
54
Most implementations react differently to congestion detection:
❏ If detection is by time-out, a new slow start phase starts.
❏ If detection is by three ACKs, a new congestion avoidance phase starts.
Note:Note:
![Page 55: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/55.jpg)
55
Congestion Control example
![Page 56: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/56.jpg)
TCP Congestion Control
16
8
4
2
1
sent packetsper round
(congestion window)
time
40
20
10
5
80
15
30
25
35
75
55
45
50
65
60
70
Losing a single packet (TCP Tahoe): threshold drops to halve CONGESTION WINDOW CONGESTION WINDOW back to 1
Losing a single packet (TCP Reno): threshold drops to halve CONGESTION WINDOW CONGESTION WINDOW back to new threshold
ssthresh
ssthresh
50%
56
![Page 57: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/57.jpg)
57
TCP Behavior
W
RTT
1
2
3
4
5
6
7
8Calculate “average packet
loss rate” and “average throughput”
![Page 58: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/58.jpg)
TCP Round Trip Time and Timeout
Q: how to set TCP timeout 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 “smoother” average several recent
measurements, not just current SampleRTT
58
![Page 59: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/59.jpg)
TCP Round Trip Time and Timeout
EstimatedRTT = (1- )*EstimatedRTT + *SampleRTTEstimatedRTT = (1- )*EstimatedRTT + *SampleRTT
typical value: = 0.125RTT: gaia.cs.umass.edu to fantasia.eurecom.fr
100
150
200
250
300
350
1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106
time (seconnds)
RTT
(mill
isec
onds
)
SampleRTT Estimated RTT
59
![Page 60: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/60.jpg)
TCP Round Trip Time and Timeout
Setting the timeout EstimatedRTT plus “safety margin”
large variation in EstimatedRTT -> larger safety margin first estimate of how much SampleRTT deviates from EstimatedRTT:
TimeoutInterval = EstimatedRTT + 4*DevRTTTimeoutInterval = EstimatedRTT + 4*DevRTT
DevRTT = (1-)*DevRTT +*|SampleRTT-EstimatedRTT|
(typically, = 0.25)
Then set timeout interval:
60
![Page 61: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/61.jpg)
Fairness goal: if K TCP sessions share same bottleneck link of bandwidth R, each should have average rate of R/K
TCP connection 1
bottleneckrouter
capacity R
TCP connection 2
TCP Fairness
61
![Page 62: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/62.jpg)
Why is TCP fair?
Two competing sessions: Additive increase gives slope of 1, as throughout increases multiplicative decrease decreases throughput proportionally
R
R
equal bandwidth share
Connection 1 throughputCon
necti
on
2 t
hro
ug
hp
ut
congestion avoidance: additive increase
loss: decrease window by factor of 2congestion avoidance: additive
increase
loss: decrease window by factor of 2
62
![Page 63: 1 Department of Computer and IT Engineering University of Kurdistan Computer Networks II Transport Layer (UDP and TCP) By: Dr. Alireza Abdollahpouri](https://reader030.vdocuments.site/reader030/viewer/2022033103/5697bfdb1a28abf838cb0a51/html5/thumbnails/63.jpg)
63QuestionsQuestionsQuestionsQuestions