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.

Slides:



Advertisements
Similar presentations
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Advertisements

CCNA – Network Fundamentals
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 OSI Transport Layer Network Fundamentals – Chapter 4.
Transport Layer – TCP (Part2) Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
Transmission Control Protocol (TCP)
Intermediate TCP/IP TCP Operation.
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
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.
The Internet Transport Protocols – TCP and UDP
CS3505 The Internet and Info Hiway transport layer protocols : TCP/UDP.
BZUPAGES.COM 1 User Datagram Protocol - UDP RFC 768, Protocol 17 Provides unreliable, connectionless on top of IP Minimal overhead, high performance –No.
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):
Computer Networks 2 Lecture 2 TCP – I - Transport Protocols: TCP Segments, Flow control and Connection Setup.
Copyright 1999, S.D. Personick. All Rights Reserved. Telecommunications Networking II Lecture 32 Transmission Control Protocol (TCP) Ref: Tanenbaum pp:
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 80N - Introduction to Networks and the Internet 1 CMPE 80N Spring 2003 Week 8 Introduction to Networks and the Internet.
William Stallings Data and Computer Communications 7 th Edition (Selected slides used for lectures at Bina Nusantara University) Transport Layer.
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
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
What Can IP Do? Deliver datagrams to hosts – The IP address in a datagram header identify a host IP treats a computer as an endpoint of communication Best.
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?
1 Semester 2 Module 10 Intermediate TCP/IP Yuda college of business James Chen
6.1. Transport Control Protocol (TCP) It is the most widely used transport protocol in the world. Provides reliable end to end connection between two hosts.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
TCP Lecture 13 November 13, TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 2.5 Internetworking Chapter 25 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
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.
1 Introduction to Computer Networks University of ilam Dr. Mozafar Bag-Mohammadi Transport Layer.
CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
1 TCP: Reliable Transport Service. 2 Transmission Control Protocol (TCP) Major transport protocol used in Internet Heavily used Completely reliable transfer.
Networking Basics CCNA 1 Chapter 11.
Institute of Technology Sligo - Dept of Computing Chapter 12 The Transport Layer.
4343 X2 – The Transport Layer Tanenbaum Ch.6.
IP1 The Underlying Technologies. What is inside the Internet? Or What are the key underlying technologies that make it work so successfully? –Packet Switching.
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.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
11 CS716 Advanced Computer Networks By Dr. Amir Qayyum.
1 TCP ProtocolsLayer name DNSApplication TCP, UDPTransport IPInternet (Network ) WiFi, Ethernet Link (Physical)
3. END-TO-END PROTOCOLS (PART 1) Rocky K. C. Chang Department of Computing The Hong Kong Polytechnic University 22 March
1 Chapter 24 Internetworking Part 4 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
The Transport Layer Implementation Services Functions Protocols
Fast Retransmit For sliding windows flow control we waited for a timer to expire before beginning retransmission of a packet TCP uses an additional mechanism.
5. End-to-end protocols (part 1)
Process-to-Process Delivery, TCP and UDP protocols
Process-to-Process Delivery
TCP.
Magda El Zarki Professor, ICS UC, Irvine
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:
PART V Transport Layer.
PART 5 Transport Layer.
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Transport Protocols: TCP Segments, Flow control and Connection Setup
Introduction to Computer Networks
Lecture 21 and 22 5/29/2019.
Transport Protocols: TCP Segments, Flow control and Connection Setup
Process-to-Process Delivery: UDP, TCP
Transport Layer 9/22/2019.
Presentation transcript:

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 17 ¥Next Lecture »Socket programming »Source: chapter 17

TELE202 Lecture 14 TCP/UDP (2) 2 Lecturer Dr Z. Huang Flow Control ¥Transport protocols resemble the data link protocols »Flow control, error control, sequencing »A sliding window is used for flow control ¥Differences »A router usually has only a few links to others, while a transport entity may have numerous connections »This difference makes it impractical to implement data link buffering strategy in the transport layer »The receiver may not dedicate specific buffers to specific connections ¥Dynamic buffer management: credit mechanism »Initially, the sender requests a certain number of buffers (credit), based on its perceived needs »The receiver then grants as many of these as it can afford »Every time the sender transmits a TPDU, it must decrease its allocation (credit), stopping altogether when the allocation (credit) reaches zero »The receiver then separately piggybacks both acknowledgments and buffer allocations (credit) onto reverse traffic

TELE202 Lecture 14 TCP/UDP (2) 3 Lecturer Dr Z. Huang Flow Control ¥Example: credit mechanism »We assume that when connection is established, entities A and B have initial sequence numbers 100 and 700 respectively, and each entity agree to buffer up to 200 bytes »Entities send 100 bytes in each TPDU »Entity A starts by sending two TPDUs and then wait for more credit because it has used up its credit »At time t2, B removes the first received TPDU from the buffer and also find 100 more bytes of buffer space; so B now has 200 bytes space available and tell A in the credit field of a TPDU »After A receives the 200 bytes credit, it can send two TPDUs again

TELE202 Lecture 14 TCP/UDP (2) 4 Lecturer Dr Z. Huang Error detection ¥Why is there error detection in the transport layer? »Reliable transmission along each link is still no guarantee of error-free transmission between the source and the destination ¥Example »Consider the router in the following figure »Suppose the router receives the IP packet intact, but an error that affects the packet’s contents occurs during reformatting of the frame containing the packet. »Since the checksum is calculated after the new frame is created it includes the erroneous data »It is not a transmission error. Instead, it is an error in the processing of packets »A transport-layer error detection mechanism would detect this error

TELE202 Lecture 14 TCP/UDP (2) 5 Lecturer Dr Z. Huang Transmission Control Protocol ¥TCP is a transport layer protocol »Provide a reliable end-to-end byte stream over an unreliable internetwork such as IP »Provide connection oriented user-to-user service: connection management ¥TCP connection »TCP connections are full duplex and point-to- point »A TCP connection is a byte stream, not a message stream »TCP does not support multicasting or broadcasting

TELE202 Lecture 14 TCP/UDP (2) 6 Lecturer Dr Z. Huang TCP ¥TCP operation »Each machine supporting TCP has a TCP entity, either a user process or part of the OS kernel that manages TCP streams and interfaces to the IP layer »A TCP entity accepts user data streams from local processes, breaks them up into pieces not exceeding 64K bytes, puts each of them into a TCP segment which is put into the payload of an IP packet, which is then transmitted by IP network protocol »When IP packets containing TCP segment arrive at a machine, they are given to the TCP entity, which reconstructs the original byte stream

TELE202 Lecture 14 TCP/UDP (2) 7 Lecturer Dr Z. Huang TCP ¥TCP/UDP service is obtained by having both the sender and receiver create end points, called sockets ¥Each socket is associated with »the IP address of the host »16-bit number local to the host, called port ¥Port number allocation »0 - not used »1-255, reserved ports for well known services » , other reserved ports » , user-defined server ports »Check generally used ports in /etc/services in UNIX environment ¥Well-known ports »FTP - 21, Telnet - 23, SMTP ( ) - 25, HTTP - 80, POP - 110, DNS - 53, BOOTP - 67

TELE202 Lecture 14 TCP/UDP (2) 8 Lecturer Dr Z. Huang TCP ¥Flow and error control »The basic protocol used by TCP entities is the sliding window protocol, which deals with the following issues »Error and flow control: timeout, retransmission, and acknowledgment »Byte stream order preservation »Congestion control: dynamic adjustment of window size according to delay of acknowledgment ¥TCP packets are called segments »A segment consists of a fixed 20-byte header (plus an optional part) followed by zero or more data bytes »Size of the segment is restricted by –65,536 (64K) bytes of the IP payload –MTU of the network

TELE202 Lecture 14 TCP/UDP (2) 9 Lecturer Dr Z. Huang TCP Segment ¥Destination port (16 bits) »Identifies the application to which the segment is sent. ¥Source port (16 bits) »Specifies the application sending the segment. ¥Sequence number (32 bits) »Contains the sequence number of the first byte of data. TCP numbers bytes not frames. ¥Acknowledgment number (32 bits) »Contains the byte sequence number the receiving TCP entity expects to receive next. ¥Header length (4 bits) »Specifies the size of the TCP header ¥Flags (6 bits): determine the purpose and content of the segment »Each bit from left to right represents the following meaning if it is set to 1 –URG: Urgent pointer field is valid –ACK: Ack field is valid –PSH: segment requests a push (segment should be sent to user immediately) –RST: Reset the connection –SYN: synchronise to set up a connection –FIN: indicate the last segment

TELE202 Lecture 14 TCP/UDP (2) 10 Lecturer Dr Z. Huang TCP Segment ¥Window (16 bits) »Tells the receiving TCP entity how many data bytes the sending TCP entity can accept in return ¥Checksum (16 bits) »used for transport layer error detection ¥Urgent pointer (16 bits) »Signal the receiver to deliver the data to the higher layer as quickly as possible ¥Options/padding: maximum segment size ¥Sliding window buffer »When ack sequence number and window size are received from the receiver, the sender has to adjust its window start pointer and window size.

TELE202 Lecture 14 TCP/UDP (2) 11 Lecturer Dr Z. Huang TCP in action ¥Before data is transferred, a connection must be opened »A server does passive open (listen) »A client does active open (connect) ¥TCP has three phases »Connection setup »Data transmission »Connection close ¥Connection establishment »Uses three-way handshake protocol »Ensures both ends are ready and starting sequence numbers are exchanged

TELE202 Lecture 14 TCP/UDP (2) 12 Lecturer Dr Z. Huang TCP in action ¥Data transmission »Use a simple example of Telnet, in which host B echoes back each received character ¥Connection close »Uses three-way handshake protocol

TELE202 Lecture 14 TCP/UDP (2) 13 Lecturer Dr Z. Huang TCP timers ¥Retransmission timer »Used to retransmit data if no ack is received within a period ¥Persist timer »Keeps window size info flowing »A window size info may get lost »A timer is set (500ms) at one end to ask for a new window update from the other end ¥Keep alive timer »Detect idle connection due to crash or reboot »Periodically send TCP segment to confirm the connection »If no ack after a number of retries, the connection is reset. ¥2MSL:2 Maximum Segment Lifetime »Maximum Segment Lifetime is the maximum time an old segment can remain alive in an Internet »This timer is used to keep a connection alive for a period to avoid problems incurred with unreliable delivery ¥Delayed ack timer »Ack is not sent immediately after receiving data »Most implementations use a 200ms delay

TELE202 Lecture 14 TCP/UDP (2) 14 Lecturer Dr Z. Huang Congestion control ¥Congestion due to »Faster LAN to slower WAN »Multiple input to a router with limited capacity ¥Dropping packets may cause worse situation ¥Congestion can be indicated by the number of lost packets »Lost packets may be caused by damage or congestion »However, the percentage of lost packets caused by damage is very small (<1%) ¥Solution: Jacobson’s algorithm »Slow start –Set the initial window size as one segment –Double the window size each time an ack is received within a time period until it reaches the window size limit –If an ack is delayed, perform congestion avoidance algorithm »Congestion avoidance –Each time an ack is delayed or data get lost, the window size is reduced to half

TELE202 Lecture 14 TCP/UDP (2) 15 Lecturer Dr Z. Huang UDP ¥User Datagram Protocol »Connectionless transport service »Much less complex, but unreliable »Simple interface between IP and higher layer protocols »Allows applications to send encapsulated datagrams without having to establish a connection »Useful in many client/server applications that have one request and one response ¥UDP header »source port: 16 bits »destination port: 16 bits »UDP length: 16 bits »UDP checksum: 16 bits

TELE202 Lecture 14 TCP/UDP (2) 16 Lecturer Dr Z. Huang Summary ¥Flow control in transport layer ¥Error control in transport layer ¥Transmission Control Protocol(TCP) »TCP connection »TCP operation »Socket »Port number »Flow&error control »Congestion control »Format of TCP segments »TCP timers ¥User Datagram Protocol »Format of UDP datagram »Connectionless service »Error detection