Chapter 2 Introduction Application Requirements VS. Transport Services IT 424 Networks2 Chapter 2 Introduction Application Requirements VS. Transport Services Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross
Overview Application Layer Architectures Process Communication Application Layer Requirements Overview Transport Layer Services Socket Programming
Learning Outcomes Describe the architectures for network applications 1 Describe the architectures for network applications 2 Differentiate between client-server and peer-to-peer architectures 3 Explain the concept of a process and the process addressing 4 Identify the application requirements in terms of delay, reliability and security 5 Select the suitable transport layer service based on application requirements 6 Use socket programming to create a network application
Overview Application Layer Architectures Process Communication Application Layer Requirements Overview Transport Layer Services Socket Programming
Protocol Layering and Data Application Layer Architectures Protocol Layering and Data source destination application transport network link physical application transport network link physical message M H t n l M H t n l segment datagram frame Each layer takes data from above Adds header information to create new data unit Passes new data unit to layer below
Some Network Applications Application Layer Architectures – Some Applications Application Layer: Some Network Applications Voice over IP (e.g., Skype) Real-time video conferencing Social networking Search … E-mail Web Text messaging Remote login P2P file sharing Multi-user network games Streaming stored video (YouTube, Hulu, Netflix)
Creating A Network Application Application Layer Architectures Creating A Network Application application transport network data link physical Write programs that: Run on (different) end systems Communicate over network E.g., web server software communicates with browser software No need to write software for network-core devices Network-core devices do not run user applications Applications on end systems allows for rapid application development, propagation application transport network data link physical application transport network data link physical
Application Architectures Application Layer Architectures Application Architectures Possible structure of applications: Client-server Peer-to-peer (P2P) Hybrid of client-server and P2P
Client-Server Architecture Application Layer Architectures – Client-Server Client-Server Architecture Server: Always-on host Permanent IP address Data centers for scaling client/server Clients: Communicate with server May be intermittently connected May have dynamic IP addresses Do not communicate directly with each other
P2P Architecture peer-peer No always-on server Application Layer Architectures – P2P P2P Architecture No always-on server Arbitrary end systems directly communicate Peers request service from other peers, provide service in return to other peers Self scalability – new peers bring new service capacity, as well as new service demands Peers are intermittently connected and change IP addresses Complex management Example: Gnutella Highly scalable But difficult to manage peer-peer
Hybrid of Client-Server and P2P Application Layer Architectures – A Hybrid Architecture Hybrid of Client-Server and P2P Skype Voice-over-IP P2P application Centralized server: Authentication - finding address of remote party Client-client connection: direct (not through server) Instant messaging Chatting between two users is P2P Presence detection/location centralized: User registers its IP address with central server when it comes online User contacts central server to find IP addresses of buddies
Overview Application Layer Architectures Process Communication Application Layer Requirements Overview Transport Layer Services Socket Programming
Process Communication client process: process that initiates communication server process: process that waits to be contacted clients, servers Process: program running within a host. Within same host, two processes communicate using inter-process communication (defined by OS) Processes in different hosts communicate by exchanging messages Aside: applications with P2P architectures have client processes & server processes
Addressing Processes To receive messages, process must have identifier Process Communication - Addressing Addressing Processes To receive messages, process must have identifier Host device has unique 32-bit IP address Identifier includes both IP address and port numbers associated with process on host. Example port numbers: HTTP server: 80 mail server: 25 To send HTTP message to gaia.cs.umass.edu web server: IP address: 128.119.245.12 port number: 80 Q: Does IP address of host on which process runs suffice for identifying the process? A: No, many processes can be running on same host
Overview Application Layer Architectures Process Communication Application Layer Requirements Overview Transport Layer Services Socket Programming
Application Layer Requirements Data integrity Some applications (e.g., file transfer, web transactions) require 100% reliable data transfer Other applications (e.g., audio) can tolerate some loss Throughput Some applications (e.g., multimedia) require minimum amount of throughput to be “effective” Other applications (“elastic applications”) make use of whatever throughput they get Security Encryption, data integrity, … Timing Some applications (e.g., Internet telephony, interactive games) require low delay to be “effective”
Requirements of Common Applications Application Layer Requirements Requirements of Common Applications Application Data loss Bandwidth Time Sensitive file transfer no loss elastic no e-mail Web documents real-time audio/video loss-tolerant audio: 5kbps-1Mbps video:10kbps-5Mbps yes, 100’s msec stored audio/video same as above yes, few secs interactive games few kbps up instant messaging yes and no These requirement should be fulfilled by the transport layer services. Calls to transport layer protocols are made through sockets.
Overview Application Layer Architectures Process Communication Application Layer Requirements Overview Transport Layer Services Socket Programming
Transport Layer Services TCP/IP Suite TCP
Internet Transport-Layer Services Reliable, in-order delivery : (TCP) Congestion control Flow control Connection setup Unreliable, unordered delivery: (UDP) No-frills extension of “best-effort” IP Services not available: Delay guarantees Bandwidth guarantees application transport network data link physical network data link physical network data link physical logical end-end transport network data link physical network data link physical network data link physical network data link physical application transport network data link physical
Internet Transport Protocols Services Transport Layer Services Internet Transport Protocols Services TCP service: in-order delivery between sending and receiving process Reliable transport between sending and receiving process Flow control: sender won’t overwhelm receiver Congestion control: throttle sender when network overloaded Connection-oriented: setup required between client and server processes Does not provide: timing, minimum throughput guarantee, security UDP service: unordered delivery between sending and receiving process Unreliable data transfer between sending and receiving process Does not provide: reliability, flow control, congestion control, timing, throughput guarantee, security, or connection setup,
Application, Transport Protocols Transport Layer Services Internet Apps: Application, Transport Protocols Application application layer protocol underlying transport protocol SMTP [RFC 2821] TCP Remote terminal access Telnet [RFC 854] Web HTTP [RFC 2616] File transfer FTP [RFC 959] Streaming multimedia HTTP (e.g., YouTube), TCP or UDP Internet telephony RTP [RFC 1889] SIP, RTP, proprietary (e.g., Skype)
Overview Application Layer Architectures Process Communication Application Layer Requirements Overview Transport Layer Services Socket Programming
Sockets socket Process sends/receives messages to/from its socket Socket Programming Sockets Internet controlled by OS controlled by app developer transport application physical link network process socket Process sends/receives messages to/from its socket Socket analogous to door Sending process shoves message out door Sending process relies on transport infrastructure on other side of door to deliver Message to socket at receiving process
Socket Programming socket Internet controlled by OS controlled by app developer transport application physical link network process socket Goal: learn how to build client/server applications that communicate using sockets Socket: door between application process and end-end-transport protocol
Socket Programming Two socket types for two transport services: UDP: Unreliable datagram TCP: Reliable, byte stream-oriented Application Example: Client reads a line of characters (data) from its keyboard and sends the data to the server. The server receives the data and converts characters to uppercase. The server sends the modified data to the client. The client receives the modified data and displays the line on its screen.
Conclusion Conclusion A network application consists of two or more processes running on different machines connected over a network A process is a program running within a host Port numbers are used in combined with host IP address to identify processes. Processes send and receive messages through sockets There are two main application architectures: client-server & peer to peer Application requirements are expressed in terms of integrity, timing, throughput & security Transport layer provides reliable service (TCP) and unreliable service (UDP) Transport layer doesn’t provide delay guarantee or security service
References References Computer Networking: A Top-Down Approach Featuring the Internet by James Kurose and Keith Ross, Addison Wesley, 2012 (chapter 2 ) Peer to Peer Architecture (RFC5694) Beej’s Guide to Network Programming Using Internet Sockets