You are on page 1of 27

Founded 1991 by Md.

Alimullah Miyan 1991-2016

Yearlong Countrywide Silver Jubilee Celebration (2016-2017)

CSC 465
Data Communication and Computer Networks

Abhijit Saha, Ph.D.


Professor
Dept. of Computer Science and Engineering (CSE)
College of Engineering and Technology (CEAT)
IUBAT, Uttara, Dhaka
Email: asaha@iubat.edu
English is the First Language of IUBAT Campus

• This is mandatory for everyone including students in all


interactions and communications as of January 1, 2014.
• If any student face difficulty, s/he is advised to contact
Mr Nazmul Haque Khan (Room No: 224/A, Cell:
01727277166, Email: nazmul@iubat.edu, Ext: 460, )
for arranging special spoken English training.
• Violation of English as the First Language in the
Campus will lead to administrative and disciplinary
action.
• All are urged to help each other to develop the Facility
of Communicating in English as the First Language in
the Campus
Web Architecture

• WWW is a distributed client/server service, in which a client


using a browser can access a service using a server
• However, the service provided is distributed over many
locations called sites

CSC 465 3
Web Architecture (Cont’)

• Browser consists of 3 parts:


– Controller (receives input, uses the client
programs, and use one of the interpreters)
– Client protocol (FTP or HTTP)
– Interpreter (HTML, Java, or JavaScript)
• Server
– Web page is stored at the server
 Cache in memory
 Multithreading or multiprocessing
• Uniform Resource Locator (URL)
– URL is a standard for specifying any kind of
information on the Internet

80 by default

CSC 465 4
Web Architecture (Cont’)

• Cookies
– The WWW was originally designed as a stateless entity
– Cookies are needed for extending functionalities of the Web, such as:
– To remember past client in order to show a customized webpage

• Creation and storage of Cookies


– When a server receives a request from a client, it stores information
about the client in a file or a string
– The server includes the cookie in the response that it sends to the
client
– When the client receives the response, the browser stores the
cookie in the cookie directory

CSC 465 5
Web Architecture (Cont’)
Example of Cookies:

CSC 465 6
Web Documents

• Web documents can be grouped into three broad categories:

• The category is based on the time at which


— the contents of the document are determined

CSC 465 7
Web Documents (Cont’)
1. Static Documents
• Fixed-content documents (Created and stored in a server)
• Contents of the server can be changed by the server not by user
• Static documents are prepared by using one of several language:
• Hypertext Markup Language (HTML), Extensible Markup
Language (XML), Extensible Hypertext Markup Language
(XHTML)

CSC 465 8
Web Documents (Cont’)
2. Dynamic Documents

• A dynamic document is created by a Web server


whenever a browser requests the document
• Example: retrieval of time and date from server
• Common Gateway Interface (CGI) was used to
retrieve a dynamic document in the past
• Today’s options include one of the scripting
languages such as Java Server Pages (JSP), which
uses the Java language for scripting, or Active
Server Pages (ASP), a Microsoft product that uses
Visual Basic language for scripting, or ColdFusion,
which embeds queries in a Structured Query
Language (SQL) database in the HTML document.

Dynamic documents are sometimes referred to as server-site dynamic documents

CSC 465 9
Web Documents (Cont’)
3. Active Documents

• In many applications, we need


a program or a script to be run
at the client site. These are
called active documents.
• Example: A program that
creates animated graphics
• Java applets used to create an
active document in server side
• Another way, JavaScripts can
be used but download and run
in the client side

Active documents are sometimes referred to as client-site dynamic documents


CSC 465 10
Web Documents (Cont’)
3. Active Documents (cont’)

CSC 465 11
Hypertext Transfer Protocol (HTTP)
• HTTP is a protocol used mainly to access data on the WWW

• In other words, HTTP is used to define how the client-server


programs can be written to retrieve web pages from the Web.

• HTTP uses the services of TCP on well-known port 80 in server side


and temporary port number in client side

• HTTP Transaction:
 HTTP uses the services of TCP, but it is a stateless protocol

CSC 465 12
Persistent/Non persistent Connections

• In a nonpersistent connection, one TCP connection is made for


each request/response.

• In a persistent connection, the server leaves the connection


open for more requests after sending a response
• The server can close the connection at the request of a client
or if a time-out has been reached

CSC 465 13
Persistent/Non persistent Connections (Cont’)

CSC 465 14
HTTP Transaction (Cont’)
• Messages

CSC 465 15
HTTP Transaction (Cont’)

CSC 465 16
HTTP Transaction (Cont’)

• Request and Status Lines

 Request Type

 URL
 Version

CSC 465 17
HTTP Transaction (Cont’)
 Status Code

 Status Phrase

CSC 465 18
HTTP Transaction (Cont’)

• Header: Exchange additional information between client and server


Header Line
General Header
Request Header
Response Header
Entity Header
 General Header

CSC 465 19
HTTP Transaction (Cont’)
 Request Header

CSC 465 20
HTTP Transaction (Cont’)
 Response Header

 Entity Header

• Body

CSC 465 21
Examples

CSC 465 22
Persistent Connection
Proxy Server
• HTTP Supports proxy server
• It reduces the load on the original server, decreases traffic
and improves latency
Example:

CSC 465 23
File Transfer Protocol (FTP)
• File Transfer Protocol (FTP) is the standard mechanism provided
by TCP/IP for copying a file from one host to another
• It establishes two connections between hosts
 One for data transfer (verities of data)
 One for control information (Commands and responses)
• FTP uses the services of TCP. It needs two TCP connections
 Port 21 for control connection
 Port 20 for data connection

CSC 465 24
File Transfer Protocol (FTP) *Cont’+
Communication and data transfer (Cont’)
• FTP may run in active or passive mode, which determines how the data
connection is established
 In both cases, the client creates a TCP control connection from a random,
usually an unprivileged, port N to the FTP server command port 21

• Active mode
• The client starts listening for
incoming data connections from
the server on port M
• It sends the FTP command PORT
M to inform the server on which
port it is listening
• The server then initiates a data
channel to the client from its port
20, the FTP server data port

CSC 465 25
File Transfer Protocol (FTP) *Cont’+
Communication and data transfer (Cont’)

• Passive mode
The client uses the control connection to
send a PASV command to the server
Then the client receives a server IP address
and server port number from the server
The client then uses to open a data
connection from an arbitrary client port to
the server IP address and server port
number received
Note: where the client is behind
a firewall and unable to accept incoming TCP
connections, passive mode may be used

CSC 465 26
Simple Mail Transfer Protocol (SMTP)
• SMTP: delivery/storage to receiver’s server
• Mail access protocol: retrieval from server
– POP: Post Office Protocol: authorization, download
– IMAP: Internet Mail Access Protocol: more features, including
manipulation of stored messages on server
– HTTP: Gmail, Hotmail, Yahoo! Mail, etc.

mail access
user SMTP SMTP user
protocol
agent Internet agent
(e.g., POP, IMAP)
SMTP
Sender’s mail Receiver’s mail
server server

CSC 465 27

You might also like