Microkernels and IPC: client-server or point-to-point?
Posted: Sat Dec 29, 2018 10:27 am
I have thought about two modes of implementing IPC for message passing in a microkernel: client-server and point-to-point.
Client-Server would be like: The processes would have ports (also called server descriptors), and client descriptors (intergers actually in userspace). Each client descriptor points to a port (or server descriptor) on some process. This way a server can have several ports, and each of them would be reachable from a number of clients maybe in different processes. It is like a multipoint-to-point structure. This way fork() would need, in the client side, to simply copy or duplicate each client descriptor so that it points to the same server as the parent process, and the server would not need to know it or be notified.
In Point-to-Point there would be only one type of descriptor (also integers in userspace): each process would have a number of descriptors and each one would point exactly to other descriptor of potentially other process. And that other descriptor would point back only to the one descriptor that points to it. So they are symmetrically connected. Each descriptor reaches 1 other descriptor and is reachable by 1 other descriptor. This way any end point could act as a client or as a server indifferently. It is like a point-to-point structure. fork() would need to duplicate the parent's descriptor to the child, and the other end would have to be notified and allocate a new descriptor that would be connected with the child's duplicated descriptor.
In my design, I started with a point-to-point approach because it seemed to me more flexible and general, but after hitting some problems, I considered the client-server approach. That was because I thought that as the Operating System is structured like a stack of protocols and services, and has different levels or types of entities (kernel - drivers - servers - normal processes), so the main direct communications would be between processes of different level or type, and they would not be peers, instead ones would provide services (servers) for others (clients). Also, as the 'normal' processes would generally only request services through libc, they would not need any server functionality, so it would be a waste or resources to assign them potentially unused server infastructures. Also, I think that in point-to-point the system would need a greater total number of descriptors, so client-server might be more efficient.
So, any thoughts about this matter? Do you think that the client-server model is the most adequate for an Operating System's IPC mechanism? Any other model?
Client-Server would be like: The processes would have ports (also called server descriptors), and client descriptors (intergers actually in userspace). Each client descriptor points to a port (or server descriptor) on some process. This way a server can have several ports, and each of them would be reachable from a number of clients maybe in different processes. It is like a multipoint-to-point structure. This way fork() would need, in the client side, to simply copy or duplicate each client descriptor so that it points to the same server as the parent process, and the server would not need to know it or be notified.
In Point-to-Point there would be only one type of descriptor (also integers in userspace): each process would have a number of descriptors and each one would point exactly to other descriptor of potentially other process. And that other descriptor would point back only to the one descriptor that points to it. So they are symmetrically connected. Each descriptor reaches 1 other descriptor and is reachable by 1 other descriptor. This way any end point could act as a client or as a server indifferently. It is like a point-to-point structure. fork() would need to duplicate the parent's descriptor to the child, and the other end would have to be notified and allocate a new descriptor that would be connected with the child's duplicated descriptor.
In my design, I started with a point-to-point approach because it seemed to me more flexible and general, but after hitting some problems, I considered the client-server approach. That was because I thought that as the Operating System is structured like a stack of protocols and services, and has different levels or types of entities (kernel - drivers - servers - normal processes), so the main direct communications would be between processes of different level or type, and they would not be peers, instead ones would provide services (servers) for others (clients). Also, as the 'normal' processes would generally only request services through libc, they would not need any server functionality, so it would be a waste or resources to assign them potentially unused server infastructures. Also, I think that in point-to-point the system would need a greater total number of descriptors, so client-server might be more efficient.
So, any thoughts about this matter? Do you think that the client-server model is the most adequate for an Operating System's IPC mechanism? Any other model?