lesson №12 telecommunication network software design for http and internet lector: aliev h.u....

14
Lesson №12 Telecommunication network software design for HTTP and Internet Lector: Aliev H.U. TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES THE DEPARTMENT OF DATA COMMUNICATION NETWORKS AND SYSTEMS

Upload: sarah-riley

Post on 29-Dec-2015

217 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Lesson №12 Telecommunication network software design for HTTP and Internet Lector: Aliev H.U. TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES THE DEPARTMENT

Lesson №12Telecommunication network software design for

HTTP and Internet

Lector: Aliev H.U.

TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES

THE DEPARTMENT OFDATA COMMUNICATION NETWORKS AND SYSTEMS

Page 2: Lesson №12 Telecommunication network software design for HTTP and Internet Lector: Aliev H.U. TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES THE DEPARTMENT

HTTP and Internet

Page 3: Lesson №12 Telecommunication network software design for HTTP and Internet Lector: Aliev H.U. TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES THE DEPARTMENT

Intro• With the advent of the World Wide Web, there has been a massive increase in the usage

of the Internet since 1990. This was made possible with the advent of HyperText Transport Protocol (HTTP). Tim Berners-Lee first implemented the HTTP protocol in 1990-91 at CERN, the European Center for High-Energy Physics in Geneva, Switzerland.

• HTTP is a lightweight application-level protocol that sits on top of TCP, and it is of course known chiefly as the transport channel of the World Wide Web, and local intranets. However, it is a generic protocol that is used for many other tasks as well as hypertext, such as for name servers and distributed object management systems through its request methods, error codes, and headers. HTTP messages are in a MIME-like format, and contain meta data about the message (such as the type of content it contains and its length), and information about the request and response, such as the method used to send the request.

• There are two essential components on which the Web depends-the TCP/IP network protocol and HTTP. Almost everything that happens on the Web happens over HTTP, and the HTTP protocol is mainly used for exchanging documents (such as web pages) in the World Wide Web.

• HTTP is a client-server protocol through which two systems communicate, usually over a TCP/IP connection. An HTTP server is a program that listens on a port on the machine for incoming HTTP requests.

• An HTTP client opens a connection to the server through a socket, sends a request message for a particular document, and waits for a reply from the server. The server sends a response message containing a success or error code, headers containing information about the response, and (if the request was successful) the requested document.

Page 4: Lesson №12 Telecommunication network software design for HTTP and Internet Lector: Aliev H.U. TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES THE DEPARTMENT

Network architecture

Page 5: Lesson №12 Telecommunication network software design for HTTP and Internet Lector: Aliev H.U. TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES THE DEPARTMENT

Function of Browser

Page 6: Lesson №12 Telecommunication network software design for HTTP and Internet Lector: Aliev H.U. TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES THE DEPARTMENT

Network architecture

Page 7: Lesson №12 Telecommunication network software design for HTTP and Internet Lector: Aliev H.U. TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES THE DEPARTMENT

Service realization

Page 8: Lesson №12 Telecommunication network software design for HTTP and Internet Lector: Aliev H.U. TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES THE DEPARTMENT

Internet software design

Web server software

Client side web

browser

Page 9: Lesson №12 Telecommunication network software design for HTTP and Internet Lector: Aliev H.U. TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES THE DEPARTMENT

HTTP in .NET

• Although we can implement the HTTP protocol manually using the standard Sockets or TCP classes, .NET provides a number of classes (mostly in the System.Net namespace) that are designed to facilitate communication with an HTTP server. These implement the generic request/response model, along with some of the additional properties that provide a greater level of control over the HTTP-specific features, such as access to the HTTP protocol in an object model for property-level control over headers, authentication, pre-authentication, encryption, proxy support, pipelining, and connection management:

Page 10: Lesson №12 Telecommunication network software design for HTTP and Internet Lector: Aliev H.U. TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES THE DEPARTMENT

HTTP in .NET

Class Namespace Inherits From Description HttpWebRequest System.Net WebRequest Represents an HTTP request

HttpWebResponse System.Net WebResponse Represents an HTTP response

WebClient System.Net Component Provides easy-to-use methods for sending files or data to a URI, and receiving data from a URI

Uri System MarshalByRef Object Represents a URI, allowing easy access to the component parts of the URI, such as the hostname and absolute path

UriBuilder System Object Utility class for creating and modifying Uri objects

ServicePoint System.Net Object Handles connections to a given URI

ServicePoint Manager

System.Net Object Manager class for managing ServicePoint objects

Page 11: Lesson №12 Telecommunication network software design for HTTP and Internet Lector: Aliev H.U. TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES THE DEPARTMENT

HttpWebRequest and HttpWeb Response application example

• The .NET Framework provides two basic classes for simplifying HTTP access: HttpWebRequest and HttpWebResponse. These classes handle most of the functionality provided through the HTTP protocol in a straightforward manner.

• To see how these classes work, let's look at an example of using them to retrieve a web page from the Internet:

• using System; • using System.Net;• using System.IO; • using System.Text; • class SimpleWebRequest• { public static void Main() • { string query = "http://www.wrox.com"; • HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(query); HttpWebResponse

resp = (HttpWebResponse)req.GetResponse(); • StreamReader sr = new StreamReader(resp.GetResponseStream, Encoding.ASCII);

Console.WriteLine(sr.ReadToEnd);• resp.Close();• sr.Close(); } }

Page 12: Lesson №12 Telecommunication network software design for HTTP and Internet Lector: Aliev H.U. TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES THE DEPARTMENT

Languages for HTTP Server and client side programming

• For web page: HTML, Java script, Ajax, python and other interpreter languages;

• For server and client network applications: C++, C#, Java, Visual basic, J# and others.

• For data bases: SQL, PL-SQL.

Page 13: Lesson №12 Telecommunication network software design for HTTP and Internet Lector: Aliev H.U. TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES THE DEPARTMENT

Conclusion • The first step in Internet programming is to have a good knowledge

of how HTTP works, so we started the chapter by giving an overview of the HTTP protocol, before looking at the support for HTTP programming in .NET. This lesson basically concentrated on:

• An overview of HTTP-the basics of HTTP, its properties and features, and HTTP requests and responses

• Using the .NET methods and classes to work with the HTTP protocol

• Reading and writing cookies in .NET• Creating an HTTP server and client in .NET, and hosting ASP.NET

apps outside US• Using the HTTP channel with .NET Remoting

Page 14: Lesson №12 Telecommunication network software design for HTTP and Internet Lector: Aliev H.U. TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES THE DEPARTMENT

Q&A?