Some network apps ❒ E-mail ❒ Internet telephone Application Layer Overview and ❒ Web ❒ Real-time video conference ❒ Instant messaging Web/HTTP ❒ Massive parallel ❒ Remote login computing ❒ P2P file sharing ❒ Multi-user network games ❒ Streaming stored video clips 2: Application Layer 2: Application Layer 1 2 Creating a network app Application architectures Write programs that application ❒ Client-server transport network ❍ run on different end systems data link physical and ❒ Peer-to-peer (P2P) ❍ communicate over a network. ❒ Hybrid of client-server and P2P ❍ e.g., Web: Web server software communicates with browser software No software written for applicatin devices in network core transport transport network network data link ❍ Network core devices do not data link physical physical function at app layer ❍ This design allows for rapid app development 2: Application Layer 2: Application Layer 3 4 Client-server archicture Pure P2P architecture server: ❒ no always on server ❍ always-on host ❒ arbitrary end systems ❍ permanent IP address directly communicate ❍ server farms for scaling ❒ peers are intermittently clients: connected and change IP ❍ communicate with server addresses ❍ may be intermittently ❒ example: Gnutella connected ❍ may have dynamic IP addresses Highly scalable ❍ do not communicate But difficult to manage directly with each other Examples? 2: Application Layer 5 2: Application Layer 6 1
Hybrid of client-server and P2P Processes communicating Client process: process that Process: program running Napster initiates communication within a host. ❍ File transfer P2P Server process: process ❒ within same host, two that waits to be ❍ File search centralized: contacted processes communicate • Peers register content at central server using inter-process • Peers query same central server to locate content communication (defined Instant messaging by OS). ❒ Note: applications with ❍ Chatting between two users is P2P P2P architectures have ❒ processes in different ❍ Presence detection/location centralized: client processes & hosts communicate by • User registers its IP address with central server server processes exchanging messages when it comes online • User contacts central server to find IP addresses of buddies 2: Application Layer 2: Application Layer 7 8 Sockets Port Numbers ❒ process sends/receives host or host or server server messages to/from its socket Web Server Mail Server ❒ socket analogous to door controlled by app developer ❍ sending process shoves process process message out door socket socket Port = 80 ❍ sending process relies on Port = 25 TCP with TCP with transport infrastructure on Internet buffers, buffers, other side of door which variables variables brings message to socket at TCP receiving process controlled by OS ❒ API: (1) choice of transport protocol; (2) ability to IP = 138.110.1.1 fix a few parameters (lots more on this later) 2: Application Layer 2: Application Layer 9 10 App-layer protocol defines Applications and App-Layer Protocols ❒ Types of messages Public-domain protocols: UI exchanged, eg, request & ❒ defined in RFCs response messages ❒ allows for ❒ Syntax of message types: HTTP what fields in messages & interoperability Web Server how fields are delineated ❒ eg, HTTP, SMTP ❒ Semantics of the fields, Proprietary protocols: Web Browser ie, meaning of information in fields ❒ eg, KaZaA File HTTP … ❒ Rules for when and how Access processes send & respond to messages 2: Application Layer 11 2: Application Layer 12 2
What transport service does an app need? Transport service requirements of common apps Data loss Bandwidth ❒ some apps (e.g., audio) Time Sensitive Application Data loss Bandwidth ❒ some apps (e.g., can tolerate some loss no multimedia) require file transfer elastic no loss ❒ other apps (e.g., file no e-mail no loss elastic minimum amount of transfer, telnet) require no Web documents no loss elastic 100% reliable data bandwidth to be yes, 100’s msec real-time audio/video loss-tolerant audio: 5kbps-1Mbps transfer video:10kbps-5Mbps “effective” stored audio/video yes, few secs loss-tolerant same as above Timing ❒ other apps (“elastic interactive games yes, 100’s msec loss-tolerant few kbps up ❒ some apps (e.g., instant messaging yes and no no loss elastic apps”) make use of Internet telephony, whatever bandwidth interactive games) they get require low delay to be “effective” 2: Application Layer 2: Application Layer 13 14 Internet transport protocols services Internet apps: application, transport protocols UDP service: TCP service: Application Underlying ❒ unreliable data transfer ❒ connection-oriented: setup Application layer protocol transport protocol between sending and required between client and receiving process server processes e-mail SMTP [RFC 2821] TCP remote terminal access Telnet [RFC 854] TCP ❒ does not provide: ❒ reliable transport between Web HTTP [RFC 2616] TCP connection setup, sending and receiving process file transfer FTP [RFC 959] TCP reliability, flow control, ❒ flow control: sender won’t streaming multimedia proprietary TCP or UDP congestion control, overwhelm receiver (e.g. RealNetworks) timing, or bandwidth ❒ congestion control: throttle Internet telephony proprietary guarantee sender when network (e.g., Dialpad) typically UDP overloaded Q: why bother? Why is ❒ does not provide: timing, there a UDP? minimum bandwidth guarantees 2: Application Layer 2: Application Layer 15 16 Web and HTTP HTTP overview First some jargon HTTP: hypertext transfer protocol ❒ Web page consists of objects HTTP request Web’s application layer ❒ ❒ Object can be HTML file, JPEG image, Java protocol PC running HTTP response applet, audio file,… Explorer client/server model ❒ ❍ client: browser that ❒ Web page consists of base HTML-file which requests, receives, HTTP request includes several referenced objects “displays” Web objects HTTP response Server ❍ server: Web server sends running ❒ Each object is addressable by a URL objects in response to Apache Web requests server ❒ Example URL: HTTP 1.0: RFC 1945 www.someschool.edu/someDept/pic.gif ❒ Mac running HTTP 1.1: RFC 2068 ❒ Navigator path name host name 2: Application Layer 17 2: Application Layer 18 3
HTTP overview (continued) HTTP PC running HTTP is “stateless” Uses TCP: Explorer ❒ server maintains no ❒ client initiates TCP connection (creates socket) information about T C P O p e n ? to server, port 80 past client requests O K aside ❒ server accepts TCP Protocols that maintain “state” H connection from client T T P G E are complex! T … ❒ HTTP messages (application- past history (state) must be ❒ a t a D layer protocol messages) maintained o s e P C l exchanged between browser T C if server/client crashes, ❒ (HTTP client) and Web their views of “state” may be server (HTTP server) inconsistent, must be reconciled ❒ TCP connection closed 2: Application Layer 2: Application Layer 19 20 HTTP connections Nonpersistent HTTP T C P O p e n ? Nonpersistent HTTP Persistent HTTP O K ❒ At most one object is ❒ Multiple objects can H T T P G E T sent over a TCP be sent over single i n d e x . h t m connection. TCP connection t a D a between client and o s e P C l ❒ HTTP/1.0 uses T C server. nonpersistent HTTP T C P O p e n ? ❒ HTTP/1.1 uses O K persistent H T T P connections in default G E T s a m i . j p g mode t a D a s e P C l o T C 2: Application Layer 2: Application Layer 21 22 Response time modeling Persistent HTTP Persistent without pipelining: Nonpersistent HTTP issues: Definition of RRT: time to send ❒ client issues new request ❒ requires 2 RTTs per object a small packet to travel from only when previous ❒ OS must work and allocate client to server and back. response has been received host resources for each Response time: initiate TCP TCP connection ❒ one RTT for each connection ❒ one RTT to initiate TCP referenced object ❒ but browsers often open RTT connection Persistent with pipelining: parallel TCP connections to request ❒ one RTT for HTTP request file fetch referenced objects ❒ default in HTTP/1.1 time to and first few bytes of HTTP RTT Persistent HTTP transmit ❒ client sends requests as response to return file ❒ server leaves connection soon as it encounters a file ❒ file transmission time referenced object received open after sending response total = 2RTT+transmit time ❒ as little as one RTT for all ❒ subsequent HTTP messages time time between same client/server the referenced objects are sent over connection 2: Application Layer 23 2: Application Layer 24 4
Recommend
More recommend