70 likes | 188 Views
Programming Assignment #1. Simulate a DNS server using TCP By utilizing Sockets!. Readings: Chapter 2: Sections 2.7 Project I Description. What should we do?. Implement a typical Client/Server model. Client gets input from user, and sends it to server.
E N D
Programming Assignment #1 • Simulate a DNS server using TCP • By utilizing Sockets! Readings: Chapter 2: Sections 2.7 Project I Description CSci4211: Programming Assignment #1
What should we do? • Implement a typical Client/Server model. • Client gets input from user, and sends it to server. • The source codes of clients have been provided. • Server gets input from clients, and send DNS results back to clients. • This is what you need to code! • They communicate through sockets. CSci4211: Programming Assignment #1
How do servers work? • Get DNS queries from clients. • Check if the query has been locally cached. • If so, fetch the IP address from cache. • Otherwise, go to the root DNS server to look up. (RootServer.class) • One server can handle multiple clients. • Refer to the “Concurrent Server” in the slides “Socket Programming”. CSci4211: Programming Assignment #1
How does cache work? • Initially, the cache should be empty. • If client’s query is not in the cache… • Look it up in root DNS • Send the result back client. • Add an entry in cache. • If client’s query is already in the cache… • Just return it! CSci4211: Programming Assignment #1
Things you may need to work on… • Socket Programming • File Operation • String Operation CSci4211: Programming Assignment #1
Things you may need to notice… • Python 2 vs Python 3 • Details about the cache. • Please read the project description carefully. • Start early! • Let me know if you have any questions anytime. • Make your code east to read. • I always get mad when facing something in a mess! CSci4211: Programming Assignment #1
Q&A CSci4211: Programming Assignment #1