Tools for Web Apps

Download Report

Transcript Tools for Web Apps

Tools for Web
Applications
Overview of TCP/IP
Link Layer
Network Layer
Transport Layer
Application Layer
Protocol Stack Diagram
Application Layer
FTP, HTTP, telnet, etc.
Provides ways for users to interact with
the network
Transport Layer
Transmission Control Protocol(TCP):
communicates using sockets (IP
address and port#), provides reliable
connection
User Data Protocol(UDP): allows
applications to send raw IP datagrams
Network Layer
Uses Internet Protocol (IP)
Uses IP addresses
 IP header contains source address,
destination address, version, length,
checksum, etc.

Link Layer
Physical interface
Device driver
Communicates with the actual network
hardware
Hypertext Transfer
Protocol(HTTP)
Allows clients to request files/other
resources from a server
ASCII Protocol – easy to talk to
HTTP Request Methods
GET - Request to read a web page or whatever information is identified by the requestURI
POST - Append to a named resource (e.g. a Web page), or provide a block of data to a
data-handling process at the server
HEAD - Request to read a web page's header
PUT - Request to store a web page
DELETE - Remove a web page
LINK - Connects two existing resources
UNLINK - Breaks an existing connection between two resources
Example
Type:
telnet www.stanford.edu 80
GET /class/ee281/index.html HTTP/1.0
Output
HTTP/1.1 200 OK
Date: Sat, 23 Nov 2002 06:35:44 GMT
Server: Apache/1.3.26 WebAuth 2.5 (Unix) mod_ssl/2.8.10 OpenSSL/0.9.6e WebAuth/2.5
mod_fastcgi/2.2.12
Connection: close
Content-Type: text/html
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Microsoft FrontPage 4.0">
<title>EE281: Embedded System Design Laboratory</title>
<meta name="keywords" content="here">
</head>
……………………
Status Codes
200 OK
201 Created
202 Accepted
204 No Content
301 Moved Permanently
302 Moved Temporarily
304 Not Modified
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
500 Internal Server Error
501 Not Implemented
502 Bad Gateway
503 Service Unavailable
EDTP Ethernet Development Board
Function Prototypes
void
void
void
void
void
void
void
void
void
void
void
void
void
void
show_regs(void);
show_packet(void);
tcp(void);
assemble_ack(void);
write_asix(unsigned char regaddr, unsigned char regdata);
read_asix(unsigned char regaddr);
get_packet(void);
setipaddrs(void);
cksum(void);
echo_packet(void);
send_tcp_packet(void);
arp(void);
icmp(void);
udp(void);
uIP – Free TCP/IP Stack
for AVR
Websites
uIP:
http://www.dunkels.com/adam/uip
EDTP Ethernet Board:
http://www.edtp.com
HTTP:
http://www.graphcomp.com/info/specs/http10.html
TCP/IP:
http://www4.ulpgc.es/tutoriales/tcpip/pru/3376fm.htm
http://www.acm.org/crossroads/xrds1-1/tcpjmy.html