Chapter 5 Transport Layer Introduction

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

Introduction 1-1 Chapter 3 Transport Layer Intro and Multiplexing Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley.
1 Computer Networks: A Systems Approach, 5e Larry L. Peterson and Bruce S. Davie Chapter 5 End-to-End Protocols Copyright © 2010, Elsevier Inc. All rights.
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.
CPSC 441: Intro, UDP1 Transport Layer Instructor: Carey Williamson Office: ICT Class Location:
EEC-484/584 Computer Networks Lecture 15 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Computer Communication Digital Communication in the Modern World Transport Layer Multiplexing, UDP
Chapter 3: Transport Layer
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
CPSC 441: Intro, UDP1 Instructor: Anirban Mahanti Office: ICT Class Location: ICT 121 Lectures: MWF 12:00 – 12:50 Notes.
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.
Transport Layer Transport Layer. Transport Layer 3-2 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet,
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.
1 Chapter 1 OSI Architecture The OSI 7-layer Model OSI – Open Systems Interconnection.
Data Communications and Computer Networks Chapter 3 CS 3830 Lecture 12 Omar Meqdadi Department of Computer Science and Software Engineering University.
CS 1652 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights Reserved Jack Lange.
Network LayerII-1 RSC Part III: Transport Layer 1. Basic Concepts Redes y Servicios de Comunicaciones Universidad Carlos III de Madrid These slides are,
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.
Transport Layer and UDP Tahir Azim Ref:
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 Part.
Chapter 3 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 Layer3-1 Chapter 3 Transport Layer These ppt slides are originally from the Kurose and Ross’s book. But some slides are deleted and added for.
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.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross Addison-Wesley,
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)
1 Transport Layer Lecture 7 Imran Ahmed University of Management & Technology.
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!
CS 3830 Day 13 Introduction 1-1. Announcements r Quiz 3: Wednesday, Oct 10 r Prog3 due Wednesday, Oct 10 Transport Layer 3-2.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July A.
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.
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,
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.
Transport Layer3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable.
Application Layer 2-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
Introduction 1-1 source application transport network link physical HtHt HnHn M segment HtHt datagram destination application transport network link physical.
2: Transport Layer 11 Transport Layer 1. 2: Transport Layer 12 Part 2: Transport Layer Chapter goals: r understand principles behind transport layer services:
CSEN 404 Transport Layer I Amr El Mougy Lamia Al Badrawy.
Transport Layer3-1 Transport Layer Never take life seriously. Nobody gets out alive anyway.
Chapter 3 Transport Layer
Chapter 3 Transport Layer
Introduction to Networks
Chapter 3 Transport Layer
Transport Layer Slides are originally from instructor: Carey Williamson at University of Calgary Very minor modification are made Notes derived from “Computer.
Chapter 3 outline 3.1 Transport-layer services
06- Transport Layer Transport Layer.
CS 1652 Jack Lange University of Pittsburgh
Introduction to Networks
Transport Layer Our goals:
September 19th, 2013 CS1652 Jack Lange University of Pittsburgh
Transport Layer Our goals:
Chapter 3 Transport Layer
CSCD 330 Network Programming
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
Chapter 3 Transport Layer
Transport Layer 9/22/2019.
Transport Layer Our goals:
Presentation transcript:

Chapter 5 Transport Layer Introduction Networking CS 3470, Section 1

Chapter 5: Transport Layer Our goals: understand principles behind transport layer services: multiplexing/demultiple xing reliable data transfer flow control congestion control learn about transport layer protocols in the Internet: UDP: connectionless transport TCP: connection- oriented transport TCP congestion control

Packet Encapsulation ** Creative Commons: http://en.wikipedia.org/wiki/File:UDP_encapsulation.svg

Transport services and protocols application transport network data link physical provide logical communication between app processes running on different hosts transport protocols run in end systems send side: breaks app messages into segments, passes to network layer rcv side: reassembles segments into messages, passes to app layer more than one transport protocol available to apps Internet: TCP and UDP logical end-end transport network data link physical network data link physical network data link physical network data link physical network data link physical application transport network data link physical

End-to-end Protocols Common properties that a transport protocol can be expected to provide Guarantees message delivery Delivers messages in the same order they were sent Delivers at most one copy of each message Supports arbitrarily large messages Supports synchronization between the sender and the receiver Allows the receiver to apply flow control to the sender Supports multiple application processes on each host

End-to-end Protocols Typical limitations of the network on which transport protocol will operate Drop messages Reorder messages Deliver duplicate copies of a given message Limit messages to some finite size Deliver messages after an arbitrarily long delay

Transport vs. network layer Household analogy: 12 kids sending letters to 12 kids processes = kids app messages = words on letters in envelopes hosts = houses transport protocol = Ann and Bill network-layer protocol = postal service network layer: logical communication between hosts transport layer: logical communication between processes relies on, enhances, network layer services

Internet transport-layer protocols application transport network data link physical reliable, in-order delivery (TCP) congestion control flow control connection setup unreliable, unordered delivery: UDP no-frills extension of “best-effort” IP services not available: delay guarantees bandwidth guarantees logical end-end transport network data link physical network data link physical network data link physical network data link physical network data link physical application transport network data link physical

Internet transport-layer protocols Challenge for Transport Protocols Develop algorithms that turn the less-than-desirable properties of the underlying network into the high level of service required by application programs

Multiplexing/demultiplexing What do these words mean, again?

Multiplexing/demultiplexing What do these words mean, again? Multiplexing – combines multiple streams of information for transmission over a shared medium Demultiplexing – takes combined streams of information and separates the streams Often abbreviated as demux

Multiplexing/demultiplexing Multiplexing at send host: Demultiplexing at rcv host: delivering received segments to correct socket gathering data from multiple sockets, enveloping data with header (later used for demultiplexing) = socket = process application transport network link physical P1 P2 P3 P4 host 1 host 2 host 3

How demultiplexing works 32 bits host receives IP datagrams each datagram has source IP address, destination IP address each datagram carries 1 transport-layer segment each segment has source, destination port number (recall: well-known port numbers for specific applications) host uses IP addresses & port numbers to direct segment to appropriate socket source port # dest port # other header fields application data (message) TCP/UDP segment format

Connectionless demultiplexing When host receives UDP segment: checks destination port number in segment directs UDP segment to socket with that port number IP datagrams with different source IP addresses and/or source port numbers directed to same socket Create sockets with port numbers: DatagramSocket mySocket1 = new DatagramSocket(99111); DatagramSocket mySocket2 = new DatagramSocket(99222); UDP socket identified by two-tuple: (dest IP address, dest port number)

Connectionless demux (cont) DatagramSocket serverSocket = new DatagramSocket(6428);

Connection-oriented demux TCP socket identified by 4-tuple: source IP address source port number dest IP address dest port number recv host uses all four values to direct segment to appropriate socket

Connection-oriented demux Server host may support many simultaneous TCP sockets: each socket identified by its own 4-tuple Web servers have different sockets for each connecting client non-persistent HTTP will have different socket for each request

Connection-oriented demux (cont)

Connection-oriented demux: Threaded Web Server

UDP: User Datagram Protocol [RFC 768] “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

UDP: User Datagram Protocol [RFC 768] Why is there a UDP? no connection establishment (which can add delay) simple: no connection state at sender, receiver small segment header no congestion control: UDP can blast away as fast as desired

UDP: more other UDP uses often used for streaming multimedia apps 32 bits often used for streaming multimedia apps loss tolerant rate sensitive other UDP uses DNS SNMP reliable transfer over UDP: add reliability at application layer application-specific error recovery! Length, in bytes of UDP segment, including header source port # dest port # length checksum Application data (message) UDP segment format

UDP checksum Sender: Receiver: Goal: detect “errors” (e.g., flipped bits) in transmitted segment. This is the IP checksum from earlier in the course! Sender: treat segment contents as sequence of 16-bit integers checksum: addition (1’s complement sum) of segment contents sender puts checksum value into UDP checksum field Receiver: compute checksum of received segment check if computed checksum equals checksum field value: NO - error detected YES - no error detected. But maybe errors nonetheless?

Internet Checksum Example Note When adding numbers, a carryout from the most significant bit needs to be added to the result Example: add two 16-bit integers 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 Don’t forget to flip the bits back! wraparound sum checksum

Internet Checksum Example What if we are adding three numbers? Add first two numbers Deal with carryout from most significant bit (if necessary) Add sum of first two numbers with third number Obtain the 1’s compliment by converting all 0s to 1s and all 1s to 0s (flip the bits) Same general algorithm for adding > 3 numbers

Internet Checksum Example At the receiver, all 16-bit words are added (including the checksum) If no errors introduced, the sum at the receiver will be all 1’s If any of the bits are zero, then we know error(s) have been introduced into the packet

Internet Checksum Example UDP checksum takes as input: UDP header Contents of message body Pseudoheader 3 fields from the IP packet: protocol number, src IP address, dst IP address UDP length field Motivation of the pseudoheader is to verify this message has been delivered between correct two endpoints

Reliable Byte Stream (TCP) In contrast to UDP, Transmission Control Protocol (TCP) offers the following services Reliable Connection oriented Byte-stream service

Flow control VS Congestion control Flow control involves preventing senders from overrunning the capacity of the receivers Congestion control involves preventing too much data from being injected into the network, thereby causing switches or links to become overloaded

End-to-end Issues At the heart of TCP is the sliding window algorithm (discussed in Chapter 2) As TCP runs over the Internet rather than a point-to-point link, the following issues need to be addressed by the sliding window algorithm TCP supports logical connections between processes that are running on two different computers in the Internet TCP connections are likely to have widely different RTT times Packets may get reordered in the Internet

End-to-end Issues TCP needs a mechanism using which each side of a connection will learn what resources the other side is able to apply to the connection TCP needs a mechanism using which the sending side will learn the capacity of the network

TCP Segment TCP is a byte-oriented protocol, which means that the sender writes bytes into a TCP connection and the receiver reads bytes out of the TCP connection. Although “byte stream” describes the service TCP offers to application processes, TCP does not, itself, transmit individual bytes over the Internet.

TCP Segment TCP on the source host buffers enough bytes from the sending process to fill a reasonably sized packet and then sends this packet to its peer on the destination host. TCP on the destination host then empties the contents of the packet into a receive buffer, and the receiving process reads from this buffer at its leisure. The packets exchanged between TCP peers are called segments.

How TCP manages a byte stream. TCP Segment How TCP manages a byte stream.

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

TCP Header The SrcPort and DstPort fields identify the source and destination ports, respectively. The Acknowledgment, SequenceNum, and AdvertisedWindow fields are all involved in TCP’s sliding window algorithm. Because TCP is a byte-oriented protocol, each byte of data has a sequence number; the SequenceNum field contains the sequence number for the first byte of data carried in that segment. The Acknowledgment and AdvertisedWindow fields carry information about the flow of data going in the other direction.

TCP Header The 6-bit Flags field is used to relay control information between TCP peers. The SYN and FIN flags are used when establishing and terminating a TCP connection, respectively. The ACK flag is set any time the Acknowledgment field is valid, implying that the receiver should pay attention to it.

TCP Header The URG flag signifies that this segment contains urgent data. The PUSH flag signifies that the sender invoked the push operation, which indicates to the receiving side of TCP that it should notify the receiving process of this fact. Finally, the RESET flag signifies that the receiver has become confused

TCP Header Finally, the Checksum field is used in exactly the same way as for UDP Computed over the TCP header, the TCP data, and the pseudoheader, which is made up of the source address, destination address, and length fields from the IP header.

Connection Establishment/Termination in TCP Timeline for three-way handshake algorithm

Closing 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? For closing connection, we can just send a close message to the peer and delete the state on our side. But what if the close message is lost. The peer would not know the connection is closed. So a graceful way is to send a close message and wait for ack. The peer would send an ack and delete its state. On receiving ack, we can also delete the state. What if ack is lost? The peer would have deleted the state and we wouldn’t have. This problem is similar to the two-army problem discussed in textbook.

Two-Army Problem It can be proven that no protocol exists that works to solve this problem. Three-way handshake will not work, so does not four-way handshake. Three-way handshake is normally used to release connections.

Connection Release 6-14, a, b DR: Disconnect request Four protocol scenarios for releasing a connection. (a) Normal case of a three-way handshake. (b) final ACK lost.

Connection Release 6-14, c,d (c) Response lost. (d) Response lost and subsequent DRs lost.