220 likes | 348 Views
CS3505 The Internet and Info Hiway transport layer protocols : TCP/UDP. transport layer : purpose. provides and end-to-end (host to host) data transfer service to its “customers” : applications (e-mail, FTP, Telnet, HTTP, telephony)
E N D
CS3505 The Internet and Info Hiwaytransport layer protocols : TCP/UDP
transport layer : purpose • provides and end-to-end (host to host) data transfer service to its “customers” : applications (e-mail, FTP, Telnet, HTTP, telephony) • interface between network/internet (e.g., IP) and the applications --TCP and UDP are the major TPs in use today, and these operate over IP
TCP/IP internet ... TCP/IP IP IP WAN TCP/IP IP WAN IP TCP/IP
protocol hierarchy applications : email, FTP, Telnet, WWW TP: TCP or UDP IP/NW protocol network/internet
major Internet protocols • “TCP/IP protocol suite” (1) IP internet protocol (2) UDP - user datagram protocol (3) TCP - transmission control protocol -- 1 : network/internet layer -- 2,3 : transport layer
other major Internet protocols ARP, RARP, BOOTP - reconciling IP, LAN addresses DNS - domain name system SNMP - simple network mgt protocol FTP - file transfer protocol Telnet, Rlogin - remote terminal access
telnet, FTP, etc. apps TFTP, other apps. TCP UDP ICMP IP IGMP RARP ARP LAN/WAN media
UDP : user datagram protocol • basic function of UDP -- to provide a simple, fast, easy datagram service. (not connection-oriented, delivery not guaranteed) -interfaces between IP and the application
UDP : user datagram protocol -provides “bare bones” transport service -works as well as IP (best effort, no guarantees) -adds source and destination port number to packet and passes on to IP (multiplexing) -does NOT provide sequencing acknowledgments flow/congestion control
UDP packet format 0 15 31 destination port source port UDP checksum UDP length DATA
protocol and port numbers • Q1: how does IP know who to hand a datagram off to (UDP, TCP, or other) ? • Q2: how does UDP know who to hand the data to? • 0-1023 are “well-known port numbers”; others can be assigned on demand • the term “port” was a poor choice of terms
reliable, stream transport : TCP • basic function of TCP -- to provide reliable, connection-oriented data transfer service, between the local application (email, web, FTP, Telnet, etc) and the distant application. internet
reliable, stream transport : TCP 5 features characterize TCP protocol service : 1. stream orientation 2. virtual circuit connection 3. buffered transfer 4. unstructured stream 5. full duplex connection
TCP connection : pair of sockets internet TCP TCP 2075 21 240.32.66.9 131.120.1.60 (2075, 131.120.1.60) ---------------(21, 240.32.66.9)
TCP packet format destination port source port sequence number (sending) sequence number (acknowledgment) HLEN RES 6 flags window size TCP checksum urgent pointer options (if any) DATA
TCP fields, comments • Header: 20 bytes minimum • data : 216 - 20(IP header) - 20(TCP header) = 65495 bytes maximum • port - TCP customer; i.e., FTP, email, etc. • TCP customer may do further multiplexing (why?) • socket : TCP endpoint; a pair (host, port) of integers • TCP connection : a pair (S1,S2) of sockets
TCP fields - flags • URG - urgent pointer valid... if set, points to last byte of urgent data (implementations vary) • ACK - acknowledgment valid • PSH - push; pass to app quickly as possible • RST - reset the connection(close connection immediately, error) • SYN - synchronize sequence numbers to initialize a connection • FIN - finished sending data
more on TCP • opening connections - both sides must agree on parameters before data passed • connection establishment - 3 way handshake (SYN,SYN,ACK) • segments - one TCP packet • window size - variable, established when connection made • flow control • out of band data
TCP connection establishment • 3 way handshake (3 messages needed) 1. “client” sends a connect request (SYN); this contains (a) buffer space available (b) max incoming segment size (c) initial sequence number 2. “server” replies (SYN), same data. 3. “client” acks the SYN, begins sending data
TCP connection establishment client server syn syn ack
TCP data transfer • each side sends data within parameter limits (window, sequencing, acks) • two main classes of data : bulk and interactive • connection may remain open for considerable time (hours) • when each side has no more data to send, connection is closed
TCP connection termination • normal case - initiated by either side A : “finished, no more data to send” (FIN bit set) B : ack B : when done sending data, sets FIN bit A : acks • abnormal case - RST bit set, closes connection immediately