prog4 - CSS 432 Program 4 Domain Name Service Professor...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSS 432 Program 4: Domain Name Service Professor: Munehiro Fukuda Due date: See the syllabus 1. Purpose This assignment is to design and code a spoof-checking program that enables a server to check the integrity of a client connection. Through this assignment, you are going to learn how to use DNS-related and address- conversion functions such as getpeername , gethostbyaddr , inet_ntoa , ntohs , and inet_addr . 2. Algorithm DNS is useful not only for resolving the IP address of a server you would like to connect to but also for verifying the integrity of a client that has contacted to your server. Since the client information within an IP packet includes only its source address and port number, it is impossible to find who actually sent this packet. A malicious client can even change its IP address and pretend to be someone else. A solution to block out such a spoofing client is to refer its IP address to a DNS server that retrieves this client's official host name, aliases, and registered IP addresses. Based on this concept, our spoofcheck.cpp program should behave as follows: 1. Use main( )'s argv[1] argument as an IP port to which spoofcheck.cpp should bind itself. 2. Instantiate a TCP socket. 3. Go into an infinite while( ) loop where: 1. Accept a new connection from a client through accept( ) . 2. Fork a child process. The parent closes this connection and goes back to the top of the while( ) loop, whereas the child continues checking the integrity of this connection. 3. Retrieve the client's IP address and port of this connection through getpeername( ) . 4. Retrieve the client's hostent data structure through gethostbyaddr( ) . 5. Retrieve the client's official name, aliases, and registered IP addresses from the hostent . 6. Decide whether this client is a honest or a spoofing client by matching its IP address retrieved from getpeername( ) and those retrieved from gethostbyaddr( ) . (In other words, if you confirm that the client's IP address of this connection matches one of the addresses listed in hostent , you can trust this client.) 7. Terminate this child process. The following shows an example where
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 12/20/2009.

Page1 / 4

prog4 - CSS 432 Program 4 Domain Name Service Professor...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online