Operating System/O.S(Neso Academy, HPC Lab. KOREATECH)

8) Sockets , Remote Procedure Call(RPC)

Tony Lim 2021. 5. 6. 15:29
728x90

Sockets

Socket = end point of communication link for each process  == IP Address + Port number

Servers implementing specific services listen to well known ports ( telnet=23 , ftp=21 , web,http=80)

ports below 1024 is well known and reserved for specific services.

 

Remote Procedure Call(RPC)

RPC is a protocol that one program can use to request a service from a program located in another computer.

it use message based communciation scheme.

now messages are more than just packet of data , it is well structured. 

at server port there is RPC daemon running and tries to catch request from client.
client sends a request with a parameter to specific RPC daemon.
then with that parameter specific function(servcie) is executed.

each client and server has "stub" whichi is interface that allows process to ignore network specific stuff.

before client sends a request to server with parameter. stub marshal paramter so it can be send in network.

after server side stub receive request with parameter , stub acts like controller and pass it to specific function(service) and return the result in same method as client send request.

 

Issue in RPC

issue = Representation of 32-bit integers == big endian and small endian issue

resolve = machine independent representation == external data representation(XDR) , works like a interface and converts to XDR representation. 


issue = RPC can fail or be duplicated and execute it more than once , as a result of common network errors.

resolve = OS must ensure that message are acted on exactly one rather than at most once. once server fullfill request it needs to send acknowledgement to client , to let client know its request is fulfilled and doesn't send request anymore.


issue = (base case) what if client and server doesn't know each other's port number.

resolve 

1. fixed port address == predetermined information 

2. Rendezvous mechanism == OS providdes rendezvous daemon on a fixed RPC port and this works like match maker and returns specific(what cilent requested) port number.


notice kernel take care of RPC protocol at client side.

 

 

 

 

728x90