0% found this document useful (0 votes)
18 views

Chapter Two

Distributed system Lecture Note

Uploaded by

habtamu molla
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)
18 views

Chapter Two

Distributed system Lecture Note

Uploaded by

habtamu molla
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/ 64

Issues and Architectures

Chapter 2
Contents
 Characterization of Distributed
System
 Networking and Internetworking
•Types of Network
•Network Principles
•Internet Protocols
 Interposes Communication
Networks vs. Distributed
Systems
Networks: A media for interconnecting local
and wide area computers and exchange
messages based on protocols. Network
entities are visible and they are explicitly
addressed (IP address).
Distributed System: existence of multiple
autonomous computers is transparent
However,
– many problems (e.g., openness,
reliability) in common, but at different
levels.
• Networks focuses on packets, routing, etc.,
whereas distributed systems focus on
applications.
• Every distributed system relies on services
provided by a computer network.
Characteristics of Distributed
Systems
Parallel activities
– Autonomous components executing concurrent
tasks
Communication via message passing
– No shared memory
Resource sharing
– Printer, database, other services
No global state
– No single process can have knowledge of the
current global state of the system
No global clock
– Only limited precision for processes to
synchronize their clocks
Types of Networks
• Local Area Networks (LAN)
– floor/building-wide
– single communication medium
– no routing, broadcast
– segments connected by switches or
hubs
– high bandwidth, low latency
– Ethernet - 10Mbps, 100Mbps, 1Gbps
– Personal area networks (PAN) [ad-
hoc networks]: blue tooth, infra-red
for PDAs, cell phones, …
Types of Networks
Metropolitan Area Networks (MAN)
– City-wide, up to 50 km
– Digital Subscriber Line (DSL): 0.25 - 8
Mbps, 5.5km from switch
– Cable modem: 1.5 Mbps, longer range
than DSL
Types of Networks
Wide Area Networks (WAN)
– World-wide
– Different organizations
– Large distances
– routed, latency 0.1 - 0.5 seconds
– Commonly 1-10 Mbps (upto 600
Mbps)
Types of Networks
• Wireless local area networks (WLAN)
– IEEE 802.11 (WiFi)
– 10-100 Mbps, 1.5km
• 802.11 (1997): upto 2 Mbps, 2.4 GHz
• 802.11a (1999): upto 54 Mbps, 5 GHz, ~75
feet outdoor
• 802.11b (1999): upto 11 Mbps, 2.4 GHz, ~150
feet [most popular]
• 802.11g (2003): upto 54 Mbps, 2.4 GHz, ~150
feet [backward compatible with 802.11b,
becoming more popular]
• Wireless metropolitan area networks
(WMAN)
– IEEE 802.16 (WiMax)
– 1.5-20 Mbps, 5-50km
Types of Networks
Wireless wide area networks
(WWAN)
– worldwide
– GSM (Global System for Mobile
communications)
– 9.6 – 33 kbps
– 3G (“third generation”): 128-384
kbps to 2Mbps
Types of Networks
Internetworks
– connecting different kinds of
networks
– routers, gateways
Types of Networks
Example Range Bandwidth Latency
(Mbps) (ms)
Wired:
LAN Ethernet 1-2 km 10-1000 1-10
Network performance

MAN ATM 250 km 1-150 10


WAN IP routing worldwide .01-600 100-500
Internetwork Internet worldwide 0.5-600 100-500
Wireless:
WPAN Bluetooth (802.15.1) 10 - 30m 0.5-2 5-20
WLAN WiFi (IEEE 802.11) 0.15-1.5 km 2-54 5-20
WMAN WiMAX (802.16) 550 km 1.5-20 5-20
WWAN GSM, 3G phone nets worldwide 0.01-2 100-500
Network principles
Packet transmission
– message: logical unit of
information
– packet: transmission unit
– restricted length: sufficient buffer
storage, reduce hogging
Network principles
• Data Streaming
– audio/video
– Need 120 Mbps (1.5 Mbps
compressed)
– play time: the time when a frame
need to be displayed
– for example, 24 frames per second,
frame 48 must be display after two
seconds
Network principles
• Switching schemes (transmission
between aribitrary nodes)
– Broadcast: ethernet, token ring,
wireless
– Circuit switching: wires are connected
– Packet switching:
• store-and-forward
• different routes
• “store-and-forward” needs to buffer the
entire packet before forwarding
– Frame relay
• Small packets
• Looks only at the first few bits
• Don’t buffer/store the entire frame
Network principles
Protocols
– Key components
• Sequence of messages
• Format of messages
Network principles

Message sent Message received

Layer n

Layer 2
Layer 1
Sender Communication Recipient
medium

Protocol layers
Network principles

Application-layer message

Presentation header

Session header

Transport header

Network header

Encapsulation in layered protocols


Network principles

Message sent Message received


Layers
Application
Presentation
Session
Transport
Network
Data link
Physical
Sender Communication Recipient
medium
ISO Open Systems Interconnection (OSI) model
Network principles
– Internet layers
• Application = application + presentation
• Transport = transport + session
Message
Layers

Application

Internetwork
Transport protocols

Internetwork
Internetwork packets

Network interface
Underlying
Network-specific packets network
protocols
Underlying network
Network principles
• Packet assembly
– header and data
– maximum transfer unit (MTU): 1500
for Ethernet
• addressing: transport address =
network address + port
– Well-known ports (below 1023)
– Registered ports (1024 - 49151)
– Private (up to 65535)
Network principles
• Routing
– LAN?
– Routing Algorithm
• decide which out-going link to forward
the packet
– for circuit switching, the route is determined
during the circuit setup time
– for packet switching, each packet is routed
independently
– Routing Table
• a record for each destination
• fields: outgoing link, cost (e.g. hop
count)
Network principles

A 1 B
Hosts 2
3 Links 4
or local C
networks 5
D 6 E
Routers

Router example
Network principles : Routing tables
Routings from A Routings from B Routings from C
To Link Cost To Link Cost To Link Cost
A local 0 A 1 1 A 2 2
B 1 1 B local 0 B 2 1
C 1 2 C 2 1 C local 0
D 3 1 D 1 2 D 5 2
E 1 2 E 4 1 E 5 1

Routings from D Routings from E


To Link Cost To Link Cost
A 3 1 A 4 2
B 3 2 B 4 1
C 6 2 C 5 1
D local 0 D 6 1
E 6 1 E local 0
Networking principles
• Network connecting devices
– Hubs: extending a segment of LAN
(broadcast)
– Switches: switching traffic at data-link
level (different segments of a LAN),
making temporary hardware
connections between two ports (or
store and forward) [switches do not
exchange info with each other]
– Routers: routing traffic at IP level
– Bridges: linking networks of different
types, could be routers as well
Networking principles
IPv6 encapsulated in IPv4 packets

IPv4 network
IPv6 IPv6
A B

Encapsulators

Tunneling
– communicate through an "alien" protocol
– “Hide” in the payload
– IPv6 traffic using IPv4 protocols
Internet protocols
• IP (Internet Protocol)
– network layer protocol
– IP addresses
• TCP (Transmission Control
Protocol)
– transport layer
– connection-oriented
• UDP (User Datagram Protocol)
– transport layer
– connection-less
Internet protocols : TCP/IP
layers
Message
Layers

Application
Messages (UDP) or Streams (TCP)

Transport
UDP or TCP packets

Internet
IP datagrams

Network interface
Network-specific frames

Underlying network
Internet protocols: layer
encapsulation

Application message

TCP header port

IP header TCP

Ethernet header IP

Ethernet frame
Internet protocols: Internet
address structure

7 24
Class A: 0 Network ID Host ID

14 16
Class B: 1 0 Network ID Host ID

21 8
Class C: 1 1 0 Network ID Host ID

28
Class D (multicast): 1 1 1 0 Multicast address

27
Class E (reserved): 1 1 1 1 0 unused

32-bit
Internet protocols: Decimal
representation
163.118.131.9 (www.example.com)
octet 1 octet 2 octet 3 Range of addresses
Network ID Host ID
1.0.0.0 to
Class A: 1 to 127 0 to 255 0 to 255 0 to 255 127.255.255.255
Network ID Host ID
Class B: 128 to 191 0 to 255 0 to 255 0 to 255 128.0.0.0 to
191.255.255.255
Network ID Host ID
Class C: 0 to 255 0 to 255 1 to 254 192.0.0.0 to
192 to 223 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
Internet protocols
header
IP address of source IP address of destination data
up to 64 kilobytes
Internet protocols: Network Address Translation
• Sharing one “global” IP address at home
• Routers with NAT
– Router has a “global” IP address from ISP
– Each machine has a “local” IP address via DHCP
– Machine -> router
• Router stores the local IP addr and source port #
• Table entry indexed by a virtual port #
– Router -> outside
• put the router IP addr and virtual port # in the packet
– Outside -> router
• Reply to the router IP addr and virtual port #
– Router -> machine
• Use the virtual port # to find table entry
• Forward to the local IP address and port #
Internet protocols
• Transport protocols: TCP and UDP
– network protocol: host to host
– transport protocol: process to
process
– Port #’s to indicate processes
• UDP
– no guarantee of delivery
– checksum is optional
– max of 64 bytes, same as IP
– no setup costs, no segments
Internet protocols
TCP
– arbitrarily long sequence
– connection-oriented
– sequencing of segments
– flow control: acknowledgement includes "window
size" (amount of data) for sender to send before
next ack
– interactive service: higher frequency of buffer flush,
send when deadline reached or buffer reaches MTU
– retransmission of lost packets
– buffering of incoming packets to preserve order and
flow
– checksum on header and data
Internet protocols
Firewalls
– monitor and filter communication
– controlling what services are available to the
outside
– controlling the use of services
– controlling internal users access to the
outside
Filtering at different protocol levels
– IP packet filtering: addresses, ports..
– TCP gateway: check for correctness in TCP
connections
– Application-level gateway: proxy for
applications
• no direct communication between the inside and outside
Inter process Communication
Layered Protocols

2-1

Layers, interfaces, and protocols in the OSI model


Layered Protocols

2-2

A typical message as it appears on the network


Data Link Layer

2-3

Discussion between a receiver and a sender in the data


link layer
Client-Server TCP

2-4

a) Normal operation of TCP


b) Transactional TCP
Conventional Procedure Call

a) Parameter passing in a local procedure call: the stack before the call to read
b) The stack while the called procedure is active
Client and Server Stubs

Principle of RPC between a client and server program


Steps of a Remote Procedure
Call
1. Client procedure calls client stub in normal
way
2. Client stub builds message, calls local OS
3. Client's OS sends message to remote OS
4. Remote OS gives message to server stub
5. Server stub unpacks parameters, calls server
6. Server does work, returns result to the stub
7. Server stub packs it in message, calls local
OS
8. Server's OS sends message to client's OS
9. Client's OS gives message to client stub
10. Stub unpacks result, returns to client
Passing Value Parameters

2-8

Steps involved in doing remote computation through RPC


Parameter Specification and Stub
Generation

a) A procedure
b) The corresponding message
Extended RPC Models

1. Doors
2. Asynchronous RPC
Doors

The principle of using doors as IPC mechanism


Asynchronous RPC

2-12

a) The interconnection between client and server in a traditional


RPC
b) The interaction using asynchronous RPC
Asynchronous RPC

2-13

A client and server interacting through two asynchronous


RPCs
Binding a Client to a Server

2-15

Client-to-server binding in DCE


Distributed Objects

2-16

Common organization of a remote object with client-side proxy


Parameter Passing

2-18

The situation when passing an object by reference or by


value
Persistence and Synchronicity in
Communication

2-20

General organization of a communication system in which


hosts are connected through a network
Persistence and Synchronicity in
Communication

Persistent communication of letters back in the days of


the Pony Express
Berkeley Sockets
Primitive Meaning

Socket Create a new communication endpoint

Bind Attach a local address to a socket


Announce willingness to accept
Listen
connections
Block caller until a connection request
Accept
arrives
Connect Actively attempt to establish a connection

Send Send some data over the connection

Receive Receive some data over the connection

Close Release the connection

Socket primitives for TCP/IP


Berkeley Sockets

Connection-oriented communication pattern using


sockets
Message-Queuing Model

Primitive Meaning
Put Append a message to a specified queue
Block until the specified queue is nonempty, and remove the first
Get
message
Check a specified queue for messages, and remove the first.
Poll
Never block.
Install a handler to be called when a message is put into the
Notify
specified queue.

Basic interface to a queue in a message-queuing system


General Architecture of a Message-Queuing
System

The relationship between queue-level addressing and


network-level addressing
General Architecture of a Message-Queuing
System

2-29

The general organization of a message-queuing system


with routers
Message Brokers

2-30

The general organization of a message broker in a message-queuing system


Message Transfer

Primitive Description
MQopen Open a (possibly remote) queue
MQclose Close a queue
MQput Put a message into an opened queue
MQget Get a message from a (local) queue

Primitives available in an IBM MQSeries MQI


Data Stream

Setting up a stream between two processes across a


network
Data Stream

2-35.2

Setting up a stream directly between two devices


Data Stream

An example of multicasting a stream to several receivers


Synchronization Mechanisms

The principle of explicit synchronization on the level data


units

You might also like