client server concepts, dns, telnet, ftpisg/internet/slides/lecture-09.pdf · linux 1.2.8. (posix)....

25
1 Client Server Concepts, DNS, Telnet, FTP Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. I.I.T. Kharagpur, INDIA Indian Institute of Technology Kharagpur Lecture 9 : Client server concepts, DNS, Telnet, FTP On completion, the student will be able to: 1. Explain how the client-server concept works. 2. Explain and illustrate the name resolution process used by DNS servers. 3. Explain how the Telnet and FTP protocol works. 4. Demonstrate usage of Telnet and FTP commands.

Upload: dinhthu

Post on 30-Sep-2018

233 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

1

Client Server Concepts, DNS, Telnet, FTP

Prof. Indranil Sen GuptaDept. of Computer Science & Engg.

I.I.T. Kharagpur, INDIA

Indian Institute of Technology Kharagpur

Lecture 9: Client server concepts, DNS, Telnet, FTP

On completion, the student will be able to: 1. Explain how the client-server concept works.2. Explain and illustrate the name resolution

process used by DNS servers.3. Explain how the Telnet and FTP protocol works.4. Demonstrate usage of Telnet and FTP

commands.

Page 2: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

2

Client-server Model

• Standard model for developing network applications.

• Notion of client and server.A server is a process that is offering some service.A client is a process that is requesting the service.Server or client may be running on different machines.Server waits for requests from client(s).

CLIENT

CLIENT

CLIENT

SERVER

Client-server Model (contd.)

Page 3: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

3

Client-server Model (contd.)

• Typical scenario:The server process starts on some computer system.

Initializes itself, then goes to sleep waiting for a client request.

A client process starts, either on the same system or on some other system.

Sends a request to the server.

When the server process has finished providing its service to the client, the server goes back to sleep, waiting for the next client request to arrive.

• The process repeats.

Page 4: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

4

Client-server Model (contd.)

• Roles of the client and the server processes are asymmetric.

• Two types of servers:Iterative servers.Concurrent servers.

Iterative Servers

• Used when the server process knows in advance how long it takes to handle each request and it handles each request itself.

Single copy of server runs at all times.A client may have to wait if the server is busy.

Page 5: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

5

Concurrent Servers

• Used when the amount of work required to handle a request is unknown; the server starts another process to handle each request.

A copy of the server caters to a client’s request in a dedicated fashion.As many copies of server as there are client requests.

Using TCP or UDP

• Before start of communication, a connection has to be established between the two hosts.

• Five components in a connection:Protocol usedSource IP addressSource port numberDestination IP addressDestination port number

Page 6: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

6

Develop a Network Application

• The best way is to use some standard and well-accepted protocol.

At the data link layer level, use Ethernet.At the network layer level, use IP.At the transport layer level, use TCP.At the application layer level, use a standard API like the Berkeley Socket Interface.

What is a Socket?

• The socket is the BSD method for achieving inter-process communication (IPC).

• It is used to allow one process to speak to another (on same or different machine).

Analogy: Like the telephone is used to allow one person to speak to another.

Page 7: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

7

Basic Idea

• When two processes located on two machines communicate, we define association and socket.

Association: basically a 5-tupleProtocolLocal IP addressLocal port numberRemote IP addressRemote port number

Socket: also called half-association (a 3-tuple)

Protocol, local IP address, local port numberProtocol, remote IP address, remote port number

Page 8: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

8

Domain Name System (DNS)

What is DNS?

• The global database system for Internet addressing, mail and other information.

Much easier to use and memorize.• Concept of domains and sub-domains.

Domain management is distributed.DNS servers translate domain names to IP addresses.

Page 9: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

9

Top Level Domains

• com – Commercial • org – Non-profit • net – Network service

provider• gov – US govt.• mil – military • edu – Education • au – Australian • at – Austrian • ca – Canadian • dk – Dutch

• fr – French • de – German• in – Indian • it – Italian • jp – Japanese • kr – Korean • nz – New Zealand • es – Spanish • tw – Taiwanese • uk – British or Irish• us – U.S.

Domain Name Structure• Domain names are arranged in a

hierarchical tree-like structure.

in

ernet

iitkgp

iitb

ececse

mathcse

mech

nicEg: cse.iitkgp.ernet.in

Page 10: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

10

Some Statistics

2507002503001,7002,40019951751251002501,0751,200199475253015070070019935010201004503501992

50520752502001991

ORGNETMILGOVEDUCOMYear

In thousands

Name Resolution Process

• The commonly used server is BIND (Berkeley Internal Name Domain).

Runs under UNIX as a process called named.

• When an application needs some information from the server, it invokes the DNS name resolver.

DNS translates a fully qualified domain name into the corresponding IP address.Using the command nslookup.

Page 11: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

11

If the name server does not have the information locally, it asks its primary server, and so on.For redundancy, each host may also have one or more secondary name servers which may be queried when the primary fails.

• How do name servers update themselves?

Hierarchy of Name Servers

root

stanford.edu

comedu

rediff.com

au in

yahoo.comgatech.edu

Page 12: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

12

stanford.edu

edu

root

com

yahoo.comclient

Recursive Name Resolution

Iterative Name Resolution

• Client sequentially sends queries to DNS servers and receives response.

If response is negative, the DNS server to query next is also returned.Unlike recursive name resolution, where only one response is finally returned back to the client.

Page 13: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

13

TELNET Protocol

TELNET

• Allows a person sitting on one computer to work on another computer.

• Starts a remote session on another machine.

• Requires a person to supply login name and password to gain entry.

• Command:telnet <domain_name>telnet <ip_address>

A B

Page 14: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

14

TELNET (contd.)

• Why required?For using software only available on the remote host.For using devices (like printer) connected to the remote host.

• Typical scenarioMany users do a telnet to a remote server, and work there.Server is a bigger and faster computer.

TELNET (contd.)

• By default connection is established over port 23.

• Any other port number can also be specified.

telnet cse.iitkgp.ernet.in 25

Page 15: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

15

A Sample TELNET Session

SUNNY>> telnet cseTrying 144.16.192.57...Connected to cse.Escape character is '^]'.Linux 1.2.8 (cse) (ttyp0)

cse login: isgPassword: Last login: Wed Jun 11 12:17:55 from 144.16.202.210Linux 1.2.8. (POSIX).You have new mail.cse:~$

FTP Protocol

Page 16: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

16

File Transfer Protocol (FTP)

• Allows a person to transfer files between two machines.

• Requires a person to supply login name and password to gain entry.

• Command:ftp <domain_name>ftp <ip_address>

Anonymous FTP

• A special form of FTP which has become very popular.

Does not require a person to know login name and password.In place of login name, type the word anonymous.In place of password, type the email address.

• Huge amount of resources are available in anonymous FTP sites.

Page 17: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

17

FTP Process Model

Control

DataTransfer

Control

INTERNET

Port 21

DataTransfer

SERVERCLIENT

Port 22

How FTP Works?

• Two connections established:A control connection over port 21, that remains all through a session.A temporary port number, used for every file being transferred.

New connection established for every file transfer.

Page 18: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

18

Typical FTP Commands

• put, mputSend one (or more) file(s).

• get, mgetReceive one (or more) file(s).

• hashIndicates progress of file transfer.

• promptPrompts user before actual transfer of each file.

• bin, ascSelects binary or ascii mode of transfer.

• exitTerminates connection with ftp server.

Sample FTP Sessions

SUNNY>> ftp cseindigoConnected to cseindigo.220 cseindigo FTP server ready.Name (cseindigo:isg): isg331 Password required for isg.Password:230 User isg logged in.Remote system type is UNIX.Using binary mode to transfer files.ftp>

Page 19: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

19

Sample FTP Sessions (contd.)

ftp> dir200 PORT command successful.150 Opening ASCII mode data connection for '/bin/ls'.total 97drwxr-xr-x 2 isg faculty 512 Oct 8 1995 PROJECTS-rw-r--r-- 1 isg faculty 7693 Mar 31 1995 lan-cse.fig-rw-r--r-- 1 isg faculty 6578 Apr 26 1995 lan-cse.fig-rw-r--r-- 1 isg faculty 6721 Jul 12 1995 newlan.fig226 Transfer complete.

Sample FTP Sessions (contd.)

ftp> get lan-cse.fig200 PORT command successful.150 Opening BINARY mode data connection for 'lan-cse.fig' (6721 bytes).226 Transfer complete.6721 bytes received in 0.0389 secs (1.7e+02 Kbytes/sec)

ftp> quit221 Goodbye.

SUNNY>>

Page 20: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

20

SOLUTIONS TO QUIZ QUESTIONS ON

LECTURE 8

Page 21: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

21

Quiz Solutions on Lecture 8

1. What are the four types of BGP messages?

OPEN, UPDATE, KEEPALIVE and NOTIFICATION.

2. How is a BGP connection between two routers maintained?

By periodically sending the KEEPALIVE message.

Quiz Solutions on Lecture 8

3. What are the main functional procedures in BGP?

Neighbor acquisition, network acquisition, and network reachability.

4. Why is IPv4 not suitable for supporting real-time traffic?

IPv4 does not guarantee packets to follow the same path. This leads to unequal delays and out-of-order delivery.

Page 22: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

22

Quiz Solutions on Lecture 8

5. How are the (multiple) headers in a IPv6 packet kept track of?

All extension headers after the mandatory base header are chained in a linked list.

6. How does IPv6 attempt to support real-time traffic?

IPv6 allows a pair of stations to establish a path before sending packets.

Quiz Solutions on Lecture 8

7. What does the “Payload length” field in the IPv6 header signify?

Total length of the extension headers and the transport level protocol data unit (PDU).

8. What does the “Next Header” field in the IPv6 header signify?

Type of information that immediately follows the current header.

Page 23: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

23

Quiz Solutions on Lecture 8

9. In IPv6, how are the fragments kept track of, in case a packet is fragmented?

Base header is copied into all the fragments. Presence of fragment headers in all the fragments.

10. What is anycast addressing?

Packet will be delivered to exactly one of a set of computers.

Quiz Solutions on Lecture 8

11. How can we use tunneling to send a IPv6 packet over a IPv4 network?

The entire IPv6 packet can be encapsulated as payload inside an INv4 packet.

Page 24: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

24

QUIZ QUESTIONS ONLECTURE 9

Quiz Questions on Lecture 9

1. What is an iterative server?2. What is a concurrent server?3. Which of client or server must start first?4. What are the components of a socket?5. What is a domain?6. What are named and nslookup?7. How does recursive name resolution

works?

Page 25: Client Server Concepts, DNS, Telnet, FTPisg/INTERNET/SLIDES/Lecture-09.pdf · Linux 1.2.8. (POSIX). You have new mail. cse:~$ FTP Protocol. 16 File Transfer Protocol (FTP)

25

Quiz Questions on Lecture 9

8. How can you connect to a server xyz.com over port number 1234?

9. Why does ftp use more than one port numbers for communication?

10. What are the functions of the hash and bin commands in ftp?