Krerk Piromsopa. Application Protocols & System Services. 1 Krerk Piromsopa. Department of Computer...

24
Application Protocols & S ystem Services. 1 rk Piromsopa. Application Protocols & System Services. Krerk Piromsopa. Department of Computer Engineering . Chulalongkorn University.

Transcript of Krerk Piromsopa. Application Protocols & System Services. 1 Krerk Piromsopa. Department of Computer...

Application Protocols & System Services.

1 Krerk Piromsopa.

Application Protocols & System Services.

Krerk Piromsopa.

Department of Computer Engineering.

Chulalongkorn University.

Application Protocols & System Services.

2 Krerk Piromsopa.

Application Protocols

• ECHO (#7)

• FINGER (#79)

• TELNET(#23)

• HTTP(#80)

• FTP (#20,#21)

• SMTP(#25)

• POP3 (#110)/ IMAP(#143)

• etc.

• TCP/UDP

• Binding with Port.

Application Protocols & System Services.

3 Krerk Piromsopa.

Finger

ksh-2.04$ telnet cpu200 finger

Connected to cpu200.cp.eng.chula.ac.th.

Escape character is '^]'.

krerk

Login Name TTY

krerk Krerk Piromsopa pts/5

g41kpr Krerk Piromsopa pts/3

u38kpr Krerk Piromsopa pts/3

• Use to verify user and view current logon user.

• TCP Port 79

• Specify username, part of Name

• Return Login, Name, TTY, etc...

Application Protocols & System Services.

4 Krerk Piromsopa.

HTTP

• HTTP/1.1 (RFC 2616)

• TCP Port # 80

• Stateless Protocol

• Server Pull Protocol

• Message format– Request

– Response

• Data format– MIME

– Encoding

• http_URL = "http:" "//" host [ ":" port ] [ abs_path [ "?" query ]]

• Date format RFC 822, RFC 850, ANSI C

Application Protocols & System Services.

5 Krerk Piromsopa.

HTTP Request Message

GET /index.html HTTP/1.1

Host: www.cp.eng.chula.ac.th

Connection: close

User-agent: Mozilla/4.0

Accept-language:en

• Request Line

• Header Lines

• Entity Body

• Support Method : GET, POST, HEAD, PUT, DELETE, etc….

Application Protocols & System Services.

6 Krerk Piromsopa.

HTTP Response Message

HTTP/1.1 200 OK

Date: Sun, 23 Jun 2002 14:56:35 GMT

Server: Apache/1.3.19 (Unix)

Last-Modified: Thu, 14 Mar 2002 07:39:11 GMT

ETag: "1300d8-e1c-3c90539f"

Accept-Ranges: bytes

Content-Length: 3612

Content-Type: text/html

………… (data)

• Status Line

• Header Lines

• Entity body

• Common status code– 200 OK, 400 Bad Request, 404

, Not Found, 505 HTTP Versionot Supported.

Application Protocols & System Services.

7 Krerk Piromsopa.

Web Data

• HTML

<html>

<head><title>Test</title></head>

<body class=“normal”>

<p class=“dirlist”>Hello, world.</p>

</body>

<html>

• CSS

.normal { font-family: "MS Sans Serif", helvetica, Angsana; font-size: 14px; color: #000000}

.dirlist { font-family: "MS Sans Serif", helvetica, Angsana, sans-serif; font-size: 14px; color: #CC0000}

Application Protocols & System Services.

8 Krerk Piromsopa.

SMTP Protocol

• SMTP (RFC821)

• TCP Port # 25

• PUSH Protocol

• Data format– MIME

– Encoding

• Commands– HELO

– MAIL FROM

– RCPT TO

– DATA

– QUIT

Application Protocols & System Services.

9 Krerk Piromsopa.

SMTP Sample

220 cpu200.cp.eng.chula.ac.th ESMTP Sendmail …..

HELO arctic

250 cpu200.cp.eng.chula.ac.th Hello arctic.cp.eng.chula.ac.th pleased to meet you

MAIL FROM:[email protected]

250 [email protected]... Sender ok

RCPT TO : [email protected]

250 [email protected]... Recipient ok DATA

DATA

354 Enter mail, end with "." on a line by itself

.

250 WAA10073 Message accepted for delivery

QUIT

221 cpu200.cp.eng.chula.ac.th closing connection

Application Protocols & System Services.

10 Krerk Piromsopa.

POP3

• POP3 (RFC1939)

• TCP Port # 110

• Command– user <user name>

– pass <password>

– list

– retr <msg-no>

– dele <msg-no>

– quit

Application Protocols & System Services.

11 Krerk Piromsopa.

POP3 Sample

+OK POP3 cpu200.cp.eng…….

user krerk

+OK User name accepted

pass <password>

+OK Mailbox open, 2 messages

list

+OK Mailbox scan listing follows

1 498

2 498

.

retr 2

+OK 426 octets

<------ Mail Message ---->.

.

dele 2

+OK Message deleted

quit

+OK Sayonara

Application Protocols & System Services.

12 Krerk Piromsopa.

FTP

• FTP (RFC 959)

• TCP Port #20 , # 21

• Separate Control/Data Connection

• Common commands– USER <username>

– PASS <password>

– LIST

– RETR <filename>

– STOR <filename>

Application Protocols & System Services.

13 Krerk Piromsopa.

FTP Sample

220 cpu.cp.eng.chula.ac.th FTP server

---> USER anonymous

331 Guest login ok

Password:

---> PASS XXXX

230 Guest login ok, access restrictions apply.

---> SYST

215 UNIX Type: L8

Remote system type is UNIX.

Using binary mode to transfer files.

---> PASV

227 Entering Passive Mode (161,200,93,1,220,154)

---> LIST

150 Opening ASCII mode data connection for directory listing.

total 8

drwxrwxrwx 6 14 root 4096 Feb 18 2002 pub

226 Transfer complete.

ftp> quit

---> QUIT

221 Thank you for using the FTP service on cpu.cp.eng.chula.ac.th.

Application Protocols & System Services.

14 Krerk Piromsopa.

System Services

• Directory Services– DNS

– LDAP

– NIS

– HESIOD

– SAMBA

• File Services– NFS

• Printing Services– CUPS

– LPR

• SAMBA

Application Protocols & System Services.

15 Krerk Piromsopa.

DNS

• Perform Name service.

• UDP #53

• Local name servers

• Root name servers

• Authoritative name server

• Record Type– Forward

– Alias

– MX

– Reverse

• Caching mechanism

• Cpu MX 20 cpu200

• cpu200 A 161.200.93.11

• www IN CNAME cpu

• 1.93.200.161.in-addr.arpa. IN PTR cpu.cp.eng.chula.ac.th.

Application Protocols & System Services.

16 Krerk Piromsopa.

LDAP

• Lightweight Directory Access Protocol (X.500 Style)

• Distributed Database

• LDAP is a vendor-independent, open, network PROTOCOL standard and thus is as platform-independent as you can get

Application Protocols & System Services.

17 Krerk Piromsopa.

RPC (Remote Procedure Call)

• When the client calls the remote procedure, it’s really calling a function the local host that’s generated by the RPC package. This function is called the client stub. The client stub packages the procedure arguments into a network message, and sends this message to the server.

• A server stub on the server host receives the network message. It takes the arguments from the network message, and calls the server procedure that the application programmer wrote

• When the server function returns, it returns to the server stub, which takes the return values, packages them into a network message and sends the message back to the client stub.

• The client stub takes the return values from the network message and returns to the client application.

Application Protocols & System Services.

18 Krerk Piromsopa.

RPC (Cont.)

• UDP (or TCP) # 111

• Format of call message.– transaction ID (client assigned)

– call (0 for call)

– RPC version

– program #

– version #

– procedure #

– credentials

– verifier (Secure RPC)

– parameter

• Format of reply message.– transaction ID

– reply (1 for reply)

– status (0 success)

– verifier

– accept status

– results

• Related Application (Program)– port mapper(100000)

– NFS (100003)

– mount (100005)

– lock manager(100021)

Application Protocols & System Services.

19 Krerk Piromsopa.

NIS

Application Protocols & System Services.

20 Krerk Piromsopa.

NFS

Application Protocols & System Services.

21 Krerk Piromsopa.

LPR

Application Protocols & System Services.

22 Krerk Piromsopa.

CUPS

• RFC 2911

• The Common UNIX Printing System ("CUPS") is a cross-platform printing solution for all UNIX environments.

• It is based on the "Internet Printing Protocol" and provides complete printing services to most PostScript and raster printers

Application Protocols & System Services.

23 Krerk Piromsopa.

SAMBA

• File & print services

• Authentication and Authorization

• Name resolution

• Service announcement (browsing)

Application Protocols & System Services.

24 Krerk Piromsopa.

Reference

• RFC

• http://www.stanford.edu/~hodges/talks/mactivity.ldap.97/

• http://www.samba.org/

• http://www.pwg.org/ipp/