Slides for Chapter 1
Introduction to Distributed System and
Computing
From Coulouris, Dollimore and Kindberg
Distributed Systems:
Concepts and Design
Edition 4, © Pearson Education 2005
Reference slides from Distributed Computing Introduction, M. Liu
And Java programming, D. Liang
Distributed system, distributed computing
Early computing was performed on a single
processor. Uni-processor computing can be called
centralized computing.
A distributed system is a collection of independent
computers, interconnected via a network, capable of
collaborating on a task by message passing. It has
three features:
Concurrency
No global clock
Independent failure
Distributed computing is computing performed in a
distributed system.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Examples of Distributed Systems
 Web Search: major growth industry in the last decade. 10 billion per
month for global number of searches. Complex task for searching a big
database with 63 billion pages. (e.g. Google distributed infrastructure, file
system, storage, lock service, parallel computing)
 Massively multiplayer online games: Large number of people interact
through the Internet with a virtual world. Challenges include fast response
time, real-time propagation of events.
 Financial trading: provides real-time access to a wide range of information
sources such as current share prices and trends, economic and political
development news. Challenges include how to deliver events reliably and
in a timely manner to very large numbers of clients.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Trend in Distributed Systems
 Pervasive networking and modern Internet: Wifi, WiMax, Bluetooth, the thirdgeneration of mobile phone networks. The result is that networking has
become a pervasive resource and devices can be connected at any time and
in any place.
 Mobile and ubiquitous computing: small and portable computing devices are
integrated into the distributed system such as laptop, handheld devices(
PDA, cell phone, camera etc).
 Distributed multimedia systems: it support a range of media types such as
audio, video in a distributed system. So desktop can access live television,
file libraries, music libraries, telephone IP phone (Skype) in distributed
system. QoS issue
 Distributed Computing as a utility: A number of companies provide the
computing, storage and application resources as a commodity or utility to
users. So users do not need to maintain local IT. Pay as use. Analogy
between distributed resources and other utilities such a water or electricity.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Figure 1.1
A typical portion of the Internet
intranet
ISP
%
%
%
%
backbone
satellite link
desktop computer:
server:
network link:
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Figure 1.2
A typical intranet
email ser ver
pr int
Desktop
computers
and other ser ver s
Loc al ar ea
Web server
networ k
email ser ver
File ser ver
pr int
other server s
the rest of
the Inter net
router/firewall
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Figure 1.3
Portable and handheld devices in a distributed system
Inter net
Host intranet
WAP
gateway
Wireless LAN
Mobile
phone
Pr inter
Laptop
Camer a
Host site
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Home intr anet
Figure 1.4
Web servers and web browsers
www.google.com
http://www.google.comlsearch?q=kindberg
Browsers
Web servers
Internet
www.cdk3.net
http://www.cdk3.net/
www.w3c.org
File system of
www.w3c.org
http://www.w3c.org/Protocols/Activity.html
Protocols
Activity.html
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Figure 1.5
Computers in the Internet
Computers
Date
1979, Dec.
1989, July
1999, July
2003, Jan.
Web servers
188
0
130,000
56,218,000
171,638,297
0
5,560,866
35,424,956
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Centralized vs. Distributed Computing
term inal
m ainfram e c om puter
w orks tation
netw ork link
netw ork hos t
ce n tralize d com pu tin g
dis tribu te d com pu tin g
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Evolution of paradigms
 Client-server: Socket API, remote method invocation
 Distributed objects
 Object broker: CORBA
 Network service: Jini
 Object space: JavaSpaces
 Mobile agents
 Message oriented middleware (MOM): Java Message
Service
 Collaborative applications
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Why distributed computing?
 Resource sharing/Economics: distributed systems allow
the pooling of resources, including CPU cycles, data
storage, input/output devices, and services.
 Scalability: Increasing demands and users can be easily
addressed by adding more resources and the system can
still run effectively.
 Reliability: a distributed system allow replication of
resources and/or services, thus reducing service outage
due to failures.
 The affordability of computers and availability of network
access: The Internet has become a universal platform for
distributed computing.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
The Challenges of Distributed Computing
The Challenges of distributed computing:
Heterogeneity: computers and networks are of different
types. Including hardware, network, programming
language, and operating system.
 E.g. Two alternatives for byte ordering of integers on different hardware, namely bigendian and little-endian. Message transfer should take care of it.
 E.g. The different types of networks are masked by the fact that all computers
attached to the Internet use the Internet protocols to communicate.
 E.g. Different OS may provide the different programming interface for message
exchanges. Like different calls in UNIX and Windows.
 E.g. Different programming languages use different representations for characters
and data structures. Difference must be handled if two need to communicate.
 E.g. Different programs written by different developers even same language may
use different communication protocols and primitive data items and data structures
in messages.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
The Challenges of Distributed Computing
 Failure handling: Failures in a distributed system are partial- that
is, some components fail while others continue to function. So is
particularly difficult.
 Detecting failures: some can be detected (checksum) and some may not.
 Masking failures: detected and can be hidden or made less severe. a. message
can be retransmitted b. file data can be save on two disks if one fails, the other one
works.
 Tolerating failures: not possible to detect all and hide all. Just report the error.
 Recovery from failure: software so that the state of permanent data can be
recovered or rolled back after a server crash.
 Redundancy: redundant components. a. two routes between two routers. b.
Domain name system, every name table is replicated in at least two servers. c.
database may be replicated in different servers. Redirect client to other servers
The design of effective techniques for keeping replicas of rapidly changing data up-todate without excessive loss of performance is challenging.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
The Challenges of Distributed Computing
 Concurrency: several clients may attempt to access a
shared resource at the same time. For example, auction bid
data structure by clients
 Process manages a shared resource could take one
client request at a time. But that approach limits
throughput. So concurrent threads are usually allowed.
Smith: $122 and Jones: $111. If operations are
interleaved without any control, then they might get
stored as Smith: $1111 and Jones: $122
 For data to be safe in a concurrent environment, its
operations must be synchronized in such a way that data
remains consistent such as semaphores.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
The Challenges of Distributed Computing
 Scalability: It will remain effective when there is a significant
increase in the number of resources and the number of users.
 Controlling the cost of physical resources: as the demand for a
resource grows, it should be possible to extend the system at
reasonable cost.
 Controlling the performance loss: Algorithm uses hierarchic structures
O(logN) scale better than those use linear structures O(N).
 Preventing software resources running out: IP addresses start with 32
bits. New version 128 bits. Modification to software needed.
 Avoiding performance bottleneck: algorithm should be decentralized to
avoid having performance bottleneck.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
The Challenges of Distributed Computing
 Security Concerns: In a distributed system, there are
more opportunities for unauthorized attack.
 Confidentiality (protecting against disclosure to
unauthorized individuals);
 Integrity (protection against alteration or corruption);
 Availability (protection against interference with the
means to access the resource);
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
The Challenges of Distributed Computing
Transparency: It is a major influence on the design of
the distributed system software
Defined as the concealment from the user and the
application programmer of the separation of
components in a distributed system, so that the
system is perceived as a whole rather than a
collection of independent component.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Transparencies
Access transparency: enables local and remote resources to be accessed using identical
operations.
Location transparency: enables resources to be accessed without knowledge of their
physical or network location (for example, which building or IP address).
Concurrency transparency: enables several processes to operate concurrently using shared
resources without interference between them.
Replication transparency: enables multiple instances of resources to be used to increase
reliability and performance without knowledge of the replicas by users or application
programmers.
Failure transparency: enables the concealment of faults, allowing users and application
programs to complete their tasks despite the failure of hardware or software components.
Mobility transparency: allows the movement of resources and clients within a system
without affecting the operation of users or programs.
Performance transparency: allows the system to be reconfigured to improve performance as
loads vary.
Scaling transparency: allows the system and applications to expand in scale without change
to the system structure or the application algorithms.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Operating Systems Basics
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Process and program
A process consists of an executing program, its
current values, state information, and the
resources used by the operating system to
manage its execution.
A program is an artifact constructed by a
software developer; a process is a dynamic
entity which exists only when a program is run.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Process State Transition Diagram
te rm in ate d
s tart
queued
exit
dis patc h
re ady
event c om pletion
ru n n in g
w aiting
for event
block e d
S im plife d fin ite s tate diagram for a proce s s 's life tim e
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Java processes
 There are three types of Java program:
applications, applets, and servlets, all are written as
a class.
 A Java application program has a main method, and is
run as an independent(standalone) process.
 An applet does not have a main method, and is run
using a browser or the appletviewer.
 A servlet does not have a main method, and is run in the
context of a web server.
 A Java program is compiled into bytecode, a
universal object code. When run, the bytecode is
interpreted by the Java Virtual Machine (JVM).
Three Types of Java programs
 Applications
a program whose byte code can be run on any system
which has a Java Virtual Machine. An application may
be standalone (monolithic) or distributed (if it interacts
with another process).
 Applets
A program whose byte code is downloaded from a
remote machine and is run in the browser’s Java Virtual
Machine.
 Servlets
A program whose byte code resides on a remote
machine and is run at the request of an HTTP client (a
browser).
Three Types of Java programs
A s tandal o ne J ava appl i c ati o n i s r un o n a l o c al m ac hi ne
com pu te r
Java obje ct
Java V irtu al Mach in e
An appl e t i s an o bje c t do w nl o ade d (tr ans fe r r e d) fr o m a r e m o te m ac hi ne ,
the n r un o n a l o c al m ac hi ne .
an apple t
Java obje ct
Java V irtu al Mach in e
A s e r vl e t i s an o bje c t that r uns o n a r e m o te m ac hi ne and
i nte r ac ts w i th a l o c al pr o g r am us i ng a r e que s t-r e s po ns e pr o to c o l
a s e rvle t
re qu e s t
re s pon s e
a proce s s
A sample Java application
/*******************************************************
* A s am ple of a s im ple Java application .
1/8/02
* M. Liu
******************************************************/
im port java.io. *;
clas s MyProgram {
pu blic s tatic void m ain (S trin g[ ] args )
th rows I O Exce ption {
Bu ffe re dR e ade r k e yboard = n e w
Bu ffe re dR e ade r(n e w I n pu tS tre am R e ade r (S ys te m .in ));
S trin g th e Nam e ;
S ys te m .ou t.prin tln (" W h at is you r n am e ?" );
th e Nam e = k e yboard.re adLin e ( );
S ys te m .ou t.prin t (" He llo " + th e Nam e );
S ys te m .ou t.prin tln (" - we lcom e to C S C 369 .\n " );
} // e n d m ain
} //e n d clas s
A Sample Java Applet
/***************************************************
* A s am ple of a s im ple apple t.
* M. Liu
1/8/02
***************************************************/
im port java.apple t.A pple t ;
im port java.awt.*;
pu blic clas s MyA pple t e xte n ds A pple t{
pu blic void pain t(Graph ics g){
s e tBack grou n d(C olor.blu e );
Fon t C lau de = n e w Fon t(" A rial" , Fon t.BO LD , 40);
g.s e tFon t(C lau de );
g.s e tC olor(C olor.ye llow);
g.drawS trin g(" He llo W orld!" , 100, 100);
} // e n d pain t
} //e n d clas s
< !-- A we b page wh ich , wh e n brows e d, will ru n >
< !-- th e MyA pple t apple t>
< !-- M. Liu 1/8/02>
< title > S am ple A pple t< /title >
< h r>
< apple t code = " MyA pple t.clas s " width = 500 h e igh t= 500>
< /apple t>
< h r>
< a h re f= " He llo.java" > Th e s ou rce .< /a>
A Sample Java Servlet
/*******************************************************
* A s am ple of a s im ple Java s e rvle t.
* M. Liu
1/8/02
******************************************************/
im port java.io.*;
im port java.te xt.*;
im port java.u til.*;
im port javax.s e rvle t. *;
im port javax.s e rvle t.h ttp. *;
pu blic clas s MyS e rvle t e xte n ds HttpS e rvle t {
pu blic void doGe t (HttpS e rvle tR e qu e s t re qu e s t,
HttpS e rvle tR e s pon s e re s pon s e )
th rows S e rvle tExce ption , I O Exce ption {
Prin tW rite r ou t;
S trin g title = " MyS e rvle t O u tpu t" ;
// s e t con te n t type an d oth e r re s pon s e h e ade r
// fie lds firs t
re s pon s e .s e tC on te n tType (" te xt/h tm l" );
// th e n write th e data of th e re s pon s e
ou t = re s pon s e .ge tW rite r();
ou t.prin tln (" < HTML> < HEA D > < TI TLE> " );
ou t.prin tln (title );
ou t.prin tln (" < /TI TLE> < /HEA D > < BO D Y > " );
ou t.prin tln (" < H1> " + title + " < /H1> " );
ou t.prin tln (" < P> He llo W orld!" );
ou t.prin tln (" < /BO D Y > < /HTML> " );
ou t.clos e ();
} //e n d doGe t
} //e n d clas s
Concurrent Processing
On modern day operating systems, multiple
processes appear to be executing concurrently
on a machine by timesharing resources.
Proce sse s
P1
P2
P3
P4
tim e
T im esharing of a resourc e
Concurrent processing within a process
It is often useful for a process to have parallel threads of
execution, each of which timeshare the system
resources in much the same way as concurrent
processes.
A pare n t proce s s m ay s pawn ch ild proce s s e s .
A proce s s m ay s pawn ch ild th re ads
a proc es s
parent proc es s
m ain thread
c hild thread 1
c hild thread 2
c hild proc es s es
C on cu rre n t proce s s in g with in a proce s s
Java threads
 The Java Virtual Machine allows an application to have multiple
threads of execution running concurrently.
 Java provides a Thread class:
public class Thread
extends Object
implements Runnable

When a Java Virtual Machine starts up, there is usually a single
thread (which typically calls the method named main of some
designated class). The Java Virtual Machine continues to
execute threads until either of the following occurs:
 The exit method of class Runtime has been called and the security
manager has permitted the exit operation to take place.
 All threads have terminated, either by returning from the call to the
run method or by throwing an exception that propagates beyond
the run method.
Using a subclass of the Thread class
Using a class that implements the Runnable interface
Create a class that is a subclass of the Thread class
Declare a class to be a subclass of
Thread. This subclass should override
the run method of class Thread. An
instance of the subclass can then be
allocated and started:
im port S om e Th re ad;
pu blic clas s R u n Th re ads
{
pu blic s tatic void m ain (S trin g[] args )
{
S om e Th re ad p1 = n e w S om e Th re ad(1);
p1.s tart();
S om e Th re ad p2 = n e w S om e Th re ad(2);
p2.s tart();
S om e Th re ad p3 = n e w S om e Th re ad(3);
p3.s tart();
}
} // e n d clas s R u n Th re ads
pu blic clas s S om e Th re ad e xte n ds Th re ad {
in t m yI D ;
S om e Th re ad(in t id) {
th is .m yI D = id;
}
pu blic void ru n ( ) {
in t i;
for (i = 1; i < 11; i+ + )
S ys te m .ou t.prin tln (" Th re ad" + m yI D + " : " + i);
}
} //e n d clas s S om e Th re ad
Create a class that implements the Runnable interface
The other way to create a thread is to declare a class that
implements the Runnable interface. That class then
implements the run method. An instance of the class can
then be allocated, passed as an argument when creating
Thread, and started.
pu blic clas s R u n Th re ads 2
{
pu blic s tatic void m ain (S trin g[] args )
{
Th re ad p1 = n e w Th re ad(n e w S om e Th re ad2(1));
p1.s tart();
Th re ad p2 = n e w Th re ad(n e w S om e Th re ad2(2));
p2.s tart();
Th re ad p3 = n e w Th re ad(n e w S om e Th re ad2(3));
p3.s tart();
}
}
clas s S om e Th re ad2 im ple m e n ts R u n n able {
in t m yI D ;
S om e Th re ad2(in t id) {
th is .m yI D = id;
}
pu blic void ru n () {
in t i;
for (i = 1; i < 11; i+ + )
S ys te m .ou t.prin tln (" Th re ad" + m yI D + " : " + i);
}
} //e n d clas s S om e Th re ad
Thread-safe Programming
 When two threads independently access and
update the same data object, such as a counter,
as part of their code, the updating needs to be
synchronized. (See next slide.)
 Because the threads are executed concurrently,
it is possible for one of the updates to be
overwritten by the other due to the sequencing
of the two sets of machine instructions
executed on behalf of the two threads.
 To protect against the possibility, a
synchronized method can be used to provide
mutual exclusion.
Race Condition
tim e
fe tch va lu e in co u n te r a n d lo a d in to a re g iste r
fe tch va lu e in co u n te r a n d lo a d in to a re g iste r
in cre m e n t va lu e in re g iste r
fe tch va lu e in co u n te r a n d lo a d in to a re g iste r
sto re va lu e in re g iste r to co u n te r
in cre m e n t va lu e in re g iste r
fe tch va lu e in co u n te r a n d lo a d in to a re g iste r
in cre m e n t va lu e in re g is te r
in cre m e n t va lu e in re g is te r
sto re va lu e in re g iste r to co u n te r
s to re va lu e in re g is te r to co u n te r
s to re va lu e in re g is te r to co u n te r
This e xe c utio n re sults in the
value 2 in the c o unte r
This e xe c utio n re sults in the
value 1 in the c o unte r
ins truc tion exec uted in c onc urrent proc es s or thread 1
ins truc tion exec uted in c onc urrent proc es s or thread 2
Synchronized method in a thread
clas s S om e Th re ad3 im ple m e n ts R u n n able {
s tatic in t cou n t= 0;
S om e Th re ad3() {
s u pe r();
}
pu blic void ru n () {
u pdate ( );
}
s tatic pu blic s yn ch ron ize d void u pdate ( ){
in t m yC ou n t = cou n t;
m yC ou n t+ + ;
cou n t = m yC ou n t;
S ys te m .ou t.prin tln (" cou n t= " + cou n t+
" ; th re ad cou n t= " + Th re ad.active C ou n t ( ));
}
}
Network Basics
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Network resources
 Network resources are resources available to
the participants of a distributed computing
community.
 Network resources include hardware such as
computers and equipment, and software such
as processes, email mailboxes, files, web
documents.
 An important class of network resources is
network services such as the World Wide Web
and file transfer (FTP), which are provided by
specific processes running on computers.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Network standards and protocols
 On public networks such as the Internet, it is
necessary for a common set of rules to be
specified for the exchange of data.
 Such rules, called protocols, specify such
matters as the formatting and semantics of
data, flow control, error correction.
 Software can share data over the network using
network software which supports a common set
of protocols.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Protocols



In the context of communications, a protocol is a set of
rules that must be observed by the participants.
In communications involving computers, protocols must
be formally defined and precisely implemented. For
each protocol, there must be rules that specify the
followings:
 How is the data exchanged encoded?
 How are events (sending , receiving) synchronized
so that the participants can send and receive in a
coordinated order?
The specification of a protocol does not dictate how the
rules are to be implemented.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
The network architecture
 Network hardware transfers electronic
signals,which represent a bit stream, between two
devices.
 Modern day network applications require an
application programming interface (API) which
masks the underlying complexities of data
transmission.
 A layered network architecture allows the
functionalities needed to mask the complexities to
be provided incrementally, layer by layer.
 Actual implementation of the functionalities may not
be clearly divided by layer.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Protocol layers in the ISO Open Systems Interconnection (OSI) model
Message r eceived
Message sent
Layers
Application
Pr esentation
Session
Tr anspor t
Networ k
Data link
Physical
Sender
Communication
medium
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Recipient
OSI protocol summary
Layer
Application
Presentation
Session
Transport
Network
Data link
Physical
Description
Protocols that are designed to meet the communication requirements of
specific applications, often defining the interface to a service.
Protocols at this level transmit data in a network representation that is
independent of the representations used in individual computers, which may
differ. Encryption is also performed in this layer, if required.
At this level reliability and adaptation are performed, such as detection of
failures and automatic recovery.
This is the lowest level at which messages (rather than packets) are handled.
Messages are addressed to communication ports attached to processes,
Protocols in this layer may be connection-oriented or connectionless.
Transfers data packets between computers in a specific network. In a WAN
or an internetwork this involves the generation of a route passing through
routers. In a single LAN no routing is required.
Responsible for transmission of packets between nodes that are directly
connected by a physical link. In a WAN transmission is between pairs of
routers or between routers and hosts. In a LAN it is between any pair of hosts.
The circuits and hardware that drive the network. It transmits sequences of
binary data by analogue signalling, using amplitude or frequency modulation
of electrical signals (on cable circuits), light signals (on fibre optic circuits)
or other electromagnetic signals (on radio and microwave circuits).
Examples
HTTP, FTP , SMTP,
CORBA IIOP
Secure Sockets
(SSL),CORBA Data
Rep.
TCP, UDP
IP, ATM virtual
circuits
Ethernet MAC,
ATM cell transfer,
PPP
Ethernet base- band
signalling, ISDN
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Figure 3.12
TCP/IP layers
The Transmission Control Protocol/Internet Protocol suite is a set of
network protocols which supports a four-layer network
architecture.
The Internet layer implements the Internet Protocol, which provides the
functionalities for allowing data to be transmitted between any two hosts
on the Internet.
The Transport layer delivers the transmitted data to a specific process running
on an Internet host.
The Application layer supports the programming interface used for building a
program.
Message
Layers
Application
Messages (UDP) or Streams (TCP)
Transport
UDP or TCP packets
Internet
IP datagrams
Network interface
Network-specific frames
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Underlying network
Figure 3.14
The programmer's conceptual view of a TCP/IP Internet
Application
Application
TCP
UDP
IP
 Socket programming in UDP and
TCP.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Identification of Network Resources
One of the key challenges in distributed
computing is the unique identification of
resources available on the network, such as email mailboxes, and web documents.
Addressing an Internet Host
Addressing a process running on a host
Email Addresses
Addressing web contents: URL
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
The Internet Topology
 The internet consists of an hierarchy of
networks, interconnected via a network
backbone.
 Each network has a unique network address.
 Computers, or hosts, are connected to a
network. Each host has a unique ID within its
network.
 Each process running on a host is associated
with zero or more ports. A port is a logical
entity for data transmission.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Network Basics
1. Addressing an Internet Host
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Figure 3.15
Internet address structure, showing field sizes in bits
7
Class A:
0
24
Networ k ID
Host ID
14
Class B:
1
0
16
Networ k ID
Host ID
21
Class C:
1
1
0
8
Networ k ID
Host ID
28
Class D (multicast) :
1
1
1
0
Multicast address
27
Class E (r eser ved) :
1
1
1
1
0
unused
Internet routing scheme developed in the 1970s. Class A addresses are the
largest, but there are few of them. Class Cs are the smallest, but they are
numerous. Classes D and E are also defined, but not used in normal
operation.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Figure 3.16
Decimal representation of Internet addresses
octet 1
octet 2
Network ID
192 to 223
Range of addresses
Host ID
Class A: 1 to 126
0 to 255
(0, 127
Network ID
reserved)
Class B:
128 to 191
0 to 255
Class C:
octet 3
Network ID
0 to 255
0 to 255
1.0.0.0 to
126.255.255.255
0 to 255
0 to 255
128.0.0.0 to
191.255.255.255
0 to 255
Host ID
1 to 254
0 to 255
Host ID
192.0.0.0 to
223.255.255.255
Multicast address
Class D (multicast):
224 to 239
0 to 255
0 to 255
1 to 254
224.0.0.0 to
239.255.255.255
Class E (reserved):
240 to 255
0 to 255
0 to 255
1 to 254
240.0.0.0 to
255.255.255.255
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
The Internet addressing scheme
Subdiv iding the ho s t po rtio n o f a n I nte rne t a ddre s s :
byte 0
c l as s B addr e s s
1 0
byte 1
netw ork addres s
byte 2
byte 3
hos t portion
A c las s A/C addre s s s pac e c an
als o be s im ilarly s ubdivide d..
W hic h po rtio n o f the ho s t addre s s
is us e d fo r the s ubne t ide ntific atio n
is de te rm ine d by a s ubne t m as k.
s ubnet addres s
loc al hos t addres s
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Example
Example:
Suppose the dotted-decimal notation for a particular Internet address
is129.65.24.50. The 32-bit binary expansion of the notation is as
follows:
1 2 9 .6 5 .2 4 .5 0
10000001
01000001
00011000
00110010 is a Class B
Since the leading bit sequence is 10, the address
address. Within the class, the network portion is identified by the
remaining bits in the first two bytes, that is, 1000000101000001,
and the host portion is the values in the last two bytes, or
0001100000110010. so that we would say that this particular
address is at network 129.65 and then at host address 24.50 on
that network.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
The Internet Address Scheme
 For human readability, Internet addresses are
written in a dotted decimal notation:
nnn.nnn.nnn.nnn, where each nnn group is a decimal
value in the range of 0 through 255
# Internet host table (found in /etc/hosts file)
127.0.0.1
localhost
129.65.242.5 falcon.csc.calpoly.edu falcon loghost
129.65.241.9 falcon-srv.csc.calpoly.edu
falcon-srv
129.65.242.4 hornet.csc.calpoly.edu hornet
129.65.241.8 hornet-srv.csc.calpoly.edu
hornet-srv
129.65.54.9 onion.csc.calpoly.edu onion
129.65.241.3 hercules.csc.calpoly.edu
hercules
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
The Domain Name System (DNS)
For user friendliness, each Internet address is
mapped to a symbolic name, using the DNS, in the
format of:
<computer-name>.<subdomain hierarchy>.<organization>.<sector name>{.<country code>}
root
e.g., www.csc.calpoly.edu.us
top-le ve l dom ain
com
e du
gov
net
org
m il
cou n try code
in th e U.S .
Top-le ve l dom ain n am e h as to be applie d for.
S u bdom ain h ie rach y an d n am e s are as s ign e d
by th e organ ization .
organ ization
...
...
s u bdom ain
h os t n am e
10/3/2015
54
The Domain Name System
 For network applications, a domain name
must be mapped to its corresponding Internet
address.
 Processes known as domain name system
servers provide the mapping service, based
on a distributed database of the mapping
scheme.
 The mapping service is offered by thousands
of DNS servers on the Internet, each
responsible for a portion of the name space,
called a zone. The servers that have access
to the DNS information (zone file) for a zone is
said to have authority for that zone.
Top-level Domain Names
 .com: For commercial entities, which anyone, anywhere in the
world, can register.
 .net : Originally designated for organizations directly involved
in Internet operations. It is increasingly being used by
businesses when the desired name under "com" is already
registered by another organization. Today anyone can register
a name in the Net domain.
 .org: For miscellaneous organizations, including non-profits.
 .edu: For four-year accredited institutions of higher learning.
 .gov: For US Federal Government entities
 .mil: For US military
 Country Codes :For individual countries based on the
International Standards Organization. For example, ca for
Canada, and jp for Japan.
Example
Another example:
Given the address 224.0.0.1, one can expand it as
follows:
2 2 4 .0 .0 .1
1110000
00000000
00000000
00000001
The binary prefix of 1110 signifies that this is class D, or
multicast, address. Data packets sent to this
address should therefore be delivered to the
multicast group 0000000000000000000000000001.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Network Basics
2. Addressing a process running on a host
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Addressing a process running on a host
h os t A
...
h os t B
...
proc es s
port
Each h os t h as 65536 ports .
Th e I n te rn e t
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Well Known Ports
Each Internet host has 216 (65,535) logical ports.
Each port is identified by a number between 1
and 65535, and can be allocated to a particular
process.
Port numbers beween 1 and 1023 are reserved
for processes which provide well-known services
such as finger, FTP, HTTP, and email.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Well Known Ports
A ssign men t of some well-kn own p orts
Protocol
Port
S e rvice
e ch o
7
IPC te stin g
d a ytime
13
p ro vid e s th e cu rre n t d a te a n d time
ftp
21
file tra n sfe r p ro to co l
te ln e t
23
remote, c ommand-line terminal s es s ion
smtp
25
simp le ma il tra n sfe r p ro to co l
time
37
p ro vid e s a sta n d a rd time
fin g e r
79
p ro vid e s in fo rma tio n a b o u t a u se r
h ttp
80
we b se rve r
R MI R e g istry
1099
re g is try fo r R e m o te Me th o d In vo ca tio n
sp e cia l we b se rve r
8080
we b se rve r wh ich su p p o rts
se rvle ts, JSP, o r ASP
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Choose a port
For our programming exercises: when a port is
needed, choose a random number above the
well known ports: 1,024- 65,535.
If you are providing a network service for the
community, then arrange to have a port
assigned to and reserved for your service.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Network Basics
3. Addressing a Web
Document
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
The Uniform Resource Identifier (URI)
 Resources to be shared on a network need to be
uniquely identifiable.
 On the Internet, a URI is a character string which allows
a resource to be located.
 There are two types of URIs:
 URL (Uniform Resource Locator) points to a specific resource
at a specific location
 URN (Uniform Resource Name) points to a specific resource at
a nonspecific location.
 “A URN is like a person's name, while a URL is like their street
address. The URN defines something's identity, while the URL
provides a method for finding something. Essentially, "what" vs.
"where".” (from Wiki)
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
URL
A URL has the format of:
protocol://host address[:port]/directory path/file name#section
A s am p l e U R L :
http ://w w w .c s c .c alp o ly.ed u:8080/~ m liu/C S C 369/hw .htm l # hw 1
s ec tio n n am e
f ile n am e
h o s t n am e
p r o to c o l o f s er v er
d ir ec to r y p ath
p o r t n u m b er o f s er v er p r o c es s
O th e r p r o to co ls th a t ca n a p p e a r in a U R L a r e :
file
ftp
gopher
news
te ln e t
W A IS
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4
© Pearson Education 2005
Descargar

Figure 15.1 A distributed multimedia system