Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Class Two & Three

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 93

3.

INTRANET AND EXTRANET


Intranet

 Private network within an enterprise.


 May contain many interlinked local area networks.
 Uses the internet protocols such as http, tcp/ip.
 Organizations can send private messages through public network plus
encryption key.
 Accessed only by authorized persons, especially members or employees
of the organization
 Until you are connected to the company network some data's will not
be available to you.
Intranet

 An organization-wide software and


information distribution system that
applies Internet technology and
standards to a closed network
within the organization.
 Separated from other networks by
firewalls, a means of preventing
unauthorized access to the company’s
internal data or leaks of sensitive
company information
What is Firewall?

 Security device located between firm’s internal network (intranet) &


external network (internet).
 Regulates access into & out of a company’s network based on a set of
rules

 Note: needs to be upgraded from time to time to check latest potential security
problems.
Applications of Intranet

 Sharing of company policies/rules & regulations


 Access employee database
 Distribution of circulars/Office Orders
 Access product & customer data
 Sharing of information of common interest
 Launching of personal/departmental home pages
 Submission of reports
 Corporate telephone directories
 And many more…
Disadvantages of Intranet

 Management Problems
 A company may not have person to update their Intranet on a routine basis
 Fear of sharing information and the loss of control

 Security Problems
 Unauthorized access
 Denial of service
Extranet

 Extranet is an Intranet for outside


authorized users using same internet
technology.
 Inter-organizational information system.
 Enable outsiders to work together with
company’s employees.
 Open to selected suppliers, customers &
other business partners.
Extranet Examples…

 Dealers/Distributors have access to product files such as:-


 Product Specification,
 Pictures,
 Images, etc.
to answer the queries of the customer.
Components of extranets

 Some basic infrastructure components such as the internet including:-


 TCP/IP protocols,
 E-mail,
 Web-browsers,
 External business partners &
 Tele-commuting employees place order, check status & send E-mail.
Benefits of Extranet

 Improved quality.
 Lower travel costs.
 Lower administrative & other overhead costs.
 Reduction in paper work.
 Delivery of accurate information on time.
 Improved customer service.
 Better communication.
 Overall improvement in business effectiveness.
Disadvantages of Extranet

 The suppliers & customer might not have technical knowledge .


 Faceless contact.
 Information can be misused by other competitors.
 Fraud may be possible.
 Technical Employees are required.
Layered System View

• Public
• Private
• Restricted

Intranet Corporate members

Extranet Clients, partners, customers

Internet Global society: competitors


4.THE WEB(WORLD WIDE
WEB)
What is Web?
 The Web (World Wide Web) consists of information organized into
Web pages containing text and graphic images.
 It contains hypertext links, or highlighted keywords and images that
lead to related information.
 A collection of linked Web pages that has a common theme or focus is
called a Web site.
 The main page that all of the pages on a particular Web site are
organized around and link back to is called the site’s home page.
How to access the Web?
 Once you have your Internet connection, then you need special
software called a browser to access the Web.
 Web browsers are used to connect you to remote computers, open
and transfer files, display text and images.
 Web browsers are specialized programs.
 Examples of Web browser: Netscape Navigator (Navigator) and
Internet Explorer.
4.1 WEB ARCHITECTURE
Client/Server Structure of the Web

 Web is a collection of files that reside on


computers, called Web servers, that are
located all over the world and are connected to
each other through the Internet.
 When you use your Internet connection to
become part of the Web, your computer
becomes a Web client in a worldwide
client/server network.
 A Web browser is the software that you run
on your computer to make it work as a web
client.
Web Art….

Presentation Tier Web Browser Web Browser


HTTP
HTTPS
Web Browser
Web Browser

World Wide
Web

Web Server

Business Logic Application Code


Tier

Data Tier
RDBMS
What is a server?
 A server is a computer program or a device that
provides functionality for other programs or
devices, called "clients". This architecture is called
the client–server model.
 In the client/server programming model, a server
program awaits and fulfills requests from client
programs, which may be running in the same or
other computers.
 A given application in a computer may function as
a client with requests for services from other
programs and also as a server of requests from
other programs.
 Types of servers:-web server, application server,
proxy server, mail server, file server
Web Browser

 Provides user interface (GUI)


 Sends requests to web servers
 Processes responses: rendering html, images, and DHTML
 Tracks user history and user preferences
 Examples: Google chrome!!
Web Server

 Sets up communication btw client and your applications: spatial server,


databases, file servers, remote resources
 Manages, requests, responses, and authentication
 Runs server side code or calls compilation engines
 Keyhole to network; security holes start here
 Many options depending on operating system
 Examples: IIS, Websphere, Apache, others
Application Code

 Processes users input


 Produces dynamic response that is sent by web server to the client
 Examples:-PHP , ASP, JSP, JAVA, .NET, C++, etc.
Database/Data files
Relational Databases (RDBMS)
 High web traffic volume
 Read/write functionality
 All the power of an RDBMS
 Data security
 “Your application
Relational data models
is only as good as
 Scalability your data.”
 Examples: Oracle, SQL Server, DB2, ArcSDE, etc.
4.2 ADDRESSES ON THE WEB
Addresses on the Web:-IP
Addressing
 Each computer on the internet does have a unique identification number,
called an IP (Internet Protocol) address.
 The IP addressing system currently in use on the Internet uses a four-part
number.
 Each part of the address is a number ranging from 0 to 255, and each part
is separated from the previous part by period
 For example, 106.29.242.17
IP Addressing

 The combination of the four IP address parts provides 4.2 billion possible
addresses (256 x 256 x 256 x 256).
 This number seemed adequate until 1998.
 Members of various Internet task forces are working to develop an
alternate addressing system that will accommodate the projected
growth.
 However, all of their working solutions require extensive hardware and
software changes throughout the Internet.
TCP/IP Port number

 Computers require ports because of network application multitasking.


 Are logical ports that are assigned to the OS by the computer to manage
network connections.
 Computers require networking ports because network applications are
bound to your system.
 Eg:-on your computer you could have outlook, chrome(browser),ftp ,skype,
applications open and are connected to the internet to get you what you
want ,but the problem is your computer have only one IP address and Mac
address.
 Ports allow you to associate packets with TCP/IP protocols.
TCP/IP Port number?
Eg:-web browsing:-http tcp port 80
Network services are assigned a port Email:-smpp tcp port 25 & pop3 tcp
number. port 110
TCP/IP has 65,536 ports avaliable

Firewalls filter network traffic by port


numbers.

Block port 80 if you don’t want your


company to browse the internet

//Read more about port numbers…


Uniform Resource Locators

 The IP address and the domain name each identify a


particular computer on the Internet.

 However, they do not indicate where a Web page’s HTML


document resides on that computer.

 To identify a Web pages exact location, Web browsers rely on


Uniform Resource Locator (URL).
Uniform Resource Locators

 URL has the following syntax:-


 Protocol://hostname:port/path-and-file-name

There are four parts in the URL


1. Protocol:- The application-level protocol used by the client and server,
e.g., HTTP, FTP, and telnet
2. Hostname:-The DNS name eg(www.hilcoe.net) or IP address
(192.168.1.0)of the server
3. Port:- The TCP port number that the server is listening for incoming
requests from the clients.
4. Path-and-file-name:- The name and location of the requested resource,
under the server document base directory
Structure of a Uniform Resource Locators

protocol pathname

http://www.HiLCoE.net/webdevanddesign/index.htm

Domain name filename

http => Hypertext Transfer Protocol


The port number was not specified in the URL, and takes on the default number,
which is TCP port 80 for HTTP.
Encoded URL

URL cannot contain special characters, such as blank or '~'. Special characters
are encoded, in the form of %xx, where xx is the ASCII hex code.

Contains query strings and fragments

For example:-, '~' is encoded as %7e; '+' is encoded as %2b. A blank can be
encoded as %20 or '+'.

The URL after encoding is called encoded URL.


URI(Uniform Resource Name)

 A URN is a URI that identifies a resource by name in a particular


namespace.
 A URN may be used to talk about a resource without implying its location
or how to access it.

 EG:- The URL urn:isbn:0451450523 corresponds to The 1968


book
The Last Unicorn, identified by its book number. It follows the
International Standard Book Number (ISBN) system

Read More:-https://en.wikipedia.org/wiki/Uniform_Resource_Name
URI,URL and URN
Domain Name Addressing

 Most web browsers do not use the IP address to locate Web sites and
individual pages.
 They use domain name addressing.
 A domain name is a unique name associated with a specific IP address
by a program that runs on an Internet host computer.
 This program, which coordinates the IP addresses and domain names for
all computers attached to it, is called DNS (Domain Name System )
software.
 The host computer that runs this software is called a domain name
server.
Domain Name Addressing

 Domain names can include any number of parts separated by periods,


however most domain names currently in use have only three or four
parts.
 Domain names follow hierarchical model that you can follow from top to
bottom if you read the name from the right to the left.
 For example, the domain name gsb.uchicago.edu is the computer
connected to the Internet at the Graduate School of Business (gsb),
which is an academic unit of the University of Chicago (uchicago), which
is an educational institution (edu).
 No other computer on the Internet has the same domain name.
Domain Name Addressing(How it works)
Domain Name Addressing(Root Servers)
How to find information on the Web?
 A number of search tools have been developed and available to you on
certain Web sites that provide search services to help you find information.
 Examples:
 Yahoo  www.yahoo.com
 Excite  www.excite.com
 Lycos  www.lycos.com
 AltaVista  www/alta-vista.com
 MSN WebSearch  www.search.msn.com
How to find information on the Web?

 You can find information by two basic means.


 Search by Topic and Search by keywords.
 Some search services offer both methods, others only one.
 Yahoo offers both.
 Search by Topic

You can navigate through topic lists


 Search by keywords

You can navigate by entering a keyword or phase into a search text box.
Wake Up Quiz

 1. Does the term internet and web the same thing? why?
 2. What are servers? Example?
 2.What is DNS?
 3.What is are the four parts of the url?
Group Reading Assignment

Form a group and submit a paper with a maximum of 5 pages using the ff
details ,I would consider the group your forming to do this assignment the same as the one
you use in the final project.

TITLE:-The Internet revolution in Ethiopia.


 your paper should answer the following 4 questions
 1. how the internet started in Ethiopia?
 2. What kind of cables were used? history of cables used?
 3.What kind of internet offers does our ISP provides for us now? For
organizations and individuals?
 4.Whats the current internet architecture in Ethiopia ?
 Note:-Plagiarism is forbidden, use your words instead of copying from the
web.
5.HTTP CONCEPTS
Terminology

 IP Address: An Internet Protocol address (IP address) is a numerical label


assigned to each device (e.g., computer, printer) participating in a computer
network that uses the Internet Protocol for communication.
 TCP: Transmission Control Protocol (TCP) is one of the two original core
protocols of the Internet Protocol Suite (IP), and is so common that the
entire suite is often called TCP/IP. TCP provides reliable, ordered, error-
checked delivery of a stream of octets between programs running on
computers connected to an intranet or the public Internet.
 Port Number: A port number is a 16 bit number which when associated
with IP address, completes the destination address for a communications
session.
 Socket: A socket is nothing but a combination of IP address and port
number. It is simply an end while communication.
HTTP DEFINITION

 Http is the set of rules for transferring files(text, graphics,….)on the WWW.
 The rules governing the conversation between a Web client and a Web
server
What is a protocol?
 In diplomatic circles, a protocol is the set of rules governing a
conversation between people

 We have seen that the client and server carry on a machine-to-machine


conversation

 A network protocol is the set of rules governing a conversation between


a client and a server

 There are many protocols, HTTP is just one


Internet is made up of protocols
HTTP
 Application-layer protocol
 A browser works as an HTTP client because it
sends requests to an HTTP server which is
called Web Server.
 The Web Server then sends responses back to
the client. The standard and default port for
HTTP servers to listen on is 80, but it can be
changed to any other port like 8080.

 Read More:-https://technet.microsoft.com/en-
us/library/cc958821.aspx
 http://www.omnisecu.com/tcpip/tcpip-model.php
The TCP/IP protocol layers
The application program is king – it gets work done using
the lower level layers for communication between the client
and server.
Get useful work done – retrieve Web pages,
Application copy files, send and receive email, etc.

Make client-server connections and


Transport optionally control transmission speed,
check for errors, etc.
Route packets between networks
Internet

Route data packets within the local area


Data link network
Specify what medium connects two nodes,
Physical how binary ones and zeros are
differentiated, etc,
TCP/IP Frame in DL Layer
Three Important Things about HTTP

 HTTP is connectionless: After a request is made, the client disconnects


from the server and waits for a response. The server must re-establish the
connection after it process the request.
 HTTP is media independent: Any type of data can be sent by HTTP as
long as both the client and server know how to handle the data content.
 HTTP is stateless: This is a direct result of HTTP’s being connectionless.
The server and client are aware of each other only during a request.
Afterwards, each forgets the other. For this reason neither the client nor
the browser can retain information between different request across the
web pages.
5.2 HOW HTTP IT WORKS
How HTTP works?

 HTTP is implemented in two programs: a client


program and a server program, executing on
different end systems, talk to each other by
exchanging HTTP messages.

 The HTTP client first initiates a TCP connection


with the server. Once the connection is
established, the browser and the server
processes access TCP through their socket
interfaces.
How HTTP Works?...

 Suppose client wants to visit www.yahoo.com


 Read more about Port numbers.
How HTTP Works?...
How HTTP Works?...
How HTTP Works?...
How HTTP Works?...
5.3 HTTP MESSAGES
An HTTP conversation

Client Server
I would like to open
a connection OK

GET <file location>


Send page or error message

Display response
Close connection
OK
HTTP Request and Response Messages

 HTTP makes use of the Uniform Resource Identifier (URI) to identify a


given
resource and to establish a connection.
 Once the connection is established, HTTP messages are passed in a
format similar to that used by the Internet mail [RFC5322] and the
Multipurpose Internet Mail Extensions (MIME) [RFC2045].
 An HTTP message consists of a message header and an optional message
body, separated by a blank line, as illustrated below:-
5.3.1 HTTP
REQUEST MESSAGES
Request Message

 The format of an HTTP request message is as follow


Request Line

 Request Line
 The first line of the header is called the request line, followed by
optional request headers.
 The request line has the following syntax:
Request-method-name request-URI HTTP-version
 request-method-name: HTTP protocol defines a set of request
methods, e.g., GET, POST, HEAD and OPTIONS. The client can use
one of these methods to send a request to the server. GET is the
most common HTTP method.
 request-URI: specifies the resource requested. (local path of
requested resource)
 The path is the part of the URL after the host name. This path is
also called the request Uniform Resource Identified (URI). A
URI is like a URL, but more general.
 HTTP-Version: Three versions are currently in use: HTTP/1.0,
HTTP/1.1 and HTTP/2.0 (“HTTP/x.x” Uppercase)
HTTP Request Message…

 Examples of request line are:


 GET /test.html HTTP/1.1
 HEAD /test.html HTTP/1.0
 POST /index.html HTTP/2.0

 Example of a request header when requesting for HILCoE ’s web site


Minimal HTTP/1.1 Exchange

GET / HTTP/1.1
Host: www.acme.com

HTTP/1.1 200 OK
Content-Type: text/html

<html>
<head><title>Acme, Inc Homepage</title></head>
<body><h1>Welcome to Acme!</h1> … </body>
</html>

66
HTTP Request Methods
 HTTP protocol defines a set of request methods (also called
Verbs). A client can use on of these request methods to send
request message to an HTTP server. The methods are:
 GET
 HEAD
 POST
 PUT
 DELETE
 OPTIONS
 TRACE
 CONNECT
 PATCH
HTTP Request Methods…

 “GET” Request Method


 A client can use the GET request to get a web resource from the server.
 GET is the most common HTTP request method. A client can use the GET
request method to request (or “get”) for a piece of resource from an HTTP
server. A GET request message takes the following syntax:
GET request-URI HTTP-version
(optional request headers)
(blank line)
(optional request body)
HTTP Request Methods…

 The keyword GET is case sensitive and must be in uppercase.


 request-URI: specifies the path of resource requested, which must begin
from the root “/” of the document base directory.
 HTTP-version: HTTP/1.0, HTTP/1.1 or HTTP/2.0. This client negotiates
the protocol to be used for the current session. For example, the client
may request to use HTTP/1.1. If the server does not support HTTP/1.1, it
may inform the client in the response to use HTTP/1.0.
 The client uses the optional request headers (such as Accept, Accept-
Language, and etc.) to negotiate with the server and ask the server to
deliver the preferred contents (e.g., in the language that the client
preferred).
 GET request message has an optional request body which contains the
query string (to be explained later).
HTTP Request Methods…

 HEAD: Asks for the response identical to the one that would correspond
to a GET request, but without the response body. This is useful for
retrieving meta-information written in response headers, without having to
transport the entire content.
 A client can use the HEAD request to get the header that a GET
request would have obtained. Since the header contains the last-
modified date of the data, this can be used to check against the
local cache copy.
 POST: Requests that the server accept the entity enclosed in the request
as a new subordinate of the web resource identified by the URI. The data
posted might be, as examples, an annotation for existing resources; a
message for a bulletin board, newsgroup, mailing list, or comment thread;
a block of data that is the result of submitting a web form to a data-
handling process; or an item to add to a database.
HTTP Request Methods…

 PUT: Requests that the enclosed entity be stored under the supplied URI.
If the URI refers to an already existing resource, it is modified; if the URI
does not point to an existing resource, then the server can create the
resource with that URI.
 Ask the server to store the data.

 DELETE: Deletes the specified resource.


 Ask the server to delete the data.

 TRACE: Echoes back the received request so that a client can see what (if
any) changes or additions have been made by intermediate servers.
 Ask the server to return a diagnostic trace of the actions it takes.
HTTP Request Methods…

 OPTIONS: Returns the HTTP methods that the server supports for the
specified URL. This can be used to check the functionality of a web server
by requesting ‘*’ instead of a specific resource.
 Ask the server to return the list of request methods it supports.
 CONNECT: Converts the request connection to a transparent TCP/IP
tunnel, usually to facilitate SSL-encrypted communication (HTTPS)
through an unencrypted HTTP proxy.
 Used to tell a proxy to make a connection to another host and simply
reply the content, without attempting to parse or cache it. This is often
used to make SSL connection through the proxy.
 PATCH: Is used to apply partial modifications to a resource.
 HTTP severs are required to implement at least the GET and HEAD
methods and, whenever possible, also the OPTIONS method.
HTTP Request Methods…

 Safe (No side effect on the server side)


 GET, HEAD,TRACE,OPTIONS,
 Idempotent (Can be applied repeatedly with no harm)
 PUT, GET,HEAD,OPTIONS, DELETE, HEAD
HTTP Header Server Configuration using PHP

Db.php

header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: PUT, GET, POST,DELETE");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type,
Accept");

Index.php

fetch({
method:'get',
url:'http://localhost/db.php',
})
5.4.2 HTTP
RESPONSE MESSAGES
HTTP Response Message

 The format of the HTTP response message is as follows:


HTTP Response Message…

 Status Line
 The first line is called the status line, followed by optional response
header(s).
 The Status line has the following syntax:
 HTTP-version status-code reason-phrase

 HTTP-version: The HTTP version used in the session. HTTP/1.0,


HTTP/1.1 or HTTP/2.0
 Status-code: a 3-digit number generated by the server to reflect
the outcome of the request
 Reason-phrase: gives a short explanation to the status code.
 Common status code and reason phrase are “200 OK”, “404 Not
Found”, “403 Forbidden”, “500 Internal Server Error”.
HTTP Response Message…

 Examples of status line are:


 HTTP/1.1 200 OK
 HTTP/1.0 404 Not Found
 HTTP/2.0 403 Forbidden

 The following is the response message when requesting a HILCoE ‘s


index page
HTTP Status Messages (1xx: Information)

Message Description
100 Continue Only a part of the request has
been received by the server, but
as long as it has not been
rejected, the client should
continue with the request
101 Switching Protocols The server switches protocol
HTTP Status Messages… (2xx: Successful)
Message Description
200 OK The request is OK
201 Created The request is complete, and a
new resource is created
202 Accepted The request is accepted for
processing, but the processing is
not complete
203 Non-authoritative
Information
204 No Content
205 Reset Content
206 Partial Content
HTTP Status Messages… (3xx: Redirection)

Message Description
301 Permanent A page has permanently move to
a new location.
302 Temporary Temporary redirection to a
resource.
HTTP Status Messages… (4xx: Client Error)
Message Description
400 Bad Request Incorrect or corrupted request,
that the server couldn’t
understand it
403 Forbidden Accessing the page or resource
you were trying to reach is
absolutely forbidden for some
reason.
404 Not Found The resource couldn’t not be
found on the server
HTTP Status Messages… (5xx: Server Error)
Message Description
500 Internal Server Error The request was not completed. The
server met an unexpected condition
501 Not Implemented The request was not completed. The
server did not support the
functionality required
502 Bad Gateway The request was not completed. The
server received an invalid response
from the upstream server
503 Service Unavailable The request was not completed. The
server is temporarily overloading or
down
504 Gateway Timeout The gateway has timed out
505 HTTP Version Not Supported The server does not support the “http
protocol” version
206 Partial Content
5.5 BEYOND HTTP
HTTP Limitations

In order to fetch multiple resources from a server,


HTTP/1.0 opens multiple connections to that server
 Extra costs in connection set-up/teardown
 Increased latency if connections are not concurrent

Two partial solutions


 Reuse connections – HTTP Keep-Alive
 Service requests in parallel – HTTP Pipelining
HTTP/1.0 and earlier

Before HTTP/1.1, each HTTP request Clien Serv


used a separate TCP connection t er
GET
TCP open

TCP close 200 OK


GET
TCP open

200 OK
TCP close
GET
TCP open

200 OK
TCP close

86
HTTP Keep-Alive

HTTP/1.1 introduced keep-alive Clien Serv


t er
TCP connections reused for multiple GET
HTTP requests TCP open

200 OK
GET

200 OK
GET

TCP close 200 OK

87
HTTP Pipelining

Also available from HTTP/1.1 Clien Serv


t er
Pipelining allows multiple requests to GET
be made without waiting for TCP open
responses GET

Server must send responses in same GET


order as received requests 200 OK

Reduces latency 200 OK

TCP close 200 OK

88
5.6 STORAGE
Cookies

 HTTP is stateless protocol


 Cookies manage state maintenance by shifting the burden to client
 Cookies are transmitted in clear text (security issue)

Client Server

Usual HTTP Request


1st client Client does
request Usual HTTP Response, not interpret
including header line Set- the cookie
cookie: <cookie> string

Usual HTTP Request, Server is


including header line Set- presented
2nd client cookie: <cookie> with the
request previously
Usual HTTP Response returned
state
Web Caching

 Also called proxy server, is a network entity


that satisfies HTTP requests on the behalf of an
origin Web server.
 The Web cache has its own disk storage and
keeps copies of recently requested objects in
this storage.
 A Web cache can substantially reduce the
response time for a client request, particularly
if the bandwidth between the client and the
origin server is much less than the bandwidth
between the client and the cache.
 Web caches can substantially reduce traffic
Conditional GET
Reading Assignment I (HTTP/1.0 vs HTTP/1.1 vs
HTTP/2.0)

 Read about HTTP/1.0, HTTP/1.1 and HTTP/2 and compare the different
versions including what's new in HTTP/2.

You might also like