CS 596: Client-Server Programming
Spring Semester, 1997
Doc 11, Client Server Protocols
To Lecture Notes Index
San Diego State University -- This page last updated Feb 26, 1997
Contents of Doc 11, Client Server Protocols
Protocol
"Well defined"
"Complete"
"Parsable"
"Available"
Protocol Types
Protocol Design Issues
Doc 11, Client Server Protocols Slide # 2
Communication between client and server
Good protocols are hard to design
Requirements for a "good protocol":
- Well defined (Protocol cannot be vague)
- Complete (All possible situations must be addressed)
- Parsable (Both clients and servers need to parse the protocol)
- Extendable (Protocols rarely remain the same)
- Available protocol document (Clients and servers that use a protocol can be written by different people)
Doc 11, Client Server Protocols Slide # 3
Every bit of data sent in either direction has to have its place in the protocol description.
Protocol == Language
Common formal description:
BNF and Augmented BNF
Format of the description language needs to be part of the protocol document.
Examples are important
The protocol document must cover all possible situations.
- Garbage data
- Old client or server (different protocol versions)
- Illegal requests
- Boundary conditions
- Etc.
Doc 11, Client Server Protocols Slide # 4
Both clients and servers are computer programs.
A computer program's IQ is generally 0.
Important design goals: (Not always possible)
- Distinct information packets or messages (allows separation of syntax and semantics)
- Consistency (allows for code reuse)
- Flexibility (remember the name-value pairs?)
-
For a given protocol, distinct groups may write clients and servers at different times.
Central registry for internet protocols
Self regulating:
- RFC == Request For Comment
- IETF == Internet Engineering Task Force
Official:
Doc 11, Client Server Protocols Slide # 5
Two basic types:
- Synchronous
- Asynchronous
Typical synchronous:
- Client sends request to server
- Server responds with a reply
Examples: HTTP, POP, SMTP, GOPHER, XMODEM
Typical asynchronous:
Client and server both send information to each other concurrently.
Examples: TELNET, RLOGIN, ZMODEM
A hybrid protocol is also possible
Doc 11, Client Server Protocols Slide # 6
Protocol Design Issues
Protocol design is difficult!
Learn from examples
Some issues:
- Protocol extendibility and versioning
- Byte order used for sending values
- ASCII vs. Binary protocol
- Efficiency
- Synchronous vs. Asynchronous
- Protocol overhead
- Roundtrip delays
- State
- Who is writing, who is reading?
- Timeouts
- Timeouts vs. Synchronous protocols