Announcements. No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

Similar documents
No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

ECE697AA Lecture 3. Today s lecture

UNIT IV -- TRANSPORT LAYER

Chapter 3: Transport Layer Part A

Chapter 23 Process-to-Process Delivery: UDP, TCP, and SCTP 23.1

Internet Applications and the Application Layer Material from Kurose and Ross, Chapter 2: The Application Layer

Announcement. Homework 1 due last night, how is that? Will discuss some problems in the lecture next week

Chapter 3: Transport Layer

Chapter 3: Transport Layer. Chapter 3 Transport Layer. Chapter 3 outline. Transport services and protocols

Communication Networks

TDTS06: Computer Networks

The Transmission Control Protocol (TCP)

NWEN 243. Networked Applications. Layer 4 TCP and UDP

Lecture 5. Transport Layer. Transport Layer 1-1

The Transport Layer Multiplexing, Error Detection, & UDP

Computer Communication Networks Midterm Review

ECE 650 Systems Programming & Engineering. Spring 2018

Page 1. Goals for Today" Discussion" Example: Reliable File Transfer" CS162 Operating Systems and Systems Programming Lecture 11

Lecture 3: The Transport Layer: UDP and TCP

CSCD 330 Network Programming

Question 1 (6 points) Compare circuit-switching and packet-switching networks based on the following criteria:

Computer Networking. Reliable Transport. Reliable Transport. Principles of reliable data transfer. Reliable data transfer. Elements of Procedure

TSIN02 - Internetworking

COSC4377. Useful Linux Tool: screen

User Datagram Protocol

The Transport Layer: TCP & Reliable Data Transfer

Transport Layer Review

Introduction to Protocols

CSC358 Week 4. Adapted from slides by J.F. Kurose and K. W. Ross. All material copyright J.F Kurose and K.W. Ross, All Rights Reserved

Lecture 4: CRC & Reliable Transmission. Lecture 4 Overview. Checksum review. CRC toward a better EDC. Reliable Transmission

Reliable Data Transfer

CS 4390 Computer Networks. Transport Services and Protocols

Guide To TCP/IP, Second Edition UDP Header Source Port Number (16 bits) IP HEADER Protocol Field = 17 Destination Port Number (16 bit) 15 16

TCP : Fundamentals of Computer Networks Bill Nace

Internet and Intranet Protocols and Applications

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

Lecture 3 The Transport Control Protocol (TCP) Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

TSIN02 - Internetworking

Lecture 9: Transpor Layer Overview and UDP

CSE 123: Computer Networks Alex C. Snoeren. HW 1 due NOW!

Lecture 08: The Transport Layer (Part 2) The Transport Layer Protocol (TCP) Dr. Anis Koubaa

Lecture 10: Transpor Layer Principles of Reliable Data Transfer

CS 640 Introduction to Computer Networks. Role of data link layer. Today s lecture. Lecture16

Principles of Reliable Data Transfer

NT1210 Introduction to Networking. Unit 10

CS457 Transport Protocols. CS 457 Fall 2014

CSCD 330 Network Programming Winter 2015

Internet transport-layer protocols. Transport services and protocols. Sending and receiving. Connection-oriented (TCP) Connection-oriented

Lecture 20 Overview. Last Lecture. This Lecture. Next Lecture. Transport Control Protocol (1) Transport Control Protocol (2) Source: chapters 23, 24

TSIN02 - Internetworking

TSIN02 - Internetworking

CS 5520/ECE 5590NA: Network Architecture I Spring Lecture 13: UDP and TCP

Reliable Transport : Fundamentals of Computer Networks Bill Nace

Suprakash Datta. Office: CSEB 3043 Phone: ext Course page:

ELEN Network Fundamentals Lecture 15

Transport Protocols & TCP TCP

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2. Goals for Todayʼs Lecture. Role of Transport Layer

CSCI Topics: Internet Programming Fall 2008

Fall 2012: FCM 708 Bridge Foundation I

Reliable Transport I: Concepts and TCP Protocol

UDP, TCP, IP multicast

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

CSCD 330 Network Programming

Announcements Computer Networking. Outline. Transport Protocols. Transport introduction. Error recovery & flow control. Mid-semester grades

CCNA 1 Chapter 7 v5.0 Exam Answers 2013

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP

CSC 401 Data and Computer Communications Networks

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control

Connectionless and Connection-Oriented Protocols OSI Layer 4 Common feature: Multiplexing Using. The Transmission Control Protocol (TCP)

Transport Layer. Application / Transport Interface. Transport Layer Services. Transport Layer Connections

Chapter 3 Transport Layer

Transport services and protocols. Chapter 3 outline. Internet transport-layer protocols Chapter 3 outline. Multiplexing/demultiplexing

Transport Layer. The transport layer is responsible for the delivery of a message from one process to another. RSManiaol

Unit 2.

COMPUTER NETWORK. Homework #2. Due Date: April 12, 2017 in class

TCP: Flow and Error Control

Transport Protocols and TCP: Review

Lecture (11) OSI layer 4 protocols TCP/UDP protocols

05 Transmission Control Protocol (TCP)

Transport Over IP. CSCI 690 Michael Hutt New York Institute of Technology

CC451 Computer Networks

Outline. CS5984 Mobile Computing

Chapter 3 Transport Layer

User Datagram Protocol (UDP):

CS4700/CS5700 Fundamentals of Computer Networks

Reliable Transport I: Concepts and TCP Protocol

Applied Networks & Security

TCP/IP Networking. Part 4: Network and Transport Layer Protocols

Networking Technologies and Applications

Lecture 7: Flow Control"

CS 43: Computer Networks. 16: Reliable Data Transfer October 8, 2018

EE 122: IP Forwarding and Transport Protocols

Chapter 24. Transport-Layer Protocols

CS519: Computer Networks. Lecture 5, Part 1: Mar 3, 2004 Transport: UDP/TCP demux and flow control / sequencing

Chapter 3. The Data Link Layer. Wesam A. Hatamleh

TCP/IP. Chapter 5: Transport Layer TCP/IP Protocols

Data Link Control Protocols

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

Chapter 3 Transport Layer

OSI Transport Layer. objectives

Transcription:

Announcements No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6 Copyright c 2002 2017 UMaine Computer Science Department 1 / 33 1

COS 140: Foundations of Computer Science Transport-Layer Protocols Fall 2017 Transport Layer 3 Protocols................................................................ 3 Transport layer............................................................ 6 Ports & sockets........................................................... 7 Types.................................................................. 9 Unreliable Transport Protocols 10 Reliable Transport Protocols 11 Using a reliable channel...................................................... 12 Bit errors................................................................ 13 Bit error protocol.......................................................... 15 Lossy channels............................................................ 20 Lossy protocol............................................................ 21 Pipelining................................................................ 22 Recovery in pipelining....................................................... 24 Example: TCP 25 Segments................................................................ 26 Sequence numbers.......................................................... 27 Connection initiation........................................................ 28 Handling problems.......................................................... 30 Handling problems.......................................................... 31 Other Transport Layer Topics 33 Homework 34 This lecture draws heavily from Kurose & Ross (2008): Computer Networks: A Top-Down Approach 2

Transport Layer 3 / 33 Protocols Recall: Protocol is a description of a pattern of interaction between agents Most common: TCP/IP Copyright c 2002 2017 UMaine Computer Science Department 3 / 33 3

Review: Layered protocols Recall: Layered network stack Application: network applications (e.g., Web clients/servers), application protocols (e.g., HTTP) Transport: Delivery of application messages between applications: error correction, reliable transport (some protocols), etc. Network: Delivery of transport-layer messages: routing, etc. Data link: Delivery of network-layer messages e.g., forwarding to next router/host (e.g., Ethernet, WiFi, link layers on routers) Physical: Moving the bits (Ethernet has variants for different media) Copyright c 2002 2017 UMaine Computer Science Department 4 / 33 Layered protocols As message goes from top bottom: Broken into pieces Each piece has its own header added at each level Copyright c 2002 2017 UMaine Computer Science Department 5 / 33 4

Transport layer Responsible for delivery of application-layer messages between processes Interacts with: application and network layers Divides/encapsulates application messages as segments Possibly: Error correction Reliable delivery Congestion control Connectionless (e.g., UDP) versus connection-oriented (e.g., TCP) Copyright c 2002 2017 UMaine Computer Science Department 6 / 33 Ports and sockets Network stack manages set of ports on host: Interface of host to outside world Logical, numbered connection points Some are well-known ports (e.g., email (25), Web (80)) Some are usable by processes on the fly Sockets: virtual connections between a process and the transport layer (and thus to a port) Each application process talks to (e.g.) TCP via a socket Can have multiple sockets attached to a port E.g.: Web server Transport layer: multiplexing/demultiplexing of sockets ports Copyright c 2002 2017 UMaine Computer Science Department 7 / 33 5

Ports and sockets Copyright c 2002 2017 UMaine Computer Science Department 8 / 33 Connection-oriented and connectionless protocols Connectionless protocols: E.g., User Datagram Protocol (UDP) Send segments ( datagrams ) between application layers No notion of a continuous connection think US Mail Maybe some error checking embedded No error correcting Not reliable Connection-oriented protocols: E.g., Transmission Control Protocol (TCP) Connection: a virtual pipeline between applications Think phone, but no real connection Reliable transport protocols Copyright c 2002 2017 UMaine Computer Science Department 9 / 33 6

Unreliable Transport Protocols 10 / 33 Unreliable Transport Protocols Very simple Possibly segment application data Possibly add error-checking code (e.g., CRC) Just pass along to network layer Copyright c 2002 2017 UMaine Computer Science Department 10 / 33 Reliable Transport Protocols 11 / 33 Reliable transport protocols More complex Have to deal with: bitwise errors lost segments out-of-order segments Can conceptualize as state machines We ll look at increasingly-complex variants Copyright c 2002 2017 UMaine Computer Science Department 11 / 33 7

Using a reliable channel Simplest Sender: Wait Request from application layer Create packet (segment) Send packet Receiver: Wait Receive packet Extract data Deliver to application Copyright c 2002 2017 UMaine Computer Science Department 12 / 33 Using a channel with bit errors Problem: Few channels are reliable Simple problem: errors in some bits Detect this with: parity, cyclic redundancy checks (CRC) The question is: what to do when detected? Copyright c 2002 2017 UMaine Computer Science Department 13 / 33 8

Using a channel with bit errors For this, need additional messages: ACK: to acknowledge correct receipt NAK: negative acknowledgment Recipient checks the packet, sends the appropriate message in reply Problem: ACKs and NAKs can be garbled, too! Copyright c 2002 2017 UMaine Computer Science Department 14 / 33 A protocol for handling bit errors Sender: "send" request Create segment Send segment Receive NAK Send segment again request ACK/NAK Receive ACK Copyright c 2002 2017 UMaine Computer Science Department 15 / 33 9

A protocol for handling bit errors Recipient: Corrupt segment Create NAK segment Send segment message Good segment Extract data Deliver data Create ACK segment Send segment Any problems with this? Yes! What about errors in ACK/NAK? Copyright c 2002 2017 UMaine Computer Science Department 16 / 33 A better protocol for handling bit errors Have the sender number its segments Receiver can then determine if the packet received is a retransmission ACK/NAK don t need to say what they re ACK ing (or not) since no messages are lost, garbled or okay, the last ACK/NAK was for its last message For this simple protocol, we only need two sequence numbers, 0 and 1 (a bit) only one packet being dealt with at a time. Copyright c 2002 2017 UMaine Computer Science Department 17 / 33 10

A better protocol for handling bit errors Sender: "send" request Create segment, #0 Send segment Receive NAK or corrupt segment Send segment again request (0) ACK/NAK (0) Receive ACK Receive ACK ACK/NAK (1) request (1) Receive NAK or corrupt segment Send segment "send" request Create segment, #1 Send segment Copyright c 2002 2017 UMaine Computer Science Department 18 / 33 A better protocol for handling bit errors Recipient: Receive corrupt packet Create NAK, send Receive segment, #0 Extract data, deliver Create ACK, send Receive corrupt packet Create NAK, send segment segment Receive segment, #1 Create ACK, send Receive segment, #1 Extract data, deliver Create ACK, send Receieve segment, #0 Create ACK, send Copyright c 2002 2017 UMaine Computer Science Department 19 / 33 11

Using a lossy channel Even harder: What if the channel can lose some messages? ACKs and NAKs could also be lost or garbled. Need timers, now if haven t received an ACK after some time, retransmit How to choose the time? At least round trip delay + some Copyright c 2002 2017 UMaine Computer Science Department 20 / 33 Protocol for lossy channels Sender: Receive segment "send" request Create segment, #0 Send segment Start timer Receive corrupt segment or ACK(1) request (0) ACK (0) Timeout Resend segment Start timer Receive ACK Stop timer Receive ACK(0) Stop timer Timeout Resend segment Start timer ACK (1) request (1) Receive segment Receive corrupt segment or ACK(0) "send" request Create segment, #1 Send segment Start timer Copyright c 2002 2017 UMaine Computer Science Department 21 / 33 12

Pipelining Problem: reliable, but inefficient Suppose it takes 5 ms for message to propagate from sender to receiver, or vice versa a 1 Gbps channel, and time to actually put the message on the channel is negligible Time to send, say, a 1 KB message: Send message: 5 ms Send ACK: 5 ms Total 10 ms/message Transfer rate = 1 KB/10 ms = only 100 KB/s! Copyright c 2002 2017 UMaine Computer Science Department 22 / 33 Pipelining Better idea: don t wait for ACK before sending other messages Now can have n messages in the pipe at once. How many, potentially? If 1 Gbps channel, 1 KB messages, then a message takes 8Kb 1Gb/s = 213 2 30s = 2 17 s 7.6µs So there can be 5ms 7.6µs 658 messages in the pipe at once In practice, have (far) fewer: Window: what can be sent before an ACK received Receive an ACK: slide window, can transmit more Copyright c 2002 2017 UMaine Computer Science Department 23 / 33 13

Recovery in pipelining In send-and-wait protocols, pretty clear what you re ACKing What about pipelined protocols? Have to mark ACK with what is being acknowledged What to do when one is missing/corrupt? Go-Back-N: When missing one (corrupt or timeout), repeat it and all others after it Selective repeat: Just repeat the one missing GBN simpler, not as efficient Copyright c 2002 2017 UMaine Computer Science Department 24 / 33 Example: TCP 25 / 33 Example: TCP Connection-oriented, reliable data transport protocol Can handle bit errors, lossy channels Full-duplex Copyright c 2002 2017 UMaine Computer Science Department 25 / 33 14

TCP segment structure Header + data Source port number, destination port number Sequence number ACK number Checksum Header length field, flags, options, some other stuff Copyright c 2002 2017 UMaine Computer Science Department 26 / 33 Sequence numbers Each half of the conversation is considered an ordered sequence of bytes Sequence number of a segment is the byte number of the first byte in the segment not the segment number! ACK number: The next byte expected from the sender These are cumulative acknowledgments Copyright c 2002 2017 UMaine Computer Science Department 27 / 33 15

Connection initiation: three-way handshake First: Client sends a special segment ( SYN segment ) to request connection No application data contained SYN bit in header = 1 Random sequence number Second: Server sets up its side of the connection and sends message 2 ( SYNACK segment ) Allocates buffers, variables Response segment: no application data SYN = 1, ACK = client sequence number + 1, random sequence number Copyright c 2002 2017 UMaine Computer Science Department 28 / 33 Connection initiation: three-way handshake Third: Client sets up its side, sends another message Allocates client-side buffers, variables Segment has SYN = 0, server s sequence number +1 as ACK Can carry application data (payload) Copyright c 2002 2017 UMaine Computer Science Department 29 / 33 16

Handling problems Corrupt segment received (bitwise error) don t ACK Receive duplicate segment Why? Lost ACK Just discard data, re-ack Timeout Why? Lost segment Single timer for all messages to reduce overhead Retransmit segment Copyright c 2002 2017 UMaine Computer Science Department 30 / 33 Handling problems ACK received for segment after one it s expecting an ACK for Not really a problem Cumulative acknowledgment, so previous segments received, too Copyright c 2002 2017 UMaine Computer Science Department 31 / 33 17

Handling problems Segment received out of order One reason: a segment was lost For this, send ACK, but with next byte expected being the missing segment Another reason: segment tied up in network For this, ACK with next real byte expected, necessarily one right after this one Copyright c 2002 2017 UMaine Computer Science Department 32 / 33 Other Transport Layer Topics 33 / 33 Other transport layer topics How to choose timeouts Flow control Congestion control When to use UDP vs TCP Copyright c 2002 2017 UMaine Computer Science Department 33 / 33 18

Homework 34 / 33 19