Network slicing is defined as one of the main components of fifth-generation mobile communications that can solve the problem of colossal growth in data volume traffic in cellular networks. A key feature of slicing is to limit the effect of one slice on another to provide a high quality of service. Therefore, in this paper, a model for resource sharing in slicing using the queueing theory methods is constructed. The main aim is to determine how radio resources should be fairly shared between different slices in the system. The proposed algorithm ensures the isolation of slices according to the quality of service. The resource sharing problem is formulated as an optimization problem. Analysis of the system’s performance characteristics will allow us to conclude that the isolation parameter has a significant effect on metrics of interest. © 2021, Springer Nature Switzerland AG.