web tech class 2

30
Mr. Debojit Boro Assistant Professor,Tezpur University,Napaam,Tezpur-784028 Web Technology Batches: M.Tech. 2 nd Semester B.Tech 6 th Semester B.Tech. 8 th Semester MCA 4 th Semester B.Tech. Electronics 8 th Semester Class No. 2

Upload: jakaltarget

Post on 10-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 1/30

Mr. Debojit Boro

Assistant Professor,Tezpur University,Napaam,Tezpur-784028

Web Technology

Batches:

M.Tech. 2nd Semester 

B.Tech 6th Semester 

B.Tech. 8th Semester 

MCA 4th Semester 

B.Tech. Electronics 8th Semester 

Class No. 2

Page 2: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 2/30

Page 3: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 3/30

Network Connectors

To connect different types of networks we have the

following types of network connectors:

Repeaters : low level device that connects cable

segments and amplify weak signals

Bridges: Connects similar LANs , store and forward

data link layer frames between LANs

Routers: Connects dissimilar networks, store and

forward network layer packets

Gateway: Connects dissimilar networks at transport

layer 

Page 4: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 4/30

Network Software

 Applications over Internet are designed as services.

 A service consists of two discrete componentscalled client and server .

Together, the two form a complete computingsystem with a distinct division of responsibility.

 A client requests a server for a service and theserver responds with the service.

Clients need to be aware of the servers that areavailable but usually do not know of the existence of other clients.

Page 5: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 5/30

Middleware

The software which enables the clients and servers of internetservices to communicate is termed as middleware.

Network middleware is complex in nature. Therefore the softwarearchitecture adopted for network software is modular one.

Each module is called a layer.

The advantages of layered architecture are

It divides the complex network operation into more meaningfuland manageable layers.

Defines the standard interface for the plug and play multi-vendor 

integration. Facilitate modular engineering. Changes in one layer does not

effect other layers.

Ensures interoperable technology.

 Accelerate evolution

Simplifies teaching and learning

Page 6: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 6/30

Types of Middleware

Remote Procedure Call ² Client makes calls to proceduresrunning on remote systems. Can be asynchronous or synchronous.

Message Oriented Middleware ² Messages sent to the client

are collected and stored until they are acted upon, while theclient continues with other processing.

Object Request Broker ² This type of middleware makes itpossible for applications to send objects and request services inan object-oriented system.

SQL-oriented Data Access ² middleware between applicationsand database servers.

Embedded Middleware ² communication services andintegration interface software/firmware that operates betweenembedded applications and the real time operating system.

Page 7: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 7/30

Middleware contd«

Middleware services provide a more functional set of 

application programming interfaces to allow an

application to:

Locate transparently across the network, thusproviding interaction with another service or application

Be independent from network services

Be reliable and always availablewhen compared to the operating system and network

services

Page 8: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 8/30

Use or advantage of Middleware

 Allows access to the database systems to a user through

a restricted network

 Allows transparent access to the database management

systems or applications via Web Server without regard todatabase specific characteristics

Link information from Information databases such as

payrolls,sales

In data mining in Laboratory Informations Systems

Page 9: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 9/30

Fat Servers V/s Fat Clients

The 2-tier system take two forms. We know that in a 2-tier systemthe server holds the data management layer and the client holdsthe presentation layer. Shifting of application logic layer constitutes the distinction between fat clients and servers.

Thin-Client Fat-Server Model : In a thin client model all theapplication logic and data management are carried out on theserver. The client is simply responsible for running thepresentation software. Examples of fat server systems:Groupware servers, web servers

Fat-Client Thin-Server Model : In this model, the server is onlyresponsible for data management. The software on the clientimplements the presentation layer and application logic layer.Examples of fat client systems: File server 

Page 10: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 10/30

Advantages of Thin-Client Fat-Server Model

It is usually easier to manage and deploy since the data and thecode exist in a centralized location

Instead of coordinating across a network, debugging is all donefrom one machine. Unfortunately, as mobile servers and clientsbecome a norm, this benefit will become less important.

Reduces the problem of limited bandwidth by carrying out mostof the work where data resides, reducing the need for costly datatransfer over the network

Mission critical applications requiring the highest degree of faulttolerence and stability use fat servers for ease of maintenance

Used to ensure greater compatibility between client and server.The more work the server does, the less dependent it is on theclient

Page 11: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 11/30

Advantages of Fat-Client Thin-Server Model

Let users create application and modify complex front-ends tothe system but at the price of reduced data encapsulation

 As more responsibility is placed on a client, the client requires

more intimate knowledge regarding the organization of data onthe server end.

With the advent of object-orientation having high degree of dataencapsulation servers can provide more abstract services to the

client hiding raw data from the client

Since client systems are highly powered now a days we see anindustry trend towards fat client with object-orientation.

Page 12: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 12/30

OSI Reference Model

The standard model for network middleware is OSI(Open SystemInter-connection) Reference Model.

It is an ISO standard for data communication over network.

It is a de-jure standard, meaning, a cannonical standard.

OSI Reference model is a stack of seven layers

Upper layers:

7. Application Layer 

6. Presentation Layer 

5. Session Layer 

Lower Layers 4. Transport Layer message

3. Network Layer Packet

2. Data Link Layer Frame

1. Physical Layer Bit

Data generation is the responsibility of upper layers, while datatransmission is the responsibility of lower layers.

Page 13: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 13/30

Subnet

Subnetting allows a network to be splitted into several parts for internal use but still act like a single network to the outside world.

Each part is called a subnet. Some of the bits from host no. of the IP address are taken as subnet number.

1 0 Network Number Host Number 

Page 14: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 14/30

Subnet Diagram

Page 15: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 15/30

Subnet contd«

When an IP packet reaches, the router determines thesubnet and the host and routes the packet.

 A subnet is implemented in the router using a subnetmask that indicates the split between(network+subnet) and the host.

Say for example, the subnet mask is 255.255.252.0.When a packet addresses to 130.50.15.6 reaches therouter, it is ANDed with the subnet mask giving theactual address 130.50.12.0.

It now finds from the routing table which subline to useto deliver the packet to the host.

 A machine in the network may have more than one IP Address.

Page 16: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 16/30

ARP, RARP

 Although every machine on the Internet has one or more IPaddresses, these cannot be used for sending packets.

Because datatalink layer hardware ( Network Interface Card,NIC) does not understand IP addresses. For example, everyEthernet card comes with a 48 bit ethernet address.

The cards send and receive frames based on 48-bit ethernetaddresses but not on 32-bit IP addresses.

Therefore, a mapping of an IP-address to ethernet address isrequired.

The protocol used for this mapping is ARP.

 ARP uses broadcast mode instead of a configuration file. A hostbroadcasts the question, say Who owns the IP-address192.31.65.5? Every host in the subnet listens and the hosthaving the IP address will reply with the ethernet address (sayE3).

Reverse Address Resolution Protocol(RARP, RFC 903) does the

reverse. Given an ethernet address, it gives the corresponding IPaddress.

Page 17: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 17/30

Transport Layer 

The goal of the transport layer is to provide efficient,reliable, cost effective service to the processes in theapplication layer.

In this layer we have Transport Control Protocol (TCP)and User Datagram Protocol (UDP).

TCP is reliable and connection-oriented protocol. It isformally defined in RFC-793/1122/1323.

UDP is unreliable, connectionless protocol. TCP accepts

user's message from the application layer and breaksthem into small packets and hands over to network layer.

When the recipient receives the packets, it reassemblesthe packets to the original message again.

Page 18: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 18/30

Sockets

 A TCP service is obtained by both the sender and the receiver creating end points, calledsockets.

 A TCP level connection is point-to-point. It does not support multi-cast and broad-cast

directly.

Each socket has a socket number consisting of 

32-bit IP address of the host and a 16-bitnumber local to that host, called the portnumber, in the range 1 - 65536.

Port No < 1024 are called well-known ports and

port no >= 1024 are randomly selected.

Page 19: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 19/30

Domain Name

Now, for a common user it is hard to remember correctly

an IP Address

 An equivalent textual name is associated with this

number and such a name is called domain name.  A user can use this domain name in lieu of the IP

address.

The domain name of the machine 202.141.129.22 is

www.tezu.ernet.in. Generic (.com, .edu .gov .org .net)

Country (.in, .jp .us .nl «)

Page 20: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 20/30

Domain Name System (DNS)

 A hierarchical, domain-based naming scheme

Implemented using a distributed database

It resovles domain-names to IP Address

The resolver sends a UDP packet to a local DNS server,which then looks up the name and terurn the IP address

Domain names are case insensitive.

Component names are upto 63 char and full names areupto 255 character long

There is co correspondence among component namesand bytes of IP address

Page 21: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 21/30

DNS in Linux

The DNS server software in Red Hat Linux is

Berkley Internet Name Daemon (BIND).

The Daemon process is named  :/usr/bin/named

Configuration file :  / etc  / named.conf 

Zone Directory :  /v ar  / named 

Eg y ourdomain.com.db

Resource Record: 5-tuple

(Domain_name, TTL, Class, Type, Value)

Page 22: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 22/30

Virtual Hosting

Normally one host has one domain name

IP address, Domain Name is 1:1

Virtual Host IP: DN is 1:M One IP address but multiple domain name

Web Site hosting agencies use virtual hosting

 A host may have more than one IP address,if it is connected to many networks

Used or applied in Shared Web Hosting

Page 23: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 23/30

Types of Virtual Hosting

Name Based ± Uses multiple hostnames for the same web server IPaddress.Browser specifies the address by setting the Host HTTP header 

with the host specified by the user.

For instance, a server could be receiving requests for two domains,

www.example.com and www.example.net, both of which resolve to the

same IP address. For www.example.com, the server would send the HTMLfile from the directory /var/www/user/Joe/site/, while requests for 

www.example.net would make the server serve pages from

/var/www/user/Mary/site/.

Disadvantage ± Occurs when DNS fails

Port Based- www.example.com:81 for port 81, or www.example.com:8000

for port 8,000 provided the port used is free

IP Based ± multiple IP addresses on one interface

Page 24: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 24/30

Internet Service:TELNET

Remote Login(TELNET) a servicewhich allows a local machine tologin to a remote machine.

The local machine now works asa terminal of the remote machine.

TELNET is the basis of other application protocols, like FTP,HTTP etc

Step1 telnet 202.141.129.18 Step2 login : password:

Step3 commands

Step 4 bye

telnet

client

telnet

server 

23

Page 25: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 25/30

Internet Service:FTP

File Transfer(FTP) service

allows users to download from

and upload files to a remote

machine to login to a remotemachine.

Step1 ftp 202.141.129.18

Step2 login : password:

Step3 bin Step4 get / put

Step54 bye

ftp

client

ftp

server 

21

Page 26: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 26/30

Internet Service:E-MAIL

This is the electronic sustitute

of conventional mail system.

Basic function is to send and

receive electronic messages.  A mail client talks to a mail

server using a mail protocol

There are basically three mail

protocol SMTP (RFC 822/2822) Port 25

POP3 (RFC 1939) Port 110

IMAP (RFC 2060) Port 143

mail

client

mail

server 

Page 27: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 27/30

Internet Service:E-MAIL

SMTPServer 

POP3

Server 

TELNET

Server 

IMAP

Server 

SMTPClient

SMTP

ISP ISP

TELNET

Client

POP3

ClientIMAP

Client

23110 143

25

Page 28: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 28/30

Internet Service:Web

The World Wide Web (www) or 

the Web service is the most

popular sevice on the Internet

WWW was originated byTimothy Berners Lee in march

1989 at CERN

WWW is a network of pages

containing hypermediainformation

 A Web client, talks to a Web

server (Port 80) using HTTP

(HyperText Transport Protocol)

Page 29: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 29/30

Web Service

Page 30: Web Tech Class 2

8/8/2019 Web Tech Class 2

http://slidepdf.com/reader/full/web-tech-class-2 30/30