Monday, May 24, 2010

What is portmapper is in linux and why we need rpc to do nfs?

I know portmapping must be enabled to do NFS (network file sharing) and i know we need that because NFS works by using RPC (remote procedure calls). And i understand that ports are just that, software ports (similar to a comm port but in software). But I need a little more explanation from a linux professor...

What is portmapper is in linux and why we need rpc to do nfs?
The RPC portmapper program is usually started by default in /etc/init.d (it's location may vary by distro).





The portmapper converts RPC program numbers into TCP or UDP protocol port numbers.





When NFS is started, it registers with the portmap, telling it what ports it listens on, and on what ports it serves data. Requests coming in, or data going out are then translated to the appropriate protocol (UDP or TCP, though TCP is typical now for NFS).





For a list of registered ports, check out /etc/services. This list is not exhaustive, but handy.





Without the RPC portmapper, most programs couldn't talk to the internet, since few programs actually 'speak' TCP or UDP. (This wasn't always true). RPC is easier to program because it is higher level, and thus it is preferred by programmers who aren't conserved about transport-layer details.


No comments:

Post a Comment