Welcome to CSC667/867 - PowerPoint PPT Presentation

About This Presentation
Title:

Welcome to CSC667/867

Description:

The materials are modified to fit to CSc667/867 with permissions from authors. ... hp = gethostbyname(argv[1]); if (!hp) // Error. memset((char*) &sin, 0, sizeof(sin) ... – PowerPoint PPT presentation

Number of Views:173
Avg rating:3.0/5.0
Slides: 36
Provided by: Ilmi7
Learn more at: http://thecity.sfsu.edu
Category:
Tags: argv | ascii | bind | csc667 | welcome

less

Transcript and Presenter's Notes

Title: Welcome to CSC667/867


1
Welcome to CSC667/867
  • Internet Application Design and Development
  • Dr. Ilmi Yoon

NOTE Course note courtesy to Ellis Horowits (USC
CS571) and PrenticeHall (Deitel Associates).
The materials are modified to fit to CSc667/867
with permissions from authors.
2
Topics what you will learn
  • Web Application Architecture
  • Principles, Protocols and Practices
  • Understanding of core technology, not platform
    specific knowledge
  • Pre-WWW, Internet, TCP/IP
  • Web Server, Browser, HTTP
  • Client side technologies
  • Server side technologies
  • E-commerce system DB connections
  • Web application development Deployment
  • XML and its applications
  • Emerging technologies
  • Web services, Mobile Application, Semantic Web,
    Data exploration, 3Ds on the WWW, Security and
    more

3
Course Overview (1/2)
  • Mechanism and various technologies of Internet
    applications through projects
  • Develop your own web server (using JAVA)
  • 2 people team project
  • Client-Server Architecture
  • HTTP protocols
  • MultiThread
  • Proj 2 (2 people team project)
  • Experiment JavaScript/Python CGI project
  • Python or PHP
  • AJAX?
  • Extra Credit
  • Design for deBugger Game Web site
  • Design for Hydrodynamics Computation Web site

4
Course Overview (2/2)
  • Advanced Topic Presentation
  • Decide Topic
  • Submit the report and slides
  • Selected ones will be presented in class
  • Various Reports
  • Proof of Self Study
  • Important topics that can not be covered in depth
    in class will be given as reading assignments.
  • Term Project
  • Develop and Deploy an Internet application
  • 4 people team project
  • Most of all, not only knowledge, you will learn
    the experience of building large application,
    team work, presentation skills, searching for
    necessary information from given large resources,
    and learning by yourself!

5
PHP vs. JSP vs. ASP
  • http//www.wrensoft.com/zoom/benchmarks.html

6
From Job posting sites
7
Announcements
  • TA Manori Thaker
  • Start to think of term project as early as
    possible!!!
  • Make a team and get started
  • Topic will be given, but you may propose your
    own.
  • Assignment 1 is now available on the course web
    site (will be updated by 1/31)

8
  • Any Questions?
  • Then, lets get started jump to Project 1!!!
  • Rest of the slides are very informative, so
    please read bring questions to the next class!

9
  • Right before jumping into Technology, use a few
    moments about Principles Usability
  • What made Web App become so important?

10
Defining the World Wide Web
  • A wide-area hypertext, multimedia information
    retrieval system that provides access to a large
    universe of documents
  • A uniform way of accessing and viewing some
    information on the Internet
  • The WWW
  • creates a world in which information has a
    reference by which it can be accessed
  • subsumes the capabilities of ftp, gopher, wais
    and news

11
History of the World Wide Web
  • WWW
  • Allows computer users to locate and view
    multimedia-based documents
  • Introduced in 1990 by Tim Berners-Lee for
    astrophysicist to share documents
  • Internet today
  • Mixes computing and communications technologies
  • Makes information constantly and instantly
    available to anyone with a connection

12
The Internet and the WWW are Different
  • The Internet is a global digital infrastructure
    that connects millions of computers and tens of
    millions of people
  • The World Wide Web is a mechanism that unifies
    the retrieval and display of a subset of data on
    the Internet
  • An intranet is a local/global information
    structure that connects an organization internally

13
Major Technology Components
  • Client/server architecture
  • where client programs interact with web servers
  • Network protocol
  • HTTP, Hypertext Transfer Protocol, is the
    language understood by browsers and web servers
  • designed to move quickly from document to
    document
  • Addressing system (Uniform Resource Locators)
  • http//domain/directory/file.html
  • Markup Language
  • every web server understands and every browser
    displays
  • includes support for Hypertext and multimedia

14
Client/Server Architecture Model
15
The WWW Server
  • Web browsers and Web servers communicate
    according to a protocol known as HTTP (HyperText
    Transfer Protocol)
  • The current HTTP protocol is version 1.1
  • The Web server is a software system running on a
    machine often called the Web server, dont
    confuse them
  • A web server can
  • receive and reply to HTTP requests
  • retrieve documents from specified directories
  • run programs in specified directories
  • handle limited forms of security
  • A web server does not
  • know about the contents of a document, links in a
    document, images in a document or whether a
    particular file, e.g. a .gif file, is in the
    correct format

16
Markup Languages
  • HTML - hypertext markup language, specifies
    document layout and the specification of
    hypertext links to text, graphics and other types
    of objects
  • browsers display text and graphics using the
    markup as guidance
  • You need to read HTML1 2 Self study slides!!
  • However, HTML is not like a word processing
    program, e.g. Microsoft Word or WordPerfect, and
    not like a page description languages, e.g.
    postscript
  • as a result, translation into HTML can produce a
    result that does not look exactly like the
    original
  • XML (extensible markup language)

17
Uniform Resource Locator
  • A mechanism whereby an Internet resource can be
    specified in a single line of ASCII text
  • 1. Scheme followed by a colon http,ftp,gopher,n
    ews,mailto,wais,telnet
  • file//pub/xt.ps (a PostScript file in
    directory pub on your local machine)
    ftp//cs.sfsu.edu/docs/sweng.txt (a file
    sweng.txt in directory docs on cs.sfsu.edu, an
    anonymous ftp) http//nunki.usc.edu/mydocs/book.do
    c (a file in directory mydocs on machine
    nunki.usc.edu)
  • 2. Double slash (only for http, ftp, gopher,
    wais) //
  • 3. Internet domain name e.g., cs.sfsu.edu
  • 4. Port number (this field is optional e.g.,
    pollux.usc.edu8081)
  • -- Standard or default port numbers
  • --- ftp is 21 gopher is 70
  • --- telnet is 23 http is 80
  • --- smtp is 25 nntp is 119
  • 5. Path e.g., /pub/docs

18
Download Install Apache
19
Total Sites Across All Domains August 1995 -
January 2010
20
Market Share for Top Servers Across All Domains
August 1995 - January 2010
21
Basic Internet Terminology Definitions
  • http//www.pierobon.org/iis/ by Pierobon
  • Simple definitions for LAN, WAN, Internet, WWW,
    Hypertext, Intranet, Extranet, Protocol, TCP/IP,
    UDP, Address, Domain, Domain Name, Plug-in, URL,
    URI, socket and a short quiz!

22
(No Transcript)
23
Network Basics
  • A host is a computer that is enabled to function
    on a network
  • any set of hosts connected in such a way that any
    two hosts can send and receive messages is called
    a network
  • a protocol is the method by which two computers
    agree to communicate
  • an address space is the set of names of computers
    that can be referenced

24
Internet Protocol (IP)
  • delivering distinguished protocol datagrams
    (packets) from the source host to the destination
    host solely based on their addresses.
  • Unreliable or best effort delivery.
  • No data checksum.
  • Physically transmits to next link after resolving
    network address.
  • Routing algorithms decide what physical link to
    send on.

25
Transmission Control Protocol (TCP)
  • Provides reliable end-to-end connection
  • Reordering of messages.
  • Flow control (sliding window protocol)
  • Resending of lost messages.
  • Abstraction of a stream of bytes.
  • Connection oriented a connection is established
    before messages are sent.
  • Uses IP as the underlying transport mechanism.
  • Assumes one process is the client and one is the
    server in establishing a connection
  • Destination address is characterized by an IP
    address and a 16-bit port number.

26
User Datagram Protocol (UDP)
  • Characteristics
  • Connectionless, Datagram, Unreliable
  • Adds only application multiplexing/demultiplexing
    and checksumming to IP
  • Good for Streaming Media, Real-time Multiplayer
    Networked Games, VoIP

27
Example of a Layered Communication
  • Arranging an appointment between two CEOs

28
Conceptual layering of protocol software
29
Layered Communication Concepts
  • Layer n provides a service for layer n1
  • API C - header files, Java - interfaces
  • Protocol language spoken between two instances
    of a layer

30
Sockets and Ports
  • Sockets provide endpoints for communication
    between processes.
  • A socket must be bound to a local port.
  • Socket pair - (local IP address, local port,
    foreign IP address, foreign port) uniquely
    identifies a communication.

31
TCP Server (Java)
import java.io. import java.net. public
class Server public static void
main(String args) try
ServerSocket ding null Socket dong
null BufferedReader in
String str try //
ServerSocket, Socket are availalbe Java classes.
ding new ServerSocket(9099)
System.out.println("Opened socket "
9099) while (true) //
keeps listening for new clients, one at a time
try dong ding.accept()
// waits for client here
System.out.println("Wow, something came
in!!!")
32
in new BufferedReader(
new InputStreamReader(
dong.getInputStream())) int i
0 str in.readLine()
System.out.println("\n" i "" str)
while (in.ready()) str
in.readLine() System.out.println("\n"
i "" str) i
BufferedOutputStream out new BufferedOutputStrea
m(dong.getOutputStream()) PrintWriter
writer new PrintWriter( out, true )
writer.println("HTTP/1.1 200 OK")
writer.println("Date Thu, 18 Sep 1997 193418
GMT") writer.println("Server
Apache/1.1.3") writer.println("Content-Ty
pe text/html") writer.println("\n")
writer.println("ltHTMLgtltbodygtWow, this simple
server works!! lt/bodygtlt/HTMLgt")
dong.close() catch (IOException e)
System.out.println("Error reading from
socket") System.exit(1) //
there should be more catch blocks to match with
try. And then close the main and class.
33
TCP Server (C)
// Creating the socket struct sockaddr_in sa int
sock sock socket(AF_INET,
SOCK_STREAM, 0) if (sock lt 0) // Error int on
1 setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
(char ) on, sizeof(on)) // Binding the
socket to an address memset(sa, sizeof(sa),
0) sa.sin_port htons(9090) sa.sin_addr.s_addr
htonl(INADDR_ANY) sa.sin_family AF_INET if
(bind (sock, (struct sockaddr) sa, sizeof(sa))
lt 0) error("bind") listen(sock, 1) // Wait for
a client int rsock accept(sock, 0, 0) if
(rsock lt 0) // Error
34
TCP Client (C)
// Create a socket int sock socket(AF_INET,
SOCK_STREAM, 0) if (sock lt 0) // Error //
Associate remote address with socket struct
hostent hp struct sockaddr_in sin hp
gethostbyname(argv1) if (!hp) // Error
memset((char) sin, 0, sizeof(sin)) memcpy((cha
r) (sin.sin_addr), hp-gth_addr,
hp-gth_length) sin.sin_family
hp-gth_addrtype sin.sin_port htons(9090) //
Connect to the remote server if (connect(sock,
(struct sockaddr ) sin, sizeof(sin)) lt 0)
// Error
35
API Java C / Unix C / Window
Initialization - - WSAStartup()
Create a socket ServerSocket / Socket socket() socket()
Bind address ServerSocket / Socket bind() bind()
Accept connection ServerSocket.accept() accept() accept()
Make a connection - connect() connect()
Receive data InputStream.read() read() recv()
Send data OutputStream.write() write() send()
Close socket Socket.close() close() close()
Write a Comment
User Comments (0)
About PowerShow.com