Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 UDP, TCP (Part I) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute

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

Transmission Control Protocol (TCP)
Intermediate TCP/IP TCP Operation.
Transport Layer3-1 TCP. Transport Layer3-2 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection.
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
1 Transport Layer Lecture 9 Imran Ahmed University of Management & Technology.
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.
CS3505 The Internet and Info Hiway transport layer protocols : TCP/UDP.
Provides a reliable unicast end-to-end byte stream over an unreliable internetwork.
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):
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.
Computer Networks 2 Lecture 2 TCP – I - Transport Protocols: TCP Segments, Flow control and Connection Setup.
CSCI-1680 Transport Layer I Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Rodrigo Fonseca.
UNIT 07 Process – to – Process Delivery: UDP,TCP and SCTP
TCP© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer Science Department.
EEC-484/584 Computer Networks Lecture 15 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 UDP, TCP (Part I) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
CSE 461: Transport Layer Connections. Naming Processes/Services  Process here is an abstract term for your Web browser (HTTP), servers (SMTP),
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 TCP (Part III: Miscl) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1-1 TCP Shivkumar Kalyanaraman Rensselaer Polytechnic Institute
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 1 Transport Protocols.
1 Ch. 7 : Internet Transport Protocols. Transport Layer Our goals: r understand principles behind transport layer services: m Multiplexing / demultiplexing.
TCP. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 UDP, TCP (Part I) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute
1 ELEN 602 Lecture 15 More on IP TCP. 2 byte stream Send buffer segments Receive buffer byte stream Application ACKs Transmitter Receiver TCP Streams.
3-1 Transport services and protocols r provide logical communication between app processes running on different hosts r transport protocols run in end.
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Gursharan Singh Tatla Transport Layer 16-May
Process-to-Process Delivery:
CSCI-1680 Transport Layer I Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Rodrigo Fonseca.
1 Chapter Internetworking Part 4 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
1 Transport Layer Computer Networks. 2 Where are we?
1 Chapter Overview TCP/IP DoD model. 2 Network Layer Protocols Responsible for end-to-end communications on an internetwork Contrast with data-link 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.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 2.5 Internetworking Chapter 25 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
1 TCP: Reliable Transport Service. 2 Transmission Control Protocol (TCP) Major transport protocol used in Internet Heavily used Completely reliable transfer.
Computer Networks23-1 PART 5 Transport Layer. Computer Networks23-2 Position of Transport Layer Responsible for the delivery of a message from one process.
© Jörg Liebeherr (modified by Malathi Veeraraghavan) 1 Overview Formats, Data Transfer, etc. Connection Management.
1 End-to-End Protocols User Datagram Protocol (UDP) Transmission Control Protocol(TCP)
IP1 The Underlying Technologies. What is inside the Internet? Or What are the key underlying technologies that make it work so successfully? –Packet Switching.
UDP : User Datagram Protocol 백 일 우
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).
1 TCP ProtocolsLayer name DNSApplication TCP, UDPTransport IPInternet (Network ) WiFi, Ethernet Link (Physical)
Spring 2006 CPE : Transport Layer Overview2-1 Special Topics in Computer Engineering The Transport Layer in the Internet: Overview Some of these.
1 Transmission Control Protocol (TCP) RFC: Introduction The TCP is intended to provide a reliable process-to-process communication service in a.
Two Transport Protocols Available Transmission Control Protocol (TCP) User Datagram Protocol (UDP) Provides unreliable transfer Requires minimal – Overhead.
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)
Chapter 9: Transport Layer
Instructor Materials Chapter 9: Transport Layer
5. End-to-end protocols (part 1)
TCP.
PART 5 Transport Layer Computer Networks.
TCP - Part I Karim El Defrawy
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
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
Transport Protocols: TCP Segments, Flow control and Connection Setup
Process-to-Process Delivery: UDP, TCP
Transport Layer 9/22/2019.
Presentation transcript:

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 UDP, TCP (Part I) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 2 q UDP: connectionless, end-to-end service q UDP Servers, Interaction with ARP q TCP features, Header format q Connection Establishment q Connection Termination q TCP options q TCP Servers Ref: Chap 11, 17,18; RFC 793, 1323 Overview

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 3 User Datagram Protocol (UDP) q Connectionless end-to-end service q No flow control. No error recovery (no acks) q Provides port addressing q Error detection (Checksum) optional. Applies to pseudo-header (same as TCP) and UDP segment. If not used, it is set to zero. q Used by SNMP, DNS, TFTP etc Source Port Dest Port Check- sum Length 16 Size in bits16

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 4 More UDP q Port number: Used for (de)multiplexing. Client ports are ephemeral (short-lived). Server ports are “well known”. q UDP checksum similar to IP header checksum, but includes a pseudo-header (to help check source/destination). Fig 11.3 q UDP checksum optional, but RFC 1122/23 (host reqts) requires it to be enabled q Application message is simply encapsulated and sent to IP => can result in fragmentation. Newer systems use some path MTU discovery algorithms at the IP layer.

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 5 UDP effects q When UDP datagram fragments at the host, each fragment may generate an ARP request (results in an ARP reply: ARP flooding) q RFC 1122/23 limits max ARP rate to 1 request per second, and requires the ARP Q to be at least of size one q Datagram truncation possible at destination if dest app not prepared to handle that datagram size ! (note: TCP does not have this problem because it has no message boundaries) q UDP sources ignore source quench messages => can’t respond to packet losses.

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 6 UDP Servers q Client-Server architecture: basis for most distributed apps today (eg Web, telnet, ftp) q Most UDP servers are “iterative” => a single server process receives and handles incoming requests on a “well-known” port. q Can filter client requests based on incoming IP address, client IP address, incoming port address, or wild card filters q Port numbers may be reused, but packet is delivered to at most one end-point. q Queues to hold requests if server busy

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 7 TCP: Key features q Connection-oriented q Point-to-point: 2 end-points (no broadcast or multicast) q Reliable transfer: Data is delivered in-order q Full duplex communication q Byte-stream I/f: sequence of octets q Reliable startup: Data on old connection does not confuse new connections q Graceful shutdown: Data sent before closing a connection is not lost. Reset or immediate shutdown also possible.

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 8 Reliability q Reliability provided by: q Reliable connection startup: Data on old connection does not confuse new connections q Graceful connection shutdown: Data sent before closing a connection is not lost. q Data segmented for transmission and acknowledged by destination. Timeout + Retransmission provided if data unacknowledged q Checksum provided to catch errors. q Resequencing of out-of-order data; discarding of duplicate data. q Window flow control => sender cannot overrun receiver buffers

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 9 TCP Header Format Source Port Dest Port Seq No Ack No Header length ControlWindowResvd 4616 xySize in bits Check- sum UrgentOptionsPadData Also see fig: 17.2 in text

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 10 TCP Header q Source Port (16 bits): Identifies source user process 20 = FTP, 23 = Telnet, 53 = DNS, 80 = HTTP,... q Destination Port (16 bits) q Sequence Number (32 bits): Sequence number of the first byte in the segment. If SYN is present, this is the initial sequence number (ISN) and the first data byte is ISN+1. q Ack number (32 bits): Next byte expected

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 11 q Header length (4 bits): Number of 32-bit words in the header. 4 bits => max header size is 60 bytes q Reserved (6 bits) q Control (6 bits) q Window (16 bits): Will accept [Ack] to [Ack]+[window] ACKURGPSHRSTSYNFIN

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 12 TCP Header (Cont) q Checksum (16 bits): covers the segment + pseudo header. Protection from mis-delivery. q Urgent pointer (16 bits): Points to the byte following urgent data. Lets receiver know how much data it should deliver right away. q Options (variable): Max segment size (does not include TCP header, default 536 bytes), Window scale factor, Selective Ack permitted, Timestamp, No-Op, End-of-options

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 13 TCP Checksum q Checksum is the 16-bit one's complement of the one's complement sum of a pseudo header, the TCP header, and the data, (padded with zero octets at the end if necessary to make a multiple of two octets.) q Checksum field filled with zeros initially q Pseudo header (similar to UDP) used in calculations, but not transmitted. RFC Source AdrDest. AdrZerosProtocolTCP Length TCP Header TCP data

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 14 Connection Establishment q Fig 18.3 q Client sends SYN, with an initial sequence number (ISN) and a Max Segment Size (MSS). Called “active open”. q Server acks the SYN (for the forward connection), and also sets the SYN bit, with its own ISN (for the reverse connection). Called “passive open”. q Client acks the reverse direction SYN. q 3 segments transmitted.

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 15 Connection Termination q Fig 18.3 again, also fig 18.5 q Client sends FIN. Server acks this and notifies its application. However it can keep its half-connection open. Each connection closed separately. q Server app issues a “close” and server sends FIN to client. Client acks this. q 4 segments transmitted.

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 16 Three-Way Handshake q 3-way handshake: necessary and sufficient for unambiguous setup/teardown even under conditions of loss, duplication, and delay

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 17 More Connection Establishment q Socket: BSD term to denote an IP address + a port number. q A connection is fully specified by a socket pair i.e. the source IP address, source port, destination IP address, destination port. q Initial Sequence Number (ISN): counter maintained in OS. q BSD increments it by every 500ms or new connection setup => time to wrap around < 9.5 hours.

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 18 q SYN pkt lost => retransmitted. Exponential timeout backoff (6, 12, 24 s etc) Connection timeout is 75 s. q Timer granularity is 500 ms => first timeout between 5.5 and 6s. See Fig. 18.7

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 19 MSS q Largest “chunk” sent between TCPs. q Default = 536 bytes. q Announced in connection establishment. Not negotiated. q Different MSS possible for forward/reverse paths. q Does not include TCP header q Many BSD systems restrict MSS to be multiples of 512 bytes: inefficient. q Path MTU restricts size of MSS further.

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 20 Half close, Half open, Reset q Possible for one end to close while the other end sends data. Used in “rsh” command. Fig 18.10, q Half-open: one side crashed and lost memory of connection while other side thinks connection is open. Usually connection is reset upon communication. q Reset => used to abort connection. Queued data (if any) is dumped. q Orderly release => FIN sent after queued data transmitted.

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 21 TCP state transition diagram q Figure 18.12: client (dark line), server (dashed line) transitions. q 2MSL wait: wait for final segment to be transmitted before releasing connection (typically 2 min) q Socket pair cannot be reused during 2MSL q Delayed segments dropped q Conn Establishment: SYN_SENT, SYN_RCVD, ESTABLISHED, LISTEN q Close: FIN_WAIT_1, FIN_WAIT_2, CLOSING, TIME_WAIT, CLOSE_WAIT, LAST_ACK

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 22 Effect of 2MSL wait q Can’t kill server & restart immediately to use the same well known port (1-4 min!) q Reason: TCP cannot reallocate the socket pair (i.e. the connection) till 2MSL. q If you kill client and restart, it will get a different port q 2MSL wait protects against delayed segments from the previous “incarnation” of the connection. q If server crashes and reboots within 2 MSL wait, it is still safe because RFC 793 prevents having connections for 1 MSL after reboot.

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 23 Simultaneous open/close q Figs and q Simultaneous open is very rare. Requires same socket pair i.e. both the ports must be well known too. q Two simultaneous telnets (A to B and B to A) will not create this because client ports are not well- known. q Possible in long RTT cases q Requires 4 messages

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 24 TCP Servers q Most TCP servers are concurrent i.e. separate process to handle each client - for ease of connection management q Server listens to well-known port. q Socket pair distinguishes connections q A separate “endpoint” in the ESTABLISHED state is associated with each connection q One endpoint is used to listen (LISTEN state) for new connections

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 25 TCP Servers (Contd) q Endpoints in the ESTABLISHED state cannot receive SYN packets q Possible to wildcard or select specific interfaces (local IP addresses) to listen to. q Multiple connection requests => backlog queue of connections established but new process not yet created by server to handle it. q Queue full => send RESET to new connection requests

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 26 Summary q UDP is connectionless and simple. No flow/error control. q TCP provides reliable full-duplex connections. q TCP state diagram, 3-way handshake, Options q UDP and TCP servers