What is the master/slave model?

Master/slave is an ar­chi­tec­tur­al concept in in­form­a­tion tech­no­logy that describes how resources are con­trolled and dis­trib­uted. Within this model, a master device or process has control over how and when sub­or­din­ate devices and processes use resources. This model is used, for example, to generate piconets in Bluetooth.

When is the master/slave model used?

The master/slave model can be im­ple­men­ted when several devices, processes or ap­plic­a­tions depend on the same resources. This is, for instance, the case when trans­mit­ting data via a data bus. The master/slave model regulates requests and ensures that com­mu­nic­a­tion between the signals takes place without any in­ter­fer­ence or modi­fic­a­tion from other par­ti­cipants. This guar­an­tees that all processes are executed correctly.

Note

The term ‘master/slave’ is extremely prob­lem­at­ic given its reference to slavery. Al­tern­at­ive ter­min­o­logy is often used, including the following: ‘primary/secondary’, ‘primary/replica’ and ‘principal/agent’.

What are some common scenarios that the master/slave model is used for?

The master/slave model is used to do the following:

  • Regulate and co­ordin­ate bus systems for in­form­a­tion exchange: The master co­ordin­ates and controls secondary devices and ensures that the data bus receives and processes in­form­a­tion correctly.
  • Organise resources within a computer network: The master releases the resources available in the network according to a certain logic. This ensures that all par­ti­cipants perform their tasks.
  • Create a piconet of terminals using Bluetooth: The master/slave model is used to create piconets. This is a [personal area network], which is a specific type of network that connects to end devices using Bluetooth.
  • Control access to a host system: A host computer provides resources within a computer network. The master regulates the par­ti­cipants’ access.

How does the master/slave model work?

In the master/slave model, com­mu­nic­a­tion is one-sided. The master can contact the slave, but it is not possible for the slave to com­mu­nic­ate with the master. Therefore, resources are always con­trolled uni­direc­tion­ally.

The master device or process grants the slave device or process the rights it needs. This may include access or com­mu­nic­a­tion rights. The slave follows the master’s requests, while the master can act as it chooses.

What are the char­ac­ter­ist­ics of master/slave?

In the master/slave model, the master device or process is in control. Slave devices and processes are always passive and must wait for the master’s per­mis­sion to use resources. Due to its position, the master is granted a larger range of functions and can control a large number of secondary devices and processes. The master can address the slaves with an address or a physical line. In certain systems, it is possible to define the master when ini­tial­ising a system of equal stations.

What are the ad­vant­ages and dis­ad­vant­ages of the master/slave model?

The master/slave model is a well-known concept for con­trolling and reg­u­lat­ing shared resources. The main advantage is that complete access control puts the master at the centre of system planning. This sim­pli­fies the process of resource sharing and also means that no un­au­thor­ised in­form­a­tion exchange can take place. The main dis­ad­vant­age of this model is the uni­direc­tion­al com­mu­nic­a­tion. Since slaves are not able to com­mu­nic­ate directly with the master, polling is used to regularly check the status of hardware or software. This method, however, is con­sidered in­ef­fi­cient.

What are al­tern­at­ives to the master/slave model?

The master/slave model is not the only ar­chi­tec­ture model for resource control and al­loc­a­tion. The client-server model is a well-known al­tern­at­ive. In this model, servers offer services that clients use. This is the most commonly used ar­chi­tec­ture model on the internet. For example, sending emails using SMTP, IMAP or POP, sending HTTP requests to a web server, and trans­fer­ring data to a server using File Transfer Protocol (FTP) are all carried out using the client-server model.

The peer-to-peer model is another al­tern­at­ive. The peer program rep­res­ents the server and client at the same time. Unlike the master/slave model, the peers have equal rights and perform both server and client tasks. Peer-to-peer ar­chi­tec­ture is used primarily for file-sharing services or grid computing.

Go to Main Menu