Title: Connect to the Internet for Free . . . Well, Almost Free
1Connect to the Internet for Free . . . Well,
Almost Free
- Mike Willey
- Embedded Systems Conference Boston 2001
- Class No. 302
2Introduction
- Mike Willey
- Vice President, Paragon Innovations, Inc.
- Specializing in Embedded Internet Devices
- 23 Years experience designing embedded systems
- willey_at_paragoninnovations.com
- 972-680-2900 x222
3Course Outline
- Why do we need an inexpensive internet
connection? - What do we need to know about TLA?
- How do you cram 5 lbs of stuff in a 3 lb bag?
- What does an inexpensive PPP implementation look
like? - Conclusions
4Why do we need an inexpensive internet connection?
- Remote control and monitoring
- Industrial automation
- Home automation
- CONSUMER DEMAND!
5What do we need to know about TLA?
- Internet Layer
- IP - Internet Protocol
- ARP - Address Resolution Protocol
- Transport Layer
- TCP - Transmission Control Protocol
- UDP - User Datagram Protocol
- Application Layer
- HTTP - Hypertext Transfer Protocol
- SMTP - Simple Mail Transport Protocol
- POP3 - Post Office Protocol
6How do you cram 5 lbs of stuff in a 3 lb bag?
- 5 lbs of stuff
- Typical Internet Stack
- Define the Problem
- Implement what you need
7What does an inexpensive PPP implementation look
like?
- Remote meter reading
- Counts pulses on the sensors
- Emails totals once a month
8Required Protocols
- SMTP - Transfers mail message to internet
- TCP - Estabishes connection, ensures end-end
transmission - IP - Establishes machine-machine connection
- PPP - Wraps everything up for asynch transmission
9SMTP
220 linus.paragon-tx.com ESMTP Sendmail 8.9.3/8.9.
3/Debian/GNU HELO meter.goofynet.net 250
linus.paragon-tx.com Hello p84-max14.akl.linus.par
agon-tx.com MAIL FROM 2
50 ... Sender ok RCPT
TO 250 COM... Recipient ok DATA 354 Enter mail, end
with "." on a line by it self Subject Meter data
from Mikes house Mike has used 1252 KWH of
electricity in the last 28 days. . 250 OAA09988
Message accepted for delivery QUIT
10SMTP (cont.)
- Server sends 220
- Reply HELO my.url.com
- Server sends 250
- Reply MAIL FROM myid_at_my.url.com
- Server sends 250
- Reply RCPT TO destid_at_your.url.com
- Server sends 354
- Reply with Subject, CC, BCC, etc message
- End with a line containing only a period
11TCP Stack
- Source port - Anything, Dest Port - 25 (SMTP)
- Sequence / Acknowledgement Numbers
- Window - how many unacked packets can be sent
12TCP (cont.)
- Offset (4 bits) - 32 bit words in header
- Reserved (6 bits) - always zero
- Flags
- URG - Message is urgent
- ACK - Acknowledgement field is valid
- PSH - Flush or push all data so far to the
receiving app. - RST - Reset the connection
- SYN - Synchronize sequence numbers
- FIN - Close connection
13TCP (cont.)
- Checksum - 16 bit ones complement of packet and
the source and destination addresses, protocol
type, and length from the IP header - Must deal with limited RAM
14Exchanging Sequence Numbers
15IP Stack
- Source IP Address
- Destination IP Address
16PPP Stack
- Wrapper for the rest of the data
17State Diagram for the Bag
- Application called in-state
- NOT a General Purpose Application
18More Information
- Sams Teach Yourself TCP/IP in 24 Hours, Sams
Publishing, Indianapolis, Indiana, 1998 - RFC 1025 - Testing TCP and IP
- RFC 1071 - Computing Checksums
- RFC 1122 - Internet protocol stacks
- RFC 1172 - PPP Configuration Options
- RFC 1180 - TCP/IP Tutorial
19More Information (cont.)
- RFC 1331 - PPP Overview
- RFC 1332 - PPP Definition
- RFC 1661 - PPP Standard
- RFC 1661 - HDLC Framing for PPP
- RFC 1962 - PPP Compression Control Protocol
- RFC 1994 - PPP Chalange Handshake Authenticaion
Protocol (CHAP)
20More Information (cont.)
- RFC 2131 - Dynamic Host Configuration Protocol
(DHCP) - RFC 768 - User Datagram Protocol (UDP)
- RFC 791 - Internet Protocol (IP)
- RFC 729 - Internet Control Message Protocol
(ICMP) - RFC 793 - Transport Control Protocol (TCP)
- RFC 813 - Windows and Acknowledgement in TCP
21More Information (cont.)
- RFC 879 - Datagram sizes
- Whew!
22Hardware Implementation
23Conclusions
- Implementation for
- Source code available for SMTP, HTTP, and POP3 on
www.ubicom.com - Principles are easily transferred to other
platforms