Escenarios en conexiones TCP - PowerPoint PPT Presentation

About This Presentation
Title:

Escenarios en conexiones TCP

Description:

Escenario 1: El servidor debe prepararse parra recibir conexiones ... Escenario 1: Un cliente pide abrir un socket y env a un SYN pidiendo ... – PowerPoint PPT presentation

Number of Views:207
Avg rating:3.0/5.0
Slides: 22
Provided by: klp186
Category:

less

Transcript and Presenter's Notes

Title: Escenarios en conexiones TCP


1
Escenarios en conexiones TCP
  • Contenidos
  • Algunos recorridos del diagrama de estado TCP

2
Establecimiento y Término de Conexión
Active participant
Passive participant
(client)
(server)
SYN, SequenceNum
x
,
y
1

SYN ACK, SequenceNum
x
Acknowledgment
ACK, Acknowledgment
y

1
3
Diagrama de Estado de Transmisión
4
Escenario 1 Establecimiento de una conexión
Cliente
Servidor
CLOSED
Active open/SYN
Passive open
Close
Close
LISTEN
Send/SYN
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN ACK/ACK
ACK
Close/FIN
ESTABLISHED
FIN/ACK
Close/FIN
CLOSE_WAIT
FIN_WAIT_1
FIN/ACK
Close/FIN
ACK
LAST_ACK
CLOSING
ACK FIN/ACK
FIN_WAIT_2
ACK
ACK
FIN/ACK
TIME_WAIT
CLOSED
Time after two segment lifetimes
5
Escenario 1 El servidor debe prepararse parra
recibir conexionesLa aplicación solicita abrir
un socket (o punto de conexión en un puerto)
CLOSED
Active open/SYN
CLOSED
Active open/SYN
Passive open
Close
Passive open
Close
Close
Close
LISTEN
LISTEN
Send/SYN
SYN/SYN ACK
Send/SYN
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN ACK/ACK
ACK
SYN ACK/ACK
ACK
Close/FIN
Close/FIN
ESTABLISHED
ESTABLISHED
FIN/ACK
Close/FIN
FIN/ACK
Close/FIN
CLOSE_WAIT
FIN_WAIT_1
CLOSE_WAIT
FIN_WAIT_1
FIN/ACK
FIN/ACK
Close/FIN
Close/FIN
ACK
ACK
LAST_ACK
CLOSING
ACK FIN/ACK
LAST_ACK
CLOSING
ACK FIN/ACK
FIN_WAIT_2
FIN_WAIT_2
ACK
ACK
ACK
ACK
FIN/ACK
FIN/ACK
TIME_WAIT
CLOSED
TIME_WAIT
CLOSED
Time after two segment lifetimes
Time after two segment lifetimes
Servidor
Cliente
6
Escenario 1 Un cliente pide abrir un socket y
envía un SYN pidiendo establecimiento de conexión
CLOSED
Active open/SYN
CLOSED
Active open/SYN
Passive open
Close
Passive open
Close
Close
Close
LISTEN
LISTEN
Send/SYN
SYN/SYN ACK
Send/SYN
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN ACK/ACK
ACK
SYN ACK/ACK
ACK
Close/FIN
Close/FIN
ESTABLISHED
ESTABLISHED
FIN/ACK
Close/FIN
FIN/ACK
Close/FIN
CLOSE_WAIT
FIN_WAIT_1
CLOSE_WAIT
FIN_WAIT_1
FIN/ACK
FIN/ACK
Close/FIN
Close/FIN
ACK
ACK
LAST_ACK
CLOSING
ACK FIN/ACK
LAST_ACK
CLOSING
ACK FIN/ACK
FIN_WAIT_2
FIN_WAIT_2
ACK
ACK
ACK
ACK
FIN/ACK
FIN/ACK
TIME_WAIT
CLOSED
TIME_WAIT
CLOSED
Time after two segment lifetimes
SYN
Time after two segment lifetimes
open
Cliente
Servidor
7
Escenario 1 Un servidor recibe un SYN y responde
con un ACK y SYN
CLOSED
Active open/SYN
CLOSED
Active open/SYN
Passive open
Close
Passive open
Close
Close
Close
LISTEN
LISTEN
Send/SYN
SYN/SYN ACK
Send/SYN
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN ACK/ACK
ACK
SYN ACK/ACK
ACK
Close/FIN
Close/FIN
ESTABLISHED
ESTABLISHED
FIN/ACK
Close/FIN
FIN/ACK
Close/FIN
CLOSE_WAIT
FIN_WAIT_1
CLOSE_WAIT
FIN_WAIT_1
FIN/ACK
FIN/ACK
Close/FIN
Close/FIN
ACK
ACK
LAST_ACK
CLOSING
ACK FIN/ACK
LAST_ACK
CLOSING
ACK FIN/ACK
FIN_WAIT_2
FIN_WAIT_2
ACK
ACK
ACK
ACK
FIN/ACK
FIN/ACK
TIME_WAIT
CLOSED
TIME_WAIT
CLOSED
Time after two segment lifetimes
SYN
Time after two segment lifetimes
open
Cliente
Servidor
SYN ACK
8
Escenario 1 El cliente recibe el SYN ACK y
para él queda establecida la conexión
CLOSED
Active open/SYN
CLOSED
Active open/SYN
Passive open
Close
Passive open
Close
Close
Close
LISTEN
LISTEN
Send/SYN
SYN/SYN ACK
Send/SYN
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN ACK/ACK
ACK
SYN ACK/ACK
ACK
Close/FIN
Close/FIN
ESTABLISHED
ESTABLISHED
FIN/ACK
Close/FIN
FIN/ACK
Close/FIN
CLOSE_WAIT
FIN_WAIT_1
CLOSE_WAIT
FIN_WAIT_1
FIN/ACK
FIN/ACK
Close/FIN
Close/FIN
ACK
ACK
LAST_ACK
CLOSING
ACK FIN/ACK
LAST_ACK
CLOSING
ACK FIN/ACK
FIN_WAIT_2
FIN_WAIT_2
ACK
ACK
ACK
ACK
FIN/ACK
FIN/ACK
TIME_WAIT
CLOSED
TIME_WAIT
CLOSED
Time after two segment lifetimes
SYN
Time after two segment lifetimes
open
Cliente
Servidor
SYN ACK
ACK
9
Escenario 1 El servidor recibe su ACK y queda
establecida la conexión para él.
CLOSED
Active open/SYN
CLOSED
Active open/SYN
Passive open
Close
Passive open
Close
Close
Close
LISTEN
LISTEN
Send/SYN
SYN/SYN ACK
Send/SYN
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN ACK/ACK
ACK
SYN ACK/ACK
ACK
Close/FIN
Close/FIN
ESTABLISHED
ESTABLISHED
FIN/ACK
Close/FIN
FIN/ACK
Close/FIN
CLOSE_WAIT
FIN_WAIT_1
CLOSE_WAIT
FIN_WAIT_1
FIN/ACK
FIN/ACK
Close/FIN
Close/FIN
ACK
ACK
LAST_ACK
CLOSING
ACK FIN/ACK
LAST_ACK
CLOSING
ACK FIN/ACK
FIN_WAIT_2
FIN_WAIT_2
ACK
ACK
ACK
ACK
FIN/ACK
FIN/ACK
TIME_WAIT
CLOSED
TIME_WAIT
CLOSED
Time after two segment lifetimes
SYN
Time after two segment lifetimes
open
Cliente
Servidor
SYN ACK
ACK
Intercambio de mensajes
10
Escenario 2 Cierre de la conexión por el
servidor.
CLOSED
Active open/SYN
CLOSED
Active open/SYN
Passive open
Close
Passive open
Close
Close
Close
LISTEN
LISTEN
Send/SYN
SYN/SYN ACK
Send/SYN
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN ACK/ACK
ACK
SYN ACK/ACK
ACK
Close/FIN
Close/FIN
ESTABLISHED
ESTABLISHED
FIN/ACK
Close/FIN
FIN/ACK
Close/FIN
CLOSE_WAIT
FIN_WAIT_1
CLOSE_WAIT
FIN_WAIT_1
FIN/ACK
FIN/ACK
Close/FIN
Close/FIN
ACK
ACK
LAST_ACK
CLOSING
ACK FIN/ACK
LAST_ACK
CLOSING
ACK FIN/ACK
FIN_WAIT_2
FIN_WAIT_2
ACK
ACK
ACK
ACK
FIN/ACK
FIN/ACK
TIME_WAIT
CLOSED
TIME_WAIT
CLOSED
Time after two segment lifetimes
Time after two segment lifetimes
Intercambio de mensajes
Cliente
Servidor
11
Escenario 2 La aplicación en el servidor
solicita un close del socket.
CLOSED
Active open/SYN
CLOSED
Active open/SYN
Passive open
Close
Passive open
Close
Close
Close
LISTEN
LISTEN
Send/SYN
SYN/SYN ACK
Send/SYN
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN ACK/ACK
ACK
SYN ACK/ACK
ACK
Close/FIN
Close/FIN
ESTABLISHED
ESTABLISHED
FIN/ACK
Close/FIN
FIN/ACK
Close/FIN
CLOSE_WAIT
FIN_WAIT_1
CLOSE_WAIT
FIN_WAIT_1
FIN/ACK
FIN/ACK
Close/FIN
Close/FIN
ACK
ACK
LAST_ACK
CLOSING
ACK FIN/ACK
LAST_ACK
CLOSING
ACK FIN/ACK
FIN_WAIT_2
FIN_WAIT_2
ACK
ACK
ACK
ACK
FIN/ACK
FIN/ACK
TIME_WAIT
CLOSED
TIME_WAIT
CLOSED
Time after two segment lifetimes
Time after two segment lifetimes
Intercambio de mensajes
Cliente
Close
Servidor
FIN
12
Escenario 2 El cliente recibe el FIN y envía
acuse de recibo.
CLOSED
Active open/SYN
CLOSED
Active open/SYN
Passive open
Close
Passive open
Close
Close
Close
LISTEN
LISTEN
Send/SYN
SYN/SYN ACK
Send/SYN
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN ACK/ACK
ACK
SYN ACK/ACK
ACK
Close/FIN
Close/FIN
ESTABLISHED
ESTABLISHED
FIN/ACK
Close/FIN
FIN/ACK
Close/FIN
CLOSE_WAIT
FIN_WAIT_1
CLOSE_WAIT
FIN_WAIT_1
FIN/ACK
FIN/ACK
Close/FIN
Close/FIN
ACK
ACK
LAST_ACK
CLOSING
ACK FIN/ACK
LAST_ACK
CLOSING
ACK FIN/ACK
FIN_WAIT_2
FIN_WAIT_2
ACK
ACK
ACK
ACK
FIN/ACK
FIN/ACK
TIME_WAIT
CLOSED
TIME_WAIT
CLOSED
Time after two segment lifetimes
Time after two segment lifetimes
Intercambio de mensajes
Cliente
Close
Servidor
FIN
ACK
13
Escenario 2 El servidor recibe el acuse y queda
a la espera del cierre por parte del cliente.
CLOSED
Active open/SYN
CLOSED
Active open/SYN
Passive open
Close
Passive open
Close
Close
Close
LISTEN
LISTEN
Send/SYN
SYN/SYN ACK
Send/SYN
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN ACK/ACK
ACK
SYN ACK/ACK
ACK
Close/FIN
Close/FIN
ESTABLISHED
ESTABLISHED
FIN/ACK
Close/FIN
FIN/ACK
Close/FIN
CLOSE_WAIT
FIN_WAIT_1
CLOSE_WAIT
FIN_WAIT_1
FIN/ACK
FIN/ACK
Close/FIN
Close/FIN
ACK
ACK
LAST_ACK
CLOSING
ACK FIN/ACK
LAST_ACK
CLOSING
ACK FIN/ACK
FIN_WAIT_2
FIN_WAIT_2
ACK
ACK
ACK
ACK
FIN/ACK
FIN/ACK
TIME_WAIT
CLOSED
TIME_WAIT
CLOSED
Time after two segment lifetimes
Time after two segment lifetimes
Intercambio de mensajes
Cliente
Close
Servidor
FIN
ACK
14
Escenario 2 El cliente decide cerrar conexión,
envía su FIN.
CLOSED
Active open/SYN
CLOSED
Active open/SYN
Passive open
Close
Passive open
Close
Close
Close
LISTEN
LISTEN
Send/SYN
SYN/SYN ACK
Send/SYN
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN ACK/ACK
ACK
SYN ACK/ACK
ACK
Close/FIN
Close/FIN
ESTABLISHED
ESTABLISHED
FIN/ACK
Close/FIN
FIN/ACK
Close/FIN
CLOSE_WAIT
FIN_WAIT_1
CLOSE_WAIT
FIN_WAIT_1
FIN/ACK
FIN/ACK
Close/FIN
Close/FIN
ACK
ACK
LAST_ACK
CLOSING
ACK FIN/ACK
LAST_ACK
CLOSING
ACK FIN/ACK
FIN_WAIT_2
FIN_WAIT_2
ACK
ACK
ACK
ACK
FIN/ACK
FIN/ACK
TIME_WAIT
CLOSED
TIME_WAIT
CLOSED
Time after two segment lifetimes
Time after two segment lifetimes
Intercambio de mensajes
Cliente
Close
Servidor
FIN
ACK
Close
FIN
15
Escenario 2 El servidor recibe el FIN y acusa su
recibo.
CLOSED
Active open/SYN
CLOSED
Active open/SYN
Passive open
Close
Passive open
Close
Close
Close
LISTEN
LISTEN
Send/SYN
SYN/SYN ACK
Send/SYN
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN ACK/ACK
ACK
SYN ACK/ACK
ACK
Close/FIN
Close/FIN
ESTABLISHED
ESTABLISHED
FIN/ACK
Close/FIN
FIN/ACK
Close/FIN
CLOSE_WAIT
FIN_WAIT_1
CLOSE_WAIT
FIN_WAIT_1
FIN/ACK
FIN/ACK
Close/FIN
Close/FIN
ACK
ACK
LAST_ACK
CLOSING
ACK FIN/ACK
LAST_ACK
CLOSING
ACK FIN/ACK
FIN_WAIT_2
FIN_WAIT_2
ACK
ACK
ACK
ACK
FIN/ACK
FIN/ACK
TIME_WAIT
CLOSED
TIME_WAIT
CLOSED
Time after two segment lifetimes
Time after two segment lifetimes
Intercambio de mensajes
Cliente
Close
Servidor
FIN
ACK
Close
FIN
ACK
16
Escenario 2 El cliente recibe el ACK de su FIN y
cierra la conexión.
CLOSED
Active open/SYN
CLOSED
Active open/SYN
Passive open
Close
Passive open
Close
Close
Close
LISTEN
LISTEN
Send/SYN
SYN/SYN ACK
Send/SYN
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN ACK/ACK
ACK
SYN ACK/ACK
ACK
Close/FIN
Close/FIN
ESTABLISHED
ESTABLISHED
FIN/ACK
Close/FIN
FIN/ACK
Close/FIN
CLOSE_WAIT
FIN_WAIT_1
CLOSE_WAIT
FIN_WAIT_1
FIN/ACK
FIN/ACK
Close/FIN
Close/FIN
ACK
ACK
LAST_ACK
CLOSING
ACK FIN/ACK
LAST_ACK
CLOSING
ACK FIN/ACK
FIN_WAIT_2
FIN_WAIT_2
ACK
ACK
ACK
ACK
FIN/ACK
FIN/ACK
TIME_WAIT
CLOSED
TIME_WAIT
CLOSED
Time after two segment lifetimes
Time after two segment lifetimes
Intercambio de mensajes
Cliente
Close
Servidor
FIN
ACK
Close
FIN
ACK
La conexión es cerrada
17
Escenario 2 El cliente recibe el ACK de su FIN y
cierra la conexión.
CLOSED
Active open/SYN
CLOSED
Active open/SYN
Passive open
Close
Passive open
Close
Close
Close
LISTEN
LISTEN
Send/SYN
SYN/SYN ACK
Send/SYN
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN/SYN ACK
SYN ACK/ACK
ACK
SYN ACK/ACK
ACK
Close/FIN
Close/FIN
ESTABLISHED
ESTABLISHED
FIN/ACK
Close/FIN
FIN/ACK
Close/FIN
CLOSE_WAIT
FIN_WAIT_1
CLOSE_WAIT
FIN_WAIT_1
FIN/ACK
FIN/ACK
Close/FIN
Close/FIN
ACK
ACK
LAST_ACK
CLOSING
ACK FIN/ACK
LAST_ACK
CLOSING
ACK FIN/ACK
FIN_WAIT_2
FIN_WAIT_2
ACK
ACK
ACK
ACK
FIN/ACK
FIN/ACK
TIME_WAIT
CLOSED
TIME_WAIT
CLOSED
Time after two segment lifetimes
Time after two segment lifetimes
Intercambio de mensajes
Cliente
Close
Servidor
FIN
ACK
Close
FIN
ACK
La conexión es cerrada
Luego de un tiempo el servidor cierra su socket
también
18
Iniciador de Cierre
Diagrama recorrido por quien inicia el cierre
19
Receptor del cierre (Me colgó el muy _at_
!!!)
Secuencia seguida por quien recibe el cierre de
su par no habiendo iniciado él el cierre
20
Diagrama de Estado de Transmisión
Los distintos caminos dependen de si hay cierre
en ambos lados o no y si los FIN se cruzan en el
camino.
Intercambio de mensajes
Close
FIN
FIN
Close
ACK
ACK
Intercambio de mensajes
Close
FIN
Close
FIN ACK
ACK
21
Algoritmo ventana deslizante
  • NS Network simulator es un simulador de redes
    bastante evolucionado y de libre
    disposición.Ref http//www.isi.edu/nsnam/ns/
  • Invito a los interesados a verlo. Ojo no es un
    programa trivial, por lo cual se escapa al
    alcance de este curso.
  • A través de este simulador se puede estudiar los
    fenómenos de ventana deslizante y otros.
Write a Comment
User Comments (0)
About PowerShow.com