Lectured by: Nguyễn Lê Duy Lai 2/14/2011HCM City University of Technology1.

Slides:



Advertisements
Similar presentations
Umut Girit  One of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer.
Advertisements

Chapter 6 The Transport Layer.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 The Transport Layer Chapter
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Chapter 6 Transport Layer.
Chapter 6 The Transport Layer.
CCNA – Network Fundamentals
Transmission Control Protocol (TCP)
Intermediate TCP/IP TCP Operation.
TELE202 Lecture 13 TCP/UDP (1) 1 Lecturer Dr Z. Huang Overview ¥This Lecture »Internet Protocols (4) »Source: chapter 15 ¥This Lecture »TCP/UDP (1) »Source:
Guide to TCP/IP, Third Edition
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.
Transport Layer – TCP (Part1) Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
Chapter 7 – Transport Layer Protocols
EECC694 - Shaaban #1 lec #12 Spring Internet Transport Protocols Transmission Control Protocol (TCP):Transmission Control Protocol (TCP):
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.
Copyright 1999, S.D. Personick. All Rights Reserved. Telecommunications Networking II Lecture 32 Transmission Control Protocol (TCP) Ref: Tanenbaum pp:
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 OSI Transport Layer Network Fundamentals – Chapter 4.
EEC-484/584 Computer Networks Lecture 15 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks.
The Transport Layer Chapter 6. The Transport Service Services Provided to the Upper Layers Transport Service Primitives Berkeley Sockets An Example of.
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
CMPE 80N - Introduction to Networks and the Internet 1 CMPE 80N Spring 2003 Week 8 Introduction to Networks and the Internet.
The Transport Layer Chapter 6. The Transport Service Services Provided to the Upper Layers Transport Service Primitives Berkeley Sockets An Example of.
William Stallings Data and Computer Communications 7 th Edition (Selected slides used for lectures at Bina Nusantara University) Transport Layer.
The OSI Reference Model
Computer Networks Transport Layer. Topics F Introduction  F Connection Issues F TCP.
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 1 Transport Protocols.
TCP. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
WXES2106 Network Technology Semester /2005 Chapter 8 Intermediate TCP CCNA2: Module 10.
Gursharan Singh Tatla Transport Layer 16-May
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.
1 Transport Layer Computer Networks. 2 Where are we?
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 The Transport Layer Chapter 6.
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.
Chapter 6 The Transport Layer.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
SMUCSE 4344 transport layer. SMUCSE 4344 transport layer end-to-end protocols –transport code runs only on endpoint hosts encapsulates network communications.
Section 5: The Transport Layer. 5.2 CS Computer Networks John Mc Donald, Dept. of Computer Science, NUI Maynooth. Introduction In the previous section.
The Transport Layer.
ECE453 – Introduction to Computer Networks Lecture 14 – Transport Layer (I)
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 26.
Copyright 2002, S.D. Personick. All Rights Reserved.1 Telecommunications Networking II Topic 20 Transmission Control Protocol (TCP) Ref: Tanenbaum pp:
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
Fall 2005 By: H. Veisi Computer networks course Olum-fonoon Babol Chapter 6 The Transport Layer.
(from Tanenabaum: “Computer Networks” Chapter 1) and
The Transport Layer Chapter 6 12/14/2015www.ishuchita.com1.
Computer Networks23-1 PART 5 Transport Layer. Computer Networks23-2 Position of Transport Layer Responsible for the delivery of a message from one process.
4343 X2 – The Transport Layer Tanenbaum Ch.6.
Data Communications and Networks Chapter 6 – IP, UDP and TCP ICT-BVF8.1- Data Communications and Network Trainer: Dr. Abbes Sebihi.
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Agenda Socket Programming The OSI reference Model The OSI protocol stack Sockets Ports Java classes for sockets Input stream and.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
Computer Networks 1000-Transport layer, TCP Gergely Windisch v spring.
Process-to-Process Delivery:
The Transport Layer Dr. ir. S.S. Msanjila RIS 251.
3. END-TO-END PROTOCOLS (PART 1) Rocky K. C. Chang Department of Computing The Hong Kong Polytechnic University 22 March
The Transport Layer Implementation Services Functions Protocols
Unit-7 The Transport Layer.
5. End-to-end protocols (part 1)
Transport Layer Unit 5.
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Process-to-Process Delivery:
The Transport Layer Chapter 6.
Process-to-Process Delivery: UDP, TCP
Transport Layer 9/22/2019.
Presentation transcript:

Lectured by: Nguyễn Lê Duy Lai 2/14/2011HCM City University of Technology1

Reference: Chapter 6 - “Computer Networks”, Andrew S. Tanenbaum, 4th Edition, Prentice Hall, /14/2011HCM City University of Technology2

The Transport Services Elements of Transport Protocols A Simple Transport Protocol The Internet Transport Protocols: UDP The Internet Transport Protocols: TCP Performance issues 2/14/2011HCM City University of Technology3

Transport Layer task is to provide reliable, cost-effective data transport from the source machine to the destination machine, independently of the physical network or networks currently in use Services Provided to the Upper Layers Transport Service Primitives Berkeley Sockets An Example of Socket Programming: An Internet File Server 2/14/2011HCM City University of Technology4

The network, transport, and application layers 2/14/20115HCM City University of Technology

The connection-oriented transport service, connections have three phases: establishment, data transfer, and release The connectionless transport service Why are there two distinct layers? The transport code runs entirely on the users' machines The network layer mostly runs on the routers (which are operated by the carrier) 2/14/2011HCM City University of Technology6

The transport layer must provide some operations to application programs Each transport service has its own interface The primitives for a simple transport service 2/14/20117HCM City University of Technology

TPDU (Transport Protocol Data Unit): messages sent from transport entity to transport entity The nesting of TPDUs, packets, and frames 2/14/20118HCM City University of Technology

A state diagram for a simple connection management scheme: Italics: packet arrivals Solid lines: client's state sequence Dashed lines: server's state sequence. 2/14/20119HCM City University of Technology

The socket primitives used in Berkeley UNIXfor TCP (Internet programming) 2/14/201110HCM City University of Technology

Server code can be compiled and run on any UNIX system connected to the Internet Client code can then be compiled and run on any other UNIX machine SERVER_PORT BUF_SIZE Server: setsockopt, bind, listen, accept, send, receive, close Client: socket, connect, send, receive, close 2/14/2011HCM City University of Technology11

Addressing Connection Establishment Connection Release Flow Control and Buffering Multiplexing Crash Recovery 2/14/2011HCM City University of Technology12

Transport protocols resemble the data link protocols? Yes: Dealing with error control, sequencing, and flow control, among other issues No: dissimilarities between the environments in which the two protocols operate (physical channel and the entire subnet) Potential existence of storage capacity in the subnet Buffering and flow control 2/14/2011HCM City University of Technology13

Application addresses on a host: Ports TSAPs, NSAPs and transport connections 2/14/201114HCM City University of Technology

2/14/2011HCM City University of Technology15

Three-way handshake (a) Normal operation. (b) Old CONNECTION REQUEST appearing out of nowhere. (c) Duplicate CONNECTION REQUEST and duplicate ACK 2/14/201116HCM City University of Technology

The problem occurs when the network can lose, store, and duplicate packets The existence of delayed duplicates A machine losing all memory Guarantee not only that a packet is dead, but also that all acknowledgements to it are also dead 2/14/2011HCM City University of Technology17

Asymmetric release is the way the telephone system works Abrupt disconnection with loss of data 2/14/201118HCM City University of Technology

Symmetric release treats the connection as two separate unidirectional connections and requires each one to be released separately A host can continue to receive data even after it has sent a DISCONNECT TPDU Avoiding data loss Determining that all the work has been done and the connection should be terminated is not so obvious 2/14/2011HCM City University of Technology19

If either blue army attacks by itself, it will be defeated, but if the two blue armies attack simultaneously, they will be victorious In fact, it can be proven that no protocol exists that works 2/14/201120HCM City University of Technology

(a) Normal case of a three-way handshake (b) final ACK lost 2/14/2011HCM City University of Technology21

(c) Response lost. (d) Response lost and subsequent DRs lost 2/14/201122HCM City University of Technology

If the network service is unreliable, the sender must buffer all TPDUs sent, just as in the data link layer The receiver may maintain a single buffer pool shared by all connections When a TPDU comes in, an attempt is made to dynamically acquire a new buffer Flow control mechanism must be applied at the sender to prevent it from having too many unacknowledged TPDUs outstanding at once Sliding window flow control scheme in which the sender dynamically adjusts the window size to match the network's carrying capacity 2/14/2011HCM City University of Technology23

UDP – User Datagram Protocol Connection-less service Useful in client-server situations: Remote Procedure Call, real-time AV streaming TCP – Transmission Control Protocol Connection-oriented service Reliable byte stream services over unreliable network Most widely used in Internet 2/14/2011HCM City University of Technology24

UDP transmits segments consisting of an 8-byte header followed by the payload Two ports serve to identify the end points within the source and destination machines 2/14/201125HCM City University of Technology

Source port is primarily needed when a reply must be sent back to the source When a UDP segment arrives, its payload is handed to the process attached to the destination port The UDP length field includes the 8-byte header and the data The UDP checksum is optional and stored as 0 if not computed 2/14/2011HCM City University of Technology26

Does: Providing an interface to the IP protocol Demultiplexing multiple processes using the ports Does Not: Flow control Error control Retransmission upon receipt of a bad segment 2/14/2011HCM City University of Technology27

Trying to arrange request-reply interactions on networks to be cast in the form of procedure calls Allowing programs to call procedures located on remote hosts Information can be transported from the caller to the callee in the parameters and can come back in the procedure result 2/14/201128HCM City University of Technology

Step 1: Client calling the client stub with the parameters pushed onto the stack Step 2: Client stub packing the parameters into a message and making a system call to send the message (marshaling) Step 3: Kernel sending the message from the client machine to the server machine Step 4: Kernel passing the incoming packet to the server stub Step 5: Server stub calling the server procedure with the unmarshaled parameters 2/14/2011HCM City University of Technology29

Internet radio, Internet telephony, music- on-demand, videoconferencing, video-on- demand, and other multimedia applications 2/14/201130HCM City University of Technology

An internetwork differs from a single network: different topologies, bandwidths, delays, packet sizes, and other parameters TCP was specifically designed to provide a reliable end-to-end byte stream over an unreliable internetwork TCP transport entity, either a library procedure, a user process, or part of the kernel TCP breaks user data stream up into pieces not exceeding 64 KB (in practice, 1460 data bytes) 2/14/2011HCM City University of Technology31

Sender and receiver need to create connection end-points first, called sockets Each socket is addressed by the host IP address (32 bits) and a port number (16 bits) A TCP connection must be explicitly established between sockets Port numbers < 1024 are reserved (well-known ports) TCP connections are full-duplex and point-to- point Push and urgent data 2/14/2011HCM City University of Technology32

A single daemon, called inetd (Internet daemon) in UNIX, attach itself to multiple ports When first incoming connection, inetd forks off a new process and executes the appropriate daemon in it, letting that daemon handle the request Inetd learns which ports it is to use from a configuration file The system administrator can set up the system to have permanent daemons 2/14/2011HCM City University of Technology33

The sending and receiving TCP entities exchange data in the form of segments Two limits restrict the segment size: 65,515-byte IP payload Maximum transfer unit (MTU): 1500 bytes Basic protocol used by TCP entities is the sliding window Segments can arrive out of order, delayed, timed out Each byte in the stream has its own unique offset 2/14/2011HCM City University of Technology34

2/14/2011HCM City University of Technology35

Source port and Destination port: identify the local end points of the connection Sequence number: every byte of data is numbered in a TCP stream Acknowledgement number: specifies the next byte expected TCP header length: tells how many 32-bit words are contained in the TCP header URG bit: is set to 1 if the Urgent pointer is in use ACK bit: is set to 1 to indicate that the Acknowledgement number is valid PSH bit: indicates PUSHed data 2/14/2011HCM City University of Technology36

RST bit: is used to reset a connection SYN bit: is used to establish connections FIN bit: is used to release a connection Window size: field tells how many bytes may be sent starting at the byte acknowledged Checksum field: checksums the header, the data, and the conceptual pseudoheader Options: provides a way to add extra facilities 2/14/2011HCM City University of Technology37

(a) TCP connection establishment in the normal case. (b) Call collision. 2/14/201138HCM City University of Technology

Each simplex connection is released independently Either party can send a TCP segment with the FIN bit set To avoid the two-army problem, timers are used If a response to a FIN is not forthcoming within two maximum packet lifetimes, the sender of the FIN releases the connection 2/14/2011HCM City University of Technology39

2/14/2011HCM City University of Technology40

2/14/2011HCM City University of Technology41

TCP attempts to achieve this goal by dynamically manipulating the window size Detecting congestion was difficult Two potential problems exist: network capacity and receiver capacity Each sender maintains two windows: negotiated window, and congestion window Slow start: test the size of congestion window 2/14/2011HCM City University of Technology42

2/14/2011HCM City University of Technology43

Client operations Identify server IP and port Create UDP socket Send/receive data to server Close socket Server operations Create socket and register with the system Read client messages and respond to client 2/14/2011HCM City University of Technology44

2/14/2011HCM City University of Technology45

Client operations Identify server IP and port Create UDP socket Setup connection to server Send/receive data Close connection 2/14/2011HCM City University of Technology46

Server operations Create and register socket Listen and wait for incoming connections Accept connection Send/receive data Close connection 2/14/2011HCM City University of Technology47

C oncurrent server operations Create and register socket Listen and wait for incoming connections Accept connection and spawn new thread to handle the connection Listen and wait for new connection Thread operations Send/receive data through connection Close connection 2/14/2011HCM City University of Technology48

2/14/2011HCM City University of Technology49

InetAddress ServerSocket Socket URL URLConnection DatagramSocket 2/14/2011HCM City University of Technology50

Class used for internet addresses (Internet Protocol) Use methods: getLocalHost, getByName, or getAllByName to create an InetAddress instance: public static InetAddess InetAddress.getByName(String hostname) public static InetAddess [] InetAddress.getAllByName(String hostname) public static InetAddess InetAddress.getLocalHost() To get the host IP address or host name: getHostAddress() getHostName() 2/14/2011HCM City University of Technology51

To describe a socket To create a socket Socket(InetAddress address, int port) Socket(String host, int port) Socket(InetAddress address, int port, InetAddress, localAddr, int localPort) Socket(String host, int port, InetAddress, localAddr, int localPort) Socket() 2/14/2011HCM City University of Technology52

Get socket information InetAddress getInetAddress() int getPort() InetAddress getLocalAddress() int getLocalPort() Using output and input Streams public OutputStream getOutputStream() throws IOException public InputStream getInputStream() throws IOException 2/14/2011HCM City University of Technology53

Used for a server side socket Create a ServerSocket ServerSocket(int port) throws IOException ServerSocket(int port, int backlog) throws IOException ServerSocket(int port, int backlog, InetAddress bindAddr) throws IOException 2/14/2011HCM City University of Technology54

Socket accept() throws IOException. void close() throws IOException InetAddress getInetAddress() int getLocalPort() void setSoTimeout(int timeout) throws SocketException 2/14/2011HCM City University of Technology55