You are on page 1of 32

Software Engineering in Geomatics

.
......
Software Engineering in Geomatics
Draen Odobai
Mario Miler
Faculty of Geodesy, University of Zagreb
Zagreb, March 20, 2013
Software Engineering in Geomatics
Exercise 2
Network computing models
Network computing
.
Network computing
..
......
is a generic term in computing which refers to computers or nodes
working together over a network
distributed computing
cloud computing
resource sharing
processing power, storage, network bandwith,
Software Engineering in Geomatics
Exercise 2
Network computing models
Fuzzy history (1)
Mainframe:
1950
dominant in critical business applications and bulk data
processing (banks, government, )
dumb terminal computers
Software Engineering in Geomatics
Exercise 2
Network computing models
Fuzzy history (2)
Client-server:
1980
more powerful/accessible computers
one server serves many clients
currently dominant model
consumer oriented
Software Engineering in Geomatics
Exercise 2
Network computing models
Fuzzy history (3)
Peer-to-peer:
internet before internet
each node simultaneously client and server
decentralized resource sharing
next big thing?
Eben Moglen: The alternate net we need, and how we can
build it ourselves http://is.gd/Ia1La8
Software Engineering in Geomatics
Exercise 2
Network computing models
Client-server (1)
.
Client-server
..
......
is a common form of distributed system in which software is split
between server tasks and client tasks. A client sends requests to
a server, according to some protocol, asking for information or
action, and the server responds.
Client:
email client, web browser, online chat client, an application,
Server:
email server, database server, print server, web server,
Software Engineering in Geomatics
Exercise 2
Network computing models
Client-server (2)
Server:
powerful networked computer sharing resources
preforms a computational task on behalf of clients
responds to client request
single server can provide many services
server/service scalabilty:
horizontal scalability
vertical scalability
Software Engineering in Geomatics
Exercise 2
Network computing models
Client-server (3)
Client:
A client is an application or system that accesses a service
made available by a server.
under-powered, inexpensive desktop computer, laptop, tablet,
smartphone,
multipurpose device
Web browser as the ultimate client (cloud computing) ?
Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
HTTP (1)
.
Hypertext Transfer Protocol
..
......
is an application protocol for distributed, collaborative, hypermedia
information systems. HTTP is the foundation of data
communication for the World Wide Web.
.
Hypermedia
..
......
is used as a logical extension of the term hypertext in which
graphics, audio, video, plain text and hyperlinks intertwine to
create a generally non-linear medium of information.
Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
HTTP (2)
1991. @CERN, Tim Barners-Lee and colleagues implemented
rst successful communication using HTTP between client
and server on internet
current standard HTTP/1.1 (June 1999)
1
development coordinated by Internet Engineering Task Force
(IETF) and the World Wide Web Consortium (W3C)
Request for Comments (RFC) procedure
1
https://tools.ietf.org/html/rfc2616
Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
HTTP (3)
HTTP functions as a request-response protocol in the
client-server computing model
HTTP Resources are identied and located on the network by
Uniform Resource Identiers (URI) Uniform Resource
Locator (URL)
https://en.wikipedia.org/wiki/Croatia#Culture
An HTTP session is a sequence of network request-response
transactions.
Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
HTTP (4)
Generic URL:
scheme://username:password@domain:port/path?query_string#fragment_id
scheme - http/https/ftp (protocol)
username:password - authentication
domain
port - not bound to protocol, http=80, https=443, ftp=21,
path - on the server
query_string - extra parameters sent to server
fragment - location on resource
http://user:pass@server.com:123/new/my_service?uid=987&order=no#view
Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
Request methods (1)
.
Request method
..
......
action to be performed on the identied resource (URL)
GET most used HTTP method, requests a representation
of the specied resource, retrieves Response
headers and Response body
HEAD asks for the response identical to the one that would
correspond to a GET request, but without the
response body.
POST submits data for processing (HTML Form)
OPTIONS returns the HTTP methods that server supports for
specied URL
Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
Request methods (2)
PUT Uploads a representation of a specied resource
DELETE Deletes the specied resource
TRACE
CONNECT
PATCH
Safe methods: HEAD, GET, OPTIONS, TRACE
only intended for information retrieval and should not change
state on the server
Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
Exercise (1)
telnet - A terminal emulation program for TCP/IP networks
Make a HTTP request:
host: gi01.geoinfo.geof.hr
port: 80 (standard http)
method: GET
path: / (root)
Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
Exercise (1.1)
putty - PuTTY is a free implementation of Telnet and SSH for
Windows and Unix platforms
Make a HTTP request:
host name: gi01.geoinfo.geof.hr
port: 80 (standard http)
conenction type: Raw
close window on exit: Never
method: GET
path: / (root)
Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
Exercise (2)
telnet gi01.geoinfo.geof.hr 80
Trying 10.5.0.41...
Connected to gi01.geoinfo.geof.hr.
Escape character is '^]'.
GET / HTTP/1.1
Host: gi01.geoinfo.geof.hr
HTTP/1.1 200 OK
Date: Fri, 09 Mar 2012 13:49:48 GMT
Server: Apache/2.0.55 (Ubuntu) mod_python/3.1.4 Python/2.4.3 PHP/5.1.2
Last-Modified: Sun, 15 Jul 2007 13:02:26 GMT
ETag: "38402a-3-f4b2fc80"
Accept-Ranges: bytes
Content-Length: 3
Content-Type: text/html; charset=UTF-8
:)
Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
HTTP status codes (1)
The rst line of the HTTP response is called the status line and
includes a numeric status code (such as 404) and a textual
reason phrase (such as Not Found).
Five groups:
1xx Informational
2xx Success
3xx Redirection
4xx Client Error
5xx Server Error
Client (web browser) interpreters status code, a displays
customized explanation/information message to user, if required.
Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
HTTP status codes (2) - Informational
100 Continue Server has received the request headers,
and that the client should proceed to send the
request body
101 Switching Protocols Requester has asked the server
to switch protocols and the server is acknowledging
that it will do so
102 Processing (WebDAV)
103 Checkpoint

Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
HTTP status codes (3) - Success
200 OK Standard response for successful HTTP requests
201 Created The request has been fullled and resulted
in a new resource being created
202 Accepted The request has been accepted for
processing, but the processing has not been
completed
203 Non-Authoritative Information (since HTTP/1.1)
204 No Content The server successfully processed the
request, but is not returning any content.
205 Reset Content
206 Partial Content

Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
HTTP status codes (4) - Redirection
300 Multiple Choices Indicates multiple options for the
resource that the client may follow
301 Moved Permanently This and all future requests
should be directed to the given URI
302 Found
303 See Other (since HTTP/1.1) The response to the
request can be found under another URI using a GET
method
304 Not Modied Indicates the resource has not been
modied since last requested (caching)
307 Temporary Redirect (since HTTP/1.1) The request
should be repeated with another URI, but future
requests can still use the original URI

Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
Exercise
telnet www.geof.hr 80
Trying 161.53.2.66...
Connected to www.geof.hr.
Escape character is '^]'.
GET / HTTP/1.1
Host: www.geof.hr
HTTP/1.1 301 Moved Permanently
Date: Sun, 11 Mar 2012 10:26:12 GMT
Server: Apache/2.2.16 (Debian) PHP/5.2.6-1+lenny13 with Suhosin-Patch ...
Location: http://www.geof.unizg.hr/
Content-Length: 407
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://www.geof.unizg.hr/">here</a>.</p>
<hr>
</body></html>
Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
HTTP status codes (5) - Client Error
400 Bad Request The request cannot be fullled due to
bad syntax
401 Unauthorized Used when authentication is possible
but has failed or not yet been provided
402 Payment Required Reserved for future use
403 Forbidden The request was a legal request, but the
server is refusing to respond to it
404 Not Found The requested resource could not be
found but may be available again in the future
405 Method Not Allowed A request was made of a
resource using a request method not supported by
that resource
406 Not Acceptable A request was made of a resource
using a request method not supported by that
resource
Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
Exercise
telnet gi01.geoinfo.geof.hr 80
Trying 161.53.248.40...
Connected to gi01.geoinfo.geof.hr.
Escape character is '^]'.
GET /something HTTP/1.1
Host: gi01.geoinfo.geof.hr
HTTP/1.1 404 Not Found
Date: Sun, 11 Mar 2012 16:36:42 GMT
Server: Apache/2.0.55 (Ubuntu) mod_python/3.1.4 Python/2.4.3 PHP/5.1.2
Content-Length: 333
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /something was not found on this server.</p>
<hr>
</body></html>
Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
HTTP status codes (6) - Client Error
410 Gone Indicates that the resource requested is no
longer available and will not be available again
415 Unsupported Media Type The request entity has a
media type which the server or resource does not
support
418 Im a teapot This code was dened in 1998 as one
of the traditional IETF April Fools jokes
429 Too Many Requests Intended for use with rate
limiting schemes

Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
HTTP status codes (7) - Server Error
500 Internal Server Error A generic error message, given
when no more specic message is suitable
501 Not Implemented The server either does not
recognise the request method, or it lacks the ability
to fulll the request
502 Bad Gateway The server was acting as a gateway or
proxy and received an invalid response from the
upstream server
503 Service Unavailable The server is currently
unavailable, this is a temporary state
504 Gateway Timeout The server was acting as a
gateway or proxy and did not receive a timely
response from the upstream server

Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
Exercise
telnet gi01.geoinfo.geof.hr 80
Trying 161.53.248.40...
Connected to gi01.geoinfo.geof.hr.
Escape character is '^]'.
GET /cgi-bin/myscript HTTP/1.1
Host: gi01.geoinfo.geof.hr
HTTP/1.1 500 Internal Server Error
Date: Sun, 11 Mar 2012 16:44:27 GMT
Server: Apache/2.0.55 (Ubuntu) mod_python/3.1.4 Python/2.4.3 PHP/5.1.2
Content-Length: 669
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
...
Software Engineering in Geomatics
Exercise 2
Hypertext Transfer Protocol
Assignments
Choose 5 web sites you regularly visit, and for each site:
...
1
make a GET request for the root of the site (1)
...
2
examine status line, in case of redirection try to follow (2
points)
...
3
log all header information (1 point)
Send completed assignments to nastava@geoinfo.geof.hr, before
next exercise.
Software Engineering in Geomatics
Exercise 2
How computers work? (1)
computer is a big calculator
everything is a number
letter A 72
word SEIG 85,74,78,80
...
99.9% of computers use binary system to represent numbers
1 or 0 (charge or no charge)
Software Engineering in Geomatics
Exercise 2
How computers work? (2)
single piece of information is called a bit (two states 1 or 0)
8 bits == 1 byte
byte is the smallest piece of information a computer can
process
letter A (1 byte) 72 01001000
i.e. to store word SEIG we need 4 bytes
Software Engineering in Geomatics
Exercise 2
How computers work? (3)
1kB (kilobyte) = 1024 2
10
(multiple unit of byte)
1MB (megabyte) = 1024 kB = 1048576 B 2
20
1GB (gigabyte) = 1024 MB = 1048576 kB = 1073741824 B
2
30
1TB (terabyte) = 1024 GB = 1048576 MB = 1073741824 kB
= 1099511627776 B 2
40
did you ever wonder why 500G hard disk actually has 465GB
(1KiB (kibibyte) = 1000 10
3
) - marketing
Software Engineering in Geomatics
Exercise 2
How computers work? (4)
this is one of the rst memory chips it can store exactly 4 bits
modern day USB drives store 4GB = 34 359 738 368 bits

You might also like