Computer Networks 2 Lecture 2 TCP – I - Transport Protocols: TCP Segments, Flow control and Connection Setup.

Slides:



Advertisements
Similar presentations
Transport Layer3-1 Transport Overview and UDP. Transport Layer3-2 Goals r Understand transport services m Multiplexing and Demultiplexing m Reliable data.
Advertisements

Transmission Control Protocol (TCP)
1 Transport Layer Lecture 9 Imran Ahmed University of Management & Technology.
CS 471/571 Transport Layer 5 Slides from Kurose and Ross.
CSE551: Computer Network Review r Network Layers r TCP/UDP r IP.
CS3505 The Internet and Info Hiway transport layer protocols : TCP/UDP.
BZUPAGES.COM 1 User Datagram Protocol - UDP RFC 768, Protocol 17 Provides unreliable, connectionless on top of IP Minimal overhead, high performance –No.
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 A.
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 outline r TCP m segment structure m reliable data transfer m flow control m congestion control.
Computer Communication Digital Communication in the Modern World Transport Layer Multiplexing, UDP
Chapter 3: Transport Layer
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Transport Layer3-1 Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer.
Lecture 8 Chapter 3 Transport Layer
Computer Networking Lecture 16 – More TCP
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. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
2: Application Layer 1 1DT066 Distributed Information System Chapter 3 Transport Layer.
Some slides are in courtesy of J. Kurose and K. Ross Review of Previous Lecture Electronic Mail: SMTP, POP3, IMAP DNS Socket programming with TCP.
3-1 Transport services and protocols r provide logical communication between app processes running on different hosts r transport protocols run in end.
8-1 Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer m flow.
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
IP-UDP-RTP Computer Networking (In Chap 3, 4, 7) 건국대학교 인터넷미디어공학부 임 창 훈.
Gursharan Singh Tatla Transport Layer 16-May
Review: –What is AS? –What is the routing algorithm in BGP? –How does it work? –Where is “policy” reflected in BGP (policy based routing)? –Give examples.
CECS 474 Computer Network Interoperability Notes for Douglas E. Comer, Computer Networks and Internets (5 th Edition) Tracy Bradley Maples, Ph.D. Computer.
Data Communications and Computer Networks Chapter 3 CS 3830 Lecture 12 Omar Meqdadi Department of Computer Science and Software Engineering University.
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.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
Chapter 3 Transport Layer
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.
Transport Layer1 Ram Dantu (compiled from various text books)
Computer Networking Lecture 16 – Transport Protocols Dejian Ye, Liu Xin.
Lecture91 Administrative Things r Return homework # 1 r Review some problems in homework # 1 r Questions about grading? Yona r WebCT for CSE245 is working!
CSE679: Computer Network Review r Review of the uncounted quiz r Computer network review.
Transport Layer 3-1 Chapter 3 Outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP.
Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer.
Andmeside IRT 0030 loeng 605. okt Avo Ots telekommunikatsiooni õppetool raadio- ja sidetehnika instituut
81 Sidevõrgud IRT 0020 loeng okt Avo Ots telekommunikatsiooni õppetool, TTÜ raadio- ja sidetehnika inst.
Prof. Younghee Lee 1 1 Computer Networks u Lecture 5: Transport services and protocols Prof. Younghee Lee * Some part of this teaching materials are prepared.
MULTIPLEXING/DEMULTIPLEXING, CONNECTIONLESS TRANSPORT.
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429 Introduction to Computer Networks Lecture 13: TCP Slides used with permissions from.
IP1 The Underlying Technologies. What is inside the Internet? Or What are the key underlying technologies that make it work so successfully? –Packet Switching.
CS640: Introduction to Computer Networks Aditya Akella Lecture 15 TCP – II - Connection Set-up and Congestion Control.
Transport Layer3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable.
CIS679: TCP and Multimedia r Review of last lecture r TCP and Multimedia.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
Introduction 1-1 source application transport network link physical HtHt HnHn M segment HtHt datagram destination application transport network link physical.
CSEN 404 Transport Layer II Amr El Mougy Lamia AlBadrawy.
11 CS716 Advanced Computer Networks By Dr. Amir Qayyum.
2: Transport Layer 11 Transport Layer 1. 2: Transport Layer 12 Part 2: Transport Layer Chapter goals: r understand principles behind transport layer services:
@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.
CSEN 404 Transport Layer I Amr El Mougy Lamia Al Badrawy.
3. END-TO-END PROTOCOLS (PART 1) Rocky K. C. Chang Department of Computing The Hong Kong Polytechnic University 22 March
Introduction to Networks
Chapter 3 outline 3.1 Transport-layer services
Introduction to Networks
5. End-to-end protocols (part 1)
Introduction to Networks
Introduction of Transport Protocols
Lecture 18 – More TCP & Congestion Control
Chapter 5 Transport Layer Introduction
Transport Protocols: TCP Segments, Flow control and Connection Setup
Chapter 5 Transport Layer Introduction
Introduction to Computer Networks
Transport Protocols: TCP Segments, Flow control and Connection Setup
Transport Layer 9/22/2019.
Transport Layer Our goals:
Presentation transcript:

Computer Networks 2 Lecture 2 TCP – I - Transport Protocols: TCP Segments, Flow control and Connection Setup

2 Transport Protocols Lowest level end- to-end protocol. –Header generated by sender is interpreted only by the destination –Routers view transport header as part of the payload Transport IP Datalink Physical Transport IP Datalink Physical IP router 22 11

3 Functionality Split Network provides best-effort delivery End-systems implement many functions –Reliability –In-order delivery –De-multiplexing –Message boundaries –Connection abstraction –Congestion control –…

4 Transport Protocols UDP provides just integrity and demux TCP adds… –Connection-oriented –Reliable –Ordered –Point-to-point –Byte-stream –Full duplex –Flow and congestion controlled Request-reply service –RPC-like –Not covered here

5 UDP: User Datagram Protocol “No frills,” “bare bones” Internet transport protocol “Best effort” service, UDP segments may be: –Lost –Delivered out of order to app Connectionless: –No handshaking between UDP sender, receiver –Each UDP segment handled independently of others Why is there a UDP? No connection establishment (which can add delay) Simple: no connection state at sender, receiver Small header No congestion control: UDP can blast away as fast as desired

6 More on UDP Often used for streaming multimedia apps –Loss tolerant –Rate sensitive Other UDP uses (why?): –DNS, SNMP Reliable transfer over UDP –Must be at application layer –Application-specific error recovery Source port # Dest port # 32 bits Application data (message) UDP segment format Length Checksum Length, in bytes of UDP segment, including header

7 TCP Source portDestination port Sequence number Acknowledgement Advertised windowHdrLen Flags 0 ChecksumUrgent pointer Options (variable) Data Flags: SYN FIN RESET PUSH URG ACK Reliable, In-order, Connection oriented, Byte stream abstraction

8 Sequence and Acknowledge Numbers Sequence number  byte num of first byte in payload Acknowledgement number –TCP is full duplex –Sequence number of next byte expected in reverse direction

9 Advertised Window Used for “flow control” –Prevent receeiving app from getting overwhelmed Both sender and receiver advertise window –Sender action: lastSent – lastACK <= Receiver’s advertised window Flow control coming up…

10 Sliding Window Again Sliding buffer at sender and receiver –Packets in transit  sender buffer size –Advance when sender and receiver agree packets at beginning have been received Receiver has to buffer a packet until all prior packets have arrived –Also accommodates slow applications Goal: provides reliable, ordered delivery, and flow control Same as link layer sliding window algorithm, except that flow control is crucial and challenging

11 TCP Flow Control TCP is a sliding window protocol –For window size n, can send up to n bytes without receiving an acknowledgement –When the data is acknowledged then the window slides forward Each packet advertises a window size –Indicates number of bytes the receiver has space for Original TCP always sent entire window –Congestion control now limits this

12 Window Flow Control: Send Side Sent but not ackedNot yet sent Advertised window Next to be sent Sent and acked Send buffer

13 acknowledgedsentto be sentoutside window Source Port Dest. Port Sequence Number Acknowledgment HL/Flags Window D. Checksum Urgent Pointer Options… Source Port Dest. Port Sequence Number Acknowledgment HL/Flags Window D. Checksum Urgent Pointer Options... Packet Sent Packet Received App write Window Flow Control: Send Side

14 Acked but not delivered to user Not yet acked Receive buffer Advertised window Window Flow Control: Receive Side

15 TCP Persist What happens if window is 0? –Receiver updates window when application reads data –What if this update is lost? TCP Persist state –Sender periodically sends 1 byte packets –Receiver responds with ACK even if it can’t store the packet

16 Performance Considerations The window size can be controlled by receiving application –Can change the socket buffer size from a default (e.g. 8Kbytes) to a maximum value (e.g. 64 Kbytes) The window size field in the TCP header limits the window that the receiver can advertise –16 bits  64 KBytes –10 msec RTT  51 Mbit/second –100 msec RTT  5 Mbit/second –TCP options to get around 64KB limit

17 Sequence Numbers How large do sequence numbers need to be? –Depends on sender/receiver window size –E.g. Max seq = 7, window_size = 7 If pkts 0..6 are sent successfully and all acks lost –Receiver expects 7,0..5, sender retransmits old 0..6!!! Max sequence must be  2 * window_size TCP uses 32 bit sequence numbers –Window size limited to 16 bits –Sequence number space is ample

18 TCP Sequence Numbers Sequence Number Space –Each byte in byte stream is numbered. –32 bit value –Wraps around Initial values selected at start up time –TCP breaks up the byte stream in packets. Packet size is limited to the Maximum Segment Size –Each packet has a sequence number. –Indicates where it fits in the byte stream

19 Establishing Connection: Three-Way handshake Each side notifies other of starting sequence number it will use for sending –Why not simply chose 0? Must avoid overlap with earlier incarnation Each side acknowledges other’s sequence number –SYN-ACK: Acknowledge sequence number + 1 Can combine second SYN with first ACK SYN: SeqC ACK: SeqC+1 SYN: SeqS ACK: SeqS+1 ClientServer

20 TCP State Diagram: Connection Setup CLOSED SYN SENT SYN RCVD ESTAB LISTEN active OPEN create TCB Snd SYN create TCB passive OPEN snd SYN ACK rcv SYN Send FIN CLOSE rcv ACK of SYN Snd ACK Rcv SYN, ACK Client Server

21 Tearing Down Connection Either side can initiate tear down –Send FIN signal –“I’m not going to send any more data” Other side can continue sending data –Half open connection –Must continue to acknowledge Acknowledging FIN –Acknowledge last sequence number + 1 ClientServer FIN, SeqA ACK, SeqA+1 ACK Data ACK, SeqB+1 FIN, SeqB

22 State Diagram: Connection Tear-down CLOSING CLOSE WAIT FIN WAIT-1 ESTAB TIME WAIT snd FIN CLOSE rcv ACK of FIN LAST-ACK CLOSED FIN WAIT-2 snd ACK rcv FIN delete TCB Timeout=2msl send FIN CLOSE send ACK rcv FIN snd ACK rcv FIN rcv ACK of FIN snd ACK rcv FIN+ACK rcv ACK Active Close Passive Close Time_Wait state is necessary in case the final ack was lost.

23 Data delivery in TCP TCP is byte oriented, however transmit data in segments (messages). How TCP knows the time for delivery? –Maximum Segment Size (MSS) –Pushed by the application. Like telnet. –Timer