+ All Categories
Home > Documents > TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View...

TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View...

Date post: 17-Dec-2015
Category:
Upload: neil-bryan
View: 219 times
Download: 2 times
Share this document with a friend
Popular Tags:
22
TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project
Transcript
Page 1: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

TCP Connection Management

Created by

M Bateman, A Ruddle & C Allison

As part of the TCP View project

Page 2: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

Connections

• Both sender an receiver must be ready before start of data transfer– Sender and receiver need to agree on parameters

– Receive buffer size, initial sliding window variables

• Sender and receiver must agree when transfer is over– Both sides must discard state

• This is signalling– Setup/teardown state at the endpoints

– Compare to ‘dialing’ in the telephone network

Page 3: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

Connection Management

• Setup– 3-way handshake

• Transfer– Sliding window, data and ACKs in both

directions

• Teardown– 4-way handshake

• Client-server model– Initiator (client) server– Listener (server) responds, provides service

Page 4: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

Connection Creation

Active participant(client)

Passive participant(server)

Page 5: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

Connection Creation

Active participant(client)

Passive participant(server)

SYN, sequence number = x

Page 6: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

Connection Creation

Active participant(client)

Passive participant(server)

SYN, sequence number = x

SYN + ACK, sequence number = y

Acknowledgement = x+ 1

Page 7: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

Connection Creation

Active participant(client)

Passive participant(server)

SYN, sequence number = x

SYN + ACK, sequence number = y

Acknowledgement = x+ 1

ACK, acknowledgement = y + 1

Page 8: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

ESTABLISHED

CLOSED

LISTEN

SYN_RCVD SYN_SENT

CLOSE_WAIT

LAST_ACKFIN_WAIT_1 CLOSING

FIN_WAIT_2 TIME_WAIT

Page 9: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

ESTABLISHED

CLOSED

LISTEN

SYN_RCVD SYN_SENT

CLOSE_WAIT

LAST_ACKFIN_WAIT_1 CLOSING

FIN_WAIT_2 TIME_WAIT

Page 10: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

Data Transfer

• Connection is bi-directional

• ACKs can carry data

Page 11: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

Connection Teardown

Active participant(client)

Passive participant(server)

Page 12: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

Connection Teardown

Active participant(client)

Passive participant(server)

FIN

Page 13: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

Connection Teardown

Active participant(client)

Passive participant(server)

FIN

ACK

Page 14: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

Connection Teardown

Active participant(client)

Passive participant(server)

FIN

ACK

FIN

Page 15: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

Connection Teardown

Active participant(client)

Passive participant(server)

FIN

ACK

ACK

FIN

Page 16: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

The TIME_WAIT State

• We wait 2 * maximum segment lifetime (60 seconds) before completing the close

• Why?– ACK might have been lost so FIN would be

resent– Could interfere with subsequent connections

Page 17: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

‘Two-Army’ Problem

• Can we use messages and retries to synchronise two machines so they are guaranteed to do some operation at the same time?

Page 18: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

Two-Army Problem

A B

Page 19: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

Two-Army Problem

A B2:30 Okay to attack?

Page 20: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

Two-Army Problem

A B2:30 Okay to attack?

okay

Page 21: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

Two-Army Problem

A B2:30 Okay to attack?

okay

So it’s 2:30?

Page 22: TCP Connection Management Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.

Two-Army Problem

A B2:30 Okay to attack?

okay

So it’s 2:30?

What if this message is lost?


Recommended