transportation layer (1)

18
Transportation Layer (1)

Upload: don

Post on 25-Feb-2016

17 views

Category:

Documents


0 download

DESCRIPTION

Transportation Layer (1). Transportation Layer. Very similar to the data link layer. two hosts connected by a link or two hosts connected by a network differences: - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Transportation Layer (1)

Transportation Layer (1)

Page 2: Transportation Layer (1)

Transportation Layer• Very similar to the data link layer.

– two hosts connected by a link or two hosts connected by a network

• differences: – When two hosts are connected by a link, packets will not

reorder or duplicate (if the sender sends only once). In addition, packets will either get to the receiver or get lost.

– When two hosts are connected by a network, packets can be duplicated, delayed, lost, reordered.

– Implication: The problems to be addressed in the transport layer are very similar to those in the data link layer. However, the solutions may be more complex.

Page 3: Transportation Layer (1)

• The transport layer issues: service interface, addressing, connection management, error control, flow control

• Service interface– connection-oriented and connectionless.– similar to the network layer. Why one more layer?

• network layer -- part of the communication subnet, run by carrier. can't be changed.

• transport layer -- put one more layer on the hosts to get the services needed

• potential problem: may do the same thing two times, which can decrease the communication performance.

Page 4: Transportation Layer (1)

– Addressing• Link: want to transfer data to Ethernet card 08.00.2b.2a.83.62 • Network: want to transfer data to IP host 128.2.222.85 • Transport: which entity you will try to address?

– want to talk to one process on host 128.2.222.85.– what to do use? process ID? how many bits? What would

be the problem when using the pid as transport layer identifier?

– Abstraction: port number

Page 5: Transportation Layer (1)

Connection management

• The problem is that network can delay, reorder, lose packets– Time-out/retransmission introduces duplicates of

data, acknowledgement, connect, close packets• Worst case scenario: consider this bank transaction

example– (a) setup connection– (b) transfer $100 – (c) close connection – all messages are delayed and replayed.

Page 6: Transportation Layer (1)

Solution 1

• assign a connection-id to each connection, the receiver keeps track what connections have been terminated. – How many connection-ids to keep?– What if receiver crashs and comes back again? It

forgets what connections have been established?

Page 7: Transportation Layer (1)

Choosing Unique Identifier

• On packet arrival: is it real or old?– New connection request/release or an old one?

Remember that there is no restriction on reusing the port number.

• Unique ID for each TPDU– How to choose an identifier for each TPDU such

that it is impossible for other TPDU currently in the network associated with this host to have the same identifier.

Page 8: Transportation Layer (1)

Choosing Unique Identifier• When a connection

is set up, choose a initial sequence number by taking the lower bits of a local clock.

• Each TPDU is given a seq. number. With each TPDU sent, the seq. number increases.

Page 9: Transportation Layer (1)

Choosing Unique Identifier

• The clock has finite bits and will wrap around

These TPDU May

still be around

Page 10: Transportation Layer (1)

Choosing Unique Identifier• There is a

maximum lifetime (T) for a TPDU.

• Forbidden region. When the clock is x, don’t send TPDUs with seq. number from x to x+2T.

Forbidden region

2T

Page 11: Transportation Layer (1)

Connection setup -- Three-Way Handshake

• Connection initiator (the client)– Chooses unique seqno x and sends req-conn(x)

• Connection respondent (the server)– Upon receiving req-conn(x)

• Chooses its own unique identifier, y• Sends ack-conn(y,x)

• Upon receiving ack-conn(y,x), client responds– With ack-conn(x+1,y)

Page 12: Transportation Layer (1)

Three-way handshake

Page 13: Transportation Layer (1)

Three-way handshake

client server

Old message

req-conn(x)

ack-conn(y,x)Ignore or reject

Page 14: Transportation Layer (1)

Threeway handshake

client server

Old message

req-conn(x)

ack-conn(y,x)Ignore or reject

ack(x+1, z)

Page 15: Transportation Layer (1)

Close a connection• Reaching agreement: two approaches

– Abort: send close msg to peer, delete state info• What if close() message lost?

– Graceful: send close msg, but before deleting state• Wait for peer to acknowledge close()

• Problem solved?– Can I decide to close, knowing that

• Other entity also agreed to close and knows that I will close

• Can two armies coordinate their attacks– If communication is unreliable?

Page 16: Transportation Layer (1)

Two army problem

Page 17: Transportation Layer (1)
Page 18: Transportation Layer (1)