Chapter 6. The Transport Layer

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

Transport Layer Protocols

Computer Networks. Chapter 5 Transport Protocols

[Prof. Rupesh G Vaishnav] Page 1

Ethernet. Ethernet. Network Devices

Transport Layer. Chapter 3.4. Think about

Chapter 11. User Datagram Protocol (UDP)

Chapter 5. Transport layer protocols

Computer Networks UDP and TCP

Final for ECE374 05/06/13 Solution!!

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

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

IP - The Internet Protocol

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

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

Access Control: Firewalls (1)

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

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

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

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

TCP and Wireless Networks Classical Approaches Optimizations TCP for 2.5G/3G Systems. Lehrstuhl für Informatik 4 Kommunikation und verteilte Systeme

Objectives of Lecture. Network Architecture. Protocols. Contents

Protocols and Architecture. Protocol Architecture.

IP address format: Dotted decimal notation:

The OSI model has seven layers. The principles that were applied to arrive at the seven layers can be briefly summarized as follows:

Improved Digital Media Delivery with Telestream HyperLaunch

How do I get to

Mobile Communications Chapter 9: Mobile Transport Layer

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

COMP 361 Computer Communications Networks. Fall Semester Midterm Examination

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

Lecture 28: Internet Protocols

Architecture and Performance of the Internet

Network Programming TDC 561

CPS221 Lecture: Layered Network Architecture

Protocols. Packets. What's in an IP packet

Transport and Network Layer

TCP/IP and the Internet

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

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

TCP for Wireless Networks

Question: 3 When using Application Intelligence, Server Time may be defined as.

Data Networks Summer 2007 Homework #3

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

Network Layer: Network Layer and IP Protocol

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

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

This sequence diagram was generated with EventStudio System Designer (

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

Midterm Exam CMPSCI 453: Computer Networks Fall 2011 Prof. Jim Kurose

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

CS155 - Firewalls. Simon Cooper <sc@sgi.com> CS155 Firewalls 22 May 2003

Overview of TCP/IP. TCP/IP and Internet

Networking Test 4 Study Guide

Visualizations and Correlations in Troubleshooting

Computer Networks and the Internet

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

Mathatma Gandhi University

Final Exam. Route Computation: One reason why link state routing is preferable to distance vector style routing.

TCP in Wireless Mobile Networks

Written examination in Computer Networks

Internet Control Protocols Reading: Chapter 3

Cisco Configuring Commonly Used IP ACLs

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

High Performance VPN Solutions Over Satellite Networks

Network Simulation Traffic, Paths and Impairment

Network Models and Protocols

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

First Semester Examinations 2011/12 INTERNET PRINCIPLES

CSIS CSIS 3230 Spring Networking, its all about the apps! Apps on the Edge. Application Architectures. Pure P2P Architecture

Internet Concepts. What is a Network?

How To Understand The Layered Architecture Of A Network

Introduction to Computer Networks

CS268 Exam Solutions. 1) End-to-End (20 pts)

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

Chapter 3: Review of Important Networking Concepts. Magda El Zarki Dept. of CS UC Irvine

Internet Protocols. Background CHAPTER

Internet Protocol: IP packet headers. vendredi 18 octobre 13

Overview of Computer Networks

PART OF THE PICTURE: The TCP/IP Communications Architecture

Module 1. Introduction. Version 2 CSE IIT, Kharagpur

Encapsulating Voice in IP Packets

What is a DoS attack?

EXPLORER. TFT Filter CONFIGURATION

Digital Audio and Video Data

Computer Networks/DV2 Lab

Solution of Exercise Sheet 5

Load Balancing and Sessions. C. Kopparapu, Load Balancing Servers, Firewalls and Caches. Wiley, 2002.

Prefix AggregaNon. Company X and Company Y connect to the same ISP, and they are assigned the prefixes:

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

The OSI and TCP/IP Models. Lesson 2

Firewalls. Basic Firewall Concept. Why firewalls? Firewall goals. Two Separable Topics. Firewall Design & Architecture Issues

Chapter 3. Internet Applications and Network Programming

How To Design A Layered Network In A Computer Network

User Datagram Protocol - Wikipedia, the free encyclopedia

Module 7 Internet And Internet Protocol Suite

Introduction to TCP/IP

The OSI Model and the TCP/IP Protocol Suite

How To Understand The Internet Of S (Netware)

TCP Performance Management for Dummies

Transcription:

Chapter 6 The Transport Layer

Services Provided to the Upper Layers The network, transport, and application layers.

Transport Service Primitives The primitives for a simple transport service: Example: Socket primitives for TCP:

Transport Service Primitives A state diagram for a simple connection management scheme. Transitions labeled in italics are caused by packet arrivals. The solid lines show the client's state sequence. The dashed lines show the server's state sequence.

Transport Protocol (a) Environment of the data link layer. (b) Environment of the transport layer.

Addressing TSAPs (port id), NSAPs (ip address) and transport connections.

Connection Establishment If user knows server port, he connects directly If not: A proxy server should be contacted first (see figure) A name server is asked first for the port id of the server (a) (b) User connects to process server (proxy) with known port Process server spawns time-of-day server that inherits port id and handles user requests

Connection Establishment Three protocol scenarios for establishing a connection using a three-way handshake. CR denotes CONNECTION REQUEST. (a) Normal operation, (b) Old CONNECTION REQUEST appearing out of nowhere. (c) Duplicate CONNECTION REQUEST and duplicate ACK.

Connection Release Abrupt disconnection with loss of data.

Connection Release 6-14, a, b 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.

Multiplexing: Multiplexing Upward multiplexing: Different applications send at the same time (typical) Downward multiplexing: One application using different connections (e.g. for speedup, e.g. in ISDN) Demultiplexing: Direct traffic to the correct receiver (if many coexist) Both constitute the most basic service of the transport layer (a) Upward multiplexing. (b) Downward multiplexing.

Crash Recovery Client Server Strategy A P Strategy P A Reissue strategy APC AC(P) C(AP) PAC PC(A) C(PA) Always 2 1 1 2 2 1 Never 1 0 0 1 1 0 Only when ACKed 2 1 0 2 1 0 Only when not ACKed 1 0 1 1 2 1 Different combinations of client and server strategies in the presence of server crashes. P: Processing, C: Crash, A: ACK Server strategies: A P: Send ACK before processing P A: Send ACK after processing Thus: The number of executions of an operation depends on when the server crash has occurred.

The Internet Transport Protocol: UDP UDP (User Datagram Protocol): Almost IP New Multiplexing/Demultiplexing Some error checking Connectionless No handshaking: just blasts away packets without any initial formality No congestion control Unreliable: just like IP, a best-effort protocol Why use UDP then? No connection establishment time: more efficient if reliability is not a big issue E.g. DNS uses UDP for better response time but HTTP uses TCP since reliability is critical (in fact this renders WWW rather world-wide wait) No connection data (e.g. sequence numbers, buffers, congestion control parameter ) need to be stored in end systems maximum number of UDP clients is in general higher than TCP clients

Why UDP? (contd): UDP Smaller packet header: UDP: 8 bytes, TCP: at least 20 bytes Better for real-time applications: They require minimum data rate (in TCP they cannot control that because TCP waits for ACKs, delay them because of congestions, etc.) These applications tolerate some data loss They can enhance UDP service at will Examples of applications that typically use UDP: DNS: déjà vu NFS: for efficiency Internet telephony: need efficiency and tolerate some loss Multimedia applications: need efficiency and tolerate some loss Network management applications: because they should run even if network is congested (if reliability and congestion control are difficult to achieve) Some routing protocols: because they exchange messages periodically, so loss can be tolerated Database clients: for efficiency RPCs (small request/reply pairs for idempotent operations)

UDP Header: UDP Size: 8 bytes; Source/Destination ports: 2 bytes each (up to 65,535, 0..1023 are reserved), Total length: of datagram, Checksum: 1 s complement (see Chapter 3) Why redo error control (checksums) in transport layer? Because layer-2 error control applies only to links, and some links may not have error control at all, and UDP is an Internet protocol that has no restrictions on used links. UDP header.

Demultiplexing in UDP: UDP A receiver (socket) is identified by (ipaddress, portaddress) (e.g. (m3, x) see below) only Example: A B socket Other Receiver Receiver a b y x m1 m2 (m1, a, m3, x) (m2, b, m3, x) m3 Parts of UDP headers, both are demultiplexed to the correct receiver using the pair (m3, x) Receiver gets data from ANY client

The Internet Transport Protocol: TCP TCP (Transmission Control Protocol): Connection-oriented: 3-way handshake TCP Connection is NOT: Like TDM/FDM connection at layer 2 Nor like virtual circuits of layer 3 Why? Since only end systems (hosts) know about it (not hardware, routers) TCP connections are reliable (e.g. TCP detects lost packets, orders packets, ) TCP connections are full-duplex TCP connections are point-to-point (no multicasting is possible using TCP) TCP connections are byte-oriented (byte streams) E.g. client sends msg1 and msg2, server is able to read them as one message. TCP allocates buffers in sender/receiver hosts: Application data are first copied to the buffer and then grabbed by TCP to encapsulate them into segments that are sent down to the network layer (at receiver, TCP first copies data into buffer, and then delivers them to server).

TCP TCP Header: Size: >= 20 bytes Ports: each 2 bytes Checksum: like in UDP Sequence/Ack numbers: for reliable communication Window size: for flow control (# of bytes a receiver is willing to accept) Header Length: 4 bits (max. 15 words = 15x4 bytes = 60 bytes) ACK bit: indicates that ACK number is valid (this is an ACK) RST bit: reset connection SYN bit: synchronize sequence numbers FIN bit: tear down connection Options: e.g. if sender wants to negotiate max. segment with receiver, PSH bit: Receiver should pass (push) data to upper layer immediately (in general not used) URG bit: part of the data are urgent (where? urgent pointer) (in general not used )

Demultiplexing in TCP: TCP A receiver (socket) is identified by (ipaddress of sender, portaddress of sender, ipaddress of receiver, portaddress of receiver) (e.g. (m1, p, m3, x) see below). Example: A and B (on different machines) use same port number p. A B Other Receiver Receiver p p m1 m2 (m1, p, m3, x) (m2, p, m3, x) m3 Parts of TCP headers, both are demultiplexed to the correct connection using the 2 quadruples Receiver gets data from ONE client per connection

TCP Sequence and ACK numbers: Number of bytes (not of segments) Example: TCP Sender sends segments of 1000 bytes Sequence numbers: 0, 1000, 2000, ACK number is the next expected byte offset e.g. receiver gets segments 0 and 2000 only, it set ACK field to 1000 (missing one) Reliable data transfer in TCP: Recall IP does not guarantee data delivery, in-order delivery, nor integrity TCP guarantees that, if data are delivered (which is best-effort), then they are: in-order, without gap, without duplication, not corrupted TCP flow control and error recovery: Hybrid of Go-back-N and Selective Repeat based on sliding windows (see Chapter 3)

TCP Congestion Control: TCP Needed because IP provides no explicit feedback to end systems regarding congestion control (recall IP routers drop packets if congestion is detected) TCP assumes a congestion if it times out or it receives NAKs (in fact there are no NAKs, but a repeated ACK is considered a NAK) TCP congestion heuristics: Additive Increase Multiplicative Decrease (AIMD) If congested, rate is halved (but never below some threshold T) rate := max(t, rate/2) If relieved, rate increases by T rate := rate + T (T = Maximum segment size / estimated round trip delay) AIMD in dependence of time is (almost) a sawtooth curve Slow (or quick?) start: Initially, rate is set to T, but it increases exponentially after each round trip time. When losses occur (congestion), rate is decreased again. In reality, algorithm is slightly more complex. TCP distinguishes between the event timeout and the event NAK received and reacts on them differently.

Fairness: TCP TCP tries to divide available network bandwidth evenly among current connections using the network. However, the loophole is that applications can use parallel connections and have more share of the bandwidth. Web browsers use parallel connections to speed up communication TCP/UDP in wireless networks (term wireless TCP/UDP is misleading): In theory, transport layer protocols should be independent of the physical layer. However, TCP protocol implementations mostly assume that a timeout signalizes a congestion. They then slow down. Wireless networks are (still) very unreliable and may frequently loose packets (without congestion!). Thus, a timeout means that the sender should send the packet again and as soon as possible. In fact, we have here the opposite effect: the sender should speed up. In practice, problem is worse, since some parts of network may be wired and other parts wireless. In UDP, also the same problem, since in practice users expect UDP to be reliable (even if it is not). Unsatisfactory solutions exist (see book) T/TCP (Transactional TCP): TCP optimized for transaction processing (less messages for connection setup/release)

Some TCP-based Applications: TCP Port Protocol Use 21 FTP File transfer 23 Telnet Remote login 25 SMTP E-mail 69 TFTP Trivial File Transfer Protocol 79 Finger Lookup info about a user 80 HTTP World Wide Web 110 POP-3 Remote e-mail access 119 NNTP USENET news