hannam university http://netwk.hannam.ac.kr 1 chapter 12 upon completion you will be able to:...
TRANSCRIPT
1HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
Chapter 12Chapter 12
Upon completion you will be able to:
TransmissionTransmissionControl ProtocolControl Protocol
โข Be able to name and understand the services offered by TCPโข Understand TCPโs flow and error control and congestion controlโข Be familiar with the fields in a TCP segmentโข Understand the phases in a connection-oriented connectionโข Understand the TCP transition state diagramโข Be able to name and understand the timers used in TCPโข Be familiar with the TCP options
Objectives
2HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
CONTENTSCONTENTS
โข PROCESS-TO-PROCESS COMMUNICATIONโข TCP SERVICESโข NUMBERING BYTESโข FLOW CONTROLโข SILLY WINDOW SYNDROMEโข ERROR CONTROLโข TCP TIMERS
3HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
CONTENTS CONTENTS (continued)(continued)
โข CONGESTION CONTROLโข SEGMENTโข OPTIONSโข CHECKSUMโข CONNECTIONโข STATE TRANSITION DIAGRAMโข TCP OERATIONโข TCP PACKAGE
4HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
TCP/IP TCP/IP ํ๋กํ ์ฝ์์ ํ๋กํ ์ฝ์์ TCPTCP ์ ์์น์ ์์น
5HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
์ ์ก ๊ณ์ธต์ ์ก ๊ณ์ธต ((TCP)TCP) ์ด ์ ๊ณตํ๋ ๊ธฐ๋ฅ์ด ์ ๊ณตํ๋ ๊ธฐ๋ฅ
ํ๋ก์ธ์ค๊ฐ ํต์ ๊ฐ์ค ( ํฌํธ ๋ฒํธ ์ด์ฉ )
์ ์ก ๋จ๊ณ์์ ํ๋ฆ ์ ์ด ๋ฉ์ปค๋์ฆ ์ ๊ณต (
์ฌ๋ผ์ด๋ฉ ์๋์ฐ ํ๋กํ ์ฝ ์ด์ฉ )
์ ์ก ๋จ๊ณ์์ ์ค๋ฅ ์ ์ด ๋ฉ์ปค๋์ฆ ์ ๊ณต ( ์๋ต
ํจํท , ์๊ฐ - ์ด๊ณผ , ์ฌ์ ์ก ๋ฐฉ์ ์ด์ฉ )
์ฐ๊ฒฐ ์งํฅ์ ์ ๋ขฐ์ฑ ์๋ ํ๋กํ ์ฝ
6HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.1 TCP SERVICES
We explain the services offered by TCP to the processes at the We explain the services offered by TCP to the processes at the application layer.application layer.
The topics discussed in this section include:The topics discussed in this section include:
Process-to-Process CommunicationProcess-to-Process CommunicationStream Delivery ServiceStream Delivery ServiceFull-Duplex CommunicationFull-Duplex CommunicationConnection-Oriented ServiceConnection-Oriented ServiceReliable ServiceReliable Service
7HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
TCP- ๋ -IP
12.1 TCP ์๋น์ค
8HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
ํด๋ผ์ด์ธํธ / ์๋ฒ ํต์ ์ ํ์ํ ์ฌํญ
๋ก์ปฌ ํด๋ผ์ด์ธํธ ํ๋ก๊ทธ๋จ
์๊ฒฉ ์๋ฒ ํ๋ก๊ทธ๋จ
๋ก์ปฌ ํธ์คํธ
์๊ฒฉ ํธ์คํธ
ํฌํธ๋ฒํธ
IP ์ฃผ์
12.1 TCP ์๋น์ค
9HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
ํฌํธ ๋ฒํธ
12.1 TCP ์๋น์ค
10HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
TCP ์์ ์ฌ์ฉ๋๋ ์ ์๋ ค์ง ํฌํธ
12.1 TCP ์๋น์ค
11HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
As we said in Chapter 11, in UNIX, the well-known ports are stored in a file called /etc/services. Each line in this file gives the name of the server and the well-known port number. We can use the grep utility to extract the line corresponding to the desired application. The following shows the ports for FTP.
Example 1
$ grep ftp /etc/services
ftp-data 20/tcpftp-control 21/tcp
12HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
์์ผ ์ฃผ์IP ์ฃผ์์ ํฌํธ ๋ฒํธ์ ์กฐํฉ
์ข ๋จ๊ฐ ์ฐ๊ฒฐ ์ค์ ์ ์ฌ์ฉ
ํด๋ผ์ด์ธํธ์ ์๋ฒ ์์ผ ์ฃผ์ ํ์
IP ํค๋ (IP ์ฃผ์ ) ์ TCP ํค๋ ( ํฌํธ ๋ฒํธ ) ์
๋ค์ด์์
12.1 TCP ์๋น์ค
13HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
์คํธ๋ฆผ ๋ฐฐ๋ฌ ์๋น์ค
์ ์ด์ค ์๋น์ค
์ฐ๊ฒฐ ์งํฅ ์๋น์ค
์ ๋ขฐ์ฑ ์๋น์ค
12.1 TCP ์๋น์ค
14HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
์คํธ๋ฆผ ๋ฐฐ๋ฌ
12.1 TCP ์๋น์ค
15HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
์คํธ๋ฆผ ๋ฐฐ๋ฌ ์๋น์ค์ก์ TCP
์ก์ ์์ฉ ํ๋ก๊ทธ๋จ์ผ๋ก๋ถํฐ ๋ฌธ์ ์คํธ๋ฆผ ์์ ( ์ก์ ๋ฒํผ ์ด์ฉ )
์ ์ ํ ํฌ๊ธฐ์ธ ์ธ๊ทธ๋จผํธ๋ฅผ ๋ง๋ค์ด ๋คํธ์ํฌ๋ฅผ ํตํ์ฌ ์ ์ก
์์ TCP ์ธ๊ทธ๋จผํธ๋ฅผ ์์ ( ์์ ๋ฒํผ ์ด์ฉ ) ๋ฐ์ดํฐ๋ฅผ ์ถ์ถํ์ฌ ๋ฌธ์ ์คํธ๋ฆผ์ผ๋ก ์์ ์์ฉ ํ๋ก๊ทธ๋จ์
์ ๋ฌ
12.1 TCP ์๋น์ค
16HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
์ก์ ๋ฒํผ์ ์์ ๋ฒํผ
12.1 TCP ์๋น์ค
17HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
TCP ์ธ๊ทธ๋จผํธ
12.1 TCP ์๋น์ค
18HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
์ ์ด์ค ์๋น์ค๋์์ ์๋ฐฉํฅ ์ ์ก์ก์ ๋ฐ์ดํฐ์ ์์ ๋ฐ์ดํฐ์ ๋ํ ํ์ธ ์๋ต์
ํจ๊ป ๋ณด๋ด๋ ํผ๊ธฐ๋ฐฑํน (piggybacking) ์ฐ๊ฒฐ - ์งํฅ ์๋น์ค
TCP ๋ ์ฐ๊ฒฐ์งํฅ ํ๋กํ ์ฝ๋ฌผ๋ฆฌ์ ์ฐ๊ฒฐ์ด ์๋ ๊ฐ์์ ์ฐ๊ฒฐ์์ฒญโ์น์ธ โ ๋ฐ์ดํฐ ๊ตํ โ ํด์ ์์ผ๋ก ์งํ
์ ๋ขฐ์ฑ ์๋น์คํ์ธ ์๋ต ๋ฉ์ปค๋์ฆ ์ด์ฉ
12.1 TCP ์๋น์ค
19HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.2 TCP FEATURES
To provide the services mentioned in the previous section, TCP has To provide the services mentioned in the previous section, TCP has several features that are briefly summarized in this section. several features that are briefly summarized in this section.
The topics discussed in this section include:The topics discussed in this section include:
Numbering System Numbering System Flow ControlFlow ControlError ControlError ControlCongestion ControlCongestion Control
20HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.2 2 ๋ฐ์ดํธ ์์๋ฐ์ดํธ ์์
The bytes of data being transferred in each connection are numbered by TCP. The numbering starts with a randomly
generated number.
Note:Note:
21HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
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 2
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)
22HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
The value in the sequence number field of a segment defines the number
of the first data byte containedin that segment.
Note:Note:
12.12.2 2 ๋ฐ์ดํธ ์์๋ฐ์ดํธ ์์
23HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.2 2 ๋ฐ์ดํธ ์์๋ฐ์ดํธ ์์ ํ์ธ์๋ต๋ฒํธ
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:
24HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
ํ๋ฆ ์ ์ด๋ฐ์ดํฐ ์์ ์ธก์ ์ก์ ์ธก์์ ์ ์กํ ๋ฐ์ดํฐ์
์ ์ด ์ค๋ฅ ์ ์ด
์ ๋ขฐ์ฑ ์๋ ์๋น์ค๋ฅผ ์ ๊ณตํ๊ธฐ ์ํด ์ค๋ฅ ์ ์ด ๋ฉ์ปค๋์ฆ ๊ตฌํ
ํผ์ก ์ ์ด๋ง์ ํผ์ก์ ๊ณ ๋ คํ์ฌ ๋ฐ์ดํฐ์์ ์์ ์ธก์์
์กฐ์
12.12.2 2 ๋ฐ์ดํธ ์์๋ฐ์ดํธ ์์
25HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.3 SEGMENT
A packet in TCP is called a segmentA packet in TCP is called a segment
The topics discussed in this section include:The topics discussed in this section include:
FormatFormatEncapsulationEncapsulation
26HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.3 3 ์ธ๊ทธ๋จผํธ์ธ๊ทธ๋จผํธ
TCP ์ธ๊ทธ๋จผํธ ํํTCP ๋ฅผ ์ด์ฉํ์ฌ ๋ ๊ฐ์ ์ฅ์น๊ฐ์ ์ ๋ฌ๋๋ ๋ฐ์ดํฐ
๋จ์
27HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.3 12.3 ์ธ๊ทธ๋จผํธ์ธ๊ทธ๋จผํธ
์ธ๊ทธ๋จผํธ ๋ฐ์ ์ง ํฌํธ ๋ฒํธ (source port address) : ์ ์ก ํธ์คํธ ์์ฉ
ํ๋ก๊ทธ๋จ์ ํฌํธ ๋ฒํธ ๋ชฉ์ ์ง ํฌํธ ๋ฒํธ (destination port address) : ์์ ํธ์คํธ ์์ฉ
ํ๋ก๊ทธ๋จ์ ํฌํธ ๋ฒํธ ์์ ๋ฒํธ (sequence number) : ์ธ๊ทธ๋จผํธ์ ํฌํจ๋ ๋ฐ์ดํฐ์
์ฒซ๋ฒ์งธ ๋ฐ์ดํธ์ ๋ถ์ฌ๋ ๋ฒํธ ํ์ธ ์๋ต ๋ฒํธ (acknowledgement number) : ์๋๋ฐฉ
๋ ธ๋๋ก๋ถํฐ ์์ ํ๊ณ ์ ํ๋ ๋ฐ์ดํธ์ ๋ฒํธ ํค๋๊ธธ์ด (header length) : TCP ํค๋ ๊ธธ์ด์ 4 ๋ฐ์ดํธ ์๋ ๊ฐ ์ ์ด (control) : ์ ์ด ๋๋ ํ๋๊ทธ
28HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.3 3 ์ธ๊ทธ๋จผํธ์ธ๊ทธ๋จผํธ
์ ์ด ํ๋
29HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.3 3 ์ธ๊ทธ๋จผํธ์ธ๊ทธ๋จผํธ
30HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.3 3 ์ธ๊ทธ๋จผํธ์ธ๊ทธ๋จผํธ
์ธ๊ทธ๋จผํธ ( ๊ณ์ )์๋์ฐ ํฌ๊ธฐ (window size) : ์๋๋ฐฉ์ด ์ ์งํด์ผ
ํ๋ ๋ฐ์ดํธ ๋จ์์ ์๋์ฐ ํฌ๊ธฐ
๊ฒ์ฌํฉ (checksum) : ์ค๋ฅ ์ ์ด
๊ธด๊ธ ํฌ์ธํฐ (urgent pointer) : ๊ธด๊ธ ๋ฐ์ดํฐ
์ต์ (option) : ์ต์ ์ ๋ณด
31HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
Pseudoheader added to the TCP
datagram
12.12.3 3 ์ธ๊ทธ๋จผํธ์ธ๊ทธ๋จผํธ
32HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
The inclusion of the checksum in TCP is mandatory.
Note:Note:
12.12.3 3 ์ธ๊ทธ๋จผํธ์ธ๊ทธ๋จผํธ
33HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.3 3 ์ธ๊ทธ๋จผํธ์ธ๊ทธ๋จผํธ
Encapsulation and decapsulation
34HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.4 A TCP CONNECTION
TCP is connection-oriented. A connection-oriented transport protocol TCP is connection-oriented. A connection-oriented transport protocol establishes a virtual path between the source and destination. All of the establishes a virtual path between the source and destination. All of the segments belonging to a message are then sent over this virtual path. A segments belonging to a message are then sent over this virtual path. A connection-oriented transmission requires three phases: connection connection-oriented transmission requires three phases: connection establishment, data transfer, and connection termination.establishment, data transfer, and connection termination.
The topics discussed in this section include:The topics discussed in this section include:
Connection EstablishmentConnection EstablishmentData TransferData TransferConnection TerminationConnection TerminationConnection ResetConnection Reset
35HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.4 4 ์ฐ๊ฒฐ์ฐ๊ฒฐ
TCP : ์ฐ๊ฒฐ - ์งํฅ ํ๋กํ ์ฝ
๋ฐ์ ์ง์ ๋ชฉ์ ์ง ๊ฐ์ ๊ฐ์ ๊ฒฝ๋ก ์ค์
์ฐ๊ฒฐ ์ค์ ๊ณผ ์ฐ๊ฒฐ ์ข ๋ฃ๋ฅผ ํตํ์ฌ ์ด๋ฃจ์ด์ง
36HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.4 4 ์ฐ๊ฒฐ์ฐ๊ฒฐ
์ฐ๊ฒฐ ์ค์ 4 ๋จ๊ณ ์ํ
1)ํธ์คํธ A ๋ ํธ์คํธ B ์๊ฒ ์ฐ๊ฒฐ ์ค์ ์ธ๊ทธ๋จผํธ๋ฅผ ์ ์ก( ์ด๊ธฐํ ์ ๋ณด )
2)ํธ์คํธ B ๋ ํธ์คํธ A ์๊ฒ ํ์ธ์๋ต ์ธ๊ทธ๋จผํธ ์ ์ก
3)ํธ์คํธ B ๋ ํธ์คํธ A ์๊ฒ ์ด๊ธฐํ ์ ๋ณด ์ธ๊ทธ๋จผํธ ์ ์ก
4)ํธ์คํธ A ๋ ํธ์คํธ B ์๊ฒ ํ์ธ์๋ต ์ธ๊ทธ๋จผํธ ์ ์ก
37HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.4 4 ์ฐ๊ฒฐ์ฐ๊ฒฐ
3 ๋จ๊ณ ํธ๋์์ดํฌ (three-way handshaking)
38HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
A SYN segment cannot carry data, but it consumes one sequence number.
Note:Note:
12.12.4 4 ์ฐ๊ฒฐ์ฐ๊ฒฐ
39HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
A SYN + ACK segment cannot carry data, but does consume one
sequence number.
Note:Note:
12.12.4 4 ์ฐ๊ฒฐ์ฐ๊ฒฐ
40HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
An ACK segment, if carrying no data, consumes no sequence number.
Note:Note:
12.12.4 4 ์ฐ๊ฒฐ์ฐ๊ฒฐ
41HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.4 4 ์ฐ๊ฒฐ์ฐ๊ฒฐ Data transfer
42HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
The FIN segment consumes one sequence number if it does not carry
data.
Note:Note:
12.12.4 4 ์ฐ๊ฒฐ์ฐ๊ฒฐ
43HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.4 4 ์ฐ๊ฒฐ์ฐ๊ฒฐ Connection termination using three-way
handshaking
44HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
The FIN + ACK segment consumes one sequence number if it does not
carry data.
Note:Note:
12.12.4 4 ์ฐ๊ฒฐ์ฐ๊ฒฐ
45HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.4 4 ์ฐ๊ฒฐ์ฐ๊ฒฐ
Half-close
46HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.5 STATE TRANSITION DIAGRAM
To keep track of all the different events happening during connection To keep track of all the different events happening during connection establishment, connection termination, and data transfer, the TCP establishment, connection termination, and data transfer, the TCP software is implemented as a finite state machine. . software is implemented as a finite state machine. .
The topics discussed in this section include:The topics discussed in this section include:
ScenariosScenarios
47HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.5 5 ์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ
์ ํ ์ํ ๊ธฐ๊ธฐ (finite state machine) ์ด์ฉ ๊ตฌํ TCP ์ํ
48HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.5 5 ์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ
์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ
49HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.5 5 ์๋ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ์๋ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ
์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ์ํ (state) : ํ์ํํ ์ํ์์ ๋ค๋ฅธ ์ํ๋ก์ ์ฒ์ด : ์ง์์ ์ฌ์ ์ผ๋ก ๋๋์ด์ง๋ ๋ ๊ฐ์ ๋ฌธ์์ด
1)์ฒซ๋ฒ์งธ ์ด : TCP ๊ฐ ์์ ํ๋ ์ ๋ ฅ2)๋๋ฒ์งธ ์ด : TCP ๊ฐ ์ ์กํ๋ ์ถ๋ ฅ
์ ์ : ์๋ฒ์ค์ : ํด๋ผ์ด์ธํธ๊ฐ๋์ : ๋น ์ ์์ ์ธ ์ํฉ
50HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.5 5 ์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ Common scenario
51HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
The common value for MSL is between 30 seconds and 1 minute.
Note:Note:
12.12.5 5 ์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ
52HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.5 5 ์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ Three-way handshake
53HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.5 5 ์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ Simultaneous
open
54HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.5 5 ์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ Simultaneous
close
55HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.5 5 ์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ Denying a
connection
56HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.5 5 ์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ์ํ ์ฒ์ด ๋ค์ด์ด๊ทธ๋จ Aborting a
connection
57HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.6 FLOW CONTROL
Flow control regulates the amount of data a source can send before Flow control regulates the amount of data a source can send before receiving an acknowledgment from the destination. TCP defines a receiving an acknowledgment from the destination. TCP defines a window that is imposed on the buffer of data delivered from the window that is imposed on the buffer of data delivered from the application program. application program.
The topics discussed in this section include:The topics discussed in this section include:
Sliding Window ProtocolSliding Window ProtocolSilly Window SyndromeSilly Window Syndrome
58HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.6 6 ํ๋ฆ ์ ์ดํ๋ฆ ์ ์ด Sliding window
59HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
A sliding window is used to make transmission more efficient as well as to control the flow of data so that the
destination does not become overwhelmed with data.
TCPโs sliding windows are byte oriented.
Note:Note:
12.12.6 6 ํ๋ฆ ์ ์ดํ๋ฆ ์ ์ด
60HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
What is the value of the receiver window (rwnd) for host A if the receiver, host B, has a buffer size of 5,000 bytes and 1,000 bytes of received and unprocessed data?
Example 3
SolutionThe value of rwnd = 5,000 โ 1,000 = 4,000. Host B can receive only 4,000 bytes of data before overflowing its buffer. Host B advertises this value in its next segment to A.
61HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
What is the size of the window for host A if the value of rwnd is 3,000 bytes and the value of cwnd is 3,500 bytes?
Example 4
SolutionThe size of the window is the smaller of rwnd and cwnd, which is 3,000 bytes.
62HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
Figure 12.21 shows an unrealistic example of a sliding window. The sender has sent bytes up to 202. We assume that cwnd is 20 (in reality this value is thousands of bytes). The receiver has sent an acknowledgment number of 200 with an rwnd of 9 bytes (in reality this value is thousands of bytes). The size of the sender window is the minimum of rwnd and cwnd or 9 bytes. Bytes 200 to 202 are sent, but not acknowledged. Bytes 203 to 208 can be sent without worrying about acknowledgment. Bytes 209 and above cannot be sent.
Example 5
63HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.6 6 ํ๋ฆ ์ ์ดํ๋ฆ ์ ์ด Example 5
64HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
In Figure 12.21 the server receives a packet with an acknowledgment value of 202 and an rwnd of 9. The host has already sent bytes 203, 204, and 205. The value of cwnd is still 20. Show the new window.
Example 6
SolutionFigure 12.22 shows the new window. Note that this is a case in which the window closes from the left and opens from the right by an equal number of bytes; the size of the window has not been changed. The acknowledgment value, 202, declares that bytes 200 and 201 have been received and the sender needs not worry about them; the window can slide over them.
65HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.6 6 ํ๋ฆ ์ ์ดํ๋ฆ ์ ์ด Example 6
66HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
In Figure 12.22 the sender receives a packet with an acknowledgment value of 206 and an rwnd of 12. The host has not sent any new bytes. The value of cwnd is still 20. Show the new window.
Example 7
SolutionThe value of rwnd is less than cwnd, so the size of the window is 12. Figure 12.23 shows the new window. Note that the window has been opened from the right by 7 and closed from the left by 4; the size of the window has increased.
67HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.6 6 ํ๋ฆ ์ ์ดํ๋ฆ ์ ์ด
Example 7
68HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
In Figure 12.23 the host receives a packet with an acknowledgment value of 210 and an rwnd of 5. The host has sent bytes 206, 207, 208, and 209. The value of cwnd is still 20. Show the new window.
Example 8
SolutionThe value of rwnd is less than cwnd, so the size of the window is 5. Figure 12.24 shows the situation. Note that this is a case not allowed by most implementations. Although the sender has not sent bytes 215 to 217, the receiver does not know this.
69HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.6 6 ํ๋ฆ ์ ์ดํ๋ฆ ์ ์ด Example 8
70HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
How can the receiver avoid shrinking the window in the previous example?
Example 9
SolutionThe receiver needs to keep track of the last acknowledgment number and the last rwnd. If we add the acknowledgment number to rwnd we get the byte number following the right wall. If we want to prevent the right wall from moving to the left (shrinking), we must always have the following relationship.
new ack + new rwnd โฅ last ack + last rwndor
new rwnd โฅ (last ack + last rwnd) โ new ack
71HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
To avoid shrinking the sender window, the receiver must wait until more space
is available in its buffer.
Note:Note:
12.12.6 6 ํ๋ฆ ์ ์ดํ๋ฆ ์ ์ด
72HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
Some points about TCPโs sliding windows:
โ The size of the window is the lesser of rwnd and cwnd. โ The source does not have to send a full windowโs
worth of data.โ The window can be opened or closed by the receiver, but should not be shrunk.โ The destination can send an acknowledgment at any time as long as it does not result in a shrinking window.โ The receiver can temporarily shut down the window; the sender, however, can always send a segment of one byte after the window is shut down.
Note:Note:
12.12.6 6 ํ๋ฆ ์ ์ดํ๋ฆ ์ ์ด
73HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.7 ERROR CONTROL
TCP provides reliability using error control, which detects corrupted, TCP provides reliability using error control, which detects corrupted, lost, out-of-order, and duplicated segments. Error control in TCP is lost, out-of-order, and duplicated segments. Error control in TCP is achieved through the use of the checksum, acknowledgment, and time-achieved through the use of the checksum, acknowledgment, and time-out. out.
The topics discussed in this section include:The topics discussed in this section include:
ChecksumChecksumAcknowledgmentAcknowledgmentAcknowledgment TypeAcknowledgment TypeRetransmissionRetransmissionOut-of-Order Segments Out-of-Order Segments Some ScenariosSome Scenarios
74HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
ACK segments do not consume sequence numbers and are not
acknowledged.
Note:Note:
12.12.7 7 ์ค๋ฅ ์ ์ด์ค๋ฅ ์ ์ด
75HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
In modern implementations, a retransmission occurs if the
retransmission timer expires or three duplicate ACK segments have arrived.
Note:Note:
12.12.7 7 ์ค๋ฅ ์ ์ด์ค๋ฅ ์ ์ด
76HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
No retransmission timer is set for an ACK segment.
Note:Note:
12.12.7 7 ์ค๋ฅ ์ ์ด์ค๋ฅ ์ ์ด
77HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
Data may arrive out of order and be temporarily stored by the receiving TCP, but TCP guarantees that no out-of-order
segment is delivered to the process.
Note:Note:
12.12.7 7 ์ค๋ฅ ์ ์ด์ค๋ฅ ์ ์ด
78HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.7 7 ์ค๋ฅ ์ ์ด์ค๋ฅ ์ ์ด
์ค๋ฅ ๊ฐ์ง ๋ฉ์ปค๋์ฆํผ์ ์ธ๊ทธ๋จผํธ์์ค ์ธ๊ทธ๋จผํธ์์๊ฐ ์ด๊ธ๋ ์ธ๊ทธ๋จผํธ์ค๋ณต ์ธ๊ทธ๋จผํธ
์ค๋ฅ ์ ์ ๋ฉ์ปค๋์ฆ
79HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.7 7 ์ค๋ฅ ์ ์ด์ค๋ฅ ์ ์ด
์ค๋ฅ ๋ฐ๊ฒฌ๊ณผ ์ ์ ์ค๋ฅ ๋ฐ๊ฒฌ ๋๊ตฌ : ๊ฒ์ฌํฉ , ํ์ธ์๋ต , ์๊ฐ - ์ด๊ณผ์ธ๊ทธ๋จผํธ์ ๊ฒ์ฌํฉ ํ๋ ์ด์ฉ ํผ์ ์ฌ๋ถ ํ์ธ์์ ์ ์ก์ ์ธก์ ์๋ ค์ฃผ๋ ํ์ธ์๋ต ์ด์ฉ์๊ฐ - ์ด๊ณผ ์ ๊น์ง ํ์ธ์๋ต ๋์ง ์์ผ๋ฉด ํผ์
๋๋ ์์ค ๊ฐ์ฃผ์ค๋ฅ ์ ์ : ์๊ฐ - ์ด๊ณผ ์นด์ดํฐ ์ด์ฉ - ์ฌ์ ์ก
80HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.7 7 ์ค๋ฅ ์ ์ด์ค๋ฅ ์ ์ด
ํผ์ ์ธ๊ทธ๋จผํธ
81HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.7 7 ์ค๋ฅ ์ ์ด์ค๋ฅ ์ ์ด
์์ค ์ธ๊ทธ๋จผํธ
82HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.7 7 ์ค๋ฅ ์ ์ด์ค๋ฅ ์ ์ด
์ค๋ณต ์ธ๊ทธ๋จผํธ์๊ฐ - ์ด๊ณผ ์ด์ ์ ํ์ธ์๋ต์ด ๋์ฐฉํ์ง ์๋ ์ก์ ๊ฐ์ ์์๋ฒํธ๋ฅผ ๊ฐ์ง ์ธ๊ทธ๋จผํธ๋ ํ๊ธฐ
์์๊ฐ ์๋ชป๋ ์ธ๊ทธ๋จผํธ๋ฐ์ดํฐ๊ทธ๋จ์ ์๋ก ๋ค๋ฅธ ๊ฒฝ๋ก๋ฅผ ํตํ ์ ๋ฌ๋ก
์ธํ์ฌ ๋ฐ์์ด์ ์ ์ธ๊ทธ๋จผํธ๋ก ๋ชจ๋ ์์ ํ๊ธฐ๊น์ง ํ์ธ์๋ต์
์ ์กํ์ง ์์์๊ฐ - ์ด๊ณผ๊ฐ ๋ฐ์ํ๋ฉด ์ธ๊ทธ๋จผํธ๊ฐ ์ฌ์ ์ก ๋จ
83HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.7 7 ์ค๋ฅ ์ ์ด์ค๋ฅ ์ ์ด
The receiver TCP delivers only ordered data to the process.
Note:Note:
84HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.7 7 ์ค๋ฅ ์ ์ด์ค๋ฅ ์ ์ด
ํ์ธ์๋ต ์์ค
85HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.7 7 ์ค๋ฅ ์ ์ด์ค๋ฅ ์ ์ด Lost
acknowledgment
86HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.7 7 ์ค๋ฅ ์ ์ด์ค๋ฅ ์ ์ด Lost acknowledgment corrected by resending a
segment
87HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
Lost acknowledgments may create deadlock if they are not properly
handled.
Note:Note:
12.12.7 7 ์ค๋ฅ ์ ์ด์ค๋ฅ ์ ์ด
88HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.8 CONGESTION CONTROL
Congestion control refers to the mechanisms and techniques to keep the Congestion control refers to the mechanisms and techniques to keep the load below the capacity. load below the capacity.
The topics discussed in this section include:The topics discussed in this section include:
Network PerformanceNetwork PerformanceCongestion Control MechanismsCongestion Control MechanismsCongestion Control in TCPCongestion Control in TCP
89HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.8 8 ํผ์ก์ ์ดํผ์ก์ ์ด
Router queues
90HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.8 8 ํผ์ก์ ์ดํผ์ก์ ์ด
ํผ์ก (Congestion) ํ์๋ผ์ฐํฐ๊ฐ ํจํท์ ์ฒ๋ฆฌํ ์ ์๋ ์๋๋ณด๋ค ๋ ๋นจ๋ฆฌ
ํจํท์ ์์ ํ๋ ๊ฒฝ์ฐ ๋ฐ์
TCPTCP ๋ ์์ค ์ธ๊ทธ๋จผํธ์ ์์ธ์ด ๋ง์ ๋ ์์ค ์ธ๊ทธ๋จผํธ์ ์์ธ์ด ๋ง์ ํผ์ก์ ๊ธฐ์ธํ ๊ฒ์ด๋ผ๊ณ ๊ฐ์ ํ๋คํผ์ก์ ๊ธฐ์ธํ ๊ฒ์ด๋ผ๊ณ ๊ฐ์ ํ๋ค ..
91HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.8 8 ํผ์ก์ ์ดํผ์ก์ ์ด Packet delay and network load
92HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.8 8 ํผ์ก์ ์ดํผ์ก์ ์ด Throughput versus network load
93HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.8 8 ํผ์ก์ ์ดํผ์ก์ ์ด
ํผ์ก ์๋์ฐ ์ค์ ์๋์ฐ ํฌ๊ธฐ = ์ต์ ( ์์ ์ธก์์ ์๋ ค์ฃผ๋ ์๋์ฐ
ํฌ๊ธฐ , ํผ์ก ์๋์ฐ ํฌ๊ธฐ )
ํผ์กํํผ ๋๋ฆฐ ์์ : ์๊ณ์น ์ค์ ( ์ต๋ ์๋์ฐ ํฌ๊ธฐ์ ๋ฐ ),
์๊ณ์น์ ๋๋ฌํ ๋๊น์ง ํ์ธ์๋ต์ด ๋์ฐฉํ๋ฉด ์ง์ํํ๋ก ์๋์ฐ ํฌ๊ธฐ๋ฅผ ์ฆ๊ฐ
๊ฐ์ฐ์ฆ๊ฐ : ์๊ณ์น๊น์ง ๋๋ฌํ๋ฉด , ํ์ธ์๋ต์ด ๋์ฐฉํ๋ฉด ํผ์ก ์๋์ฐ ํฌ๊ธฐ๋ฅผ ํ๋์ฉ ์ฆ๊ฐ
์ง์ ๊ฐ์ : ํผ์ก์ด ๋ฐ์ํ๋ฉด ์๊ณ์น๋ฅผ ํ์ฌ ์๋์ฐ ํฌ๊ธฐ์ ๋ฐ์ผ๋ก ์ค์ฌ์ ๋๋ฆฐ ์์์ ์ํ
94HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.8 8 ํผ์ก์ ์ดํผ์ก์ ์ด
Slow start, exponential increase
95HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
In the slow start algorithm, the size of the congestion window increases exponentially until it reaches a
threshold.
Note:Note:
12.12.8 8 ํผ์ก์ ์ดํผ์ก์ ์ด
96HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.8 8 ํผ์ก์ ์ดํผ์ก์ ์ด Congestion avoidance, additive increase
97HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
In the congestion avoidance algorithm the size of the congestion window
increases additively until congestion is detected.
Note:Note:
12.12.8 8 ํผ์ก์ ์ดํผ์ก์ ์ด
98HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
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:
12.12.8 8 ํผ์ก์ ์ดํผ์ก์ ์ด
99HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.8 8 ํผ์ก์ ์ดํผ์ก์ ์ด TCP congestion policy summary
100HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.8 8 ํผ์ก์ ์ดํผ์ก์ ์ด Congestion
example
101HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.9 TCP TIMERS
To perform its operation smoothly, most TCP implementations use at To perform its operation smoothly, most TCP implementations use at least four timers. least four timers.
The topics discussed in this section include:The topics discussed in this section include:
Retransmission TimerRetransmission TimerPersistence TimerPersistence TimerKeepalive TimerKeepalive TimerTIME-WAIT TimerTIME-WAIT Timer
102HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.9 TCP 9 TCP ํ์ด๋จธํ์ด๋จธ
TCP ํ์ด๋จธ
103HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
In TCP, there can be only be one RTT measurement in progress at any time.
Note:Note:
12.12.9 TCP 9 TCP ํ์ด๋จธํ์ด๋จธ
104HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
Let us give a hypothetical example. Figure 12.38 shows part of a connection. The figure shows the connection establishment and part of the data transfer phases.
Example 10
1. When the SYN segment is sent, there is no value for RTTM , RTTS , or RTTD . The value of RTO is set to 6.00 seconds. The following shows the value of these variables at this moment:
RTTM = 1.5 RTTS = 1.5
RTTD = 1.5 / 2 = 0.75 RTO = 1.5 + 4 . 0.75 = 4.5
2. When the SYN+ACK segment arrives, RTTM is measured and is equal to 1.5 seconds. The next slide shows the values of these variables:
105HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
Example 10
RTTM = 1.5 RTTS = 1.5RTTD = 1.5 / 2 = 0.75 RTO = 1.5 + 4 . 0.75 = 4.5
3.When the first data segment is sent, a new RTT measurement starts. Note that the sender does not start an RTT measurement when it sends the ACK segment, because it does not consume a sequence number and there is no time-out. No RTT measurement starts for the second data segment because a measurement is already in progress.
RTTM = 2.5RTTS = 7/8 (1.5) + 1/8 (2.5) = 1.625RTTD = 3/4 (7.5) + 1/4 |1.625 โ 2.5| = 0.78RTO = 1.625 + 4 (0.78) = 4.74
106HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.9 TCP 9 TCP ํ์ด๋จธํ์ด๋จธ Example 10
107HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
TCP does not consider the RTT of a retransmitted segment in its calculation of a new RTO.
Note:Note:
12.12.9 TCP 9 TCP ํ์ด๋จธํ์ด๋จธ
108HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
Figure 12.39 is a continuation of the previous example. There is retransmission and Karnโs algorithm is applied. The first segment in the figure is sent, but lost. The RTO timer expires after 4.74 seconds. The segment is retransmitted and the timer is set to 9.48, twice the previous value of RTO. This time an ACK is received before the time-out. We wait until we send a new segment and receive the ACK for it before recalculating the RTO (Karnโs algorithm).
Example 11
109HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.9 TCP 9 TCP ํ์ด๋จธํ์ด๋จธ Example 11
110HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.9 TCP 9 TCP ํ์ด๋จธํ์ด๋จธ
์ฌ์ ์ก ํ์ด๋จธ (retransmission timer)์ฌ์ ์ก ์๊ฐ : ์ธ๊ทธ๋จผํธ ์ ์ก ํ ํ์ธ์๋ต์
๊ธฐ๋ค๋ฆฌ๋ ์๊ฐ
ํ์ด๋จธ๊ฐ ๋๋๊ธฐ ์ ํ์ธ์๋ต์ด ์์ ๋๋ฉด ํ์ด๋จธ ์๋ฉธ
ํ์ธ์๋ต์ด ์์ ๋๊ธฐ ์ ํ์ด๋จธ๊ฐ ์ข ๋ฃ๋๋ฉด ํด๋น ์ธ๊ทธ๋จผํธ๋ ์ฌ์ ์ก๋๊ณ ํ์ด๋จธ ์ด๊ธฐํ
์ฌ์ ์ก ์๊ฐ = 2 * RTT(round-trip time)
111HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.9 TCP 9 TCP ํ์ด๋จธํ์ด๋จธ
Karn ์๊ณ ๋ฆฌ์ฆ ์ ์ก๋ ์ธ๊ทธ๋จผํธ์ ๋ํด ํ์ธ ์๋ต๋์ง ์์ ์ฌ์ ์ก๋ ๊ฒฝ์ฐ ์ด์ ์ธ๊ทธ๋จผํธ์ ๋ํ ํ์ธ์๋ต์ธ์ง ์ฌ์ ์ก์ ๋ํ
ํ์ธ์๋ต์ธ์ง ์ฌ๋ถ ํ๋จ์ด ์ ๋งคํ๋ค RTT ๊ฐ์ ์ฌ์ ์ก ์์ด ํ์ธ์๋ต ์์ ์ ๊น์ง ๋ณ๋์ด ์์
์์ ํ์ด๋จธ (persistence timer) ์๋์ฐ ํฌ๊ธฐ๊ฐ 0 ์ธ ๊ฒฝ์ฐ๋ฅผ ์ฒ๋ฆฌํ๊ธฐ ์ํ ํ์ด๋จธ ์์ TCP ๊ฐ ์๋์ฐ ํฌ๊ธฐ 0 ์ ํต๋ณดํ๋๋ฐ , ์ก์ TCP ๊ฐ
์ด์ ๋ํ ํ์ธ์๋ต์ ๋ณด๋์ง๋ง ์์ TCP ๊ฐ ์ด๋ฅผ ์์ ํ์ง ๋ชปํจ
์์ชฝ TCP ๊ฐ ์๋ก ๊ธฐ๋ค๋ฆฌ๋ ๊ต์ฐฉ์ํ (deadlock) ํด๊ฒฐ
112HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.9 TCP 9 TCP ํ์ด๋จธํ์ด๋จธ
Keepalive ํ์ด๋จธ๋ TCP ๊ฐ์ ์ค์ ๋ ์ฐ๊ฒฐ์ด ์ค๋ซ๋์ ํด์ง (idle)
์ํ์ ์๋ ๊ฒ์ ๋ฐฉ์งํ๊ธฐ ์ํ ํ์ด๋จธ์๊ฐ - ์ข ๋ฃ : 2 ์๊ฐ2 ์๊ฐ์ด ์ง๋๋๋ก ์ธ๊ทธ๋จผํธ๋ฅผ ์์ ํ์ง ๋ชปํ๋ฉด 7
5 ์ด ๊ฐ๊ฒฉ์ผ๋ก 10 ๊ฐ์ ํ๋ฃจ๋ธ (probe) ์ ์ก์๋ต์ด ์์ผ๋ฉด ๋ค์ด์ผ๋ก ๊ฐ์ฃผํ๊ณ ์ฐ๊ฒฐ ์ข ๋ฃ
์๊ฐ - ๋๊ธฐ ํ์ด๋จธ (time-waited timer)์ฐ๊ฒฐ ์ข ๋ฃ ๋์์ ์ฌ์ฉ
113HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.10 OPTIONS
The TCP header can have up to 40 bytes of optional information. The TCP header can have up to 40 bytes of optional information. Options convey additional information to the destination or align other Options convey additional information to the destination or align other options.options.
114HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.10 10 ์ต์ ์ต์
์ต์
115HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.10 10 ์ต์ ์ต์
์ต์ - ๋ (end of option)๋งจ ๋์ ํจ๋ฉ์ ์ํด ์ฌ์ฉ๋๋ ํ ๋ฐ์ดํธ ์ต์
116HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
EOP can be used only once.
Note:Note:
12.12.10 10 ์ต์ ์ต์
117HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.10 10 ์ต์ ์ต์
๋ฌด ๋์ (no operation)๋งจ ๋์ ํจ๋ฉ์ ์ํด ์ฌ์ฉ๋๋ ํ ๋ฐ์ดํธ ์ต์
118HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
NOP can be used more than once.
Note:Note:
12.12.10 10 ์ต์ ์ต์
119HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.10 10 ์ต์ ์ต์
์ต๋ ์ธ๊ทธ๋จผํธ ํฌ๊ธฐ (maximum segment size : MSS) ๋ชฉ์ ์ง์์ ์์ ํ ์ ์๋ ๋ฐ์ดํฐ ์ธ๊ทธ๋จผํธ์ ์ต๋ ํฌ๊ธฐ ์ฐ๊ฒฐ ์ค์ ๋จ๊ณ ์ค์ ๋ชฉ์ ์ง์ ์ํด ๊ฒฐ์
120HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
The value of MSS is determined during connection establishment and
does not change during the connection.
Note:Note:
12.12.10 10 ์ต์ ์ต์
121HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.10 10 ์ต์ ์ต์
์๋์ฐ ํ์ฅ ์ธ์ ์๋์ฐ ํฌ๊ธฐ๋ฅผ ์ฆ๊ฐ์ํค๊ธฐ ์ํด ์ฌ์ฉ ์๋ก์ด ์๋์ฐ ํฌ๊ธฐ = ํค๋์์ ์ ์๋ ์๋์ฐ ํฌ๊ธฐ ฮง2 ์๋์ฐํ์ฅ์ธ์
์ต๋ ์ค์ ๊ฐ : 16 ์ต๋ ์๋์ฐ ํฌ๊ธฐ : 216ฮง216=232( ์์๋ฒํธ ๊ฐ๊ณผ ๋์ผ )
122HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
The value of the window scale factor can be determined only during
connection establishment; it does not change during the connection.
Note:Note:
12.12.10 10 ์ต์ ์ต์
123HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.10 10 ์ต์ ์ต์
ํ์ ์คํฌํ (timestamp) 10 ๋ฐ์ดํธ ๊ธธ์ด ์ต์ ์๋ณต์๊ฐ (round-trip time) ๊ณ์ฐ์ ์ฌ์ฉ
124HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
One application of the timestamp option is the calculation of round trip
time (RTT).
Note:Note:
12.12.10 10 ์ต์ ์ต์
125HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
Figure 12.46 shows an example that calculates the round-trip time for one end. Everything must be flipped if we want to calculate the RTT for the other end.
Example 12
The sender simply inserts the value of the clock (for example, the number of seconds past from midnight) in the timestamp field for the first and second segment. When an acknowledgment comes (the third segment), the value of the clock is checked and the value of the echo reply field is subtracted from the current time. RTT is 12 s in this scenario.
126HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
The receiverโs function is more involved. It keeps track of the last acknowledgment sent (12000). When the first segment arrives, it contains the bytes 12000 to 12099. The first byte is the same as the value of lastack. It then copies the timestamp value (4720) into the tsrecent variable. The value of lastack is still 12000 (no new acknowledgment has been sent). When the second segment arrives, since none of the byte numbers in this segment include the value of lastack, the value of the timestamp field is ignored. When the receiver decides to send an accumulative acknowledgment with acknowledgment 12200, it changes the value of lastack to 12200 and inserts the value of tsrecent in the echo reply field. The value of tsrecent will not change until it isreplaced by a new segment that carries byte 12200 (next segment).
Example 12
127HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
Note that as the example shows, the RTT calculated is the time difference between sending the first segment and receiving the third segment. This is actually the meaning of RTT: the time difference between a packet sent and the acknowledgment received. The third segment carries the acknowledgment for the first and second segments.
Example 12
128HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.10 10 ์ต์ ์ต์ Example 12
129HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
The timestamp option can also be used for PAWS.
Note:Note:
12.12.10 10 ์ต์ ์ต์
130HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.10 10 ์ต์ ์ต์ SACK
131HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
Let us see how the SACK option is used to list out-of-order blocks. In Figure 12.48 an end has received five segments of data.
Example 13
The first and second segments are in consecutive order. An accumulative acknowledgment can be sent to report the reception of these two segments. Segments 3, 4, and 5, however, are out of order with a gap between the second and third and a gap between the fourth and the fifth. An ACK and a SACK together can easily clear the situation for the sender. The value of ACK is2001, which means that the sender need not worry about bytes 1 to 2000. The SACK has two blocks. The first block announces that bytes 4001 to 6000 have arrived out of order. The second block shows that bytes 8001 to 9000 have also arrived out of order. This means that bytes 2001 to 4000 and bytes 6001 to 8000 are lost or discarded. The sender can resend only these bytes.
132HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.10 10 ์ต์ ์ต์ Example 13
133HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
The example in Figure 12.49 shows how a duplicate segment can be detected with a combination of ACK and SACK. In this case, we have some out-of-order segments (in one block) and one duplicate segment. To show both out-of-order and duplicate data, SACK uses the first block, in this case, to show the duplicate data and other blocks to show out-of-order data. Note that only the first block can be used for duplicate data. The natural question is how the sender, when it receives these ACK and SACK values knows that the first block is for duplicate data (compare this example with the previous example). The answer is that the bytes in the first block are already acknowledged in the ACK field; therefore, this block must be a duplicate.
Example 14
134HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.10 10 ์ต์ ์ต์ Example 14
135HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
The example in Figure 12.50 shows what happens if one of the segments in the out-of-order section is also duplicated. In this example, one of the segments (4001:5000) is duplicated. The SACK option announces this duplicate data first and then the out-of-order block. This time, however, the duplicated block is not yet acknowledged by ACK, but because it is part of the out-of-order block (4001:5000 is part of 4001:6000), it is understood by the sender that it defines the duplicate data.
Example 15
136HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.10 10 ์ต์ ์ต์ Example 15
137HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.11 TCP PACKAGE
We present a simplified, bare-bones TCP package to simulate the heart We present a simplified, bare-bones TCP package to simulate the heart of TCP. The package involves tables called transmission control blocks, of TCP. The package involves tables called transmission control blocks, a set of timers, and three software modules.a set of timers, and three software modules.
The topics discussed in this section include:The topics discussed in this section include:
Transmission Control Blocks (TCBs)Transmission Control Blocks (TCBs)TimersTimersMain ModuleMain ModuleInput Processing ModuleInput Processing ModuleOutput Processing ModuleOutput Processing Module
138HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.112.11 TCP 1 TCP ์ค๊ณ์ค๊ณ
์ ์ก ์ ์ด ๋ธ๋ก (TCB : Transmission Control Block)
ํ์ด๋จธ (Timer)
๋ฉ์ธ ๋ชจ๋ (Main Module)
์ ๋ ฅ ํ๋ก์ธ์ค ๋ชจ๋ (Input Process Module)
์ถ๋ ฅ ํ๋ก์ธ์ค ๋ชจ๋ (Output Process Module)
139HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.11 TCP 11 TCP ์ค๊ณ์ค๊ณ
TCP ์ค๊ณ
140HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.12.11 TCP 11 TCP ์ค๊ณ์ค๊ณ
์ ์ก ์ ์ด ๋ธ๋ก (TCB) ์ฐ๊ฒฐ ์ ์ด์ ๋ํ ์ ๋ณด ๋ณด๊ด
141HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.112.11 TCP 1 TCP ์ค๊ณ์ค๊ณ
์ ์ก ์ ์ด ๋ธ๋ก (TCB)์ํ (state)
ํ๋ก์ธ์ค (process)
๋ก์ปฌ IP ์ฃผ์๋ก์ปฌ ํฌํธ ๋ฒํธ์๊ฒฉ์ง IP ์ฃผ์์๊ฒฉ์ง ํฌํธ ๋ฒํธ์ธํฐํ์ด์ค๋ก์ปฌ ์๋์ฐ
142HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.112.11 TCP 1 TCP ์ค๊ณ์ค๊ณ
์ ์ก ์ ์ด ๋ธ๋ก (TCB)( ๊ณ์ )์๊ฒฉ์ง ์๋์ฐ์ก์ ์์๋ฒํธ์์ ์์๋ฒํธ์๋ณต (round-trip) ์๊ฐ์๊ฐ ์ด๊ณผ ๊ฐ๋ฒํผ ํฌ๊ธฐ๋ฒํผ ํฌ์ธํฐ
143HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
12.112.11 TCP 1 TCP ์ค๊ณ์ค๊ณ
ํ์ด๋จธ TCP ๋์์ ์ฒ๋ฆฌํ๊ธฐ ์ํ ์ฌ๋ฌ ๊ฐ์ง ํ์ด๋จธ
๋ฉ์ธ ๋ชจ๋ TCP ์ธ๊ทธ๋จผํธ ๋์ฐฉ ์๊ฐ - ์ด๊ณผ ์ด๋ฒคํธ ๋ฐ์ ์์ฉ ํ๋ก๊ทธ๋จ์ผ๋ก๋ถํฐ ๋ฉ์์ง๊ฐ ๋ค์ด์ค๋ ๊ฒฝ์ฐ
์ ๋ ฅ ์ฒ๋ฆฌ ๋ชจ๋ ์ฐ๊ฒฐ ์ค์ ์ํ์์ ์์ ํ๋ ๋ฐ์ดํฐ๋ ํ์ธ์๋ต์ ์ฒ๋ฆฌํ๊ธฐ
์ํด ํ์ํ ๊ธฐ๋ฅ๋ด๋น ์ถ๋ ฅ ์ฒ๋ฆฌ ๋ชจ๋
์ฐ๊ฒฐ ์ค์ ์ํ์์ ์์ฉ ํ๋ก๊ทธ๋จ์ผ๋ก๋ถํฐ ์์ ํ ๋ฐ์ดํฐ๋ฅผ ์ ์กํ๊ธฐ ์ํด ํ์ํ ๊ธฐ๋ฅ ๋ด๋น
144HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr
์ฐ์ต๋ฌธ์ ํ์ดํด์
Report ๋ก ๋ค์์ฃผ๊น์ง (์ผ์ฃผ์ผ ํ )
์ ์ถํด ์ฃผ์ธ์ !
์๋ฆผ์๋ฆผ