How to create a RPC packet

I am learning Windows Networking , lower level , and I am interested in learning about how to make and send a simple RPC packet. RPC are a very important part of any OS considering they are one of the most major effected Networking parts in OS due to make RPC vulnerability in XP & 2003.

I am not going to make any such exploit but want to learn how it works. The other reason I want to learn this is that , when I made my OS , I wanted to implement a RPC system but sadly I did not have enough experience at that time.

RPC (Remote Procedure Call ) is also very important for me since I am really interest in Security field in Computers.