next up previous
Next: 9 Extra Credit Up: CS-441 Project 1: Simplified Previous: 7 Getting Help


8 Suggestions

Start early.
Although this is generally a good idea, it is particularly important for this project. This is the first time we are trying an IRC server as a project, so there may be kinks that we have not yet worked out. Getting started early will allow some time to deal with this. This will make life easier both for you, and your teaching staff.
Be secure.
By default, a listening socket will accept packets from any IP address. This means that any host on the Internet will be able to connect to your server. If your server has bugs, they might be exploited to compromise your account. To reduce this possibility, you can bind your socket to the loopback address, rather than the wildcard address. This will cause the network stack to reject connections unless the destination address on the connection request is the loopback address. To do so, the address field of the sockaddr struct that you pass to bind should be set to the loopback address.

For an example, see this code.

You can check that your program is only listening on the loopback address using netstat. Assuming that your program is listening on port 9000, the output of netstat -tnl | grep 9000 should be:

tcp  0  0 127.0.0.1:9000  0.0.0.0:*   LISTEN

If your program is listening on the wildcard address, you will instead see:

tcp  0  0 0.0.0.0:9000    0.0.0.0:*   LISTEN


next up previous
Next: 9 Extra Credit Up: CS-441 Project 1: Simplified Previous: 7 Getting Help
mukesh agrawal 2003-01-28