5. ★All looks like a serial port
★Ethernet: initialise network
★Client: connect to a port on a
server, then read() and write()
★Server: waits for a connection
on a port
The Ethernet library
6. ★DHCP needs 3rd-party library
★No DNS
★DIY for high-level protocols
(no HTTP library, etc) - lots of
print() statements
★Library memory footprint
Ethernet limitations
12. $ curl -v http://www.example.com
* About to connect() to www.example.com port 80 (#0)
* Trying 208.77.188.166... connected
* Connected to www.example.com (208.77.188.166) port 80 (#0)
Talking HTTP: the request
13. $ curl -v http://www.example.com
* About to connect() to www.example.com port 80 (#0)
* Trying 208.77.188.166... connected
* Connected to www.example.com (208.77.188.166) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.16.3
> Host: www.example.com
> Accept: */*
>
Talking HTTP: the request
14. $ curl -v http://www.example.com
* About to connect() to www.example.com port 80 (#0)
* Trying 208.77.188.166... connected
* Connected to www.example.com (208.77.188.166) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.16.3
> Host: www.example.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Sun, 16 Aug 2009 16:05:42 GMT
< Server: Apache/2.2.3 (Red Hat)
< Last-Modified: Tue, 15 Nov 2005 13:24:10 GMT
< ETag: "b80f4-1b6-80bfd280"
< Accept-Ranges: bytes
< Content-Length: 438
< Connection: close
< Content-Type: text/html; charset=UTF-8
Talking HTTP: the response
15. $ curl -v http://www.example.com
* About to connect() to www.example.com port 80 (#0)
* Trying 208.77.188.166... connected
* Connected to www.example.com (208.77.188.166) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.16.3
> Host: www.example.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Sun, 16 Aug 2009 16:05:42 GMT
< Server: Apache/2.2.3 (Red Hat)
< Last-Modified: Tue, 15 Nov 2005 13:24:10 GMT
< ETag: "b80f4-1b6-80bfd280"
< Accept-Ranges: bytes
< Content-Length: 438
< Connection: close
< Content-Type: text/html; charset=UTF-8
<
<HTML>
..........
Talking HTTP: the document
16. > GET / HTTP/1.1
> Host: www.example.com
>
< HTTP/1.1 200 OK
< Content-Type: text/html; charset=UTF-8
<
<HTML>
..........
The most important bits