CS-344: Web
Engineering
Dr. Mehdi Hussain
Tenured Associate Professor
mehdi.hussain@seecs.edu.pk
BSCS/BESE Lecture-1AB
Summer-2024
School of Electrical Engineering and Computer
Science
National University of Sciences and
Technology (NUST)
Outline
• Web Engineering (3+1)
• Course Objectives
• Course Learning Outcomes (CLOs)
• Course Contents
• Course Assessment
• World Wide Web, Internet and Related
Concepts
2
Web Engineering Motivation
3
Source: Statista 2024
Motivation
Motivation - Meta Revenue Q1 FY23
Source: https://twitter.com/EconomyApp/status/1651322758977159171 5
Motivation – Amazon’s revenue
Motivation:
Alibaba
Group
Source: Statista 2024 7
E-commerce in
Pakistan
8
Motivation: E-commerce in
Pakistan
9
Motivation: IT Exports
10
Motivation: Internet and Mobile Banking
11
Motivation: Alibaba vs Local Exports
12
Popular Programming Languages
13
Top
Programming
Languages
Across Globe
– 2024
14
Skill set demands of the IT Industry in Pakistan
Skill set demands of the IT
Industry in Pakistan
Skilling Stack
World
Wide Web
& Internet
• The internet is a network of computer
networks worldwide
World Wide Web • The web is a tool used to retrieve
information published on the internet
& Internet • To navigate the web we use a web
browser i.e. Firefox, Edge, Chrome,
Safari, …
• W3C or World Wide Web
Consortium
• W3C is the main
international standards
organization for the World
Wide Web
• Develops open
Who standards to ensure
the long-term growth
of the Web
defines the
Web • Founded and currently led
by Tim Berners-Lee, the
Standards? inventor of the World
Wide Web
• Tim Berners-Lee
implemented the
first successful
communication
between a Hypertext
Transfer Protocol
(HTTP) client and
server via the
Internet in Nov. 1989
20
The
Internet!
“The Internet is not a thing, a place, a single
• Q: How to find IP address technology, or a mode of governance. It is an
of any website on internet! agreement”
- John Gage, Director of Science, Sun
• Hack: In Windows, go to Microsystems, Inc.
command prompt. Write
‘ping <URL of the website>’ Internet is a global network of computers.
e.g. ping facebook.com. Hit Nobody company or government owns it (it’s
enter! global!)
Each computer has a unique Internet Protocol (IP)
address in the form of xxx.xxx.xxx.xxx
Each xxx is a number from 0 to 255
Example: 31.13.92.36 (facebook.com)
Communicating on the
Web
• Web pages are viewed in Web browsers
• Web Browsers
• Google Chrome
• Mozilla Firefox
• Microsoft Edge
• Apple Safari
• Others (Opera, Lynx)
• …
• Web Browsers are also
• known as HTTP Client
22
Client computer Server computer
Internet
connection
Web browser Web server
Database server
Accessing a Website
23
Uniform
Resource
Locator (URL)
Uniform Resource Locator
(URL)
• Also known as web address
• It’s a reference to a web resource that specifies
• Its location on a computer network &
• A mechanism for retrieving it
• Syntax
scheme:[//[user:password@]host[:port]][/]path[?query][#fragment]
25
Uniform Resource
Locator (URL)
Type Content
• http://seecs.nust.edu.pk:80/Dep Scheme http
artments/Department-of-
User None
Computing/Degrees-
Offered/BSCS/index.php Password None
Host seecs.nust.edu.pk
• scheme:[//[user:password@]hos Port 80 [default port]
t[:port]][/]path[?query][#fragment] Path Departments/Department-of-Computing/Degrees-
Offered/BSCS/index.php
Query None
Fragment None
26
Uniform Resource
Locator (URL)
Type Content
• https://www.google.com.pk/sear Scheme https
ch?q=nust
User None
Password None
• scheme:[//[user:password@]hos
t[:port]][/]path[?query][#fragment] Host www.google.com.pk
Port default port [80]
Path search
Query q=nust
Fragment None
27
Uniform Resource
Locator (URL)
Type Content
• https://www.google.com.pk/sear Scheme https
ch?q=nust#top
User None
Password None
• scheme:[//[user:password@]hos
t[:port]][/]path[?query][#fragment] Host www.google.com.pk
Port default port [80]
Path search
Query q=nust
Fragment top
28
Uniform Resource
Locator (URL)
29
IP addresses
• IP addresses can be
• Permanent also called static or
• Temporary also known as dynamic
• If you have computer on a corporate network then
most likely it has a static IP address
• Usually DHCP is used to distribute IP address
• DHCP = Dynamic Host Configuration Protocol
30
Domain Names resolution
Domain Names and
Address Resolution
• An IP Address is used to connect
from computer A to computer B
• Remembering IP addresses is not
easy for general public
• Instead domain names like
www.nust.edu.pk are used as they
are easier to remember
• But how to map between IP
addresses and hostnames?
32
DNS: Domain Name
System
• DNS is a distributed database of computers’
names and their corresponding IP addresses
• Domain Name system or DNS serves as a phone
book for the Internet
• Translates human-friendly computer host
names into IP addresses
• Map domain names to IP addresses
• DNS servers are used to host the DNS database
and software to use it
• Since the DNS database is too large to be stored
on any specific computer only a subset of the
database is usually kept on any DNS server
33
How DNS Work
34
Image source: Google
DNS
35
DNS Hierarchy
36
Internet hierarchy http://library.seecs.edu.pk
PK …………….. FR UA US
ORG GOV EDU COM NET MIL
SEECS MIT IBM Apple
Library Sub-
domain
37
Protocol Stack
Internet Protocol
• In order to send a message from one
computer to another, Protocols are used
• There are several layers of protocols which
we call Protocol Stack because they are
built on top of each other.
• The protocol stack used on the Internet is
referred to as the TCP/IP protocol stack
because of the two major communication
protocols used.
39
Protocol Stack
Computer A Computer B
Application Layer Application Layer
(Telnet, HTTP, FTP, (Telnet, HTTP, FTP,
SMTP, SSL etc.) SMTP, SSL etc.)
Transport Layer Transport Layer
(TCP, UDP, …) (TCP, UDP, …)
Network (Internet) Network (Internet)
Layer Layer
(IP, ICMP, IPsec, …) (IP, ICMP, IPsec, …)
Physical (Link) Layer Physical (Link) Layer
INTERNET (Transmission Channel)
40
Application Layer
Protocol Stack
Transport Layer
Network Layer
• Application Layer is specific to
applications e.g. HTTP, E-mail, FTP, etc. Physical Layer
• Transport Layer uses Transmission Control Protocol (TCP) to
direct packets to a specific application on a computer using a
port number
• Network Layer uses Internet Protocol (IP) to direct packets to
a specific computer using an IP address.
• Physical Layer is responsible for physical transfer of packet
data over the network (e.g. using Ethernet, modem wireless
etc.)
41
Sending a
message
from
computer
A to B
Sending a message from computer A to B
•A message will start at the top of
the protocol stack on computer A
and will go in the downward Application Layer
direction Transport Layer
•If the message is long, each stack Network Layer
Physical Layer
layer can break the message up
into smaller chunks of data
• Data sent over the Internet is in
manageable chunks. These chunks of
data are known as packets.
43
Sending a message from computer A to B
• The data packets go through the
application Layer to Transport layer
Application Layer
• Each packet is assigned a port number. Transport Layer
Network Layer
• Different programs can use TCP/IP stack Physical Layer
to send are receive messages.
• Each program listens to the port
assigned to it to send and receive
messages.
44
Sending a message from computer A
▪toAfter
B transport layer, the packets proceed to the network layer.
This is where each packet receives it's destination IP address.
▪ Once we have a port number and an IP address, our message is
ready to be sent over the Internet.
▪ The physical layer takes care of turning data packets into
electronic signals and transmitting them over the physical
medium
Application Layer Application Layer
Transport Layer Transport Layer
Network Layer Network Layer
Physical Layer Physical Layer
INTERNET (Transmission Channel) 45
46
Sending a message from computer A to B
• ISP’s router examines the address of each packet and decides
where to send it ( usually to another router)
• Once the packet reaches the destination computer the process
works upward and the packets are reassembled.
• All extra information such as port and address numbers are
stripped from the packets
Application Layer Application Layer
Transport Layer Transport Layer
Network Layer Network Layer
Physical Layer Physical Layer
INTERNET (Transmission Channel)
Application protocols (HTTP)
• Hypertext Transfer Protocol or HTTP is the Application Layer
foundation of data communication over
WWW Transport Layer
Network Layer
• Hypertext is structured text that uses logical Physical Layer
links (hyperlinks) between nodes containing
text
• HTTP is the protocol to exchange or transfer
hypertext
• HTTP is an application level protocol
47
Application Protocols: (FTP)
• File Transfer Protocol or FTP
• FTP is used to send files between computers
• FTP is connection based protocol Application Layer
Transport Layer
• FTP can be used to transfer either text or binary Network Layer
data Physical Layer
• For using FTP, usually a login is required
48
Transmission Control Protocol (TCP)
• TCP is responsible for routing
application protocols to the correct Application Layer
application on the destination Transport Layer
computer Network Layer
Physical Layer
• What TCP does
• Get data from application to application
reliably! Two applications using TCP
must first establish a
connection before exchanging
• TCP is a connection-oriented, reliable,
data.
byte stream service
For each packet received, an
acknowledgement is sent to
the sender to confirm the
49
delivery
Transmission Control Protocol (TCP)
TCP Header (20 bytes)
16 bit source port number 16 bit destination port number
32 bit sequence number
32 bit acknowledgment number
Misc. data 16 bit window size
16 bit TCP checksum 16 bit urgent pointer
50
Internet Protocol (IP)
• Delivers packets across networks
through routers Application Layer
Transport Layer
• IP provides Internet-wide addressing
Network Layer
• IP provides connectionless and
unreliable packets service Physical Layer
• Packets may or may not be delivered
• Packets may arrive at destination out of
order
• Packets may be arbitrarily delayed
• Current version: IPv4. Next generation: IPv6
51
Internet Protocol (IP)
IP Header (20 bytes)
Version, header length, type of 16 bit total length in bytes
service
16 bit identification Flags and 13 bit fragment offset
8 bit time to live 16 bit header checksum
8 bit protocol
32 bit source IP address
32 bit destination IP address
52
Complete Packet
IP Header ( 20 bytes )
TCP Header ( 20 bytes )
Application
Layer
Data
53
Internet Port Numbers
• The following are default port numbers:
• FTP 20/21
• Telnet 23
• SMTP 25
• DNS 53
• HTTP 80
• POP2 109
• POP3 110
• SFTP 115
• IMAP 143
• HTTPS 443
54
Summary
WORLD WIDE WEB UNIFORM DOMAIN NAME PROTOCOL STACK
AND INTERNET RESOURCE LOCATOR SYSTEM (DNS)
(URL)
55