Download presentation
Presentation is loading. Please wait.
1
Programming Assignment #1
Simulate a DNS server using TCP By utilizing Sockets! Due Date: Sunday October 15, 11:55 p.m. through Moodle website Find project description and files you will need at Programming Projects Hello everyone. Now I’m gonna introduce something about socket programming. First we will try to get a general idea about what socket is. Then we will introduce socket programming with Java and socket programming with Python. The corresponding reading material is the Section 2.7 in Chapter 2, and the project 1 description. Readings: Chapter 2: Sections 2.7 Project I Description CSci4211: Programming Assignment #1
2
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
3
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 (here we use the local machine DNS lookup) One server can handle multiple clients. Refer to the “Concurrent Server” in the slides “Socket Programming”. CSci4211: Programming Assignment #1
4
How does DNS server work?
Initially, the DNS data should be empty. If client’s query is not in the DNS server… Look it up in root DNS Send the result back client. Add an entry in DNS_mapping.txt file (cache data). If client’s query is already in the cache… Just return it! CSci4211: Programming Assignment #1
5
Things you may need to work on…
Socket Programming File Operation String Operation CSci4211: Programming Assignment #1
6
CSci4211: Programming Assignment #1
Scenario 1 1 2 4 3 2, 3 Step 1: Client Contact’s the local DNS server. Step 2: As the local DNS data is empty, contact the root server for the web page. (Here we use local machine DNS lookup) Step 3: Root server to return the html page. Cache this on your local server. (Here we get the result of local machine DNS lookup) Step 4: Return the query result to the client. CSci4211: Programming Assignment #1
7
CSci4211: Programming Assignment #1
Scenario 2 1 2 Step 1: Client Contact’s the local server. Step 2: The requested host IP resolution is cached on the local server, just return it to the client! CSci4211: Programming Assignment #1
8
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. Pease add suitable comments, makes life more easy for all of us! CSci4211: Programming Assignment #1
9
CSci4211: Programming Assignment #1
Q&A CSci4211: Programming Assignment #1
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.