0% found this document useful (0 votes)
113 views58 pages

E-Commerce Communication Infrastructure

The document discusses the mathematics and concepts that form the foundation of computer networks, including number systems, IP addressing, protocols, and network architectures. It also covers topics like data representation, encoding, addressing schemes (IPv4 and IPv6), domain names, protocols (HTTP), and network architectures including LAN, WAN, and client-server models. The goal is to provide an overview of the basic concepts and components that underlie modern e-commerce communication infrastructure on computer networks and the internet.

Uploaded by

Alex Cheng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
113 views58 pages

E-Commerce Communication Infrastructure

The document discusses the mathematics and concepts that form the foundation of computer networks, including number systems, IP addressing, protocols, and network architectures. It also covers topics like data representation, encoding, addressing schemes (IPv4 and IPv6), domain names, protocols (HTTP), and network architectures including LAN, WAN, and client-server models. The goal is to provide an overview of the basic concepts and components that underlie modern e-commerce communication infrastructure on computer networks and the internet.

Uploaded by

Alex Cheng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 58

E-commerce Communication Infrastructure

Objectives
Mathematics foundation for computer network
Number systems, data representation

Basic concepts in computer network


IP address, domain name, etc.

LAN and WAN Network architecture

Number system
Numbers are usually base-10 numbers in daily life There are many other possible number systems
Example:
base-2 numbers (1011011) Base-8 numbers (133)

In general, we can have base-n numbers for any value of n

Number representation
Format
354(8)
Base-8 numbers The digits here describe the magnitude of the represented value

There are n digits (symbols) for base-n numbers


Example:
Base-8: the digits can only be 0, 1, , 6, 7

Evaluating the value


Example (translating to decimal numbers) :
456(8) = 4 * 82 + 5 * 81 + 6 * 80 = 302(10) 3344(5) = 3 * 5 3 + 3 * 5 2 + 4 * 5 1 + 4 * 50 = 474(10)

Translating to base-n
Example:
307(10) = 463(8)
8 | 307 |_______ | 38 |_______ | 4 |_______ 0

..

3 Read in this direction

... 6 ... 4

Translating to base-n theory - SS


General case
Translate y(10) = x(b)

Goal: find x1, x2, ., xn (< b) such that x(b) = x1 * bn-1 + x2 * bn-2 + xn-1 * b1 + xn * b0 Compute y/b
Quotient: x1 * bn-2 + x2 * bn-3 + xn-1 * b0 repeating case Remainder: xn
Overall effect: we obtain the rightmost digit

Base-11 or higher
Arabic numbers has 10 symbols/digits only
For higher based numbers, a common practice is to use alphabets

Example:
`A represents 10 `B represents 11 `C represents 12 `F represents 15

Example: base-16 numbers


6A(16) = 6 * 16 + 10 = 106(10)

Exercise
65(7) = ???(5) ACC(16) = ???(8) 50(10) = ???(2)

Floating point numbers - SS


2.5(10) = ???(2) The same idea will apply .567(8) = 5 * 8-1 + 6 * 8-2 + 7*8-3 = 0.732421875 Translating to base-8 Note: some translations will 0.73241875 * 8 = 5.859375 result in infinite long sequences 0.859375 * 8 = 6.875 Example: 0.1 = ??? 0.875 * 8 = 7
(3) (10)

Numbers in computer
Signal in computer is either high or low
Binary representation
Voltage

Square wave signal

Data in computer
Everything in computer is binary data!
Image
Example: each pixel is defined by RGB values (red, green blue)

Sound

Audio signal Distortion

Digital signal

Data in computer
Text
ASCII 1 bytes representation
http://en.wikipedia.org/wiki/ASCII - SS

Unicode 4 bytes representation Other encoding schemes: Big5

Data size
Measured by number of binary digit (bit)
1 byte = 8 bits 1kB (kilobyte) = 1024 bytes 1MB (Megabyte) = 1024kB 1GB (Gigabyte) = 1024MB

Overflow - SS
Data in computer is usually fix-sized
An integer is usually 4 bytes (unsigned) At most 232 1 = 4,294,967,295

If a value goes over the limit, an overflow occurs 1 0


Consequences:
+) 1 1 0 0 0 2+2=0

The math will be wrong Software errors

Modifying the values of other data

Underflow - SS
Fix-sized floating point numbers
Not possible to represent very long real numbers
Example, 1/3 cannot be represented precisely in computer 1/3 = 0.010101010(2)
If we use only 5 bits, we have 0.01010(2) = 0.3125

Underflow
The value is too small to be represented in computers

Base-16 for values in computers - SS


Popular representation in representing very large values in computer
Abstract (fewer digits) Faster translation (binary to base-16 is easy)
Per-digit translation

Example
Encryption keys/values Binary editor software IPv6

Computer Network
Allow people to connect computers to each other Internet
A large system of interconnected computer networks spanning the globe

19

20

History of Internet Self Study


http://en.wikipedia.org/wiki/Internet

21

Identification of nodes
IP address
Identify a computer in a computer network

IPv4
A 4-bytes code (32 digits in binary) Example: 10.107.149.101

IPv6

A 16-bytes code Example: FE80:0000:0000:0000:0202:B3FF:FE1E:8329


22

Each byte is represented in decimal, i.e., each has a range of 28 (0-255)

IPv4 is not enough


The address format can have at most 232 = 4,294,967,296 addresses Machines that may request an IP address
PC Notebook Mobile phone

Connection to a computer
Port: differentiate different connections to the same computer Max: 65535 (216 1) (2 bytes)
MSN Port: 51456

Windows Update
Port: 36785 Web Port: 33485

Common representation: IP:PORT Example: 10.107.149.101:80


24

Connection between programs


Each party in the connection will allocate a unique port number for the communication Example: Web IP: 210.0.164.194 IP: 10.107.149.101 Your computer HSMCs web server
Web request

IE
Content
10.107.149.101:54678
25

Web server software


210.0.164.194:80

How data is transferred in the network - routing


Multiple machines may be visited from the source to destination
210.0.164.194 10.107.149.101

26

Domain name
A human-readable format for identifying the address
Example: hsmc.edu.hk

The domain name will be transformed to IP address in data transmission

27

Domain name system (DNS)


Translate the domain name of a URL into IP
Your computer IP: 210.0.164.194 HSMCs web server

DNS server

Web request: hsmc.edu.hk


IP: 210.0.164.194 Web content
28

Registering your domain name


Internet Corporation for Assigned Names and Numbers (ICANN)
Responsible for managing domain names and coordinating them with IP address registrars

Low registering fee


Per period charge
Example: HKD 99 per year

29

Common domain names - SS


Top-level domain (or TLD)
Rightmost part of a domain name

30

Question
My company wants to set up a web. I want to have 3 different domain names. Do I need 3 machines and 3 IP addresses to setup 3 different webs of the same content?

31

Uniform Resource Locator (URL)


A reference to an Internet resource
http://hk.news.yahoo.com/most-popular/

Protocol (discuss later)

Domain name or IP address

Parameters passed to the server machine/software

Different protocols usually use different ports


32

Protocol
Protocol
Message formats and rules in information exchange

So, each machine can understand each other

33

Common protocols - SS
HTTP: for accessing webpages FTP: for file transfer SMTP, POP3: for email services

34

Example: HTTP request message - SS


HTTP request message:
Requesting the content for a webpage

request line
GET /somedir/page.html HTTP/1.1 Host: www.someschool.edu User-agent: Mozilla/4.0 header Connection: close lines Accept-language:fr Carriage return, line feed indicates end of message (extra carriage return, line feed)

35

HTTP request message: general format - SS

36

HTTP response message - SS


HTTP response message
The response from web server
status line (protocol status code status phrase)
header lines HTTP/1.1 200 OK Connection close Date: Thu, 06 Aug 1998 12:00:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 1998 ... Content-Length: 6821 Content-Type: text/html data data data data data ...
37

data, e.g., requested HTML file

Experiment - SS
Telnet to your favorite Web server:
telnet www.yahoo.com 80

Type in the simplest but complete HTTP request


GET /index.html HTTP/1.0

What is the result?

38

More advanced concepts on computer network


How is a computer network formed?
LAN and WAN

How is a service provided to users via computer networks?


Client/Server Architecture P2P Architecture

39

Local area network - LAN


A computer network in a small area, e.g., home, office A simple LAN with the use of a router Router
A device to facilitate the computer network
Assigning IP addresses to machines Forwarding messages PC #1 from/to machines
40 40

Router

PC #2

Mobile

IP address in LAN
LAN is itself a complete network
Not necessary to be connected to the Internet

IP address of machines are local only!


You can set any IP addresses to your computers in router settings How to reach PC#1?
Router

PC #1 PC #2 172.168.0.100 172.168.0.101

People outside your LAN No idea

41

WAN / Internet
Wide area network (WAN) is a computer network in a board area
Connect different LANs together

Internet can be considered a WAN


LAN3

LAN2 LAN1
42

Global IP address
On Internet, your IP address has to be unique Internet Service Provider (ISP) will assign to you a unique global IP address
Typical scenario:
Every client has only 1 global IP address

Global IP address is also called


Real IP address Public IP address
43

LAN in WAN
Proxy servers, routers will help to distribute the communication channels Example: home network
Any message to your global IP will first reach the router Router The messages will be distributed to machines in LAN accordingly
PC #1
44

PC #2

Mobile

IP address assigned from ISP


Dynamic vs static IP address
Dynamic: Your assigned IP address may vary Static: Your IP address is the same all the time
For a company hosting a website, static address is necessary. Why?

It depends on ISP whether your IP address is dynamic or static

Domestic users usually get a dynamic IP address


Note: Despite being dynamic, the global IP address rarely changes
45

Questions
I want to launch an e-shop on my PC at my home. I have obtained an e-shop software already. What else do I need to do? I would like to invite my friend to play a computer game with me. I have started the server already and have told my friend my IP address. But my friend said he/she cannot connect to my server. What are the potential problem(s)?
46

Client-Server Architecture
Two-tier client/server architecture has only one client and one server (in each service delivery) The server hosts certain types of services
Email: email server
Receive and send emails for users

Database: database server


Record and manage a collection of data

Clients connect to the server to access the service

47

Client-Server Architecture
The same server may serve many clients at the same time
Server

Client

Client
48

Client

Hardware
Different machines are designed for different purposes
PC: general-purpose machines Game console: optimized for graphic processing
GPU: highly parallel structure

Server requirements depend on applications Common server hardware properties


High memory High bandwidth High processing power But low graphic processing capability

Server machines are usually more expensive


49

Popular server software


Web server
Apache HTTP Server
Microsoft Internet Information Server (IIS)

Database server
Oracle IBM DB2 MySQL
50

N-tier architecture
Dividing an application into different layers Example:
An e-shop with 3-tier architecture

Client

Web server

Database server

Note: the above 3-tier architecture is also a popular model for many other applications
51

Remark: multiple client in n-tier architecture

Client

Client

Web server

Database server

Client
52

Benefits of n-tier architecture


Each tier/component has a single focus Reusable components
Example: the same database server can serve different applications, e.g. web and mobile apps, at the same time

53

Disadvantages of n-tier architecture


More difficult to trace errors Integration of different tiers is difficult

54

Peer-to-peer (P2P) architecture


Each computer in the network can be a server/client of other computers No single centralized server Example application
BitTorrent (BT)
BT is a protocol!

55

P2P architecture - benefits


To service providers
Reduced hardware requirement
Not all clients will access the same service provider

More clients can be served at the same time Not necessary to be online 24/7
In file sharing case, after the file is copied, the file owner can go offline while other clients can still obtain the file from other sources

56

P2P architecture - benefits


To users
Easier access to resources Faster transfer speed More information is available

57

Disadvantages of P2P
Limited access for certain resources sometimes
In file sharing, there is hardly any parties sharing some old files

Hard to monitor the quality of services/contents

58

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy