+ All Categories
Home > Documents > SEIG EX2 Single

SEIG EX2 Single

Date post: 21-Jul-2016
Category:
Upload: josip-gulin
View: 26 times
Download: 3 times
Share this document with a friend
Description:
Software engineering 2
32
Software Engineering in Geomatics . . Software Engineering in Geomatics Dražen Odobašić Mario Miler Faculty of Geodesy, University of Zagreb Zagreb, March 20, 2013
Transcript

Software Engineering in Geomatics

.

...... Software Engineering in Geomatics

Dražen OdobašićMario Miler

Faculty of Geodesy, University of Zagreb

Zagreb, March 20, 2013

Software Engineering in GeomaticsExercise 2

Network computing models

Network computing

.Network computing..

......is a generic term in computing which refers to computers or nodesworking together over a network

distributed computingcloud computingresource sharing

processing power, storage, network bandwith, …

Software Engineering in GeomaticsExercise 2

Network computing models

Fuzzy history (1)

Mainframe:

1950 ⇒ …dominant in critical business applications and bulk dataprocessing (banks, government, …)dumb terminal computers

Software Engineering in GeomaticsExercise 2

Network computing models

Fuzzy history (2)

Client-server:

1980 ⇒ …more powerful/accessible computersone server serves many clientscurrently dominant modelconsumer oriented

Software Engineering in GeomaticsExercise 2

Network computing models

Fuzzy history (3)Peer-to-peer:

internet before interneteach node simultaneously client and serverdecentralized resource sharingnext big thing?Eben Moglen: The alternate net we need, and how we canbuild it ourselves http://is.gd/Ia1La8

Software Engineering in GeomaticsExercise 2

Network computing models

Client-server (1)

.Client-server..

......

is a common form of distributed system in which software is splitbetween server tasks and client tasks. A client sends requests toa server, according to some protocol, asking for information oraction, 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 GeomaticsExercise 2

Network computing models

Client-server (2)

Server:powerful networked computer sharing resourcespreforms a computational task on behalf of clients

responds to client request

single server can provide many servicesserver/service scalabilty:

horizontal scalabilityvertical scalability

Software Engineering in GeomaticsExercise 2

Network computing models

Client-server (3)

Client:A client is an application or system that accesses a servicemade available by a server.under-powered, inexpensive desktop computer, laptop, tablet,smartphone, …multipurpose deviceWeb browser as the ultimate client (cloud computing) ?

Software Engineering in GeomaticsExercise 2

Hypertext Transfer Protocol

HTTP (1)

.Hypertext Transfer Protocol..

......

is an application protocol for distributed, collaborative, hypermediainformation systems. HTTP is the foundation of datacommunication for the World Wide Web..Hypermedia..

......

is used as a logical extension of the term hypertext in whichgraphics, audio, video, plain text and hyperlinks intertwine tocreate a generally non-linear medium of information.

Software Engineering in GeomaticsExercise 2

Hypertext Transfer Protocol

HTTP (2)

1991. @CERN, Tim Barners-Lee and colleagues implementedfirst successful communication using HTTP between clientand server on internetcurrent 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

1https://tools.ietf.org/html/rfc2616

Software Engineering in GeomaticsExercise 2

Hypertext Transfer Protocol

HTTP (3)

HTTP functions as a request-response protocol in theclient-server computing modelHTTP Resources are identified and located on the network byUniform Resource Identifiers (URI) ⇒ Uniform ResourceLocator (URL)

https://en.wikipedia.org/wiki/Croatia#Culture

An HTTP session is a sequence of network request-responsetransactions.

Software Engineering in GeomaticsExercise 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 - authenticationdomainport - not bound to protocol, http=80, https=443, ftp=21, …path - on the serverquery_string - extra parameters sent to serverfragment - location on resource

http://user:[email protected]:123/new/my_service?uid=987&order=no#view

Software Engineering in GeomaticsExercise 2

Hypertext Transfer Protocol

Request methods (1)

.Request method..

......action to be performed on the identified resource (URL)

GET most used HTTP method, requests a representationof the specified resource, retrieves Responseheaders and Response body

HEAD asks for the response identical to the one that wouldcorrespond to a GET request, but without theresponse body.

POST submits data for processing (HTML Form)OPTIONS returns the HTTP methods that server supports for

specified URL

Software Engineering in GeomaticsExercise 2

Hypertext Transfer Protocol

Request methods (2)

PUT Uploads a representation of a specified resourceDELETE Deletes the specified resourceTRACE …

CONNECT …PATCH …

Safe methods: HEAD, GET, OPTIONS, TRACEonly intended for information retrieval and should not changestate on the server

Software Engineering in GeomaticsExercise 2

Hypertext Transfer Protocol

Exercise (1)

telnet - A terminal emulation program for TCP/IP networks

Make a HTTP request:host: gi01.geoinfo.geof.hrport: 80 (standard http)method: GETpath: / (root)

Software Engineering in GeomaticsExercise 2

Hypertext Transfer Protocol

Exercise (1.1)

putty - PuTTY is a free implementation of Telnet and SSH forWindows and Unix platforms

Make a HTTP request:host name: gi01.geoinfo.geof.hrport: 80 (standard http)conenction type: Rawclose window on exit: Never

method: GETpath: / (root)

Software Engineering in GeomaticsExercise 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.1Host: gi01.geoinfo.geof.hr

HTTP/1.1 200 OKDate: Fri, 09 Mar 2012 13:49:48 GMTServer: Apache/2.0.55 (Ubuntu) mod_python/3.1.4 Python/2.4.3 PHP/5.1.2Last-Modified: Sun, 15 Jul 2007 13:02:26 GMTETag: "38402a-3-f4b2fc80"Accept-Ranges: bytesContent-Length: 3Content-Type: text/html; charset=UTF-8

:)

Software Engineering in GeomaticsExercise 2

Hypertext Transfer Protocol

HTTP status codes (1)

The first line of the HTTP response is called the status line andincludes a numeric status code (such as ”404”) and a textualreason phrase (such as ”Not Found”).

Five groups:1xx Informational2xx Success3xx Redirection4xx Client Error5xx Server Error

Client (web browser) interpreters status code, a displayscustomized explanation/information message to user, if required.

Software Engineering in GeomaticsExercise 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 therequest body

101 Switching Protocols Requester has asked the serverto switch protocols and the server is acknowledgingthat it will do so

102 Processing (WebDAV)103 Checkpoint

… …

Software Engineering in GeomaticsExercise 2

Hypertext Transfer Protocol

HTTP status codes (3) - Success

200 OK Standard response for successful HTTP requests201 Created The request has been fulfilled and resulted

in a new resource being created202 Accepted The request has been accepted for

processing, but the processing has not beencompleted

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 Content206 Partial Content

… …

Software Engineering in GeomaticsExercise 2

Hypertext Transfer Protocol

HTTP status codes (4) - Redirection

300 Multiple Choices Indicates multiple options for theresource that the client may follow

301 Moved Permanently This and all future requestsshould be directed to the given URI

302 Found303 See Other (since HTTP/1.1) The response to the

request can be found under another URI using a GETmethod

304 Not Modified Indicates the resource has not beenmodified since last requested (caching)

307 Temporary Redirect (since HTTP/1.1) The requestshould be repeated with another URI, but futurerequests can still use the original URI

… …

Software Engineering in GeomaticsExercise 2

Hypertext Transfer Protocol

Exercisetelnet www.geof.hr 80Trying 161.53.2.66...Connected to www.geof.hr.Escape character is '^]'.GET / HTTP/1.1Host: www.geof.hr

HTTP/1.1 301 Moved PermanentlyDate: Sun, 11 Mar 2012 10:26:12 GMTServer: Apache/2.2.16 (Debian) PHP/5.2.6-1+lenny13 with Suhosin-Patch ...Location: http://www.geof.unizg.hr/Content-Length: 407Content-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 GeomaticsExercise 2

Hypertext Transfer Protocol

HTTP status codes (5) - Client Error

400 Bad Request The request cannot be fulfilled due tobad syntax

401 Unauthorized Used when authentication is possiblebut has failed or not yet been provided

402 Payment Required Reserved for future use403 Forbidden The request was a legal request, but the

server is refusing to respond to it404 Not Found The requested resource could not be

found but may be available again in the future405 Method Not Allowed A request was made of a

resource using a request method not supported bythat resource

406 Not Acceptable A request was made of a resourceusing a request method not supported by thatresource

Software Engineering in GeomaticsExercise 2

Hypertext Transfer Protocol

Exercise

telnet gi01.geoinfo.geof.hr 80Trying 161.53.248.40...Connected to gi01.geoinfo.geof.hr.Escape character is '^]'.GET /something HTTP/1.1Host: gi01.geoinfo.geof.hr

HTTP/1.1 404 Not FoundDate: Sun, 11 Mar 2012 16:36:42 GMTServer: Apache/2.0.55 (Ubuntu) mod_python/3.1.4 Python/2.4.3 PHP/5.1.2Content-Length: 333Content-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 GeomaticsExercise 2

Hypertext Transfer Protocol

HTTP status codes (6) - Client Error

410 Gone Indicates that the resource requested is nolonger available and will not be available again

415 Unsupported Media Type The request entity has amedia type which the server or resource does notsupport

418 I’m a teapot This code was defined in 1998 as oneof the traditional IETF April Fools’ jokes

429 Too Many Requests Intended for use with ratelimiting schemes

… …

Software Engineering in GeomaticsExercise 2

Hypertext Transfer Protocol

HTTP status codes (7) - Server Error

500 Internal Server Error A generic error message, givenwhen no more specific message is suitable

501 Not Implemented The server either does notrecognise the request method, or it lacks the abilityto fulfill the request

502 Bad Gateway The server was acting as a gateway orproxy and received an invalid response from theupstream server

503 Service Unavailable The server is currentlyunavailable, this is a temporary state

504 Gateway Timeout The server was acting as agateway or proxy and did not receive a timelyresponse from the upstream server

… …

Software Engineering in GeomaticsExercise 2

Hypertext Transfer Protocol

Exercise

telnet gi01.geoinfo.geof.hr 80Trying 161.53.248.40...Connected to gi01.geoinfo.geof.hr.Escape character is '^]'.GET /cgi-bin/myscript HTTP/1.1Host: gi01.geoinfo.geof.hr

HTTP/1.1 500 Internal Server ErrorDate: Sun, 11 Mar 2012 16:44:27 GMTServer: Apache/2.0.55 (Ubuntu) mod_python/3.1.4 Python/2.4.3 PHP/5.1.2Content-Length: 669Connection: closeContent-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 GeomaticsExercise 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 [email protected], beforenext exercise.

Software Engineering in GeomaticsExercise 2

How computers work? (1)

computer is a big calculatoreverything is a number

letter A ⇒ 72word ’SEIG’ ⇒ 85,74,78,80...

99.9% of computers use binary system to represent numbers1 or 0 (charge or no charge)

Software Engineering in GeomaticsExercise 2

How computers work? (2)

single piece of information is called a bit (two states 1 or 0)8 bits == 1 bytebyte is the smallest piece of information a computer canprocessletter A (1 byte) ⇒ 72 ⇒ 01001000

i.e. to store word ’SEIG’ we need 4 bytes

Software Engineering in GeomaticsExercise 2

How computers work? (3)

1kB (kilobyte) = 1024 210 (multiple unit of byte)1MB (megabyte) = 1024 kB = 1048576 B 220

1GB (gigabyte) = 1024 MB = 1048576 kB = 1073741824 B230

1TB (terabyte) = 1024 GB = 1048576 MB = 1073741824 kB= 1099511627776 B 240

did you ever wonder why 500G hard disk actually has 465GB(1KiB (kibibyte) = 1000 103) - marketing

Software Engineering in GeomaticsExercise 2

How computers work? (4)

this is one of the first ’memory chips’ it can store exactly 4 bitsmodern day USB drives store 4GB = 34 359 738 368 bits


Recommended