P a g e | 1 | CN Module 1 MODULE 1: APPLICATION LAYER 1.1 Principles of Network Applications 1.1.1 Network Application Architectures 184.108.40.206 Client Server Architecture 220.127.116.11.1 Data Center 18.104.22.168 P2P Architecture 1.1.2 Processes Communicating 22.214.171.124 Process 126.96.36.199.1 Client & Server Processes 188.8.131.52.2 Interface between the Process and the Computer Network Socket 184.108.40.206.3 Addressing Processes 1.1.3 Transport Services Available to Applications 220.127.116.11 Reliable Data Transfer 18.104.22.168 Throughput 22.214.171.124 Timing 126.96.36.199 Security 1.1.4 Transport Services Provided by the Internet 188.8.131.52 TCP Services 184.108.40.206 UDP Services 1.2 The Web & HTTP 1.2.1 Overview of HTTP 220.127.116.11 Web 18.104.22.168 HTTP 1.2.2 Non-Persistent & Persistent Connections 22.214.171.124 HTTP with Non-Persistent Connections 126.96.36.199 HTTP with Persistent Connections 1.2.3 HTTP Message Format 188.8.131.52 HTTP Request Message 184.108.40.206 HTTP Response Message 1.2.4 User-Server Interaction: Cookies 1.2.5 Web Caching 1.2.6 The Conditional GET 1.3 File Transfer: FTP 1.3.1 FTP Commands & Replies 1.4 Electronic Mail in the Internet 1.4.1 SMTP 1.4.2 Comparison of SMTP with HTTP 1.4.3 Mail Access Protocols 220.127.116.11 POP 18.104.22.168 IMAP 22.214.171.124 Web-Based E-Mail 1.5 DNS — he Internet‘s Directory Service 1.5.1 Services Provided by DNS 1.5.2 Overview of How DNS Works 126.96.36.199 A Distributed, Hierarchical Database 188.8.131.52.1 Recursive Queries & Iterative Queries 1.5.3 DNS Records & Messages 184.108.40.206 DNS Messages 1.6 Peer-to-Peer Applications 1.6.1 P2P File Distribution 220.127.116.11 BitRorrent 1.6.2 Distributed Hash Table 18.104.22.168 Circular Arrangement 1.7 Socket Programming: Creating Network Applications 1.7.1 Socket Programming with UDP 1.7.2 Socket Programming with TCP Prof. Preethi S, Dept. of ISE, CITech, Bangalore
MODULE 1: APPLICATION LAYER Principles of Network Applications 1.1 • Network-applications are the driving forces for the explosive development of the internet. • Examples of network-applications: 1)Web 5) Social networking (Facebook, Twitter) 2) File transfers 6) Video distribution (YouTube) 3)E-mail 7) Real-time video conferencing (Skype) 4) P2P file sharing 8) On-line games (World of Warcraft) • In network-applications, program usually needs to → run on the different end-systems and → communicate with one another over the network. • For ex: In the Web application, there are 2 different programs: 1) The browser program running in the user's host (Laptop or Smartphone). 2) The Web-server program running in the Web-server host. Network Application Architectures 1.1.1 • Two approaches for developing an application: 1) Client-Server architecture 2) P2P (Peer to Peer) architecture Client-Server Architecture 22.214.171.124 • In this architecture, there is a server and many clients distributed over the network (Figure 1.1a). • The server is always-on while a client can be randomly run. • The server is listening on the network and a client initializes the communication. • Upon the requests from a client, the server provides certain services to the client. • Usually, there is no communication between two clients. • The server has a fixed IP address. • A client contacts the server by sending a packet to the server's IP address. • A server is able to communicate with many clients. • The applications such as FTP, telnet, Web, e-mail etc use the client-server architecture. 126.96.36.199.1 Data Center • • • • • • • Earlier, client-server architecture had a single-server host. But now, a single-server host is unable to keep up with all the requests from large no. of clients. For this reason, data-center a is used. A data-center contains a large number of hosts. A data-center is used to create a powerful virtual server. In date center, hundreds of servers must be powered and maintained. For example: Google has around 50 data-centers distributed around the world. These 50 data-centers handle search, YouTube, Gmail, and other services. P2P Architecture 188.8.131.52 • There is no dedicated server (Figure 1.1b). • Pairs of hosts are called peers. • The peers communicate directly with each other. • The peers are not owned by the service-provider. Rather, the peers are laptops controlled by users. • Many of today's most popular and traffic-intensive applications are based on P2P architecture. • Examples include file sharing (BitTorrent), Internet telephone (Skype) etc. • Main feature of P2P architectures: self-scalability. • For ex: In a P2P file-sharing system, Each peer generates workload by requesting files. Each peer also adds service-capacity to the system by distributing files to other peers. • Advantage: Cost effective ‗.‘ Normally, server-infrastructure & server bandwidth are not required. • Three challenges of the P2P applications: Most residential ISPs have been designed for asymmetrical bandwidth usage. Asymmetrical bandwidth means there is more downstream-traffic than upstream-traffic. But P2P applications shift upstream-traffic from servers to residential I Ps, which stress on the ISPs. 2) Security
P a g e | 3 | CN Module 1 Since the highly distribution and openness, P2P applications can be a challenge to security. 3) Incentive Success of P2P depends on convincing users to volunteer bandwidth & resources to the applications. Figure 1.1: (a) Client-server architecture; (b) P2P architecture Processes Communicating 1.1.2 184.108.40.206 Process • A process is an instance of a program running in a computer.(IPC inter-processcommunication). • The processes may run on the 1) same system or 2) different systems. 1) The processes running on the same end-system can communicate with each other using IPC. 2) The processes running on the different end-systems can communicate by exchanging messages. i) A sending-process creates and sends messages into the network. ii) A receiving-process receives the messages and responds by sending messages back. Client & Server Processes 220.127.116.11.1 • A network-application consists of pairs of processes: 1) The process that initiates the communication is labeled as the client. 2) The process that waits to be contacted to begin the session is labeled as the server. • For example: 1) In Web application, a client-browser process communicates with a Web-server-process. 2) In P2P file system, a file is transferred from a process in one peer to a process in another peer. Interface between the Process and the Computer Network Socket 18.104.22.168.2 • Any message sent from one process to another must go through the underlying-network. • A process sends/receives message through a software-interface of underlying-network called socket. • Socket is an API between the application-layer and the transport layer within a host (Figure 1.2). • The application-developer has complete control at the application-layer side of the socket. • But, the application-developer has little control of the transport-layer side of the socket. 1) The choice of transport-protocol: TCP or UDP. (API Application Programming Interface) 2) The ability to fix parameters such as maximum-buffer & maximum-segment-sizes.
P a g e | 4 | CN Module 1 Figure 1.2: Application processes, sockets, and transport-protocol 22.214.171.124.3 Addressing Processes • To identify the receiving-process, two pieces of information need to be specified: 1) IP address of the destination-host. 2) Port-number that specifies the receiving-process in the destination-host. • In the Internet, the host is identified by IP address. • An IP address is a 32-bit that uniquely identify the host. • Sending-process needs to identify receiving-process ‗.‘ a host may run several network-applications. • For this purpose, a destination port-number is used. • For example, A Web-server is identified by port-number 80. A mail-server is identified by portnumber 25. Transport Services Available to Applications 1.1.3 • Networks usually provide more than one transport-layer protocols for different applications. • An application-developer should choose certain protocol according to the type of applications. • Different protocols may provide different services. Reliable Data Transfer 126.96.36.199 • Reliable means guaranteeing the data from the sender to the receiver is delivered correctly. For ex: TCP provides reliable service to an application. • Unreliable means the data from the sender to the receiver may never arrive. • Unreliability may be acceptable for loss-tolerant applications, such as multimedia applications. • In multimedia applications, the lost data might result in a small glitch in the audio/video. Throughput 188.8.131.52 • Throughput is the rate at which the sending-process can deliver bits to the receiving-process. • Since other hosts are using the network, the throughput can fluctuate with time. • Two types of applications: 1) Bandwidth Sensitive Applications These applications need a guaranteed throughput. For ex: Multimedia applications Some transport-protocol provides guaranteed throughput at some specified rate (r bits/sec). 2) Elastic Applications These applications may not need a guaranteed throughput. For ex: Electronic mail, File transfer & Web transfers. Timing 184.108.40.206 • A transport-layer protocol can provide timing-guarantees. • For ex: guaranteeing every bit arrives at the receiver in less than 100 msec. • Timing constraints are useful for real-time applications such as → Internet telephony