Unit Two Objectives, CSCI 561 Computer Networks I Tobin Maginnis Updated: 04-Oct-07 UNIX Network Programming - 3rd edition - W. R. Stevens, et. al. Chapter 3 - Sockets Introduction Omit)Describe the general contents of a socket structure and explain why it is difficult to create a true "generic" socket. (hint: multiple versions of Unix, two standards organizations, and four IP protocol address formats) 2)Contrast the following socket structures IPv4, IPv6, Unix, Datalink, & Storage. 3)Describe a "value-result" argument and explain why the concept of a kernel can be fuzzy. 4)Contrast little versus big "endian," why it exists, and at what network levels it resides. Omit)Describe the three aspects of address conversion functions and give three reasons why Stevens will only use the pton and ntop functions. 6)Explain the role of Stevens' sock_xxxx library and be able to commet the /lib/sock_ntop.c file. 7)Be able to comment the readn(), writen(), or readline() functions. 8)Contrast file (disk) versus socket I/O and explain how to deal with it. 9)Explain how Stevens was able to reduce read run time from 8.8 to 0.3 seconds and the general rule-of-thumb. UNIX Network Programming - 3rd edition - W. R. Stevens, et. al. Chapter 4 - Elementary TCP Sockets 1)Define and give the order of socket services for the client & server. 2)Describe the three basic error possibilities for the connect() service. And explain the thinking regarding ENETUNREACH versus EHOSTUNREACH. 3)Explain the three reasons a server would send reset (RST) and the reason the TCP transport station does not send a RST when it queues are full. See p. 100 and 107. 4)Describe the role of the bind function and its default action for ports versus IP addresses, and how to confirm the operation. 5)Explain the TCP/IP stack interprets client/server connections when source addresses are NOT specified. 6)Explain how, in one sense, the role of the listen function is silly, yet in another sense, it plays a key role in connection establishment. 7)Describe the accept function arguments and its key role. 8)Explain how the close function is typically automatic, but when programming concurrent servers, close must be used carefully. 9)Give the five scenarios for using getsockname and getpeername functions. Chapter Five - Client-Server Example (Boundary Conditions) Omit)Explain how to test (execute) the client-server example on one host and list the three steps to achieve a state of equilibrium. 2)List the six basic steps of "closure" for the client-server. See 1st six on p. 128 3)Contrast "slow" versus "fast" system calls and "manual" versus "automatic" restart of system calls (see p. 134). 4)Explain the oxymoron of a signal handler that must execute "wait()" and list the four steps in processing SIGCHLD (see pp. 132-134). 5)Explain the "nondeterministic" nature of signals and explain how to overcome this UNIX design flaw (see p. 135-139). 6)Explain the role of "EINTR" in server code design (see p. 134 & 139). 7)Explain how the terminated server impacts the client return codes and Stevens suggest remedy. 8)Explain the role of the SIGPIPE signal in TCP connections; explain its "silent" nature, and explain how to make it visible. 9)Contrast what the client sees in a server crash, server host crash, and server host reboot. 10)Describe the three basic problems with sending data among hosts and the two solutions. p. 150 Boundary Zone Lecture 1)Explain the nature of the "boundary zone" and explain the role of the following programs: DD, ifconfig, route, netstat, arp, & iptables. Boundary zone - allows synchronization between user initiated network requests and incoming network packets. Contains a linked list or array of IP packets which have yet to be processed. Also has the following data structures: Routing Table - associates an IP address with an interface plus node status ARP Table - associates an IP address with an Ethernet station address Firewall In & Out Tables - Accepts or denys IP addresses to/from interface Masquerade - Maps ephemeral ports above 32,000 for hidden TCP & UDP hosts Device Driver - Delivers IP packets into the boundary zone from an interface and accepts packets from the boundary zone for the interface. Ifconfig - Enables a DD, associates an interface, establishes route metric Route - Fills in the routing table with IP address and interface pairs. RIP - Net-based packet which adds entries to the routing table. Netstat - Shows the contents of routing table and socket states. ARP - Shows/sets current list of physical and IP address pairs. Iptables - Shows/sets firewall and masquerade tables. Chapter Six - I/O Multiplexing: The select() and poll() Functions 1)Stevens I/O Multiplexing is really asynchronous (non-blocking) slow I/O (also called real-time I/O). Contrast slow versus fast I/O and synchronous (blocking) versus asynchronous (non-blocking) I/0. a)Slow I/O occurs when the user is unknowly blocked in the kernel as the device driver waits for I/O completion. b)Fast I/O occurs when the user's service request can be performed in the kernel without I/O such setting a flag, returning a cache hit, or activating a logical driver like /proc/cpuinfo. c)Synchronous I/O is point "a." Asynchronous I/O appears similar to synchronous except that the OS returns to the user while the device driver is waiting for I/O. But when the user wants data, it must also check with the OS to see if I/O has completed. 2)Describe the role of the select() function and describe in detail its arguments. Omit)Given the amount of debugging time that the select call introduces, support or refute the need for requiring the programmer to count "fd"s and adding 1 to create maxfdp1. 4)Explain what is meant by a socket's "low water mark," and explain how and why it might be manipulated. 5)Contrast the close() and shutdown() functions and explain how shutdown() is used. 6)Describe the additional complexity of designing a multi-client server as a single process (iterative) server and a possible pitfall. Omit - Chapter Eight - Elementary UDP Sockets 1)Describe the eight "service steps" (using five services) of the UDP client and server. 2)Explain the relationship between UDP packet length and program design. 3)Explain how UDP servers typically differ from TCP servers, yet they both are able to process outstanding network-based requests. and server. 4)Explain what the connect function does for a UDP socket and describe the three ways a connected UDP socket is different from an unconnected socket. 5)Describe two examples of why a programmer would perform multiple connects on a UDP socket. 6)Explain why, in spite of the programmer's efforts, error reporting in UDP is "up for grabs," and support or refute the notion that UDP is "broken." 7)Explain what is meant by lack of flow control in UDP and describe the example that Stevens provides. Why is it "non-deterministic" and why extra buffers will not help. 8)Explain the odd thing about the clients IP address and how this may impact the UDP programmer.