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.

Slides:



Advertisements
Similar presentations
2: Transport Layer 31 Transport Layer 3. 2: Transport Layer 32 TCP Flow Control receiver: explicitly informs sender of (dynamically changing) amount of.
Advertisements

Transportation Layer (2). TCP full duplex data: – bi-directional data flow in same connection – MSS: maximum segment size connection-oriented: – handshaking.
Introduction 1-1 Chapter 3 TCP Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 IC322 Fall 2013 Some.
Transport Layer3-1 TCP. Transport Layer3-2 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection.
3-1 TCP Protocol r point-to-point: m one sender, one receiver r reliable, in-order byte steam: m no “message boundaries” r pipelined: m TCP congestion.
Data Communications and Computer Networks Chapter 3 CS 3830 Lecture 16 Omar Meqdadi Department of Computer Science and Software Engineering University.
1 Chapter 3 Transport Layer. 2 Chapter 3 outline 3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4.
1 Transport Layer Lecture 9 Imran Ahmed University of Management & Technology.
CS 471/571 Transport Layer 5 Slides from Kurose and Ross.
Transport Layer3-1 Summary of Reliable Data Transfer Checksums help us detect errors ACKs and NAKs help us deal with errors If ACK/NAK has errors sender.
Week 9 TCP9-1 Week 9 TCP 3 outline r 3.5 Connection-oriented transport: TCP m segment structure m reliable data transfer m flow control m connection management.
Transport Layer3-1 Homework r Chapter 2#10,13-18 r Due Wed September 17.
Transport Layer3-1 Pipelined protocols Pipelining: sender allows multiple, “in-flight”, yet-to- be-acknowledged pkts m range of sequence numbers must be.
Transport Layer1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r reliable, in-order byte steam: m no “message boundaries” r pipelined: m TCP congestion.
3: Transport Layer3b-1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection m MSS: maximum.
TCP segment structure source port # dest port # 32 bits application data (variable length) sequence number acknowledgement number rcvr window size ptr.
Chapter 3 outline 3.1 transport-layer services
EEC-484/584 Computer Networks Lecture 15 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
Transport Layer Transport Layer: TCP. Transport Layer 3-2 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional.
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
1 Announcement r Project 2 out m Much harder than project 1, start early! r Homework 2 due next Tuesday.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley,
CSE 124 Networked Services Fall 2009 B. S. Manoj, Ph.D 10/20/20091CSE 124 Networked Services Fall 2009 Some.
Announcement Project 2 out –Much harder than project 1, start early! Homework 2 due next Tu.
1 TCP latency modeling. 2 Q: How long does it take to receive an object from a Web server after sending a request? r TCP connection establishment r data.
The Future r Let’s look at the homework r The next test is coming the 19 th (just before turkey day!) r Monday will finish TCP canned slides r Wednesday.
Transport Layer3-1 Data Communication and Networks Lecture 7 Transport Protocols: TCP October 21, 2004.
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Announcement Homework 1 graded Homework 2 out –Due in a week, 1/30 Project 2 problems –Minet can only compile w/ old version of gcc (2.96). –Only tlab-login.
Transport Layer session 1 TELE3118: Network Technologies Week 9: Transport Layer Basics Some slides have been taken from: r Computer Networking:
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 point-to-point:
Network LayerII-1 RSC Part III: Transport Layer 3. TCP Redes y Servicios de Comunicaciones Universidad Carlos III de Madrid These slides are, mainly, part.
Transport Layer1 Reliable Transfer Ram Dantu (compiled from various text books)
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 All.
3: Transport Layer3b-1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection m MSS: maximum.
2: Transport Layer 21 Transport Layer 2. 2: Transport Layer 22 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data.
TCOM 509 – Internet Protocols (TCP/IP) Lecture 04_b Transport Protocols - TCP Instructor: Dr. Li-Chuan Chen Date: 09/22/2003 Based in part upon slides.
Fall 2005 By: H. Veisi Computer networks course Olum-fonoon Babol Chapter 6 The Transport Layer.
Transport Layer3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable.
CSE679: Computer Network Review r Review of the uncounted quiz r Computer network review.
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.
1 End-to-End Protocols (UDP, TCP, Connection Management)
September 26 th, 2013 CS1652 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
Connection-oriented transport: TCP. Transport Layer 3-2 TCP: Overview RFCs: 793,1122,1323, 2018, 2581  full duplex data:  bi-directional data flow in.
Transport Layer3-1 Transport Layer If you are going through Hell Keep going.
CIS679: TCP and Multimedia r Review of last lecture r TCP and Multimedia.
Transport Layer1 Goals: r understand principles behind transport layer services and protocols: m UDP m TCP Overview: r transport layer services r multiplexing/demultiplexing.
Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
CSEN 404 Transport Layer II Amr El Mougy Lamia AlBadrawy.
DMET 602: Networks and Media Lab Amr El Mougy Yasmeen EssamAlaa Tarek.
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
09-Transport Layer: TCP Transport Layer.
COMP 431 Internet Services & Protocols
Chapter 3 outline 3.1 Transport-layer services
DMET 602: Networks and Media Lab
Chapter 3 outline 3.1 transport-layer services
CS 1652 Jack Lange University of Pittsburgh
TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 full duplex data:
Introduction to Networks
CS1652 TCP Jack Lange University of Pittsburgh
Review: UDP demultiplexing TCP demultiplexing Multiplexing?
Transport Layer Goals: Overview:
Chapter 3 outline 3.1 Transport-layer services
Transmission Control Protocol (TCP)
Transportation Layer.
Chapter 3 Transport Layer
Presentation transcript:

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.

Problems The problem is that n etwork 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.

TCP full duplex data: – bi-directional data flow in same connection – MSS: maximum segment size connection-oriented: – handshaking (exchange of control msgs) init’s sender, receiver state before data exchange flow controlled: – sender will not overwhelm receiver point-to-point: – one sender, one receiver reliable, in-order byte steam: – no “message boundaries” pipelined: – TCP congestion and flow control set window size send & receive buffers

TCP segment structure source port # dest port # 32 bits application data (variable length) sequence number acknowledgement number Receive window Urg data pnter checksum F SR PAU head len not used Options (variable length) URG: urgent data (generally not used) ACK: ACK # valid PSH: push data now (generally not used) RST, SYN, FIN: connection estab (setup, teardown commands) # bytes rcvr willing to accept counting by bytes of data (not segments!) Internet checksum (as in UDP)

– Port number Link: want to transfer data to Ethernet card b.2a Network: want to transfer data to IP host Transport: which entity you will try to address? – want to talk to one process on host – 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

TCP 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+1) Upon receiving ack-conn(y,x+1), client responds – With ack-conn(x+1,y+1) SYN (SEQ=x) SEQ=x+1, ACK=y+1) SYN (SEQ=y, ACK=x+1) Con. Set up Con. Set up A B

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. Pick a random seq#

Zhenhai DuanComputer Science, FSU9 TCP Round Trip Time and Timeout Q: how to set TCP timeout value? longer than RTT – note: RTT will vary too short: premature timeout – unnecessary retransmissions too long: slow reaction to segment loss Q: how to estimate RTT? SampleRTT : measured time from segment transmission until ACK receipt – ignore retransmissions, cumulatively ACKed segments SampleRTT will vary, want estimated RTT “smoother” – use several recent measurements, not just current SampleRTT

Zhenhai DuanComputer Science, FSU10 TCP Round Trip Time and Timeout EstimatedRTT = (1-x)*EstimatedRTT + x*SampleRTT Exponential weighted moving average influence of given sample decreases exponentially fast typical value of x: 0.1 Setting the timeout EstimtedRTT plus “safety margin” Timeout is doubled every time a segment is timeout large variation in EstimatedRTT  larger safety margin Timeout = EstimatedRTT + 4*Deviation Deviation = (1-x)*Deviation + x*|SampleRTT-EstimatedRTT|

TCP Timeout

Modified three-way handshake: client closes socket: Step 1: client end system sends TCP FIN control segment to server Step 2: server receives FIN, replies with ACK. Sends FIN. TCP Connection Management: close a connection client FIN server ACK FIN close closed time wait Step 3: client receives FIN, replies with ACK. Enters “time wait” - will respond with ACK to received FINs Step 4: server, receives ACK. Connection closed. Socket programming interface  close() vs shutdown() closed

Why TCP Closes Connection Like This Saying goodbye is difficult! Consider A sending file to B. When A gets the last ACK for data, A sends FIN. Can A quit at this time? No, because B does not know that A knows that B got all data. So, B might keep sending the last data ACK. FIN A B

Why TCP Closes Connection Like This B ACK this FIN by sending ACKFIN. Can B quit at this time? No, because B does not know whether ACKFIN got through or not. If not, A does not know that B knows that A knows that B got all the data. If A is not sure about this, A might keep on sending FIN. FIN ACKFIN A B

Why TCP Closes Connection Like This So A sends ACKACKFIN. Can A quit at this time? Still no, because … (too long, you get it). The point is, if you have reason to send the last ACK, you have just as good reason to send last + 1 ACK, because the only way to make sure that the last ACK is received is to receive the ACK for that ACK, and you have to send an ACK to ACK that ACK because the other side is waiting for it. Conclusion: No protocol can make sure of graceful close of connection. So have to use timeout. If to use timeout, better use it earlier than later. FIN ACKACKFIN ACKFIN A B

TCP connection close Now, A enters the TIMEWAIT state because it is not sure its ACKACKFIN will be received or not. If not, he assumes that B will retransmit ACKFIN. If he does not receive ACKFIN for TIMEWAIT, he assumes that its ACKACKFIN got through and quit. However, it could happen that all the ACKACKFINs were lost. It could also happen that All B’s retransmit of ACKFIN were lost. So there is a (very slight) chance that B did not receive the final ACKACKFIN. The approach adopted by TCP at least makes sure that A is sure that B receives FIN (A must receive ACKFIN.) So TCP is still reliable for data transfer.