Here is a link to a project with a simple firewall for you to look at to start with. An Easy Firewall Application I would recommend you do something simpler like a socket server to start off with so you understand the basic concepts of socket programming. Staring with the links below.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)