Вы находитесь на странице: 1из 28

BiLIM Systems

-, . , 80, (812) 449-0770, (812) 449-0771, E-mail: info@bilim.com

Transmission Control Protocol



DARPA INTERNET
Defense Advanced Research Projects Agency
Information Processing Techniques Office
1400 Wilson Boulevard
Arlington, Virginia 22209
Information Sciences Institute
University of Southern California
4676 Admiralty Way
Marina del Rey, California 90291
RFC: 793
RFC 761
IEN: 129, 124, 112, 81, 55, 44, 40, 27, 21, 5

......................................................................................................................................................................................................
.............2
1. ................................................................................................................................................................................................................
.....3
1.1. ......................................................................................................................................................................................................
..3
1.2. ................................................................................................................................................................
..3
1.3. ........................................................................................................................................................................
..............3
1.4. ..............................................................................................................................................................................................
........3
1.5. ........................................................................................................................................................................
.....................3
.......................................................................................................................................................................
..4
.........................................................................................................................................................................................
........4
..............................................................................................................................................................
....4
......................................................................................................................................................................
........4
.........................................................................................................................................................................................
........4
.......................................................................................................................................................
..........4
2. .......................................................................................................................................................................................................
...........4
2.1. ......................................................................................................................................
...............4
2.2. ...........................................................................................................................................................................
..5
2.3. ............................................................................................................................................................................................
...........5
2.4. ................................................................................................................................................................................................
......5
2.5. ................................................................................................................................................................
......5
2.6. ....................................................................................................................................................................
.............................6
2.7. .......................................................................................................................................................
.......6
2.8. ............................................................................................................................................................................................
...6
2.9. .........................................................................................................................................................
..............7
2.10. ...........................................................................................................................................................
......................7
3. ..........................................................................................................................................................
...................7
3.1. ....................................................................................................................................................................................
........7
TCP............................................................................................................................................................................
........7
Source Port - : 16 ...................................................................................................................................
..........7
Destination Port - : 16 .....................................................................................................................................
..7
Sequence Number - : 32 ........................................................................................................................
..........7
Acknowledgment Number - : 32 ..................................................................................................
............7
Data Offset - : 4 .....................................................................................................................................
............8
Reserved - : 6 .....................................................................................................................................
............8
Control Bits - : 6 ( ):.......................................................................................................
...8
Window -: 16 ...................................................................................................................................................
........................8
Checksum - : 16 ....................................................................................................................................
........8
Urgent Pointer - : 16 .....................................................................................................................
..............8
Options - : .....................................................................................................................................
..................8
...........................................................................................................................................................................
.8
End of Option List........................................................................................................................................................................
..8
www.bilim.com

www.protocols.ru

BiLiM Systems
RFC 793
No-Operation..................................................................................................................................................................................
8
Maximum Segment Size..........................................................................................................................................................
......9
Maximum Segment Size - : 16 ............................................................................................
..9
Padding - : .....................................................................................................................................
........9
3.2. ..............................................................................................................................................................................
.....................9
..............................................................................................................................................
.9
................................................................................................................................
...................9
........................................................................................................................................................
...9
...............................................................................................................................................
................9
...............................................................................................................................................
.....................9
3.3. ......................................................................................................................................................................................
10
..........................................................................................................................................................
..................11
...........................................................................................................................................................
....12
TCP........................................................................................................................................................................
....12
3.4. ..................................................................................................................................................
............................13
..................................................................................................................
......................13
Reset................................................................................................................................................................................
..............14
Reset......................................................................................................................................................................
........................15
3.5. ...........................................................................................................................................................................
....15
1: .............................................................................................................
..........15
2: TCP FIN ....................................................................................................................................................
..............15
3: ............................................................................................................
15
3.6. .................................................................................................................................................
....................15
3.7. ...........................................................................................................................................................................................
..16
- .............................................................................................................................................................
........16
-.........................................................................................................................................................
......16
......................................................................................................................................................
................16
.......................................................................................................................................................................................
..16
.................................................................................................................................................
..17
3.8. ......................................................................................................................................................................................
..............17
TCP - ...........................................................................................................................................................
........17
TCP ....................................................................................................................................................
.....17
Open............................................................................................................................................................................................
.........17
Send..................................................................................................................................................................................
....................18
Receive.....................................................................................................................................................................
............................18
Close........................................................................................................................................................................
.............................18
Status..................................................................................................................................................................................
..................19
Abort..................................................................................................................................................................................................
..19
TCP .................................................................................................................................................
....19
TCP - ..............................................................................................................................................
....19
3.9. .....................................................................................................................................................................................
..20
....................................................................................................................................................
..................20
OPEN ..............................................................................................................................................................................................
....20
SEND ..............................................................................................................................................................................................
....20
RECEIVE ..............................................................................................................................................................
..............................21
CLOSE ..................................................................................................................................................................................
..............21
ABORT .....................................................................................................................................................................................
..........22
STATUS ...........................................................................................................................................................................................
..22
.......................................................................................................................................................................
..........22
-..................................................................................................................................................................
................................26
-...................................................................................................................................
..........................26
....................................................................................................................................................
......................26
........................................................................................................................................................................
........26
...............................................................................................................................................................................................
.......................26
................................................................................................................................................................................................
....................28

TCP (Transmission Control


Protocol). ARPA TCP,
, .
. ,
end-of-letter letter push1.
Jon Postel,
- , ,
. TCP Internet .
TCP , . .
. ,
. , RFC-793 TCP
, .
, RFC-793
. .
,

. RFC-1122
( www.protocols.ru). . .
www.bilim.com
2
www.protocols.ru
1

RFC 793

BiLiM Systems

1.

TCP
.
, TCP,
, TCP.

1.1.
, .
,
,
.

,
. , Deputy Undersecretary of
Defense for Research and Engineering TCP (Transmission Control Protocol - ),
,
.
TCP ,
, . TCP
, , .
,
TCP. TCP ,
. TCP
, (packet-switched)
(circuit-switched).
TCP , [1]. TCP
Internet (IP) [2], TCP
, "" .
TCP, . IP
TCP, ().
IP (precedence) , TCP
- .


TCP
Internet (IP)

1
TCP,
. (front-end)
, TCP IP, . TCP
, front-end (
).

1.2.
TCP .
TCP .

1.3.
, TCP,
TCP .
. 2 TCP.
3 , TCP (
, , . .), TCP.

1.4.
TCP , -
(, IP).
TCP .
, , . ,
, . ,
TCP . TCP
,
TCP ,
TCP
. ,
. TCP
. IP [2].

1.5.
, TCP
.
Internet :
(Basic Data Transfer);
www.bilim.com

www.protocols.ru

BiLiM Systems
(Reliability);
(Flow Control);
(Multiplexing);
(Connections);
(Precedence and Security)
TCP .

RFC 793


TCP ,
. TCP ,
.
, , TCP, .
(push).
TCP "" .
push TCP . ""
push .

TCP , ,
. ,
(ACK - acknowledgment), TCP. ACK
(-), .
, , .
,
. ;
.
.
TCP Internet ,
. TCP Internet.


TCP , .
ACK "" (window),
. ,
.

TCP,
() . ( internet),
(socket). . ,
.
(binding) . ,
(, )
() , .
.
.

, , TCP
. , , ,
. ,
.
, TCP
( ). ,
(terminate close) .
, , ,
(handshake)
.


TCP .
, .

2.
2.1.
(internetwork environment) , ,

. (, ETHERNET) (,
ARPANET2), . ,
, . ,
,
.
.
, , .
2

Internet. . .
www.bilim.com

www.protocols.ru

RFC 793
BiLiM Systems
, ( )
. (
). ( -)
.
.
,
, ,
.

2.2.
, TCP . TCP
IP TCP.
TCP . TCP
,
.
IP TCP internet,
. internet TCP IP
IP - .
.
, ,
IP -.
IP "" (unwrapped)
, . IP "" (wrapped)
, .
IP (),
. IP,
. .
, IP .
IP ( , )
TCP.
. -
( IP), .
() ,
, ,
.

2.3.
, TCP . TCP
. TCP (, ).
, . TCP
IP,
.
TCP TCP .
TCP , .

2.4.
TCP TCP (OPEN) (CLOSE)
, (SEND) (RECEIVE) , (STATUS) .
(, ,
).
TCP - IP , TCP
internet. , , ,
.

2.5.

+-----+
2 TCP +------+ +-----+ +-----+
|Telnet| | FTP | |Voice| ... |
|
:
+-----+
,

TCP

+------+ +-----+ +-----+


.
|
|
|
|

+-----+
+-----+
+-----+
Telnet AUTODIN
| TCP |
| RTP | ... |
|
II THP.
+-----+
+-----+
+-----+
|
|
|
2.6.
+-------------------------------+
|
Internet Protocol & ICMP
|

TCP


+-------------------------------+
.
|

+---------------------------+

|
Local Network Protocol |

. ,
+---------------------------+
.
2.

. ,
, .
TCP , ,
. .
(-), .
www.bilim.com
5
www.protocols.ru

BiLiM Systems
RFC 793
TCP , ,
TCP , .
TCP . TCP
"" TCP. (
), TCP .

2.7.
, TCP,
. TCP,
3. TCP IP
TCP; .
.
.
.
, . . "".
TCP , ,
. " " (well-known) ,
TCP . ,
TCP "" .
, Request
Port (,
).
OPEN , .
TCP ,
. , . ,
TCB (Transmission Control Block - ).
TCB . OPEN
- ( ) ().
OPEN , ,
. , OPEN,
. , ,
. OPEN.
, ,
OPEN . ,
. , ,
.
Well-known . ,
Telnet , File Transfer,
Remote Job Entry, Text Generator, Echoer, Sink ( ).
Look-Up, , .
TCP,
(. [4]3).
OPEN OPEN ;
TCP . ,
OPEN , .
, .
OPEN OPEN.
OPEN - .
OPEN -
, . .
OPEN ( TCB)
OPEN TCB ,
OPEN ( TCB); TCB
.
(SYN) ,
three-way hand shake ( ) [3].
SYN TCB,
OPEN. .
established () .
- FIN.

2.8.
, , .
SEND ( ) ,
(push) , PUSH.
TCP -
, push ().
. TCP PUSH,
TCP .
push .
SEND ( ) SEND.
push PUSH "" .
(record service).
push , TCP-, .
PUSH , ,
TCP/UDP Assigned Numbers
(RFC-1700 ). . .
www.bilim.com
6
www.protocols.ru
3

RFC 793
BiLiM Systems
, .
PUSH, .
TCP ,
, , (urgent data). TCP ,
,
.

2.9.
TCP IP
. TCP
- ,
. , TCP
.
TCP, ,
. TCP
( Telnet THP) ,
.

2.10.
TCP -
.

3.
3.1.
TCP IP. IP ,
[2]. TCP IP ,
TCP. , TCP.

TCP

0
1
2
3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
Source Port
|
Destination Port
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
Sequence Number
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
Acknowledgment Number
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Data |
|U|A|P|R|S|F|
|
| Offset| Reserved |R|C|S|S|Y|I|
Window
|
|
|
|G|K|H|T|N|N|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
Checksum
|
Urgent Pointer
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
Options
|
Padding
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
data
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3. TCP

Source Port - : 16
.

Destination Port - : 16
.

Sequence Number - : 32
SYN. SYN,
(ISN), ISN+1.

Acknowledgment Number - : 32
ACK , ,
. .

Data Offset - : 4
32- TCP. . TCP (
) , 32 .

Reserved - : 6
.

Control Bits - : 6 ( ):
URG: Urgent Pointer
ACK: Acknowledgment Number
PSH: Push
www.bilim.com

www.protocols.ru

BiLiM Systems
RST: (Reset)
SYN:
FIN:

RFC 793

Window -: 16
, , .

Checksum - : 16
, 16 1.
, 16 . .
Checksum .
96- , TCP.
, TCP. TCP
. IP
TCP- TCP IP.


0
PTCL
TCP
TCP Length TCP ( , ); 12 .

Urgent Pointer - : 16
-
. URG.

Options - :
TCP .
. . :
1. .
2. , (1 ) .
2 , , 4.
TCP .
( ):

End of option list

No-Operation

Maximum Segment Size


End of Option List
+--------+
|00000000|
+--------+
=0
. TCP,
Data Offset. , -
, TCP.

No-Operation
+--------+
|00000001|
+--------+
=1
(, ).
, ,
.

Maximum Segment Size


+--------+--------+---------+--------+
|00000010|00000100|
max seg size
|
+--------+--------+---------+--------+
=2 =4

Maximum Segment Size - : 16


, TCP,
. ( SYN).
, .

, .
.
www.bilim.com
8
www.protocols.ru
4

RFC 793

BiLiM Systems

Padding - :
TCP 32- .
0.

3.2.
, TCP, . TCP
. , TCB (Transmission
Control Block - ). TCB ,
, ,
. , TCB .


SND.UNA -
SND.NXT -
SND.WND -
SND.UP -
SND.WL1 - ,
SND.WL2 - ,
ISS -


RCV.NXT -
RCV.WND -
RCV.UP -
IRS -
.


1
2
3
4
----------|----------|----------|---------SND.UNA
SND.NXT
SND.UNA
+SND.WND
1.
2.
3.
4.

,

,
,
4.
3 4.


1
2
3
----------|----------|---------RCV.NXT
RCV.NXT
+RCV.WND
1. ,
2. ,
3. ,
5.
2 5.
, ,
.


SEG.SEQ -
SEG.ACK -
SEG.LEN -
SEG.WND -
SEG.UP -
SEG.PRC -
- LISTEN, SYN-SENT, SYN-RECEIVED,
ESTABLISHED, FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT CLOSED
( , , TCB , , ).
.
LISTEN - TCP .
SYN-SENT - .
SYN-RECEIVED - .
ESTABLISHED - .
.
www.bilim.com

www.protocols.ru

BiLiM Systems
RFC 793
FIN-WAIT-1 - TCP
.
FIN-WAIT-2 - TCP.
CLOSE-WAIT - .
CLOSING - TCP .
LAST-ACK - , TCP (
).
TIME-WAIT - , TCP
.
CLOSED - ().
+---------+ ---------\
active OPEN
TCP
| CLOSED |
\
----------
+---------+<---------\
\
create TCB
,

|
^
\
\ snd SYN

passive OPEN |
|
CLOSE
\
\
OPEN,
SEND,
RECEIVE,
------------ |
| ---------\
\
CLOSE, ABORT STATUS,
create TCB |
| delete TCB
\
\

(
V
|
\
\

+---------+
CLOSE
|
\
SYN, ACK,
| LISTEN |
---------- |
|
RST, FIN) -.
+---------+
delete TCB |
|

rcv SYN
|
|
SEND
|
|
6
----------|
|
------|
V

+---------+
snd SYN,ACK /
\
snd SYN
+---------+

|
|<---------------------------------->|
|
,
|
SYN
|
rcv SYN
|
SYN
|

|
RCVD |<-----------------------------------------------|
SENT |

|
|
snd ACK
|
|
,
|
|------------------------------------|
|

+---------+
rcv ACK of SYN \
/ rcv SYN,ACK
+---------+

|
-------------|
|
----------
|
x
|
|
snd ACK
TCP
|
V
V
.
| CLOSE
+---------+
| ------| ESTAB |
3.3.
| snd FIN
+---------+
|
CLOSE
|
|
rcv FIN

V
------|
|
------
+---------+
snd FIN /
\
snd ACK
+---------+

TCP

| FIN
|<---------------------------------->| CLOSE |
-
| WAIT-1 |-----------------|
WAIT |
,

+---------+
rcv FIN \
+---------+
TCP
| rcv ACK of FIN
------|
CLOSE |
.
,
| -------------snd ACK
|
------- |

V
x
V
snd FIN V

+---------+
+---------+
+---------+
(acknowledgment).

|FINWAIT-2|
| CLOSING |
| LAST-ACK|

+---------+
+---------+
+---------+

|
rcv ACK of FIN |
rcv ACK of FIN |
(),

| rcv FIN
-------------- |
Timeout=2MSL -------------- |

| ------x
V
-----------x
V

X
\ snd ACK
+---------+delete TCB
+---------+
,
------------------------>|TIME WAIT|------------------>| CLOSED |
X (
+---------+
+---------+
X) .
6. TCP

.
, . . , , ,
.
, , ( 0
232 - 1). ,
232. 232 - 1
. ,
, . =< " " ( 232).
, TCP, :
(a) , ,
.
(b) , , , (,
).
(c) , (, ,
"" ).
TCP .
.
SND.UNA =
SND.NXT =
www.bilim.com

10

www.protocols.ru

RFC 793
BiLiM Systems
SEG.ACK = TCP ( , TCP)
SEG.SEQ =
SEG.LEN = , ( SYN FIN)
SEG.SEQ+SEG.LEN-1 =
( acceptable ack - ) :
SND.UNA < SEG.ACK =< SND.NXT
,
.
:
RCV.NXT = , ( )

RCV.NXT+RCV.WND-1 = , (
)
SEG.SEQ = ,
SEG.SEQ+SEG.LEN-1 = ,
:
RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND

RCV.NXT =< SEG.SEQ+SEG.LEN-1 < RCV.NXT+RCV.WND


"" , .
, , .
.
:

SEG.SEQ = RCV.NXT

>0

RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND

>0

>0

>0

RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND


RCV.NXT =< SEG.SEQ+SEG.LEN-1 < RCV.NXT+RCV.WND
, , ACK.
, TCP ,
ACK. TCP RST URG
.
.
,
(. ., ).
. ,
. SYN FIN,
. SYN ,
FIN - . (SEG.LEN) .
SYN SEG.SEQ SYN.


- . .
"".
- " TCP ?"
" "
.

, .
TCP .
(initial sequence number) ISN. (, ) 32 , 4 . ,
ISN 4.55 . , ,
MSL (Maximum Segment Lifetime - ), MSL < 4.55 .,
ISN .
. (ISS)
TCP, (IRS)
.
TCP
. , SYN (
) . SYN SYN. ,

ISN.
,
.
.
1) A --> B SYN - X
2) A <-- B ACK - X
3) A <-- B SYN - Y
4) A --> B ACK - Y
www.bilim.com

11

www.protocols.ru

BiLiM Systems
RFC 793
. 2 3 , 3- (three way
handshake).
, TCP
ISN. SYN (
), , (
), SYN.
[3].


, TCP ,
, , TCP MSL
-
. MSL 2
, . , -
TCP
, , .

TCP
"" -
, (. ., ) , -
TCP MSL internet,
"" . . TCP
,
internet.
TCP
-. TCP
, 232
, .
internet. TCP
, ,
. ,
.
TCP
, ,
. , ,
,
. 2 / 4.5 232
. ,
10 /. 100 /
5.4 . - , .
, TCP
, . , TCP
0, "" TCP
( )) ,
, (
). , , TCP
MSL ,
. ,
.
, S. ,
ISN(t)
(, S1) , TCP . ,
"", . S1 =
ISN(t) - !
, , S1,
.
, , ""
.
MSL
"" - quite time. , ,
. TCP
quite time . ,
MSL .
.
MSL. ""
, ,
.

3.4.
(three-way handshake).
TCP, TCP .
. TCP
SYN, SYN.
SYN .
reset.
.
, , TCP
(. ., ,
www.bilim.com

12

www.protocols.ru

RFC 793
BiLiM Systems
ESTABLISHED). .
,
.
7. (-->)
TCP A TCP B B A. (<--)
. (...) , (). XXX
. () . TCP
( ).
- , ACK. ( , , )
.
TCP A
TCP B
1. CLOSED
LISTEN
2. SYN-SENT
--> <SEQ=100><CTL=SYN>
--> SYN-RECEIVED
3. ESTABLISHED <-- <SEQ=300><ACK=101><CTL=SYN,ACK> <-- SYN-RECEIVED
4. ESTABLISHED --> <SEQ=101><ACK=301><CTL=ACK>
--> ESTABLISHED
5. ESTABLISHED --> <SEQ=101><ACK=301><CTL=ACK><DATA> --> ESTABLISHED
7. 3-
2 7 TCP A SYN, ,
100. 3 TCP B SYN SYN TCP A. ,
TCP B 101, SYN 100.
4 TCP A ACK SYN TCP B; 5 TCP A
. , 5 4, ACK
( , - ACK ACK!).
(. 8). TCP
CLOSED SYN-SENT SYN-RECEIVED ESTABLISHED.
TCP A
TCP B
1. CLOSED
CLOSED
2. SYN-SENT
--> <SEQ=100><CTL=SYN>
...
3. SYN-RECEIVED <-- <SEQ=300><CTL=SYN>
<-- SYN-SENT
4.
... <SEQ=100><CTL=SYN>
--> SYN-RECEIVED
5. SYN-RECEIVED --> <SEQ=100><ACK=301><CTL=SYN,ACK> ...
6. ESTABLISHED <-- <SEQ=300><ACK=101><CTL=SYN,ACK> <-- SYN-RECEIVED
7.
... <SEQ=100><ACK=301><CTL=SYN,ACK> --> ESTABLISHED5
8.

, .
- reset (). TCP
(. ., SYN-SENT, SYN-RECEIVED), LISTEN reset. TCP
(ESTABLISHED, FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIMEWAIT), reset .
(half-open) .
TCP A
TCP B
1. CLOSED
LISTEN
2. SYN-SENT
--> <SEQ=100><CTL=SYN>
...
3. (duplicate) ... <SEQ=90><CTL=SYN>
--> SYN-RECEIVED
4. SYN-SENT
<-- <SEQ=300><ACK=91><CTL=SYN,ACK>
<-- SYN-RECEIVED
5. SYN-SENT
--> <SEQ=91><CTL=RST>
--> LISTEN
6.
... <SEQ=100><CTL=SYN>
--> SYN-RECEIVED
7. SYN-SENT
<-- <SEQ=400><ACK=101><CTL=SYN,ACK> <-- SYN-RECEIVED
8. ESTABLISHED --> <SEQ=101><ACK=401><CTL=ACK>
--> ESTABLISHED
9. SYN
9 . 3 SYN
TCP B, ( 4). TCP A ACK
RST (reset) SEQ, (believable). TCP B, RST,
LISTEN. SYN ( 6), .
SYN 6 RST, RST
.


(half-open), TCP
,
. .
, .
A , B -
, TCP B reset. TCP B
.
, A B TCP A.
A TCP. TCP A
.
OPEN SEND, , .
connection not open (A) TCP.
TCP A , SYN ( 10). TCP A
, TCP B , .
TCP A
TCP B
1. (CRASH)
(send 300,receive 100)
<SEQ=101><ACK=301><CTL=ACK>, RFC-1122 . .
.
www.bilim.com
13
www.protocols.ru
5

BiLiM Systems
RFC 793
2. CLOSED
ESTABLISHED
3. SYN-SENT --> <SEQ=400><CTL=SYN>
--> (??)
4. (!!)
<-- <SEQ=300><ACK=100><CTL=ACK>
<-- ESTABLISHED
5. SYN-SENT --> <SEQ=100><CTL=RST>
--> (Abort!!)
6. SYN-SENT
CLOSED
7. SYN-SENT --> <SEQ=400><CTL=SYN>
-->
10.
SYN ( 3) TCP B, ,
, (ACK 100). TCP A ,
() , ,
RST, . TCP B ( 5). TCP A
, (. 7).
TCP A, TCP B ,
(. 11). , TCP A TCP B ( 2),
, TCP A RST. RST TCP B,
.
TCP A
TCP B
1. (CRASH)
(send 300,receive 100)
2. (??)
<-- <SEQ=300><ACK=100><DATA=10><CTL=ACK> <-- ESTABLISHED
3.
--> <SEQ=100><CTL=RST>
--> (ABORT!!)
11.
12 TCP A TCP B , SYN. , TCP B (
2), B . SYN-ACK ( 3), TCP A RST (ACK
3 ). TCP B LISTEN.
TCP A
TCP B
1. LISTEN
LISTEN
2.
... <SEQ=Z><CTL=SYN>
--> SYN-RECEIVED
3. (??) <-- <SEQ=X><ACK=Z+1><CTL=SYN,ACK>
<-- SYN-RECEIVED
4.
--> <SEQ=Z+1><CTL=RST>
--> (return to LISTEN!)
5. LISTEN
LISTEN
12. SYN Reset
,
RST.

Reset
RST ,
. .
:
1. (CLOSED), reset ,
reset. , SYN, , .
ACK, reset ACK, reset
, ACK ,
. CLOSED.
2. (LISTEN, SYN-SENT, SYN-RECEIVED)
-, ( ACK),
(compartment),
, reset.
SYN ,
( ) reset;
,
( TCP ,
). SYN
( ),
; , reset.
ACK, reset ACK;
, ACK .
.
3. (ESTABLISHED, FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIMEWAIT), (
) , ,
, . .
, ,
, reset CLOSED. reset
ACK .

Reset
, SYN-SENT, RST SEQ. ,
. SYN-SENT ( RST SYN)
RST , ACK SYN.
RST , . LISTEN,
. SYN-RECEIVED, LISTEN,
LISTEN; CLOSED.
, , ,
CLOSED.

3.5.
CLOSE .
, , .
www.bilim.com
14
www.protocols.ru

RFC 793
BiLiM Systems
CLOSE - CLOSE RECEIVE,
, CLOSE. ,
SEND, CLOSE RECEIVE,
RECEIVE CLOSE . , TCP
, RECEIVE ,
. TCP SENT
, , , - ,
CLOSED,
. , , TCP
- .
:
1) TCP CLOSE .
2) TCP FIN.
3) CLOSE.

1:
FIN .
SEND TCP FIN-WAIT-1. RECEIVE
. FIN ,
. TCP FIN FIN, TCP
ACK FIN. , TCP FIN ACK,
FIN, .

2: TCP FIN
FIN ACK
. CLOSE, TCP FIN
. TCP FIN, .
ACK , - .

3:
CLOSE FIN. ,
FIN, , TCP ACK
FIN. ACK .
TCP A
TCP B
1. ESTABLISHED
ESTABLISHED
2. (Close)
FIN-WAIT-1 --> <SEQ=100><ACK=300><CTL=FIN,ACK> --> CLOSE-WAIT
3. FIN-WAIT-2 <-- <SEQ=300><ACK=101><CTL=ACK>
<-- CLOSE-WAIT
4.
(Close)
TIME-WAIT
<-- <SEQ=300><ACK=101><CTL=FIN,ACK> <-- LAST-ACK
5. TIME-WAIT
--> <SEQ=101><ACK=301><CTL=ACK>
--> CLOSED
6. (2 MSL)
CLOSED
13.
1.
2.

3.

4.

TCP A
ESTABLISHED
(Close)
FIN-WAIT-1 -->
<-...
CLOSING
-->
<-...
TIME-WAIT
(2 MSL)
CLOSED

TCP B
ESTABLISHED
(Close)
<SEQ=100><ACK=300><CTL=FIN,ACK> ... FIN-WAIT-1
<SEQ=300><ACK=100><CTL=FIN,ACK> <-<SEQ=100><ACK=300><CTL=FIN,ACK> -->
<SEQ=101><ACK=301><CTL=ACK>
... CLOSING
<SEQ=301><ACK=101><CTL=ACK>
<-<SEQ=101><ACK=301><CTL=ACK>
-->
TIME-WAIT
(2 MSL)
CLOSED
14.

3.6.
, ,
(compartment)
(precedence).
, TCP, IP
[2]. security/compartment , IP,
, (compartment), .

(reset). ,
SYN.
, TCP, ,
.
(
), ,
.

3.7.
.
( ) , TCP (
www.bilim.com
15
www.protocols.ru

BiLiM Systems
RFC 793
-) . .
, TCP
.
( ) SND.NXT.
( ) RCV.NXT.
SND.UNA.
(momentarily idle) , .
, SND.NXT . , ,
RCV.NXT . ,
SND.UNA.
. , , . ,
ESTABLISHED .
CLOSE ( push),
FIN .

-
TCP -
. -
.

-
,
( ), RTT (Round Trip
Time - ). SRTT (Smoothed Round Trip Time - ), :
SRTT = ( ALPHA * SRTT ) + ((1-ALPHA) * RTT)
- (RTO):
RTO = min[UBOUND,max[LBOUND,(BETA*SRTT)]]6
UBOUND - (, 1 ), LBOUND - (, 1 ),
ALPHA - (, 0.8 - 0.9), BETA - (, 1.3 - 2.0).



TCP ,
.
.
(RCV.NXT), TCP
urgent; TCP
, . ,
urgent, .
(urgent), . URG ,
urgent
. , .
, .
(push),
.


, , ( ),
. ,
.
. , , ,
, TCP.
- (round trip delay) .
TCP .
shrinking the window ( ) . TCP "
, TCP".
TCP ,
. TCP
. 2 .
, TCP
(re-opening) .
TCP , ,
(0).
TCP , ,
. ,
.
,
, .
, .
(. .,
, ).
,
.


,
.
6

4.2.2.15 4.2.3.1 RFC-1122 -. . .


www.bilim.com
16

www.protocols.ru

RFC 793
BiLiM Systems
, , ,
X% (X 20 40).

. push,
.
, ,
. (
) .
, , .
, .
TCP ,
.
.
.
TCP
,
.

3.8.
TCP - .
TCP ,
,
. IP ,
TCP.

TCP -
TCP,
. , TCP
. , TCP
, .
, TCP.

TCP
TCP .
,
- trap (, SVC, UUO, EMT).
TCP
.
. , (OPEN)
SEND RECEIVE, .
TCP ,
. :
(a) (, , , ).
(b) , (, ).

Open
: OPEN ( , , / [, -] [, ]
[, /] [, ])->
, TCP
. TCP TCP
TCP (, IP).
, TCP
. . TCP.
, LISTEN (
). (
) ( ).
SEND.
TCB (transmission control block),
OPEN.
OPEN TCP () .
- ( ) ,
TCP. , TCP .
- 5 .
TCP
. OPEN
.
TCP
, OPEN.
, OPEN
. .
. ,

.
TCP.
< , >.

Send
: SEND ( , , , PUSH, URGENT
[, -])
www.bilim.com

17

www.protocols.ru

BiLiM Systems
RFC 793
.
, SEND . SEND
; OPEN.
, .
PUSH, PUSH
TCP, . PUSH
SEND .
URGENT . TCP
,
.
.
TCP .
OPEN , (, LISTEN
), () .
, OPEN , SEND, .
, SEND , , .
STATUS . TCP
.
-, .
SEND ,
. , (,
SEND - RECEIVE)
, .
, -.
SEND, TCP
.
, SEND
( ) TCP.
. , SEND
TCP. . ,
-. ()
, , .
, ( ) SEND
SEND . TCP , , ,
.

Receive
: RECEIVE ( , , ) -> , ,

, . OPEN
, .
,
- . , .
RECEIVE.
. ,
(, ) PUSH .
PUSH, PUSH. PUSH
, PUSH .

TCP. urgent. URGENT ,
. URGENT , RECEIVE
. ,
( ) , ,
.
, RECEIVE ,
, .
RECEIVE TCP TCP
.

Close
: CLOSE ( )
.
, .
SEND (, ) .
, SEND, CLOSE,
. , RECEIVE ,
. , CLOSE ,
, , . (
),
-. CLOSE ABORT TCP .
CLOSE
TCP (, , - , ).
TCP,
. , TCP CLOSE
.
CLOSE (push).

Status
: STATUS ( ) ->
www.bilim.com

18

www.protocols.ru

RFC 793
BiLiM Systems
TCP.
TCB .
, :
,
,
,
,
,
,
, ,
, ,
,
,
/,
- .
/ .
, .

Abort
: ABORT ( )
SEND RECEIVE, TCB
RESET TCP-.
SEND RECEIVE .

TCP
, TCP
. TCP , (,
). SEND, RECEIVE
.
:


Send Receive

Receive
Push
Receive
Urgent
Receive

TCP -
TCP .
ARPA, Internet Protocol (IP) [2].
IP
. TCP :
(Type of Service) = (Precedence): routine, (Delay): normal,
(Throughput): normal, (Reliability): normal ( 00000000).
(Time to Live) = 1 00111100 7.
,
, 1 .
IP ( , )
(source routing), .
, TCP
. .
,
, TCP.
IP TCP.

3.9.
.
, , .
TCP . , -. TCP
. .
:

OPEN
SEND
RECEIVE
CLOSE
ABORT
STATUS

SEGMENT ARRIVES
-
TIMEOUT
7

60 (. RFC-1122, 4.2.2.19). . .
www.bilim.com
19
www.protocols.ru

BiLiM Systems
RFC 793
RETRANSMISSION TIMEOUT
TIME-WAIT TIMEOUT
TCP
8 .
.
. , ,
, "error: connection not open" (: ).
, , , . .
232 ( ). =< " " ( 232).

(. ., "" ), .
, ,
( ).
, TCP , .


OPEN
CLOSED (TCB )
(TCB) .
, , , -. ,
OPEN
SYN. -
"error: precedence not allowed" (
) "error: security/compartment not allowed" ( ).
LISTEN . ,
"error: foreign socket unspecified" ( );
, SYN. ISS. SYN
<SEQ=ISS><CTL=SYN>. SND.UNA = ISS, SND.NXT = ISS+1,
SYN-SENT .
, "error: connection
illegal for this process" ( ). ,
"error: insufficient resources" ( ).
LISTEN
,
ISS. SYN, SND.UNA = ISS, SND.NXT + ISS+1.
SYN-SENT. , SEND, SYN
ESTABLISHED. ,
, . ,
"error: insufficient resources". , "error: foreign
socket unspecified".

SYN-SENT
SYN-RECEIVED
ESTABLISHED
FIN-WAIT-1
FIN-WAIT-2
CLOSE-WAIT
CLOSING
LAST-ACK
TIME-WAIT
"error: connection already exists" ( ).

SEND
CLOSED (TCB )
, "error: connection illegal for this process"
( ).
"error: connection does not exist" ( ).
LISTEN
, ISS.
SYN, SND.UNA = ISS, SND.NXT + ISS+1. SYN-SENT.
, SEND, SYN
ESTABLISHED. ,
, . ,
"error: insufficient resources". , "error: foreign socket unspecified".

SYN-SENT
SYN-RECEIVED
ESTABLISHED. ,
"error: insufficient resources".

ESTABLISHED
CLOSE-WAIT
(RCV.NXT).
"error: insufficient resources".
, SND.UP <- SND.NXT-1 .

FIN-WAIT-1
FIN-WAIT-2
CLOSING
LAST-ACK
8

(. .)
www.bilim.com

20

www.protocols.ru

RFC 793
BiLiM Systems
TIME-WAIT
"error: connection closing" ( ) .

RECEIVE
CLOSED (TCB )
, "error: connection illegal for this process"
( ).
"error: connection does not exist" ( ).

LISTEN
SYN-SENT
SYN-RECEIVED
ESTABLISHED. ,
"error: insufficient resources".

ESTABLISHED
FIN-WAIT-1
FIN-WAIT-2
, .
RECEIVE, "error: insufficient resources".
(Reassemble) .
PUSH.
RCV.UP,
.
TCP ,
.
.
CLOSE-WAIT
FIN, RECEIVE , ,
. , RECEIVE "error:
connection closing" ( ). RECEIVE .

CLOSING
LAST-ACK
TIME-WAIT
"error: connection closing".

CLOSE
CLOSED (TCB )
, "error: connection illegal for this process".
"error: connection does not exist".
LISTEN
RECEIVE "error: closing" ( ). TCB
CLOSED.
SYN-SENT
TCB "error: closing" SEND RECEIVE.
SYN-RECEIVED
SEND , , FIN FINWAIT-1. ESTABLISHED.
ESTABLISHED
, SEND.
FIN FIN-WAIT-1.

FIN-WAIT-1
FIN-WAIT-2
, "error: connection closing"
( ). "ok" ( ) , FIN (
FIN ).
CLOSE-WAIT
, SEND.
FIN 9.

CLOSING
LAST-ACK
TIME-WAIT
"error: connection closing".

ABORT
CLOSED (TCB )
, "error: connection illegal for this process".
"error: connection does not exist".
LISTEN
RECEIVE "error: connection reset" (
). TCB, CLOSED.
SYN-SENT
TCB "error: connection reset" SEND RECEIVE,
CLOSED.

SYN-RECEIVED
ESTABLISHED
FIN-WAIT-1
FIN-WAIT-2
CLOSE-WAIT
CLOSING LAST-ACK (. RFC-1122, 4.2.2.20(a)). .
.
www.bilim.com
21
www.protocols.ru
9

BiLiM Systems
RFC 793
<SEQ=SND.NXT><CTL=RST>.
"error: connection reset" SEND RECEIVE;
( RST) , TCB
CLOSED.

CLOSING
LAST-ACK
TIME-WAIT
"ok" ( ), TCB CLOSED.

STATUS
CLOSED (TCB )
, "error: connection illegal for this process".
"error: connection does not exist".
LISTEN
"state = LISTEN" TCB.
SYN-SENT
"state = SYN-SENT" TCB.
SYN-RECEIVED
"state = SYN-RECEIVED" TCB.
ESTABLISHED
"state = ESTABLISHED" TCB.
FIN-WAIT-1
"state = FIN-WAIT-1" TCB.
FIN-WAIT-2
"state = FIN-WAIT-2" TCB.
CLOSE-WAIT
"state = CLOSE-WAIT" TCB.
CLOSING
"state = CLOSING" TCB.
LAST-ACK
"state = LAST-ACK" TCB.
TIME-WAIT
"state = TIME-WAIT" TCB.


CLOSED (TCB )
, , RST.
RST RST. ,
reset TCP, .
ACK , 0
<SEQ=0><ACK=SEG.SEQ+SEG.LEN><CTL=RST,ACK>
ACK
<SEQ=SEG.ACK><CTL=RST>
LISTEN
1) RST - RST .
2) ACK - , LISTEN.
(reset) :
<SEQ=SEG.ACK><CTL=RST>
.
3) SYN
SYN , . /
TCB, .
<SEQ=0><ACK=SEG.SEQ+SEG.LEN><CTL=RST,ACK>10
SEG.PRC > TCB.PRC, TCB.PRC<SEG.PRC; .
<SEQ=0><ACK=SEG.SEQ+SEG.LEN><CTL=RST,ACK>10
SEG.PRC < TCB.PRC, .
RCV.NXT = SEG.SEQ+1 IRS = SEG.SEQ,
. ISS SYN :
<SEQ=ISS><ACK=RCV.NXT><CTL=SYN,ACK>
SND.NXT = ISS+1 SND.UNA = ISS. SYNRECEIVED. , ( SYN)
SYN-RECEIVED, SYN ACK .
(. ., ),
.
4)
( SYN) ACK , ,
ACK. RST ,
- . ,
, .
SYN-SENT
1) ACK
ACK , :
SEG.ACK =< ISS SEG.ACK > SND.NXT, reset ( RST ,
)
<SEQ=SEG.ACK><CTL=RST>
<SEQ=SEG.ACK><CTL=RST>. RFC-1122,
4.2.2.20(b). . .
www.bilim.com
22
www.protocols.ru
10

RFC 793
BiLiM Systems
.
SND.UNA =< SEG.ACK =< SND.NXT, ACK .
2) RST
RST :
ACK , "error: connection reset" ( ),
CLOSED TCB .
( ACK) .
3)
/ TCB,
(reset):
ACK
<SEQ=SEG.ACK><CTL=RST>
ACK
<SEQ=0><ACK=SEG.SEQ+SEG.LEN><CTL=RST,ACK>
, :
ACK
TCB,
<SEQ=SEG.ACK><CTL=RST>
ACK
TCB,
TCB ;

<SEQ=0><ACK=SEG.SEQ+SEG.LEN><CTL=RST,ACK>
TCB, .
(reset), .
4) SYN
ACK ACK, RST.
SYN / , RCV.NXT =
SEG.SEQ+1 IRS = SEG.SEQ. SND.UNA SEG.ACK ( ACK)
, , .
SND.UNA > ISS ( SYN ), ESTABLISHED11,
ACK
<SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK>
.
, URG (. (6)
), .
SYN , SYN-RECEIVED,
SYN,ACK
<SEQ=ISS><ACK=RCV.NXT><CTL=SYN,ACK>
,
ESTABLISHED .
5) SYN, , .
CLOSED, LISTEN, SYN-SENT :
(1) .
SYN-RECEIVED
ESTABLISHED
FIN-WAIT-1
FIN-WAIT-2
CLOSE-WAIT
CLOSING
LAST-ACK
TIME-WAIT
,
SEG.SEQ.
, .
4 :

SEG.SEQ = RCV.NXT

>0

RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND

>0

>0

>0

RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND

RCV.NXT =< SEG.SEQ+SEG.LEN-1 < RCV.NXT+RCV.WND


RCV.WND = 0, ACK, URG RST.
, ( RST,
):
<SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK>
.
- RCV.NXT .
,
( SYN FIN), , RCV.NXT.
.
(2) RST
SYN-RECEIVED
RFC 1122 ESTABLISHED
SND.WND<-SEG.WND, SND.WL1<-SEG.SEQ, SND.WL2<-SEG.ACK. . .
www.bilim.com
23
www.protocols.ru
11

BiLiM Systems
RFC 793
RST
OPEN (. ., LISTEN),
LISTEN . .
OPEN (. ., SYN-SENT),
(refused) "connection refused".
. OPEN CLOSED
TCB .
ESTABLISHED
FIN-WAIT-1
FIN-WAIT-2
CLOSE-WAIT
RST, RECEIVE SEND (reset).
. "connection reset" ( ).
CLOSED TCB .
CLOSING
LAST-ACK
TIME-WAIT
RST, CLOSED TCB .
(3)
SYN-RECEIVED
/ TCB,
(reset) .
ESTABLISHED12
FIN-WAIT-1
FIN-WAIT-2
CLOSE-WAIT
CLOSING
LAST-ACK
TIME-WAIT
/ TCB,
(reset), RECEIVE SEND reset.
. "connection reset".
CLOSED TCB .
,
, ,
.
OPEN, LISTEN c .
13.
(4) SYN
SYN-RECEIVED
ESTABLISHED
FIN-WAIT-1
FIN-WAIT-2
CLOSE-WAIT
CLOSING
LAST-ACK
TIME-WAIT
SYN , . (reset),
RECEIVE SEND reset. ,
"connection reset". CLOSED TCB .
SYN , ,
( ).
(5) ACK
ACK ,
ACK .
SYN-RECEIVED
SND.UNA =< SEG.ACK =< SND.NXT, ESTABLISHED 11
.
, (reset)
<SEQ=SEG.ACK><CTL=RST>
ESTABLISHED
SND.UNA < SEG.ACK =< SND.NXT, SND.UNA <- SEG.ACK. , ,
.
, (. ., SEND
"ok"). ACK (SEG.ACK =< SND.UNA14),
. ACK -, (SEG.ACK > SND.NXT),
ACK .
SND.UNA =< SEG.ACK =< SND.NXT 15, .
(SND.WL1 < SEG.SEQ) OR ((SND.WL1 = SEG.SEQ) AND (SND.WL2 =< SEG.ACK)),
SND.WND <- SEG.WND, SND.WL1 <- SEG.SEQ SND.WL2 <- SEG.ACK.
12

ESTABLISHED - RFC-1122 ( 4.2.2.20(d)) .


. .
13
. . 4.2.2.20(e) RFC-1122. . .
14
SEG.ACK < SND.UNA. 4.2.2.20 (g) RFC-1122. .
.
15
SND.UNA < SEG.ACK =< SND.NXT. 4.2.2.20 (g) RFC1122. . .
www.bilim.com
24
www.protocols.ru

RFC 793
BiLiM Systems
, SND.WND SND.UNA, SND.WL1
, SND.WND, SND.WL2
, SND.WND.
.
FIN-WAIT-1
, ESTABLISHED (. ), FIN
, FIN-WAIT-2 .
FIN-WAIT-2
, ESTABLISHED (. ),
, CLOSE "ok", TCB .
CLOSE-WAIT
, ESTABLISHED.
CLOSING
, ESTABLISHED (. ), ACK
FIN, TIME-WAIT, .
LAST-ACK
FIN. FIN ,
TCB CLOSED .
TIME-WAIT
FIN .
- 2 MSL.
(6) URG

ESTABLISHED
FIN-WAIT-1
FIN-WAIT-2
URG, RCV.UP <- max(RCV.UP,SEG.UP)
, , (RCV.UP)
. ( "urgent")
, .

CLOSE-WAIT
CLOSING
LAST-ACK
TIME-WAIT
, FIN.
URG.
(7)

ESTABLISHED
FIN-WAIT-1
FIN-WAIT-2
ESTABLISHED RECEIVE.
.
PUSH, PUSH .
TCP , .
TCP , RCV.NXT
RCV.WND . RCV.NXT RCV.WND
.
, , 3.7.
:
<SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK>
, .

CLOSE-WAIT
CLOSING
LAST-ACK
TIME-WAIT
, FIN.
.
(8) FIN
FIN CLOSED, LISTEN SYN-SENT, SEG.SEQ
; .
FIN , "connection closing" ( )
RECEIVE , RCV.NXT FIN FIN.
, FIN PUSH , .

SYN-RECEIVED
ESTABLISHED
CLOSE-WAIT.
FIN-WAIT-1
FIN ( ), TIME-WAIT,
.
CLOSING.
FIN-WAIT-2
TIME-WAIT, .

CLOSE-WAIT
CLOSING
LAST-ACK
TIME-WAIT
. TIME-WAIT - 2 MSL.
.
www.bilim.com

25

www.protocols.ru

BiLiM Systems

RFC 793

-
-
-, ,
"error: connection aborted due to user timeout" , TCB
CLOSED .


- ,
, .


TCB CLOSED
.

1822
BBN Report 1822, "The Specification of the Interconnection of a Host and an IMP" -
ARPANET.
ACK
(), ,
,
.
ARPANET message
IMP ARPANET 16. 1012
(8096 ).
ARPANET packet
IMP ARPANET. 126 (1008
).
Connection ()
, .
Datagram ()
, .
Destination Address ( )
, .
FIN
, , ,
, .
Fragment ()
( , IP).
FTP
.
Header ()
, , , .
Host ()
. , .
Identification ()
IP, , .
IMP
Interface Message Processor - ARPANET.
internet address
, .
internet datagram
IP , IP .
internet fragment
IP IP.
IP
Internet Protocol.
IRS
Initial Receive Sequence - . ,
.
ISN
Initial Sequence Number - . (ISS IRS),
. .
ISS
Initial Send Sequence - . ,
.
left sequence
, , TCP (
); .
16

Internet. . .
www.bilim.com

26

www.protocols.ru

RFC 793
BiLiM Systems
local packet ( )
.
Module ()
( ) .
MSL
Maximum Segment Lifetime - TCP . 2 .
Octet ()
- .
Options ()
Option , .
(, ).
IP, TCP.
Packet ()
( ).
, .
Port ()
, .
Process ()
. TCP
.
PUSH
, , , ,
.
RCV.NXT
receive next sequence number - .
RCV.UP
receive urgent pointer - .
RCV.WND
receive window - .
receive next sequence number ( )
, TCP.
receive window ( )
, () TCP . ,
TCP , , RCV.NXT RCV.NXT+RCV.WND-1,
. , ,
, .
RST
(reset - ), , ,
. ,
, .
, RST, RST.
RTP
Real Time Protocol - .
SEG.ACK
segment acknowledgment -
SEG.LEN
segment length -
SEG.PRC
segment precedence value -
SEG.SEQ
segment sequence -
SEG.UP
segment urgent pointer field -
SEG.WND
segment window field -
segment ()
. , TCP ,
TCP.
segment acknowledgment
.
segment length
, , ,
.
segment sequence
sequence .
send sequence
, () TCP .
ISN
.
send window ( )
www.bilim.com

27

www.protocols.ru

BiLiM Systems
RFC 793
, () TCP . window,
( ) TCP. ,
TCP, SND.NXT SND.UNA + SND.WND - 1 (
SND.UNA SND.NXT).
SND.NXT

SND.UNA

SND.UP

SND.WL1

SND.WL2

SND.WND

socket ()
, TCP IP.
Source Address
, .
SYN
( ),
.
TCB
Transmission control block - , .
TCB.PRC
.
TCP
Transmission Control Protocol - . ,
.
TOS
Type of Service - . IP.
Type of Service
IP, IP.
URG
(urgent - ), ,
(
, , ).
urgent pointer ( )
, URG ,
.

[1] Cerf, V., and R. Kahn, "A Protocol for Packet Network Intercommunication", IEEE Transactions on Communications, Vol. COM-22,
No. 5, pp 637-648, May 1974.
[2] Postel, J. (ed.), "Internet Protocol - DARPA Internet Program Protocol Specification", RFC 79117, USC/Information Sciences Institute,
September 1981.
[3] Dalal, Y. and C. Sunshine, "Connection Management in Transport Protocols", Computer Networks, Vol. 2, No. 6, pp. 454-473,
December 1978.

[4] Postel, J., "Assigned Numbers", RFC 79018, USC/Information Sciences Institute, September 1981.


nmalykh@bilim.com

17

www.protocols.ru
( RFC 1700), RFC 3232 STD 2 .
Assigned Numbers , www.iana.org/numbers.html. . .
www.bilim.com
28
www.protocols.ru
18