Transport Layer:UDP&TCP (Commonalities)

Slides:



Advertisements
Similar presentations
Introduction 1 Lecture 13 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer.
Advertisements

TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
CCNA – Network Fundamentals
Transmission Control Protocol (TCP)
Intermediate TCP/IP TCP Operation.
CISCO NETWORKING ACADEMY PROGRAM (CNAP)
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
1 TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
1 CS 4396 Computer Networks Lab Transmission Control Protocol (TCP) Part I.
TELE202 Lecture 14 TCP/UDP (2) 1 Lecturer Dr Z. Huang Overview ¥Last Lecture »TCP/UDP (1) »Source: chapter 17 ¥This Lecture »TCP/UDP (2) »Source: chapter.
Computer Networks Transport Layer. Topics F Introduction  F Connection Issues F TCP.
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 1 Transport Protocols.
1 CCNA 2 v3.1 Module Intermediate TCP/IP CCNA 2 Module 10.
TCP. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
WXES2106 Network Technology Semester /2005 Chapter 8 Intermediate TCP CCNA2: Module 10.
Process-to-Process Delivery:
TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.
The Transport Layer.
1 Transport Layer Computer Networks. 2 Where are we?
1 Semester 2 Module 10 Intermediate TCP/IP Yuda college of business James Chen
Transport Layer3-1 TCP sender (simplified) NextSeqNum = InitialSeqNum SendBase = InitialSeqNum loop (forever) { switch(event) event: data received from.
1 7-Oct-15 OSI transport layer CCNA Exploration Semester 1 Chapter 4.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 OSI Transport Layer Network Fundamentals – Chapter 4.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
26-TCP Dr. John P. Abraham Professor UTPA. TCP  Transmission control protocol, another transport layer protocol.  Reliable delivery  Tcp must compensate.
Transport Layer Natawut Nupairoj, Ph.D. Department of Computer Engineering Chulalongkorn University.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 2.5 Internetworking Chapter 25 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
Chapter 6-2 the TCP/IP Layers. The four layers of the TCP/IP model are listed in Table 6-2. The layers are The four layers of the TCP/IP model are listed.
Today’s topic: UDP Reliable communication over UDP.
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
4343 X2 – The Transport Layer Tanenbaum Ch.6.
© 2002, Cisco Systems, Inc. All rights reserved..
Data Communications and Networks Chapter 6 – IP, UDP and TCP ICT-BVF8.1- Data Communications and Network Trainer: Dr. Abbes Sebihi.
Transmission Control Protocol (TCP) TCP Flow Control and Congestion Control CS 60008: Internet Architecture and Protocols Department of CSE, IIT Kharagpur.
1 14-Jun-16 S Ward Abingdon and Witney College CCNA Exploration Semester 1 OSI transport layer CCNA Exploration Semester 1 Chapter 4.
© 2006 Cisco Systems, Inc. All rights reserved.Cisco Public 1 OSI transport layer CCNA Exploration Semester 1 – Chapter 4.
3. END-TO-END PROTOCOLS (PART 1) Rocky K. C. Chang Department of Computing The Hong Kong Polytechnic University 22 March
1 Chapter 24 Internetworking Part 4 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
Chapter 5 Network and Transport Layers
The Transport Layer Implementation Services Functions Protocols
Chapter 9: Transport Layer
09-Transport Layer: TCP Transport Layer.
DMET 602: Networks and Media Lab
Fast Retransmit For sliding windows flow control we waited for a timer to expire before beginning retransmission of a packet TCP uses an additional mechanism.
Instructor Materials Chapter 9: Transport Layer
TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 full duplex data:
Introduction to Networks
5. End-to-end protocols (part 1)
Transport Layer.
Process-to-Process Delivery, TCP and UDP protocols
TCP.
PART 5 Transport Layer Computer Networks.
TCP Transport layer Er. Vikram Dhiman LPU.
Magda El Zarki Professor, ICS UC, Irvine
TCP - Part I Karim El Defrawy
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Process-to-Process Delivery:
CS4470 Computer Networking Protocols
Dr. John P. Abraham Professor UTPA
TRANSMISSION CONTROL PROTOCOL
Dr. John P. Abraham Professor UTPA
CPEG514 Advanced Computer Networkst
PART 5 Transport Layer.
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Transport Protocols: TCP Segments, Flow control and Connection Setup
Lecture 21 and 22 5/29/2019.
Process-to-Process Delivery: UDP, TCP
The Internet 2nd Lecture
Computer Networks Protocols
Transport Layer 9/22/2019.
Presentation transcript:

Transport Layer:UDP&TCP (Commonalities) End-to-End Communication How a process is identified on Internet: Each process communicating via TCP or UDP is assigned an host-unique 16-bit binary called “port number” ; A port number is either TCP- or UDP-type; A process is uniquely identified by an IP address and its port number. Port numbers in range of 1-1024 are assigned by IANA。

Transport Layer:UDP(1) UDP is end-to-end and connectionless. UDP is NOT reliable per se; UDP does NOT do flow-adjustment; UDP CAN(!) go in broadcast or multicast way( in contrast TCP CANNOT do).

Transport layer:UDP(2)

Transport layer:UDP(3)

Transport layer:UDP(4)

Transport Layer:TCP(1) TCP is end-to-end and connection-oriented; TCP is bi-directional; TCP is reliable: receiver is guaranteed to get exactly whatever is outgoing from the sender; TCPP does flow-adjustment; TCP can support neither broadcast nor multicast(!).

Transport Layer:TCP(2) What sort of reliability issues on IP packets transmitting over Internet? Packet Loss( because of, e.g., link/gateway saturation、media interference、gateway overloading、interface fault, etc); Packet Disorder( packets in the same stream arrive at destination host in different order from that of sender) ; Flow-mismatch( Lower-speed receiver cannot catch up with a higher-speed sender, as a result, some packets are dropped).

Transport Layer:TCP(3-1) How TCP resolve those reliability issues? Rule#1: sequence number TCP regards whatever is in transmission (Email/file data, Web-page, voice, video, etc.) as the ordered byte sequence (called stream). Each byte is assigned an unique sequence number( a 32-bit binary ) which is contiguous with the byte’s position in the stream.

Transport Layer:TCP(3-2) How TCP resolve those reliability issues? Rule#2: Acknowledgement/resending 1)Everytime TCP sending a block of bytes( a segment), the sender must wait until explicitly acknowledged by its receiver. 2) Everytime TCP receives a block of bytes, the receiver must explicitly acknowledge the sender( by acknowledge number which value is sequence number of the first byte received + the number of received bytes or equivalently 1+sequence number of the last received byte); 3) If the sender is NOT acknowledged after a period(1-2ms), it must resend the segment again, repeat the procedure until explicitly acknowledged.

Transport Layer:TCP(3-3) How TCP resolve those reliability issues? Rule#3 Flow Adjustment TCP explicitly repots the receiving buffer size via parameter Windowsize and does flow adjustment via Window algorithm.

Transport Layer: TCP(4) TCP’s connection-oriented communication procedure: phase#1:open connection phase#2:(bi-directional) data transmission phase#3:close connection

Transport Layer: TCP(5-1)

Transport Layer: TCP(5-2)

Transport Layer: TCP(6) What is TCP connection? A TCP connection is just a group of parameters to indicate peer status under which communication is completely controlled; Which parameters? Sequence number of the currently transmitted bytes, acknowledgement number, current windowsize, etc. On internet each connection is uniquely identified by a 4-tupe: source host’s IP address, source port #, destination host’s IP address, destination port #.

Transport Layer: TCP(7) How is a TCP connection opened (3-way handshaking)? TCP client TCP server SYN=1,Seq# = m SYN=1,Seq#=n, ACK=1, Ack#= m+1 ACK=1,Ack#=n+1 m=base seq# at client side,n=base seq# at server side

m=base seq# at client side TCP(8-1) How is a TCP connection closed? FIN=1,Seq#=M ACK=1,Ack#= M+1 M=acknowledgment number right before the connection-closure; Any side (client or server) can issue a closing-request.

Transport Layer: TCP(8-2) TCP connection-closing is unidirectional(!) Proc.A Proc.B FIN=1,Seq#=M ACK=1,Ack#= M+1 Stream In this example: stream from A to B is closed, in contrast, stream from B to A can still go(!).

Transport Layer:TCP(9-1) How does TCP transmit data: Interactive Mode Proc. A Proc. B 100 bytes ready (new)250B ready Seq#=M, TCP Seg. Size =100 ACK=1,Ack#= M+100 Seq#=M+100, TCP Seg. size=250 ACK=1,Ack#= M+350 Real-world Example: Telnet, etc.

Transfer layer:TCP(9-2) Merge Data Transmission and Acknowledgement Proc#A Proc#B 100B ready Curr. Seq#=M Seq#=M, TCP Seg.size=100 Curr. Seq#=N 500B Ready Seq#=N, TCP Seg.size=500 ACK=1,ACK#= M+100 ACK=1,Seq#= N+500 Each TCP Seg. can carry both data and acknowledgment at the same time

Transfer Layer:TCP(9-3) Pls. Speculate: 1 How does the receiver know the exact number of bytes in a TCP payload? TCP段的载荷长度=IP分组的载荷长度-TCP首长度 What does the TCP Ack#. mean? 若确认号=N, 则接收方A是在向原数据发送方B报告: A期待B下次从第N号字节开始传输数据(记住:TCP把每个字节都编号了!)

Transfer Layer:TCP(9-4) Exercise (to be continued) Proc. A Proc. B SYN=1,序列号= 6999 Base Seq#.=6999 Open Conn. 400B ready Base Seq#=1999 500B Ready SYN=1, Seq#= 1999 , ACK=1,Ack#= 7000 ACK=1,Ack#= 2000 Seq#= 2000, 500B ACK=1, Ack#=2500 Seq#= 7000, 400B ACK=1, Ack#=7400

Transfer Layer:TCP(9-5) (continued) What happens if the receiver cannot receive the whole segment at one time? Proc.A Proc.B Seq#= 7400 1000B 1000B ready Know 400B remained Only 70B accepted Only 600B accepted Accept all 270B ready ACK=1,Ack#= 8000 Seq#= 8000, 400B ACK=1, Ack#= 8400 Seq#= 2500, 270B ACK=1, Ack#=2570

Transfer Layer:TCP(9-6) How does TCP deal with packet loss (I)? Proc.A Proc.B Seq#= 4096, 1000B 1000B ready Start timer timeout Resend/restart timer Clear timer Timeout point Seq#= 4096, 1000B ACK=1, Ack# = 5096 Timeout period is exponentially increased, Why?

Transfer Layer:TCP(9-7) How does TCP deal with packet loss (II)? Proc.A Proc.B Seq# = 90000, 100B 1000B ready start timer timeout Timeout point ACK=1, Ack# = ? (resend) seq# = 90000, 100B ACK=1, Ack# = ? (resend) seq# = 90000, 100B

Transfer Layer:TCP(9-8) Merge the data transmit Proc.A Proc.B 100B: A’s curr. Seq# = M Wait a moment Another 250B ready (Merged bytes):Seq# =M+100, 250B ACK=1,Ack# = M+100 The sender tries to merge the bytes as far as possible. Example: Telnet

Transfer Layer:TCP(9-9) Pls. reasonably guess how to merge acknowledgments for multi-segments? Proc.A Proc.B A’s curr. Seq#=M Seq# =M, 100B Wait a moment Merge Seq# =M+100, 450B ACK=1,Ack# = M+550 特点: 接收方每次等待1ms或更短,目的是尽量合并确认. 例子: Telnet

Transfer Layer:TCP(9-10) Batch Mode Proc A Proc B Cur. Seq#=M Bold size data ready Ack. time Seg. Size=1000B:each seg.’s seq#=? ACK=1,Ack# = ? ACK=1,Ack# =? Feature: 1) Sender sends lots of (e.g., 4) segments before waiting for the acknowledgements. 2) Receiver acknowledges segments in batch, e.g., acknowledges for every receiving two segments. Example: HTTP carrying image、video, etc.

Transfer Layer:TCP(9-11) Slow Start Proc. A Proc. B Curr. Seq#=M Data ready Ack. time 1000B each seg.:each seg.’s seq# =? ACK=1,Ack#= ? ACK=1,Ack# =?

Transfer Layer:TCP(9-12) Example & exercise#1 Proc.A Proc.B Curr. Seq#=78910 Ack. time 1000B each seg. size:each seg.’s seq# =? ACK=1,Ack# = ? Question: If the second seg. Is lost,how does TCP behave? Whatever the receiver does, seg.#2、seg.#3、seg.#4 ALL have to be resent !

Transfer Layer:TCP(9-13) Example & exercise#2 Proc A Proc B Curr.seq#=78910 Ack. time 1000B in each seg.:each seg.’s seq# =? ACK=1,Ack# = ? Question: The second segment arrives late,how can the receiver know there is a gap in the upcoming stream? how does TCP behave?

Transfer Layer:TCP(9-14) Example for Flow Adjustment Proc A Proc B 当前接收缓空间大小为X字节 当前接收缓空间饱和 接收区有Y字节空间可用 当前序列号=78910 大量数据就绪 A停止发送任何数据 用下一个待发送字节试探B A恢复传输 每个段1000字节:每段的序列号=? ACK=1,确认号#,窗口参数=X ACK=1,确认号#,窗口参数=0 序列号#,段长度=1 ACK=1,确认号#,窗口参数=Y>0

Transfer Layer:TCP(9-15) 成批传输情况下如何进行流量调节:例子及练习3-2 B 进程A 当前接收缓空间大小为X字节 当前接收缓空间饱和 接收区有Y字节空间可用 当前序列号=78910 大量数据就绪 A停止发送任何数据 A被动等待 恢复传输 每个段1000字节:每段的序列号=? ACK=1,确认号#,窗口参数=X ACK=1,确认号#,窗口参数=0 序列号#,段长度=1 ACK=1,确认号#,窗口参数=Y>0