CPSC 441, Fall 2018
Information About the First Test

The first test will take place in class on Wednesday, October 3. It will cover course material through Friday, September 28. From the textbook, this includes: Chapter 1, Sections 1.1, 1.2, 1.3, 1.5, and some general ideas from 1.4; Chapter 2, especially Sections 2.1, 2.2, 2.3 2.4, and basic ideas from 2.5; and Chapter 3, Sections 3.1, 3.2, 3.3 and basic ideas from 3.4. You are also responsible for Labs 1 through 4, and for aspects of Java socket programming that were covered in lecture; the Java thread API will not be on the test.

The test will include: some shorter essay-type questions such as definitions; longer, more conceptual essay questions about general network principles; questions about network tools and configuration; and questions about socket programming and the Java Socket API. You might be asked to write some basic Java code with sockets, such as code to contact a server and exchange some data. You might be given some Java code and asked to explain it. The test will be four pages long, with room for answers.

Here are some of the terms and ideas that you should know for the test:



the Internet: a global packet-switched network of networks using the IP protocol

packet-switching and packet-switched networks
comparison with circuit-switched networks
routers (packet-switches between networks)
hosts (computers on the network edge)
protocol
layered protocols and why layered protocols are used
encapsulation in protocol layers
headers added and used by the different layers
IP addresses
port numbers

throughput and latency
sources of delay:
    processing delay
    queueing delay
    transmission delay
    propagation delay
how queuing is used at routers and how it can lead to dropped packets

The five layer Internet protocol stack:
     Application layer (messages)
     Transport layer (segments)
     Network layer (datagrams)
     Link layer (frames)
     Physical layer (bits)
     
Responsibilities of layers in the Internet protocol stack
     Transport layer:  process-to-process delivery of application-layer messages
     Network layer:  host-to-host delivery of transport layer packets,
                                         across multiple networks and routers
     Link layer:  host-to-host delivery within a single local network
     Physical layer:  transmission of bits between directly connected devices
     
application layer:
    uses transport layer services for process-to-process delivery
    implements its own architectures, protocols, and policies
    uses a client/server model on the Internet
    server "listens" for communications from client at a known IP address and port
    client sends a connection request to the server
   
HTTP:  HyperText Transfer Protocol
    used for communication between web servers and web clients (browsers)
    standard port number is 80
    a request/response protocol
    stateless (no state information is automatically preserved between requests)
    request format: request line, headers, blank line, and (for POST command) data
    request line example:  GET /index.html HTTP/1.1
    some request headers:  Host:, Connection:, If-Modified-Since:, Cookie:
    response format: status line, headers, blank line, data
    status line example:  HTTP/1.1 200 OK
    status codes such as 200 OK, 404 Not Found
    some response headers:  Content-Type:, Content-Length:, Connection:, Set-Cookie:
    MIME types and why they are used in HTTP
    persistent connections (Connection: keep-alive vs. Connection: close)
    Web caching and web proxies

SMTP: Simple Mail Transfer Protocol
    Mail agents and mail servers
    SMTP used to send mail from mail agent to server and from server to server
    other protocols (IMAP, POP, webmail) are used to retrieve mail from server
    traditionally used a plain text conversation on port 25
    message headers From:, To:, and Subject: -- part of the mail message
    SMTP commands MAIL FROM:, RCPT TO: -- part of the "envelope", not the message
    MIME was introduced to enable binary mail attachments, non-ASCII characters, etc.
    DNS MX records are used to find the mail server for a email addressm

DNS: Domain Name System
    global, hierarchical, distributed database
    record types include:  A, NS, MX
    root DNS servers
    TLD (top-level domain) and TLD servers
    authoritative name server for a domain
    local DNS servers
    DSN queries and answers
    how a DNS server looks up an IP address
    caching in DNS and the time-to-live field in DNS database records
    
Peer-to-peer applications
    why they probably still need a server
    why they can be faster and more efficient than pure client/server applications
    
multiplexing and demultiplexing in the transport layer
TCP (Transmission Control Protocol): connection-oriented, reliable, two-way
           communication, with congestion control
TCP requires connection setup and connection state for each connection 
UDP (User Datagram Protocol): simple, unreliable process-to-processes delivery
UDP checksums and error detection
the UDP header:  source and destination port numbers, length, checksum
UDP does not do congestion control

basic ideas for reliable communication:
    ACK and NAK
    timeouts and retransmission (to account for packet loss)
    sequence numbers (to account for duplicate and out-of-order packets)
    pipelining (to allow multiple packets to be transmitted but not ACKed)
    
Wireshark packet sniffer
how Wireshark lets you observe network traffic and packet contents
basic network tools: ping, traceroute, nslookup, ifconfig, telnet, netstat

socket programming in Java
programming basic TCP clients and servers
class ServerSocket:
   constructor:  serverSocket = new ServerSocket(port)
   major method: clientSocket = serverSocket.accept()
class Socket:
   constructor for client side:  socket = new Socket(host,port)
   on sever side, returned by serverSocket.accept();
   major methods:  socket.getInputStream(), socket.getOutputStream(), socket.close()
using socket streams to send and receive messages
blocking in serverSocket.accept(), new Socket(), and read operations on Sockets
running a server in an infinite loop to handle a sequence of client connections

basic ideas of threads and parallel processing
why servers are multithreaded
thread pools