390 likes | 643 Vues
Lecture 2: Internet Applications. Elements of Internet Applications Client-server model iterative vs. concurrent server Basic Internet Applications Domain name system (DNS) Telnet FTP E-mail. 2.1. Elements of Internet Applications. Network application
E N D
Lecture 2: Internet Applications • Elements of Internet Applications • Client-server model • iterative vs. concurrent server • Basic Internet Applications • Domain name system (DNS) • Telnet • FTP • E-mail 2: Basic Internet Applications
2.1. Elements of Internet Applications • Network application • communicating, distributed processes (programs) running in network hosts • exchange messages to implement application (e.g., e-mail, file transfer, web) • message format and actions to be taken are defined by application-layer protocols (e.g., FTP, SMTP, HTTP) • Computing model used: • Software that implements Internet services use client-server computing • Some computer on the Internet offer services that others access 2: Basic Internet Applications
2.1. Client-server paradigm • Client-server paradigm is a form of communication • Server application is ``listener'’ • Waits (passively) for incoming message • Performs service • Returns results • Eg, a mailserver’s function is to receive, store and deliver e-mails. • Client application establishes connection • Sends message to server • Waits for return message • Eg, a mail client (also called a mailer or mail program mail application) is a software that allows a user to manage, read, and compose e-mail. 2: Basic Internet Applications
2.1. Client-server paradigm 2: Basic Internet Applications
2.1. Characteristics of client • Arbitrary application program • Becomes client when network service is needed (Eg, a sender’s computer becomes a client to a remote mail server) • Also performs other computations • Invoked directly by user • Runs locally on user's computer Initiates contact with server • Can access multiple services (one at a time) • Does not require special hardware or sophisticated operating system 2: Basic Internet Applications
2.1. Characteristics of server • Special purpose application dedicated to providing network service • Starts automatically at system initialization time (system boot) • Runs on a remote computer (usually centralized, shared computer) • Waits for service requests from clients; loops to wait for next request • Will accept requests from arbitrary clients; provides one service to each client • May require powerful hardware and sophisticated operating system 2: Basic Internet Applications
2.1. Server types: • Iterative server: • can process one request at a time. • it receives a request, processes it, and sends the response to the requestor before it handles another request. • Concurrent server: • can process many requests at the same time. 2: Basic Internet Applications
2.1. Multiple servers for one service • Responding to a client request may require significant time • Other clients must wait while earlier requests are satisfied • concurrent program - has > 1 thread of control • concurrent server offers service to multiple clients at the same time • When a request arrives, the server assigns the request to a thread of control that can execute concurrently with existing threads • In other words, multiple copies of a servers for a single service can handle requests concurrently 2: Basic Internet Applications
2.1. Dynamic servers • Concurrent server operates dynamically • One way to run concurrent servers is to dynamically create server processes for each client • Parent (or Master) server accepts incoming requests and starts Child (or slave) server for each client • Child server handles subsequent requests from its client • Parent server then waits for next request 2: Basic Internet Applications
2.1. Client-Server Example 2: Basic Internet Applications
2.1. Selecting from multiple servers • How do incoming messages get delivered to the correct server? • To allow a process to identify the other process with which it wants to communicate some form of addressing is needed. • Addressing: Each transport session has two unique identifiers • (IP address, port number) on server • (IP address, port number) on client • A port number is a 16 bits number located in the TCP header • port numbers 0 to 1,023 (controlled by IANA (Internet Assigned Numbers Authority)) are reserved for `well-known` services like telnet and ftp • port numbers 1,024 to 49,151 (not controlled by IANA, these ports can only be registered with IANA) • port numbers from 49,152 to 65,535 are ephemeral ports (Dynamic and/or Private Ports) and can be used by any process. • No two clients on one computer can use same source port • Thus, client endpoints are unique, and server computer protocol software can deliver messages to correct server process 2: Basic Internet Applications
2.2. Domain Name System (DNS) • All applications use IP addresses through the TCP/IP protocol software • Difficult for humans to remember: 134.82.11.70 • The Domain Name System (DNS) provides translation between symbolic names and IP addresses • DNS is the naming scheme used in the Internet 2: Basic Internet Applications
2.2. Structure of DNS names • Each name consists of a sequence of alphanumeric components separated by periods • Examples: • www.eg.bucknell.edu • www.netbook.cs.purdue.edu • charcoal.eg.bucknell.edu • challenger.atc.fhda.edu • Names are hierarchical, with most-significant component on the right • Left-most component is computer name • Domain name space: names are defined in an inverted-tree structure with the root at the top • the tree can have only 128 levels: level 0 (root) to level 127. 2: Basic Internet Applications
2.2. DNS: Tree Structure • Each node in the tree has • a label - a string with a maximum of 63 characters. • a domain name - a sequence of labels separated by dots. 2: Basic Internet Applications
2.2. DNS naming structure • Domain: a part of the computer naming hierarchy used in the Internet. • Eg, commercial organization have names registered under the .com domain • Top level domains (right-most components; also known as TLDs) defined by global authority 2: Basic Internet Applications
2.2. DNS naming structure • Organizations apply for names in a top-level domain: • bucknell.edu • macdonalds.com • Organizations determine own internal structure • cs.stanford.edu • cs.purdue.edu • ie.cuhk.edu.hk 2: Basic Internet Applications
2.2. Geographic structure • Top-level domains are US-centric • Geographic TLDs used for organizations in other countries: TLD Country .ca Canada .uk United Kingdom .fr France .ch Switzerland .hk Hong Kong .cn China .jp Japan .sg Singapore .au Australia • Countries define their own internal hierarchy: ac.uk and .edu.au are used • for academic organizations in the United Kingdom and Australia 2: Basic Internet Applications
2.2. DNS and client-server computing • DNS names are managed by a hierarchy of DNS servers • Translates a name to an IP address, or • Contains information that links to other DNS servers • Hierarchy is related to DNS domain hierarchy • Root server at top of tree knows about next level servers • Next level servers, in turn, know about lower level servers 2: Basic Internet Applications
edu com gov mil org net uk fr … … … … … princeton mit cisco yahoo nasa nsf arpa navy acm ieee cs ee physics ux01 ux04 2.2. Name Servers • Partition hierarchy into administrative authority responsible for portion of the hierarchy 2: Basic Internet Applications
2.2. Domain Name System (DNS) • DNS Name Servers: • maps domain name of a host to its IP address. • hierarchically organized • local name servers: • located in the same domain as the host that make the DNS query. • authoritative name servers: • often located in the domain where the host that we queried is located. • can perform name/address translation for that host’s name • root name servers: • contacted by local name server that can not resolve name • give referral on which authoritative name servers to contact. 2: Basic Internet Applications
root name server 2 3 5 4 local name server dns.ie.cuhk.edu.hk authoritative name server dns.umass.edu 1 6 requesting host surf.ie.cuhk.edu.hk gaia.cs.umass.edu 2.2. Domain Name System (DNS) • host surf.ie.cuhk.edu.hk wants IP address of gaia.cs.umass.edu 1. contacts its local DNS server, dns.ie.cuhk.edu.hk 2. dns.ie.cuhk.edu.hk contacts root name server 3. root name server contacts authoritative name server, dns.umass.edu 4-6. root name server returns the resolved name to local host via local name server. 2: Basic Internet Applications
2.2. Domain Name System: nslookup • Trying out DNS for yourself: • Use nslookup to find the IP address or hostname of a machine: • Go to http://www.infobear.com/nslookup.shtml • Enter the IP address or hostname that you want to look it up • Select the name server: WebSiteSource -ns.websitesource.com • Try to look up www.ie.cuhk.edu.hk - it should give you an IP address. • For popular web sites, such as www.cnn.com, nslookup may give you multiple IP addresses. This indicates that the website are served by multiple servers. 2: Basic Internet Applications
Output of:nslookup -q=A www.cnn.com ns.websitesource.com Server: ns.websitesource.com Address: 216.147.43.135 Non-authoritative answer: Name: cnn.com Addresses: 64.236.16.116, 64.236.24.4, 64.236.24.12, 64.236.24.20 64.236.24.28, 64.236.16.20, 64.236.16.52, 64.236.16.84 Aliases: www.cnn.com 2.2. Domain Name System: nslookup • Sample output of nslookup for www.cnn.com : 2: Basic Internet Applications
2.2. Domain Name System: nslookup • Output of: nslookup -q=A gaia.cs.umass.edu ns.websitesource.com • Server: ns1.worldnet.att.net Address: 204.127.129.1 • Name: gaia.cs.umass.edu Address: 128.119.245.12 2: Basic Internet Applications
User 1 2 user @ cs.princeton.edu cs.princeton.edu Name Mail server program 4 192.12.69.5 192.12.69.5 3 TCP 192.12.69.5 5 IP 2.2. DNS Example: sending E-mail 2: Basic Internet Applications
2.2. DNS Example: sending E-mail 1. User presents domain name of host (eg, cs.princeton.edu) to an application program (eg, a mail program) 2. Application program (mail program in this example) engage the naming system (name server program) to translate the domain name of host into host address (ie IP address). 3. Application (mail program) opens a connection to the host by presenting its IP address to TCP 2: Basic Internet Applications
2.3. Telnet • Telnet (TErminaLNETwork) • the standard TCP/IP protocol for virtual terminal service by ISO. • enables the establishment of a connection to a remote system in such a way that the local terminal appears to be a terminal at the remote system. • uses TCP service on the well-known port 23. • Cf. Rlogin - remote login protocol by BSD UNIX. 2: Basic Internet Applications
Remote login follows the client-server paradigm. The client: Is the application that uses TCP/IP for making connection transforms the characters typed by users to a universal character set called Network Virtual Terminal (NVT) characters. e.g. End of file in DOS (Ctrl+z), UNIX (Ctrl+d) The server: Allows the user to interact with the remote computer Sends output to the client 2.3. Telnet: How Remote Login Works Fig 28.1 (text book) 2: Basic Internet Applications
2.4. FTP • FTP (File Transfer Protocol) • the standard application for copying a file from one host to another. • uses the client-server approach 2: Basic Internet Applications
2.4. FTP: Retrieve and Store Files • Retrieve A File • Contacts a remote computer • Obtains a copy of a file • get: receive one file, eg, get filename1 • mget: get multiple files, eg, mget filename1 filename2 • Store A File • Contacts a remote computer • Sends a copy of a file • put: send one file , eg, put filename1 • mput: send multiple files, eg, mput filename1 filename2 • open: connect to a remote computer • FTP Prompts for a login identifier • FTP Prompts for a password • bye: terminate a connection and leave FTP program • Two FTP file formats: text(ascii) & binary 2: Basic Internet Applications
2.4. FTP: Making Connections • needs two TCP connections. • well-known port 21 for control connection. • well-known port 20 for data connection. 2: Basic Internet Applications
2.4. FTP: Making Connections 2: Basic Internet Applications
E-mail systems follow the client server approach In sender’s computer, an email program becomes a client contacts an e-mail server program on the recipient’s computer transfer a copy of the message When the e-mail server receives a message, it stores the message in the recipient’s mailbox informs the recipient 2.5. How E-mail Works Fig. 20.1 (text book) 2: Basic Internet Applications
2.5. SMTP • SMTP (Simple Mail Transfer Protocol) • the standard TCP/IP protocol for supporting electronic mail on the Internet • uses the TCP well-known port 25. • SMTP client/server has two components: • UA (User Agent) - prepares the message, creates the envelope and puts the message in the envelope. • MTA (Mail Transfer Agent) - transfers the mail across the Internet. 2: Basic Internet Applications
Relay MTAs 2.5. SMTP 2: Basic Internet Applications
2.5. SMTP • E-mail format: • Envelope: contains the sender address, receiver address and other information • Message: contains the headers and the body. • Address format: • local_part@domain_name • local_part defines the name of user mailbox 2: Basic Internet Applications
Mail transfer phases: connection establishment client made a TCP connection to the well-known port 25 message transfer client sends a single message the message can be to more than one recipients connection termination client terminate the connection. Connection establishment 2.5. SMTP 2: Basic Internet Applications
Message transfer Connection termination 2.5. SMTP 2: Basic Internet Applications
Client-server model: Textbook Chapter 17. Forouzan Chapter 14. DNS: Textbook Chapter 18. Forouzan Chapter 16. Telnet: Textbook Chapter 28 Forouzan Chapter 17 FTP: Textbook Chapter 27. Forouzan Chapter 18. SMTP: Textbook Chapter 20 (p 161). Forouzan Chapter 20. Further Readings • Note: This lecture is designed with the objective of providing an introduction tothe client-server model, DNS, FTP and SMTP . • Details of these topics are beyond the scope of this course and will NOT be taught or discussed. Students who wish to invest more time on studying more details for these topics are referred to: 2: Basic Internet Applications