(Module 10: Midterm review and exam)
Version 6.21
Exam date: Friday, October 28, 2:00–3:15 p.m. (or as arranged for online section).
The exam will be given on paper and answered using a pencil or pen. There will be a mixture of question types, possibly including multiple choice, true/false, short answer, essay, and coding.
The exam will be given in two parts: Part I, Concepts and Terms, Closed Book and Notes; Part II, Coding, Open Book and Notes. Students may take either part first, but must complete that part before beginning the other part.
The exam will cover modules 2–7:
Terms: protocol, IP, packet, TCP, UDP, connection, host, node, IP address or IP number, DNS, port, process, well-known ports, client/server model, server process, client process, socket, datagram, datagram socket, stream socket, stream, server socket, telnet, netcat (nc), URI, URL, RFC.
Know the names and descriptions of the four layers of the Internet architecture. Be able to say in which layers the following protocols operate: IP, TCP, UDP, SMTP, HTTP, telnet.
Distinction between connection-oriented and connectionless networking.
Distinction between TCP and UDP. Why use one or the other?
Discuss the reliability or unreliability of TCP and UDP.
Distinction between blocking (synchronous) and non-blocking (asynchronous) communication.
Python: how to create a socket and bind to an address and port, listen for and accept connections.
Python: how to connect as client to a given server and port, using a stream socket, and to send and/or receive a message through the socket (see sample questions).
??? Three paradigms of computing: client/server, peer-to-peer, and message-passing. Design of distributed systems: advantages and disadvantages of client/server versus peer to peer, design of a simple message-passing protocol.
Kinds of protocol: text-based, binary, request-response.
Terms: string, Unicode, bytes object type in Python, network byte order, pickle, JSON, exceptions.
How to handle exceptions (try / catch statement in Python).
Terms: TLS/SSL, public key encryption, certificate.
Explain how TLS protects against spoofing (impersonating a host) and sniffing (listening to network data).
Terms: process, thread, fork, parent/child, deadlock, race condition, thread-safe, lock, zombie process.
The role of the Python class Thread (from the threading module).
Writing Python statements to create and run a thread which performs a simple task (see sample questions).
Distinguish between iterative and concurrent servers.
Why a server might create and run threads.
(Concurrent servers based on asynchronous I/O will not be covered.)
Know what DNS is, why we have it, and the general concept of how it works.
Be able to explain forward and reverse DNS lookup.
Protocol for a Driver License System
Design a message-passing protocol for the Bureau of Motor Vehicles driver license system. The application will use a central server which maintains license data. Clients will be located at the Bureau's 200 branch offices throughout the state. Clients and server will communicate via connection-oriented, stream sockets over TCP.
The protocol should enable branches to issue new driver licenses and to renew old driver licenses. For a new license, the branch office will collect the following information from the driver and send it to the central system: name (first, last), address (street, city), date of birth. The central system will then create a new license number, and the branch office will issue the license with that number to the driver. For a renewal, the branch office will normally send only the license number to the server, but may also send any of the data required for a new license, to make corrections or updates. The expiration date for a new or renewed license is four years from the date issued or renewed. The server will compute the expiration date.
In your answer, specify the syntax and semantics of each message clearly and precisely. Formally specify the messages; don't just give examples. But do show at least one example scenario (i.e., a "dialog" between server and client).
Note that you are not to write a program, just design and specify the protocol.
string and bytes objects.Explain the role of the pickle module.