Chapter 5 Transport Layer Introduction. Networking CS 3470, Section 1

Similar documents
Transport Layer Services Mul9plexing/Demul9plexing. Transport Layer Services

Transport Layer Protocols

Computer Networks UDP and TCP

q Connection establishment (if connection-oriented) q Data transfer q Connection release (if conn-oriented) q Addressing the transport user

Transport Layer. Chapter 3.4. Think about

Chapter 5. Transport layer protocols

Data Communication & Networks G

ICOM : Computer Networks Chapter 6: The Transport Layer. By Dr Yi Qian Department of Electronic and Computer Engineering Fall 2006 UPRM

IP address format: Dotted decimal notation:

Computer Networks. Chapter 5 Transport Protocols

Ethernet. Ethernet. Network Devices

Names & Addresses. Names & Addresses. Hop-by-Hop Packet Forwarding. Longest-Prefix-Match Forwarding. Longest-Prefix-Match Forwarding

Overview. Securing TCP/IP. Introduction to TCP/IP (cont d) Introduction to TCP/IP

Chapter 11. User Datagram Protocol (UDP)

EITF25 Internet Techniques and Applications L5: Wide Area Networks (WAN) Stefan Höst

[Prof. Rupesh G Vaishnav] Page 1

How do I get to

Indian Institute of Technology Kharagpur. TCP/IP Part I. Prof Indranil Sengupta Computer Science and Engineering Indian Institute of Technology

Access Control: Firewalls (1)

Objectives of Lecture. Network Architecture. Protocols. Contents

Network Programming TDC 561

Final for ECE374 05/06/13 Solution!!

Network Security TCP/IP Refresher

IP Network Layer. Datagram ID FLAG Fragment Offset. IP Datagrams. IP Addresses. IP Addresses. CSCE 515: Computer Network Programming TCP/IP

This sequence diagram was generated with EventStudio System Designer (

Networking Test 4 Study Guide

Computer Networks Practicum 2015

IP - The Internet Protocol

8.2 The Internet Protocol

SIP: Session Initiation Protocol

La couche transport dans l'internet (la suite TCP/IP)

Protocols and Architecture. Protocol Architecture.

Architecture and Performance of the Internet

Overview of TCP/IP. TCP/IP and Internet

TCP/IP Optimization for Wide Area Storage Networks. Dr. Joseph L White Juniper Networks

Basic Networking Concepts. 1. Introduction 2. Protocols 3. Protocol Layers 4. Network Interconnection/Internet

Lecture 2-ter. 2. A communication example Managing a HTTP v1.0 connection. G.Bianchi, G.Neglia, V.Mancuso

SSC - Communication and Networking Java Socket Programming (II)

First Workshop on Open Source and Internet Technology for Scientific Environment: with case studies from Environmental Monitoring

B-2 Analyzing TCP/IP Networks with Wireshark. Ray Tompkins Founder of Gearbit

How To Design A Layered Network In A Computer Network

COMP 3331/9331: Computer Networks and Applications. Lab Exercise 3: TCP and UDP (Solutions)

Course Overview: Learn the essential skills needed to set up, configure, support, and troubleshoot your TCP/IP-based network.

A Multi-level Security Mechanism for Secure Data Transmission in SCTP

TCP/IP and the Internet

IP Subnetting and Addressing

(Refer Slide Time: 02:17)

DO NOT REPLICATE. Analyze IP. Given a Windows Server 2003 computer, you will use Network Monitor to view and analyze all the fields of IP.

Introduction to TCP/IP

Networks: IP and TCP. Internet Protocol

We will give some overview of firewalls. Figure 1 explains the position of a firewall. Figure 1: A Firewall

The Transport Layer. Antonio Carzaniga. October 24, Faculty of Informatics University of Lugano Antonio Carzaniga

Improved Digital Media Delivery with Telestream HyperLaunch

Network layer" 1DT066! Distributed Information Systems!! Chapter 4" Network Layer!! goals: "

Network-Oriented Software Development. Course: CSc4360/CSc6360 Instructor: Dr. Beyah Sessions: M-W, 3:00 4:40pm Lecture 2

First Midterm for ECE374 03/09/12 Solution!!

Internet Architecture and Philosophy

Why SSL is better than IPsec for Fully Transparent Mobile Network Access

La couche transport dans l'internet (la suite TCP/IP)

CS 457 Lecture 19 Global Internet - BGP. Fall 2011

Understanding Layer 2, 3, and 4 Protocols

Improving the Performance of TCP Using Window Adjustment Procedure and Bandwidth Estimation

Lecture 28: Internet Protocols

Understanding TCP/IP. Introduction. What is an Architectural Model? APPENDIX

PART OF THE PICTURE: The TCP/IP Communications Architecture

TCP Performance Management for Dummies

Module 7 Internet And Internet Protocol Suite

What is a DoS attack?

Note! The problem set consists of two parts: Part I: The problem specifications pages Part II: The answer pages

The Transport Layer and Implica4ons for Network Monitoring. CS 410/510 Spring 2014

Internet Concepts. What is a Network?

Protocols. Packets. What's in an IP packet

CS335 Sample Questions for Exam #2

Per-Flow Queuing Allot's Approach to Bandwidth Management

Kap. 2. Transport - Schicht

Transport and Network Layer

Networking Overview. (as usual, thanks to Dave Wagner and Vern Paxson)

Network Layer: Network Layer and IP Protocol

Chapter 3. Internet Applications and Network Programming

Transport Layer and Data Center TCP

CPS221 Lecture: Layered Network Architecture

TCP/IP Networking for Wireless Systems. Integrated Communication Systems Group Ilmenau University of Technology

Internet Control Protocols Reading: Chapter 3

How To Understand The Layered Architecture Of A Network

The OSI and TCP/IP Models. Lesson 2

Chapter 3. TCP/IP Networks. 3.1 Internet Protocol version 4 (IPv4)

2.1 Introduction. 2.2 Voice over IP (VoIP)

Overview of Asynchronous Transfer Mode (ATM) and MPC860SAR. For More Information On This Product, Go to:

Encapsulating Voice in IP Packets

Unix System Administration

Answer FIVE Questions only. Each carries 20 marks.

2. IP Networks, IP Hosts and IP Ports

Stateful Firewalls. Hank and Foo

Internet Protocols. Background CHAPTER

TCP/IP Fundamentals. OSI Seven Layer Model & Seminar Outline

Computer Networks Homework 1

Firewall Implementation

Network layer: Overview. Network layer functions IP Routing and forwarding

Effect of Packet-Size over Network Performance

An Introduction to VoIP Protocols

Transcription:

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: connectionoriented transport TCP congestion control

Packet Encapsulation ** Creative Commons: http://en.wikipedia.org/wiki/file:udp_encapsulation.svg 3

Transport services and protocols 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 application transport network data link physical 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

Transport vs. network layer Why can t we just use the network layer to send messages from host to host?

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

Internet transport-layer protocols 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 application transport network data link physical 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

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 9

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 10

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

UDP checksum 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 wraparound sum checksum 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

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 Deal with carryout from most significant bit (if necessary) 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 14

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 15

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 16

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 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.

TCP Segment How TCP manages a byte stream.

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

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.

Multiplexing/demultiplexing What do these words mean, again? 28

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 29

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

How demultiplexing works 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 # 32 bits application data (message) dest port # other header fields TCP/UDP segment format

Connectionless demultiplexing 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) 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

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

Source Ports and Destination Ports How does UDP (or TCP) know which source and destination ports to use? 34

Source Ports and Destination Ports How does UDP (or TCP) know which source and destination ports to use? Servers tend to listen on well-known ports We can utilize this information Client uses well-known destination port number (e.g. port 80 to connect to web server) Server uses well-known source port number to listen for incoming connections (e.g. port 80 if web server) 35

Source Ports and Destination Ports What about the client s source port? Operating systems pick a random, temporary port Guaranteed to be > 1024 IANA suggests between 49,152-65,535 What about the server s destination port? 36

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 38

Connection-oriented demux (cont)

Connection-oriented demux: Threaded Web Server