| | | .->SYN Fig 4.1,4.2 no '. ? .' |
| | | | .->INT Fig 4.3 '._____.' |
| | | | | .->FIN Fig 4.4 | yes ________|_
| | | | | | _V_ | discard |
| _|_|_|_|_|___________ .' '. |(or queue)|
| | | .' error '. |__________|
|<-| Control Processing |/_________.'or control '. A
|____________________|\ yes '. ? .' |
| '._____.' |
| (INT with data) | no |
| | |
V _V_ |
to "X" .' '. . |
in Fig 2.2b-2 .'(estab)'. .' '. |
_____.' R=S1=S2=1 '.----->.'seq.#'.--->|
| yes '. ? .' no '.OK .' no |
| '._____.' '.' |
| | yes |
| _______________ | |
| | Set S2=1, U=0 | V |
| | Notify user | .'. |
|<--| with event 2 | .'ACK'. |
| | if U was 1 |<-----'. OK .'--->'
| |_______________| yes '. .' no
| '
V
to "Y"
in Fig 2.2b-2
FIGURE 2.2b-2: Input Packet Handler (continued)
"Y"
|
.'. _V_
.'txt'. .' '. ______________________________
.'lgth>0 '. .'within '. |Use ACK to advance send window|
,<----'. or DSN .'<---'. window .'--->|Release ACK'ed packets from |
| no '. ? .' no '. ? .' yes |retransmit or send queues. If |
| '._.' '._.' |any packet had EB bit set |
| | yes |remove buffer from Packetized |
| ________V____________________ |buffer queue and inform user |
| |Create ACK packet. Put on | |(success). Signal Packetizer. |
|<-|Send packet queue. Signal OPH| |______________________________|
| |_____________________________| |
| |
| _____________________________________________|
| |
| |
| | "X"
| | |
| _V_ _V_ _____________________
| .' '. .'TCB'. |Put packet on |
| .' text '. yes .'Receive'. yes |Receive packet queue |
| .' length>0 '.-------->.' buffer '.------>|in the right order. |
| '. or DSN .' A '.available.' |Signal Reassembler. |
| '. ? .' | '. ? .' |_____________________|
| '._.' | '._.' |
| | no | | no |
| | | _V_ |
|________\| | .' '. |
/| | .' seq # '. ________ |
| | .' of packet '. yes |Discard | |
| | '. highest so .'---->|packet |----->|
| | '. far .' |________| |
| | '. ? .' |
| | '._.' |
| | | no |
| | _______V______________ |
| | |Discard packet with | |
| |_____|highest seq. no from | |
| |Receive packet queue. | |
| |______________________| |
| |
|_____________________________________________________|
|
V
to "Begin" in Fig 2.2b-1
FIGURE 2.3-1: Reassembler
_______
/ Begin \
\_______/
|
|
|<----------------------------------------------.
| _____ | yes
______V_____ .' '. _|_
|Get ready | .' Receive '. yes .'any'.
|for next TCB|--------->.'Packet Queue '.-------->.' more '.
|____________| A '. empty ? .' A '.work?.'
| '._______.' | '._.'
| | no | | no
"R"------>---------' __V__ | ____V____
.' is '. | | Go to |
.' packet '. | | Sleep |
.--<----------------------'.DSN with no.' | |_________|
| yes '. data? .' |
| '.___.' |
| | no |
| __V__ |
| .' '. |
| .' Receive '. yes |
| .'Buffer Queue '.--->|
| '. empty ? .' |
| ________________ '._______.' |
| |Copy from packet| | no |<-------------"S"
| |to buffer until | __V__ |
| |one is exhausted| .'First'. |
| |Update receive | yes .' packet '. no |
| |window. |<----.'matches Recv '.--->'
| |________________| '.left window.'
| | '. edge ?.'
| __V__ '.___.'
| .'Send '.
| .' Packet '. yes _____________________________
| .' Queue empty '.---->|Create ACK packet containing |
| '. ? .' |new window. Signal OPH. |
| '._______.' |_____________________________|
| no | |
| | |
| '--------------------------->|
| |
V V
to "T" to "U"
in Fig 2.3-2 in Fig 2.3-2
FIGURE 2.3-2: Reassembler (continued)
"T" "U"
| |
| | _____________
___V____ ___ __V__ |Mark progress|
|process | yes .' '. yes .'whole'. no |in packet. |
| DSN |<-----.' DSN '.<-----.' packet '.--->|Return buffer|--->.
|________| '. set?.' '.copied?.' |to user. | |
| '._.' '.___.' |_____________| |
| | no |
'--------------->| |
| |
__V__ __________________________ |
.' EOL '. yes |Return buffer to user. | |
'. set? .'--------->|Return packet to free |--->|
'.___.' |storage. Signal Packetizer| |
no | |__________________________| |
| A |
__V__ | |
.' full'. | |
'. buffer.'--------------' |
'.___.' yes |
| no |
| |
___________________V__________________ |
|Mark progress in buffer. Return packet| |
|to free storage. Signal Packetizer. | ,--------'
|______________________________________| |
| |
| |
V V
to "R" in Fig 2.3-1 to "S" in Fig 2.3-1
FIGURE 2.4: Packetizer
_______ ________________________
/ Begin \____________\| Get ready for next TCB |/___________________
\_______/ /|________________________|\ |
| |
__V__ _____ |
.'Send '. .' any '. |
no .' Buffer '. yes .' more '. yes |
.-------------'. Queue .'---->'. work .'-----'
| '.empty? .' A '. ? .'
____________V____________ '.___.' | '.___.'
|Pick packet size depend- | | | no
,-->|ing on send buffer, TCB | | ______V______
| |buffer space, window, etc| | | go to sleep |
| |_________________________| | |_____________|
| | |
| __V__ |
| .'Send '. |
| .' window '. no |
| '.has room ? .'--------------------->|
| '._______.' |
| | yes |
| __V__ |
| .' TCB '. |
| .' buffer '. no |
| .'space avail- '.---------------------'
| '. able ? .' A
| '._______.' |
| | yes |
| _____________V____________ _________|_______ ____________
| |Copy from Send buffer to | |Move buffer from | |Set EOL bit |
| |packet until packet full. | |Send queue to |<--|in packet |
| |Put packet on Send packet | |packetized queue | |header |
| |queue. Signal OPH. | |_________________| |____________|
| |__________________________| A A
| | | no |
| __V__ __|__ |
| .'whole'. .' EOL '. |
| .' Send '. yes .' set in '. yes |
| '. buffer .'----------->'. Send .'-----------'
| '.copied?.' '.buffer?.'
| '.___.' '.___.'
| | no
| _____________V__________
| |Note in TCB where in |
--|Send buffer we stopped. |
|________________________|
FIGURE 2.5a:
Output Packet Handler
_______
/ Begin \
\_______/
|
|<--------------------------.
____________V___________ |
| Get ready for next TCB | |
|________________________| |
| |
,------------------------------------>| |
| __V__ _____ |
| _____ .'Send '. .' any '. |
| yes .' ACK '. no .' Buffer '. yes .' more '. yes |
| .-----'.bit set.'<------'. Queue .'---->'. work .'-----'
| | '.___.' '.empty? .' A '. ? .'
| | no |________ '.___.' | '.___.'
| | |__________ | | no
| ____V__________________ | | |
| |Put latest receive left| ________v______ | ______V______
| |window edge in ACK. |->|Transmit packet| | | go to sleep |
| |_______________________| |_______________| | |_____________|
| | |
| ________________ __V__ |
| |Return packet to| .'pckt '. |_________________
| |buffer pool as | no .'seq # to '. |
| |it has been |<------.'rgt of Send '. |
| |ACKed | '.left window.' |
| |________________| '. edge .' |
| | '.___.' |
| | | yes |
| | _______________V________________ |
| | |Move packet to retransmit queue;| |
| | |set new retrans. time for it. | |
| | |________________________________| |
| | | |
| '---------------------->| |
| __V__ |
| no .'Time '. yes |
-------------------------------.'to switch'.---------------------'
'.TCB's? .'
'.___.'
FIGURE 2.5b:
Retransmit Process
_______
/ Begin \
\_______/
|
|<----------------------------------.
____________V___________ |
| Get ready for next TCB | |
|________________________| |
| |
.-------------------------------->| |
| __V__ |
| .' Any '. _____ |
| .'packet's '. .' any '. |
| .'retrans. time'. no .' more '. yes |
| '. has occurred .'----->'. work .'-----'
| '. for this .' '. ? .'
| '. TCB ? .' '.___.'
| '.___.' |
| | yes | no
| | ______V______
| ________V________ | go to sleep |
| |Move packet to | |_____________|
'------------------------|Send Packet |
|queue. Signal OPH|
|_________________|
FIGURE 3.1:
OPEN
_______
/ Begin \
\_______/
|
__V__
.'User '. _______
.'permitted'. no | |
.' access to '.---->|error 1|------------.
'.this local .' |_______| |
'.socket?.' |
'.___.' |
| yes |
__V__ |
.' fgn '. |
yes .' socket '. no |
.-----'. specified .'----. |
| '. ? .' | |
__V__ '.___.' __V__ _______ |
_______ .'conn-'. .'space'. no | | |
| | yes .' ection '. '.for TCB.'---->|error 4|-->|
,-|error 6|<----'. already .' '.___.' |_______| |
| |_______| '.exists?.' | yes |
| '.___.' | |
| | no ____V__________ |
| _______ __V__ |Create TCB. Set| |
| | | no .'space'. |S1=S2=R=F=C=1 | |
|<-|error 4|<-----'.for TCB.' |Set U=1 | |
| |_______| '.___.' |_______________| |
| | yes | |
| | | |
| _________V__________ | |
| |Create TCB. Set U=0 | | |
| |Set S1=S2=R=F=C=1 | | |
| |____________________| | |
| | | |
| '-------------.-------------' |
| | |
| _____________________V__________________ |
| |Return local connection name and Success| |
| |________________________________________| |
| | |
----------------------------------->|<--------------------------------'
____V___
/ Return \
\________/
FIGURE 3.2:
SEND
_______
/ Begin \
\_______/
|
__V__
.'conn-'.
.' ection '. _________
.' legal for '. no | |
'. this process .'---------->| error 1 |-----------.
'. ? .' |_________| |
'._______.' |
| yes |
__V__ |
.'conn-'. _________ |
.' ection '. no | | |
.' open '.----------->| error 3 |---------->|
'. ? .' |_________| |
'._______.' |
| yes |
__V__ |
.' fgn '. _________ |
.' socket '. no | | |
'. specified .'------------>| error 5 |---------->|
'.(U=0)? .' |_________| |
'.___.' |
| yes |
__V__ |
.'conn-'. _________ |
.' ection '. yes | | |
'. closing ? .'------------>| error 12|---------->|
'.(F,C=1).' |_________| |
'.___.' |
| no |
____________________V________________________________ |
|Put buffer on Send Buffer queue and signal Packetizer| |
|_____________________________________________________| |
| |
|<-----------------------------------------'
____V___
/ Return \
\________/
FIGURE 3.3:
INTERRUPT
_______
/ Begin \
\_______/
|
|
V
Same as SEND
| |
| |
____________________V_________________________ |
|Return any pending Send buffers with code 10. | |
|Create INT packet on outgoing packet queue. | |
|Signal Output Packet Handler. | |
|______________________________________________| |
| |
|<-----------------------------------------'
____V___
/ Return \
\________/
FIGURE 3.4:
RECEIVE
_______
/ Begin \
\_______/
|
__V__
.'conn-'.
.' ection '. _________
.' legal for '. no | |
'. this process .'---------->| error 1 |-----------.
'. ? .' |_________| |
'._______.' |
| yes |
_V_ |
.' '. |
.' '. |
.'connection '. |
.' state '. |
:___________________: _________ |
| | | | | |
1-4 | 5,6 | 0 '-------------------->| error 3 |-->|
| '---------------------. |_________| |
__________V__________ | |
|Put buffer on Receive| | _________ |
|Buffer queue. Signal | | | | |
|Reassembler | '----->| error 12|-->|
|_____________________| |_________| |
| |
|<------------------------------------------------'
____V___
/ Return \
\________/
FIGURE 3.5:
CLOSE
_______
/ Begin \
\_______/
|
__V__
.'conn-'.
.' ection '. _________
.' legal for '. no | |
'. this process .'---------->| error 1 |-----------.
'. ? .' |_________| |
'._______.' |
| yes |
_V_ |
.' '. |
.' '. |
.'connection '. |
.' state '. |
:___________________: _________ |
5| |3,4 |1,2,6 |0 | | |
| | | '------------------>| error 3 |-->|
,------------' | '-------------------. |_________| |
| ______________V______________________ | |
| |Return all buffers to user with error| | ___________ |
| |12; clear all packet queues, create | | |Remove TCB | |
| |FIN packet, signal Output Packet | '--->|Return |--->|
| |Handler, set C=F=1 | |Success | |
| |_____________________________________| |___________| |
| | |
--------------------->|<----------------------------------------'
____V___
/ Return \
\________/
FIGURE 3.6:
STATUS
_______
/ Begin \
\_______/
|
__V__
.'conn-'.
.' ection '. _________
.' legal for '. no | |
'. this process .'---------->| error 1 |-----------.
'. ? .' |_________| |
'._______.' |
| yes |
__V__ __________ |
.'conn-'. |Return | |
.' ection '. no |state=0 or| |
'. open ? .'------------>|error 3 |--------->|
'._______.' |__________| |
| yes |
___________V___________ |
|Fill in reply from TCB.| |
|Return Success to user.| |
|_______________________| |
| |
|<-----------------------------------------'
____V___
/ Return \
\________/
FIGURE 4.1:
SYN (no ACK)
_______
/ Begin \
\_______/
|
_V_
.' '.
.' '.
.' S1, S2, R '.
.' ? '.
:___________________: 1,1,1 _________
__________ | | | | (states 4-6) | |
|Treat as a| 1,0,1 | | | '------------->| error 6 |-->.
|duplicate.|<-----------' | | |_________| |
|Retransmit| | | 1.0,0 |
|SYN, ACK | 0,0,0 | | (Syn sent) ________________ |
|__________| (listening) | '------------>|Collision: Clear| |
| | |S1, set timeout,| |
| _____________________V________________ |remove SYN from |-->|
| |Set R=S1=1. If U=1 set foreign socket | |retransmit queue| |
| |in TCB to match packet local socket. | |________________| |
| |Send SYN, ACK. Signal OPH. Fill in TCB| |
| |with send window, receive sequence #. | |
| |______________________________________| |
| | |
| | |
'----------------------->|<---------------------------------------'
___V__
/ Done \
\______/
FIGURE 4.2:
SYN,ACK
_______
/ Begin \
\_______/
|
__V__
.' '.
.' State 2 '. no
'.S1=1;S2=R=0.'----------------.
'. ? .' |
'.___.' |
| yes |
__V__ _______V______
.' ACK '. no | |
.' correct '.-------->| send error 6 |
'. ? .' |______________|
'.___.' |
| yes |
_________V_________ |
|Set S2=R=1. Process| |
|ACK. Send ACK. | |
|___________________| |
| |
|<----------------------'
___V__
/ Done \
\______/
FIGURE 4.3:
INT (from net)
_______ ____________
/ Begin \____\|Process ACK |
\_______/ /|(may set S2)|------.
|____________| |
|
__V__
____________ .' in '.
| Discard | no .' state 4 '.
.<-------| (or queue) |<-------'. S1=S2=R=1 .'
| |____________| '. F=0 ? .'
| '.___.'
| | yes
| __V__
| ____________ .' '.
| | ACK and | no .' within '.
|<-------| discard |<-------'. window .'
| |____________| '. ? .'
| '.___.'
| | yes
| ____________________________V_______________
| |Move Receive Left window edge to sequence |
| |number of INT. Return event 10 with any |
| |pending Receive buffers. Ruturn event 11 to |
| |user. Send ACK for INT. |
| |____________________________________________|
| |
| __V__
| see yes .'data '.
| Figure<----------.' in this '.
| 2.2 '.packet?.'
| '.___.'
| | no
'------------------------------------>|
___V__
/ Done \
\______/
FIGURE 4.4:
FIN
_______ ____________
/ Begin \____\|Process ACK |
\_______/ /|(may set S2)|------.
|____________| |
|
__V__
.' '.
no .'S1=S2=R=1'.
.--------------'. (estab- .'
| '.lished).'
| '.___.'
| | yes
| __V__
______V_____ .' '.
| | no .' within '.
.-----------------| discard |<-------'. window .'
| |____________| '. ? .'
| '.___.'
| | yes
| __V__
| (state 4) 0 .'F bit'. 1 (state 5)
| .------------'. value .'------------.
| | '.___.' |
| _________________________V________ |
| |Return all user buffers (event 12)| _____________________V__
| |Clear all packet queues. Send FIN | |Return success to User's|
| |packet. Set F=1. Inform user | |CLOSE. Remove TCB. |
| |"connection closing" (event 12) | |________________________|
| |__________________________________| |
| | |
'----------------->|<-----------------------------------'
___V__
/ Done \
\______/
FIGURE 4.5:
Error 6 (bad SYN)
_______
/ Begin \
\_______/
|
|
__V__
.' '.
.'refers to'.
.'current pckt?'. _________
.'(ACK matches seq '. no | |
'. # of packet on .'----------------->| discard |-----------.
'.retrans or send.' |_________| |
'. queues?) .' |
'._______.' |
| yes |
| |
_V_ |
.' '. 1 (state 3) |
.' value '.--------------------------------. |
'. of R.' bad SYN,ACK | |
'._.' | |
| | |
| 0 (state 2) | |
| bad SYN | |
__________________V__________________ _______V______ |
|Other side is established. Send RESET| |Clear S1, R | |
|(put error packet's seq. # in ACK | |Remove SYN,ACK| |
|field. Return all user buffers with | |from retrans | |
|code 14. Inform user with event 14 | |queue. | |
|_____________________________________| |______________| |
| | |
| V |
|<--------------------------------------------------'
___V__
/ Done \
\______/
FIGURE 4.6:
Error 7,8
_______
/ Begin \
\_______/
|
__V__
.' '.
.'refers to'. _________
.' current '. no | |
'. packet (check .'---------------->| discard |-----------.
'. ACK)? .' A |_________| |
'._______.' | |
| yes | |
_V_ | |
.' '. | |
.' '. | |
.'connection '. | |
.' state '. | |
:___________________: | |
4| 5| 3| 2| 6| | |
.-------' | | | '------' |
| | | '-----------------------------. |
| | '-------------. | |
| | | | |
___V___ ____V_______ ______V_______ ________V_________ |
|Pass to| |Remove TCB. | |Clear S1, R. | |Discard. SYN will | |
|user | |Return | |Remove SYN,ACK| |be retrans to | |
|_______| |success to | |from transmit | |avoid receiver | |
| |user's CLOSE| |queue (go to | |having to queue it| |
| |____________| |state 1). | |__________________| |
| | |______________| | |
| V | V |
'------------------------------>|<---------------------------------'
___V__
/ Done \
\______/
FIGURE 4.7:
RESET
_______
/ Begin \
\_______/
|
__V__
no .'Reset'. yes
.------------'. All ? .'------------------.
| '.___.' |
| _________V_________
| |Clear all TCB's for|
| |foreign TCP. Inform|
| |users with event 14|
| |___________________|
__V__ |
.' Is '. _________ |
.' RESET '. no | | |
.'believable ? '.------->| discard |------------->|
'.(check ACK .' |_________| |
'.field) .' |
'.___.' |
| yes |
________________V________________ |
|Clear all queues for this TCB. | |
|Return event 14 for user buffers.| |
|Inform User with event 14. | |
|_________________________________| |
| |
|<----------------------------------------'
___V__
/ Done \
\______/
[ This RFCwas put into machine readable form for entry ]
[ into the online RFCarchives by Alex McKenzie with ]
[ support from GTE, formerly BBN Corp. 2/2000 ]