19
Operating Systems and Distributed Systems SCC Networks and Distributed computing Operating Systems and Distributed Systems Previously discussed... Operating Systems and Distributed Systems What we will learn Every SCC is a component in a distributed system that executes distributed programs on a combination of the SCC and one or more other machines. Distributed systems concepts Network architecture and the ISO/OSI reference model The device abstraction for communicating: remote computers as devices Of client and servers Operating Systems and Distributed Systems Motivations Networks are not considered to be an essential component of a von Neumann computer – standalone computers do not even use a network. • Contemporary SCC: ability to communicate with other computers using a network. – every SCC contains at least one communication device

Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

Operating Systems and Distributed Systems

SCC Networks and

Distributed computing

Operating Systems and Distributed Systems

Previously discussed...

Operating Systems and Distributed Systems

What we will learn• Every SCC is a component in a distributed system

that executes distributed programs on a combination of the SCC and one or more other machines.

• Distributed systems concepts

• Network architecture and the ISO/OSI reference model

• The device abstraction for communicating: remote computers as devices

• Of client and servers

Operating Systems and Distributed Systems

Motivations

• Networks are not considered to be an essential component of a von Neumann computer– standalone computers do not even use a

network.

• Contemporary SCC: ability to communicate with other computers using a network.

– every SCC contains at least one communication device

Page 2: Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

Operating Systems and Distributed Systems

Distributed computing

• Ability to execute code within a machine and to exchange information with other computers: the foundation of distributed computing

Operating Systems and Distributed Systems

Distributed systems

• A collection of independent computers that appear to the users of the system as a single computer

• A collection of computing nodes interconnected by a network

• Distribution of the execution over multiple computers is transparent:

– the way that the program is written is the same whether it executes on a single computer or on the distributed system

Operating Systems and Distributed Systems

Data Networks

Network

DeviceMemory

CPU

Network

DeviceMemory

CPU

Specialized Data Network

• The actual device is the subcommunication network• The computer’s component is the device controller that adapts the computer to the subcommunication network, often referred to as the network interface controller, (or NIC)

Operating Systems and Distributed Systems

Data Networks

Page 3: Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

Operating Systems and Distributed Systems

Data Networks• NIC:

– physically and electronically connect to the subcommunication network

– write data to and read data from the network

• NIC I/O commands are similar to commands for other I/O devices

Operating Systems and Distributed Systems

A History Lesson of Networking

• 1969 – ARPANET, first packet switched network consist of UCLA, Stanford, UC Santa Barbara and Utah University

• 1971 – first email program

• 1974 – TCP/IP

• 1980’s – Local Area Networks (LANs)

• 1984 – OSI Layer

• 1990’s – WWW / Internetworking

Operating Systems and Distributed Systems

Protocols• Set of rules for acceptable behaviour (how

communication should take place in) – the rules used by communicating parties for that

communication to be successful

– mostly implemented in Software

• Driving Force: need for different proprietary networking system to communicate

• Complexity demands that protocols are ‘layered’

Operating Systems and Distributed Systems

Advantages of Layering Protocols

• Dividing complex network operation into more manageable layers

• Defining the standard interface for the “plug-and-play” multi-vendor integration

• Facilitate Modular Engineering

• Simplifies Teaching and Learning

Page 4: Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

Operating Systems and Distributed Systems

Protocol Tasks• Control information delivery rates

• Pass data across networks

• Provide fast/reliable IPC-like communication

• Support logical byte streams

• Create other models for communication

– File transfer

– Procedure call paradigm

– Shared memory paradigm

• Translate machine-dependent data representations

• … and more …Operating Systems and Distributed Systems

Standardizing Protocols

• ANSI X.25

• ARPAnet

• ISO Open Systems Interconnect (OSI) model– Now widely used as a reference architecture

Operating Systems and Distributed Systems

ISO/OSI Reference Model

• ISO in 1984

• Open Systems Interconnect (OSI)

• A design guideline for network layering

– Provides framework for specific protocols (such as IP, TCP, FTP, RPC, RSVP, …)

• Abstract layers provide different services

– 7 layers of service

• Each level has an implied level of intelligence

Operating Systems and Distributed Systems

Application

Data Link

Presentation

Network

Physical

Session

Transport

Physical Medium

Application

Data Link

Presentation

Network

Physical

Session

Transport

Host A Host B

ISO/OSI Reference Model

Page 5: Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

Operating Systems and Distributed Systems

Application

Data Link

Presentation

Network

Physical

Session

Transport

Physical Medium

Application

Data Link

Presentation

Network

Physical

Session

Transport

Host A Host B

ISO/OSI Reference Model

Each layer communicates with same layer in remote machine

Layer 7 Protocol

Layer 4 Protocol

Layer 3 Protocol

Layer 2 Protocol

Layer 1 Protocol

Layer 5 Protocol

Layer 6 Protocol

Operating Systems and Distributed Systems

Application

Data Link

Presentation

Network

Physical

Session

Transport

Physical Medium

Application

Data Link

Presentation

Network

Physical

Session

Transport

Host A Host B

ISO/OSI Reference Model

Each layer communicates with same layer in remote machine

Eac

h lay

er p

rovi

des

ser

vice

to a

dja

cent

laye

rs

Layer 7 Protocol

Layer 4 Protocol

Layer 3 Protocol

Layer 2 Protocol

Layer 1 Protocol

Layer 5 Protocol

Layer 6 Protocol Layer 6/7 Interface

Layer 5/6 Interface

Layer 4/5 Interface

Layer 3/4 Interface

Layer 2/3 Interface

Layer 1/2 Interface

Operating Systems and Distributed Systems

• Interface: It defines which primitive operations and services the lower layer offers to the upper layer.

• Peer: The similar layer on a different machine

– the peer processes communicate with each other using a protocol.

• Protocol: It is a set of rules and conventions used by the layer to communicate with similar peer layer in another (remote) system.

• A set of layers and protocols is called a network architecture.

ISO/OSI Reference Model: some definitions

Operating Systems and Distributed Systems

• In reality, no data are directly transferred from layer i on one machine to layer i on another machine.

• Each layer passes data and control information to the layer immediately below it, until the lowest layer is reached.

• Below layer 1 is the physical medium through which actual communication occurs.

Send-To-Other-side ( ) Get-From-Other-side ( )

Protocol

(Virtual Communication)

Host A Host B

Layer i Layer i

ISO/OSI Reference Model: layer communication

Page 6: Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

21

Data

DataPH

DataAH

DataSH

DataTH

DataNH

DataDH DT

Application

Data Link

Presentation

Network

Physical

Session

Transport

Receiving Process

Application

Data Link

Presentation

Network

Physical

Session

Transport

Sending Process

Bits

ISO OSI Model: data transmissionThe package of data that moves through the layers is called a Protocol Data Unit (PDU)

Operating Systems and Distributed Systems

The beautification principle

Operating Systems and Distributed Systems

ISO OSI Model: layer implementation

Operating Systems and Distributed Systems

All People Seem To Need Data Processing• Layer 7, Application: provides services to the software through which the user

requests network services. This layer isn't about applications and doesn't contain any applications. In other words, programs such as Microsoft Word or Corel are not at this layer, but browsers, FTP clients, and mail clients are.

• Layer 6, Presentation: is concerned with data representation and code formatting.

• Layer 5, Session: establishes, maintains, and manages the communication session between computers.

• Layer 4, Transport: provides for the reliable transmission of data segments, as well as the disassembly and assembly of the data before and after transmission.

• Layer 3, Network: routing takes place, and, as a result, is perhaps the most important OSI layer. The Network layer defines the processes used to route data across the network and the structure and use of logical addressing.

• Layer 2, Data Link: is concerned with the linkages and mechanisms used to move data about the network, including the topology, such as Ethernet or Token Ring, and deals with the ways in which data is reliably transmitted.

• Layer 1, Physical: defines the electrical and physical specifications for the networking media that carry the data bits across a network.

NIC

OS

SYST

EM

SW

Page 7: Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

Operating Systems and Distributed Systems

Layer 1 - Physical

• Physical Layer:– Move bits between devices

– Specifies voltage, wire speed, and pin out cables

– Passes data up to data link layer (and receives from data link layer)

Operating Systems and Distributed Systems

Physical Physical

•The Ethernet carrier sensing and collision detection techniques are good examples of a physical layer network protocol: CSMA/CD (Carrier Sensing Multiple Access with Collision Detection(IEEE Standard 802.3, ).• Token Passing Ring Network. IEEE Standard 802.5, (Token Ring IBM).•Part of this layer is implemented in the subcommunication network (the part that dictates how signals are transmitted and received), and part of it is in the NIC.

Layer 1 Physical

Operating Systems and Distributed Systems

Ethernet (CSMA/CD)

• Asynchronous• Carrier Sense• Multiple Access• Collision Detection• Backoff

Operating Systems and Distributed Systems

Wireless

Backbone

•IEEE 802.11 (“WiFi”)•IEEE 802.15 (“Bluetooth”)

Ad hoc networks

Page 8: Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

Operating Systems and Distributed Systems

Layer 2 – Data Link

• Performs framing of bits, flow and error control but not correction

• Responsible for transmission of frames across the physical link

• Provide access to media using MAC address

• Passes data between physical and network layers

Data Link

Physical

Data Link

Physical

Operating Systems and Distributed Systems

• The Institute of Electrical and Electronics Engineers (IEEE) has subdivided the data link layer into two sublayers: Logical Link Control (LLC) and Media Access Control (MAC).

Layer 2 – Data Link

• Error Control

• Access Control

Operating Systems and Distributed Systems

• The Logical Link Control (LLC) 802.2 sublayer is responsible for identifying Network Layer protocols and then encapsulating them.

– LLC header tell the Data Link Layer what to do with the packet if a frame is coming

– provide flow control and sequencing of control bits

• The Media Access Control (MAC) sublayer manages protocol access (logical topologies) to the physical network medium.

– The IEEE MAC specification defines MAC addresses, which enable multiple devices to uniquely identify one another at the data link layer. IEEE 802.3 and 802.5

Layer 2 – Data Link

Operating Systems and Distributed Systems

Layer 3 - Network

• Passes data between data link and transport layers

• Responsible for routing data across a network, from source to destination using (network-wide) logical addressing

• Pass data between (separate) subnetworks

• Hides network topology from higher layers

• Example: Network layer net, the Internet

Network

Data Link

Physical

Network

Data Link

Physical

Page 9: Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

Operating Systems and Distributed Systems

Layer 3 - Network :Addressing

Operating Systems and Distributed Systems

Layer 3 - Network: Addressing

Operating Systems and Distributed Systems

Layer 3 - Network: Addressing

Operating Systems and Distributed Systems

Layer 3 - Network: Addressing

Page 10: Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

Operating Systems and Distributed Systems

Layer 3 - Network

• Primary purpose is to combine networks

• Internet protocol (IP) is dominant protocol

• Creates an internet address space

• Implements packet routing across networks

Host X

Host R Host S Host Y

Network B Network CNetwork A

Operating Systems and Distributed Systems

Using Data Link and Network Layer Addresses

Network

Layer

Data Link

Layer

0x80C31A80837E

128.123.234.012

Dat

a L

ink L

ayer

Fra

me

Net

work

Lay

er

Pac

ket

Protocol Data Unit (PDU)

39

Application

Data Link

Presentation

Network

Physical

Session

Transport

Application

Data Link

Presentation

Network

Physical

Session

Transport

Layer 7 Protocol

Layer 4 Protocol

Layer 5 Protocol

Layer 6 Protocol

Host A Host B

Data Link

Network

Physical

Data Link

Network

Physical

ISO OSI Model: networking

Operating Systems and Distributed Systems

Layer 3 - Network: Addressing & Routing

Host X

Host R Host Y

Network CNetwork A

3b4e87

3b4e62 3b4e55 3b621a

3b6209

•Host X does not know how to send to Host Y•Can send a frame to Host R for forwarding•What should it tell Host R?

Page 11: Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

Operating Systems and Distributed Systems

Host X

Host R Host Y

Network CNetwork A

•Host X does not know how to send to Host Y•Can send a frame to Host R for forwarding•What should it tell Host R?•Internet address spans all machines

3b4e87

3b4e62 3b4e55 3b621a

3b6209

128.123.234.033

128.123.234.188 128.229.244.006

128.229.244.109

128.123.234.063

To: 128.229.244.006

From: 128.123.234.033

Network Layer data

Layer 3 - Network: Addressing & Routing

Operating Systems and Distributed Systems

Host X

Host R Host Y

Network CNetwork A

•Host X does not know how to send to Host Y•Can send a frame to Host R for forwarding •What should it tell Host R?•Internet address spans all machines•Send encapsulated packet to Host R with Host Y

3b4e87

3b4e62 3b4e55 3b621a

3b6209

128.123.234.033

128.123.234.188 128.229.244.006

128.229.244.109

128.123.234.063

To: 3b4e55

From: 3b4e87

To: 128.229.244.006

From: 128.123.234.033

Network Layer data

Layer 3 - Network: Addressing & Routing

Operating Systems and Distributed Systems

Host X

Host R Host Y

Network CNetwork A

•Host X does not know how to send to Host Y•Can send a frame to Host R for forwarding •What should it tell Host R?•Internet address spans all machines•Send encapsulated packet to Host R with Host Y

3b4e87

3b4e62 3b4e55 3b621a

3b6209

128.123.234.033

128.123.234.188 128.229.244.006

128.229.244.109

128.123.234.063

Host S

Network B

Layer 3 - Network: Addressing & Routing

Operating Systems and Distributed Systems

Host X

Host R Host Y

Network CNetwork A

•Host X does not know how to send to Host Y•Can send a frame to Host R for forwarding•What should it tell Host R?•Internet address spans all machines•Send encapsulated packet to Host R with Host Y•Data Link frame is received by Host Y

3b4e87

3b4e62 3b4e55 3b621a

3b6209

128.123.234.033

128.123.234.188 128.229.244.006

128.229.244.109

128.123.234.063

To: 3b621a

From: ...

To: 128.229.244.006

From: 128.123.234.033

Network Layer data

Network B

Layer 3 - Network: Addressing & Routing

Page 12: Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

Operating Systems and Distributed Systems

Layer 4 - Transport

• Passes data between network and session layers

• Provides reliable end-to-end delivery of data segments , including flow and error control of packets

• Fragmentation of large messages

• Quality of Service (QoS), usually with layer 3

• Last of the pure network layers

Transport

Network

Data Link

Physical

Transport

Network

Data Link

Physical

Operating Systems and Distributed Systems

Layer 4 - Transport

• Uses the network to provide various application interfaces to the services implemented by the network layer, including block, byte stream, and record stream communication.

• Example. Transport layer net: TCP-based network

Transport

Network

Data Link

Physical

Transport

Network

Data Link

Physical

Operating Systems and Distributed Systems

• Converts a stream of bytes into packets when it transmits information using the network layer, and viceversa

• Transport layer adds ports,logical endpoints

– Address: <net, host, port>

• Two primary protocols (both from ARPAnet)

– User Datagram Protocol (UDP)• User-space interface to IP packets

• No guarantee that packet will be delivered

– Transmission Control Protocol (TCP)• Provides a stream-oriented interface to the network

• Reliable delivery

Layer 4 - Transport

Operating Systems and Distributed Systems

Communication Ports

• Global name for a “mailbox”

• Will be many ports at one <net, host>

Transport Layer

Network Layer

Low Layers

P P P P

ports

0 1 2 n

port numbers

mumble.cs.colorado.edu

Host: 34Net: 128.138.34

DN

S r

esolv

e

Page 13: Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

Operating Systems and Distributed Systems

Communication Ports

• Global name for a “mailbox”

• Will be many ports at one <net, host>

• Each port can be bound to an address

P P P P

Transport Layer

Network Layer

Low LayersHost: 34On Net 128.138.34

128.138.249.34

<128.138.249, 34, 1>

0 1 2 n

Operating Systems and Distributed Systems

Layers 3 & 4: OSI Layer vs. TCP/IP

Operating Systems and Distributed Systems

MAC

ISO OSI Network

ISO OSI TLI

ISO OSI Session

ISO OSI packet

ISO OSI frame

Ethernet

ARPAnet IP

ARPAnet TCP

ISO OSI Session

ISO OSI packet

IP frame

Ethernet packet

Layers 3 & 4: OSI Layer vs. TCP/IP

Operating Systems and Distributed Systems

Some Protocols in TCP/IP Suite

Page 14: Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

Operating Systems and Distributed Systems

Layer 5 - Session

• Passes data between presentation and transport layers

• Responsible for managing network sessions (series of related data streams): logical connection and security

• Provides synchronization and scheduling

• NFS (Network File System), RPC (Remote Procedure Call), X Window

Session

Transport

Network

Data Link

Physical

Session

Transport

Network

Data Link

Physical

Operating Systems and Distributed Systems

Layer 6 - Presentation

• Passes data between application and session layers

• Provides translation services for data to ensure applications are using compatible formats (machine independent)

– Example: converting from ASCII to EBCDIC text representations

• Compression and Cryptography

Presentation

Session

Transport

Network

Data Link

Physical

Presentation

Session

Transport

Network

Data Link

Physical

Operating Systems and Distributed Systems

Application

Presentation

Session

Transport

Network

Data Link

Physical

Application

Presentation

Session

Transport

Network

Data Link

Physical

Layer 7 - Application

• Passes data to presentation layer (and receives from presentation layer)

• … to and from the user!

• Communicates with remote applications

• Determines the user capability within the network representation

Operating Systems and Distributed Systems

Application

Presentation

Session

Transport

Network

Data Link

Physical

Application

Presentation

Session

Transport

Network

Data Link

Physical

•Physical/Data Link layer networks: Ethernet, Token Ring, ATM•Network layer net: The Internet•Transport layer net: TCP-based network•Presentation/Session layer net: http/html, RPC, PVM, MPI•Applications: SMTP (Simple Mail Transfer Protocol), HTTP (Hypertext Transfer Protocol), TELNET, FTP (File Transfer Protocol), POP3 (Post Office Protocol v3), IMAP (Internet Mail Access Protocol)

Layer 7 - Application

Page 15: Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

Operating Systems and Distributed Systems

An interlude on I/O:the Device model

• Every executing program needs to communicate with the external environment of the computer in order to do any useful work

processor executes almost every machine

instructionI/O instruction is

executed by a device

...startRead(DEV_3, x);while(DEV_3.busy == 1)

(wait);// The device is doney = f(x);...

Operating Systems and Distributed Systems

An interlude on I/O:the Device model

while(DEV_3.busy == 0)(wait);

DEV_3.busy = 1;// Perform an input opreturn(value);DEV3.busy = 0…

• Sequential operation

CPU

DEV_3

Hardware

Operating Systems and Distributed Systems

An interlude on I/O:the Device model

while(DEV_3.busy == 0)(wait);

DEV_3.busy = 1;// Perform an input opreturn(value);DEV3.busy = 0…

• Overlapped operation

CPU

DEV_3

Hardware

...startRead(DEV_3, x);while(DEV_3.busy == 1)

executeCodeFragment();// The device is doney = f(x);...

Operating Systems and Distributed Systems

Generalizing the Device model

• The idea:– at a low layer (NIC) control flow perspective

• sending a message to a remote computer is not much different from writing data to a local device

Page 16: Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

Operating Systems and Distributed Systems

Generalizing the Device model

• The remote computer as a device

Operating Systems and Distributed Systems

Generalizing the Device model

• The remote computer as a device

setAddr(NIC, addrSCC);while(NIC.busy== 1)(wait);startWrite(NIC, x)while(NIC.busy== 1) (wait);// The device sent // a message

startRead(NIC, &x);while(NIC.busy== 1) (wait);// The device received// a message…

Operating Systems and Distributed Systems

Roles for SCC in Distributed Systems

• SCC: specialized to perform a particular task or to handle a small number of tasks in a particular domain

• The SCC can:– provide a service to other computers in the

distributed system (a server)

– it might play the opposite role of using services provided by other computers in the system (a client)

Operating Systems and Distributed Systems

Roles for SCC in Distributed Systems

• SCCs can be used to add “intelligence” to devices in a distributed system.

• Smart device scenario: work is distributed across different hardware units – in this case across the processor and devices– Dumb devices leave that computation to the

application program

– Smart devices are able to execute part of the processor’s algorithm on their own

Page 17: Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

Operating Systems and Distributed Systems

Roles for SCC in Distributed Systems: Example

• Build a large computer system that controls the heating and cooling in a large cruise ship with, say 1,500 rooms. – The ship is large enough that some rooms

might have to be cooled at the same time that others are being heated.

– Each room contains a digital thermometer that the central computer can read to determine if it needs to heat or cool the associated room

Operating Systems and Distributed Systems

Example: simple solutionDirect control of each digital thermometer (Dumb device)

/* The temperature maintenance loop

* thermometer[i] is the device in room #i

*/

for(i=0; i<NUMBER_OF_ROOMS; i++) {

! startRead(thermometer[i], &currentTemp, …);

! while(thermometer[i].busy == 1); /*(waiting)*/

! /* We have a current temperature for room #i */

! if(currentTemp >= maxTemp) {

! ! /* Turn on the air conditioning */

! ! …

! } else

! ! if(currentTemp <= minTemp) {

! ! ! /* Turn on the heater */

! ! ! …

! ! }

! …

}

while(TRUE) {…startRead(myThermometer, &currentTemp, …);while(thermometer[i].busy== 1)

/*(waiting)*/;/* We have a current temperature for my room */if(currentTemp>= maxTemp) {

/* Notify the chief to turn on the * air conditioning */…

} elseif(currentTemp<= minTemp) {

/* Notify the chief to turn on the heater */…

}}

}

Operating Systems and Distributed Systems

Example: better solutionVery simple SCC was associated with each digital thermometer(Smart device)

Operating Systems and Distributed Systems

Example: final solution

Page 18: Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

Operating Systems and Distributed Systems

Example: final solution

/* Initialize SCC-thermometers * Send commands to all SCCs (use broadcast if available) */ … /* Periodically check the NIC to see if any SCC is trying * to send any information to me (the large computer) */ startRead(NIC, …); if(NIC.done == 1) { /* We have a message. Parse it to determine: * - which SCC transmitted the device * - the reason for the message – normal or exception * - determine the response to the message, if any * - execute the response, if any */ … }

Large computer

Operating Systems and Distributed Systems

Example: final solutionwhile(TRUE) { /* Check the Network for info form the large computer */ startRead(NIC, &cmd, …); while(NIC.busy == 1) ; /*(waiting)*/ switch(cmd) { // Process the command from the large computer case HI_THRESHOLD_TEMP: // Set the high threshold temp … break; case LO_THRESHOLD_TEMP: // Set the Low threshold temp … break; case ACTIVATE: // Start measuring the temperature activated = TRUE; … break; ... default: break; }; if(!activated) break; // Skip temperature measurements /* Check the temperature */ startRead(myThermometer, &currentTemp, …); while(thermometer[i].busy == 1) ; /*(waiting)*/ /* We have a current temperature for my room */ if(currentTemp >= maxTemp) { /* Notify the chief to turn on the air conditioning */ startWrite(NIC, …); … } else if(currentTemp <= minTemp) { /* Notify the chief to turn on the heater */ startWrite(NIC, …); … } }

SCC

Operating Systems and Distributed Systems

Roles for SCC in Distributed Systems

• Client SCCs

Operating Systems and Distributed Systems

Client-Server Paradigm

• Making a connection in TCP is an example of the client-server paradigm for distributed computing– Active component is the client

• Runs autonomously

• Decides when it wants to use server

– Passive component is the server• Persistent

• Always waiting for a client to request service

• Not a machine -- just software

Page 19: Previously discussed SCC Networks and Distributed computinghomes.di.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD... · SCC Networks and Distributed computing Operating

Operating Systems and Distributed Systems

What we have learned• Independent of the amount of responsibility delegated to the SCC, there

is an implicit assumption that it communicates with a remote machine.

• Every SCC is a component in a distributed system that executes distributed programs on a combination of the SCC and one or more other machines.

• SCC operating system is distinguished from studying generic operating systems since every SCC must be designed to operate in the context of a distributed system.

• SCC is assigned work to reduce

– the amount of processing that a host machine would otherwise have to perform,

– the amount of information that needs to be exchanged between the two computers (as in the thermometer controller case)

• Systems will evolve over time so that the SCC and other machines will share information using events, message, and objects in addition to information contained in files.