Trivial Protocols CS-328 Dick Steflik. What’s a Protocol The rules that govern the exchange of...

16
Trivial Protocols CS-328 Dick Steflik

Transcript of Trivial Protocols CS-328 Dick Steflik. What’s a Protocol The rules that govern the exchange of...

Page 1: Trivial Protocols CS-328 Dick Steflik. What’s a Protocol The rules that govern the exchange of information between to hosts –when a dignitary visits a.

Trivial Protocols

CS-328

Dick Steflik

Page 2: Trivial Protocols CS-328 Dick Steflik. What’s a Protocol The rules that govern the exchange of information between to hosts –when a dignitary visits a.

What’s a Protocol

• The rules that govern the exchange of information between to hosts– when a dignitary visits a foreign country there

are certain rules of protocol that they must follow

– when you meet the Queen of Great Britain you bow or curtsey

Page 3: Trivial Protocols CS-328 Dick Steflik. What’s a Protocol The rules that govern the exchange of information between to hosts –when a dignitary visits a.

more specifically…

• Communications rules– who initiates the exchange– who terminates the exchange– what order things are done in

• finite state machine model

– option negotiation

Page 4: Trivial Protocols CS-328 Dick Steflik. What’s a Protocol The rules that govern the exchange of information between to hosts –when a dignitary visits a.

DayTime

• RFC 868, RFC 867

• TCP and UDP

• port 13

• client connects to port 13– server returns date/time and closes connection

Page 5: Trivial Protocols CS-328 Dick Steflik. What’s a Protocol The rules that govern the exchange of information between to hosts –when a dignitary visits a.

Echo

• RFC 862• TCP and UDP• well known port 7• TCP Client opens connection on port 7

– Client sends data <crlf>

– server echos data back

– repeat prev two steps

– client closes connection

Page 6: Trivial Protocols CS-328 Dick Steflik. What’s a Protocol The rules that govern the exchange of information between to hosts –when a dignitary visits a.

Echo

• UDP Client connects and sends data– host receives and immediately returns datagram

Page 7: Trivial Protocols CS-328 Dick Steflik. What’s a Protocol The rules that govern the exchange of information between to hosts –when a dignitary visits a.

Finger

• Retrieve user information from remote host

• RFC 1288

• well known TCP port 79

• Client opens connection on port 79– client sends finger query– remote host runs query, returns data and closes

connection

Page 8: Trivial Protocols CS-328 Dick Steflik. What’s a Protocol The rules that govern the exchange of information between to hosts –when a dignitary visits a.

Finger

• Queries– {Q1} ::= [{W} | {W} {S} {U} ] {C}– {Q2} ::= [{W} {S} ] [{U} {H} {C}– {U} ::= username– {H} ::= @hostname | @hostname{H}– {W} ::= /W– {S} ::= <sp> | <sp>{S}– {C} ::= <crlf>

Page 9: Trivial Protocols CS-328 Dick Steflik. What’s a Protocol The rules that govern the exchange of information between to hosts –when a dignitary visits a.

Finger

• Remote User Interface Program (RUIP)– program on remote host that performs finger

queries– may be turned off in TCP/IP config– may be configured to return limited info on

user for security purposes– format may be differant on various platforms

Page 10: Trivial Protocols CS-328 Dick Steflik. What’s a Protocol The rules that govern the exchange of information between to hosts –when a dignitary visits a.

Finger

• Security– many sites don’t fun finger servers

• a bug in the original finger left a hole through which unfriendly and unnatural acts could be done

– 1988 - Internet Worm gained machine access via the finger bug

– some sites run a finger server that just returns a textual message

Page 11: Trivial Protocols CS-328 Dick Steflik. What’s a Protocol The rules that govern the exchange of information between to hosts –when a dignitary visits a.

Post Office Protocol (POP3)

• Used in conjunction with anSMTP Host– SMTP Host sends and receives e-mail for

remote users, POP allows users to retreive their mail from the host.

– SMTP stores mail for unconnected hosts

• RFC 1730

• TCP Port 110

Page 12: Trivial Protocols CS-328 Dick Steflik. What’s a Protocol The rules that govern the exchange of information between to hosts –when a dignitary visits a.

POP3

• protocol is relatively simple– connect to port 110 of remote host

• read back a response check for OK or ERR

• over and over again

– close the connection

Page 13: Trivial Protocols CS-328 Dick Steflik. What’s a Protocol The rules that govern the exchange of information between to hosts –when a dignitary visits a.

POP3 - State Machine

AuthAuth AuthAuth TransactionTransaction UpdateUpdate

USERUSER PASSPASS

CommandsCommands

QUITQUIT

Page 14: Trivial Protocols CS-328 Dick Steflik. What’s a Protocol The rules that govern the exchange of information between to hosts –when a dignitary visits a.

POP3

• Commands– USER name

• terminate with <crlf>• identifies the user/mail drop name

– PASS string• user password• usually the same as the user’s logon password

– STAT• request number of messages on server and size of mail

drop

Page 15: Trivial Protocols CS-328 Dick Steflik. What’s a Protocol The rules that govern the exchange of information between to hosts –when a dignitary visits a.

POP3 (Commands)

– LIST• return a list <crlf> of all msgs on server

– format msg size

– LIST [msg_no]• request size of msg_no

– format msg_no size

– RETR msg_no• return the message identified by msg_no

Page 16: Trivial Protocols CS-328 Dick Steflik. What’s a Protocol The rules that govern the exchange of information between to hosts –when a dignitary visits a.

POP3 (Commands)

– DELE msg_no• delete msg_no from server

• happens in UPDATE State

– NOOP• nothing except a positive reply from server

– RSET• reset all deletions pending on server

– QUIT• quit session, UPDATE, enter AUTH1 State