Professional Documents
Culture Documents
0-0
Example: DNS
The DNS header, taken from RFC 1035.
1 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | ID | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |QR| Opcode |AA|TC|RD|RA| Z | RCODE | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | QDCOUNT | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | ANCOUNT | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | NSCOUNT | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | ARCOUNT | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
When you feel the urge to design a [...] the feeling passes
Eric Raymond: The Art of UNIX Programming
complex binary
Pros: Compact: Ecient computer processing Fixed syntax and simple semantics Cons: Not extendable Not human readable. Byte order, alignment problems
Example: DHCP
A vendor extension eld taken from RFC 2132.
3.5. Router Option The router option specifies a list of IP addresses for routers on the clients subnet. Routers SHOULD be listed in order of preference. The code for the router option is 3. The minimum length for the router option is 4 octets, and the length MUST always be a multiple of 4. Code Len Address 1 Address 2 +-----+-----+-----+-----+-----+-----+-----+-----+-| 3 | n | a1 | a2 | a3 | a4 | a1 | a2 | ... +-----+-----+-----+-----+-----+-----+-----+-----+--
10
11
XML
Plain-text markup language: simple syntax, easy to parse. Denition declared externally by XML Schema or DTD. Well suited for complex data formats with recursive and nested structures. Cons mainly its textual nature: parsing can be inecient.
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE note SYSTEM "InternalNote.dtd"> <note> <to>Eva</to> <from>Phil</from> <heading>Reminder</heading> <body>Remember to go to the store!</body> </note>
PDU ::= SEQUENCE { request-id Integer32, error-status INTEGER ( noError(0), tooBig(1), noSuchName(2), badValue(3), readOnly(4), ... inconsistentName(18) ), error-index INTEGER (0..max-bindings), variable-bindings VarBindList }
12
13
14
(cont)
(cont)
Another example; In RFC 2048, the HTTP URL is dened as: http URL host = = http: // host [ :
characters to end a line a string, case insensitive an alternative a strict sequence a range of characters element repetition optional elements
A legal Internet host domain name or IP address (in dotted-decimal form) as dened by Section 2.1 of RFC 1123
= = =
15
16
17
Specic applications/protocols
Pros & Cons
Pros: Easy to extend and exible. Human readable (easy to debug) Cons: Not compact. Syntax-heavy: may require complex parsers. telnet http tftp ftp smtp snmp rtp sip Others: Instant Messaging, Peer-to-peer, Distributed gaming.
18
19
21
22
23
(cont)
But most html documents contain sub-parts one TCP connection for each sub-request. But TCP congestion control is made for longer connections they can adapt to congestion in the network. When http trac grew when the web exploded, these small ows were said to kill the Internet! HTTP 1/1 supports persistent connections: keep the TCP connection during the complete session: send all requests on the same TCP connection. Now, these longer TCP connection can perform congestion control algorithm in a proper way.
24
25
FTP modes
FTP can run in two modes- active mode and passive mode. This refers to whether the ftp server will start the data connection or not. active: The server will start the TCP session for the data connection, thereby connecting to the client to a port and IP specied by the client. (May not work if client is behind NAT) passive: The server will not start a TCP session. Instead, the client will create a TCP session to the server, to a port and IP specied by the server.
27
28
29
SMTP (cont)
Electronic mail is dierent from the previous protocols in its delayed delivery in several steps: Spooling from sending host to rst MTA. Relaying by intermediate MTAs. Downloading of email by receiving host using other protocols: POPv3 (Post Oce Protocol) or IMAPv3 (Interactive Mail Access Protocol)
Addressing: <mailbox>@<domain name> This results in a a DNS MX request for <domain name>, giving a name of the MTA to transfer the message to.
30
31
32
SMTP syntax
Like HTTP and FTP, SMTP has special commands and status codes. HELO <hostname>: MAIL FROM <email address>: Sender email address RCPT TO <email address>: Recipient email address DATA: Tells the email server that data follows. QUIT: Immediately close the connection. The status codes are similar to that of HTTP and FTP.
MIME - Multipurpose Internet Mail Extensions Classical email messages must be written in US-ASCII (7-bit). What does this imply? MIME aims at redening the format of messages to allow for: textual message bodies in character sets other than US-ASCII, an extensible set of dierent formats for non-textual message bodies, multi-part message bodies, and textual header information in character sets other than US-ASCII
33
34
35
Real-time multimedia
Time-sensitive, interactive applications: (eg, telephony). Use RTP- Real-Time Protocol. Limited time-sensitivity: Streaming protocols. Use RSTP (Real-Time Streaming Protocol) Non-time sensitive: Transfer the data using le transfer.
Signaling
So, RTP can be used to transfer time-sensitive data streams. But what about signaling: how to set up sessions: SIP - Session Initization Protocol H.323
39
40
41
IM - Instant Messaging
On-line messaging and presence information using a central server and many connected clients. Some systems: AOL IM/ICQ, MSN Messenger, Yahoo Messenger An IM system typically has the following features: Buddy list Chat, Images, Sounds, File-sharing Real-time talk and video Most protocols are proprietary. But SIP has messaging extensions (SIMPLE). A special feature is to serve many small messages in a short time, and to manage presence information.
42
43
44
Skype
Distributed games
Some of the best-known distributed games are interactive and real-time: Doom, Quake, Counter-Strike, Half-life, etc. Some issues are: Low latency: low pingers win ghts. Usually small UDP packets. Textures and geometric information preloaded: only deltas distributed. Movement of 3D graphics may use dead reckoning: no need to send updates on all geometric movements: use motion equations instead. All communication via central server, synchronizes and resolves events (who wins a ght).
47
(Encrypted, TCP/UDP) Skype is a VoIP tool using peer-to-peer techniques for name-lookup. Skype is a completely closed system - no open interfaces, not even which RFCs are implemented No interoperation possible. You could say this violates the Internet spirit. Uses high compression: iLBC coding ( 10x compression of audio data) Name lookup using same infrastructure as KaZaa: nodes and supernodes. NAT traversal techniques using UDP, TCP or bounce connections via supernodes. End-to-end RSA encryption
45
46