Networking Exam 2 Review

Valid XHTML 1.0!

Networking Exam 2 Review

When would a server handle a request in the main process?

  • A server would handle a request in the main process loop when the request is a simple one. A simple request is defined as one that can be completed using less resources than it would take to start a slave process (a child or thread).
 

When would a server start a child/thread to handle a request?

  • A server would handle a request in the main process loop when the request is a complex one. A complex request is defined as one that requires more resources than it would take to start a slave process (a child or thread). This allows other requests to come in and be processed simultaneously.
 

Give a realistic example of a server that does not process any input from the client but performs a useful function.

  • A server for a particular service can execute on a timesharing system along with other programs, or it can execute on a personal computer. Multiple servers can offer the same service, and can execute on the same machine or on multiple machines. In fact, managers commonly replicate copies of a given server onto physically independant machines to increase reliablity or improve performance. If a computer's primary purpose is support of a particular server program, the term "server" may be applied to the computer as well as to the server program. Thus, one hears statements such as "machine A is our file server."
 

What are some of the advantages of using a server?

  • server »
    • A server applies to any program that offers a service that can be reached over a network. A server accepts a request over the network, performs its service, and requires returns the result to the requester.
    • Advantages:
      • can perform simple or complex tasks
      • are implemented as application programs
        • implementing servers as application programs is that they can execute on any computing system that supports TCP/IP communications
    • client »
      • A program becomes a client when it sends a request to a server and waits for a response.
 

Can a program be both a client and a server?

  • Yes, in the client/server programming model, a server is a program that awaits and fulfills requests from client programs in the same or other computers. A given application in a computer may function as a client with requests for services from other programs and also as a server of requests from other programs.
 

What is the required sequence of socket calls for a server?

What is the required sequence of socket calls for a client?

  • Sockets are a method for communication between a client program and a server program in a network. A socket is defined as "the endpoint in a connection." Sockets are created and used with a set of programming requests or "function calls" sometimes called the sockets application programming interface (API). The most common sockets API is the Berkeley Unix C interface for sockets. Sockets can also be used for communication between processes within the same computer.
  • A client is the requesting program or user in a client/server relationship. For example, the user of a Web browser is effectively making client requests for pages from servers all over the Web. The browser itself is a client in its relationship with the computer that is getting and returning the requested HTML file. The computer handling the request and sending back the HTML file is a server.
  • required sequence of socket calls for a server
    • server (trivial)
      • socket
      • bind
      • listen
      • accept
      • read, write
      • close
    • server (fork)
      • socket
      • bind
      • listen
      • accept
        • fork
        • read, write
        • close
        • exit
    • client
      • socket
      • connect
      • read, write
      • close
 

Why must a server bind to a well known port number but a client does not have to?

  • The server is in a constant port where a client must request a port dynamically for each connection.
  • Higher-level applications that use TCP/IP such as the Web protocol, Hypertext Transfer Protocol, have ports with preassigned numbers. These are known as "well-known ports" that have been assigned by the Internet Assigned Numbers Authority (IANA). Other application processes are given port numbers dynamically for each connection. When a service (server program) initially is started, it is said to bind to its designated port number. As any client program wants to use that server, it also must request to bind to the designated port number.
  • Port numbers are from 0 to 65536. Ports 0 to 1024 are reserved for use by certain privileged services. For the HTTP service, port 80 is defined as a default and it does not have to be specified in the Uniform Resource Locator (URL).
 

How can the client ensure that the server will see data in records of 80 bytes?

 

What is the difference between a name resolver and a name server?

  • name resolver »
    • The client software, called an name resolver, uses one or more name servers when translating a name.
  • name server »
    • The domain mechanism for mapping names to addresses consists of independent, cooperative systems called name servers. A name server is a server program that supplies name to address translation, mapping from domain names to IP address.
 

What are the steps required to translate a domain name to an IP address?

  • Name server receives request
  • If it has authority for subdomain,
    Returns address according to database
  • Else
    If client requested complete translation
    Contact another name server
    Else
    Return address of another name server

 

What are the two types of resolution that can be requested by a name resolver?

  • recursive resolution »
    • Asking name server for complete resolution
  • iterative resolution »
    • Contacting names servers one at a time
 

Why would a name resolution result in multiple IP addresses?

  • In the case of cs.purdue.edu, there are 3 labels. Any suffix of a label in a domain name is also called a domain. The lowest level domain is cs.purdue.edu; which is the domain name for the Computer Science Department at Purdue University. The second level domain is purdue.edu, which is the domain name for Purdue University. The top level domain is edu, which is the domain name for educational institutions which teach bachelors and masters level courses; not community college degrees.
 

What does DNS do to ensure that the connection requests are evenly distributed for multiple IP addresses?

  • uses Round Robin
    • When the first request arrives at the DNS server, it returns the IP address 203.34.23.3, the first machine. On the second request, it returns the second IP address: 203.34.23.4. And so on. On the fourth request, the first IP address is returned again. Using the above DNS round robin, all of the requests to the particular site have been evenly distributed among all of the machines in the cluster. Therefore, with the DNS round robin method of load balancing, all of the nodes in the cluster are exposed to the net.
 

Who determines how long a domain name should be cached?

  • authoritative source »
    • Whenever an authority responds to a request, it includes a TTL value in the response that specifies how long it guarantees the binding to remain. Thus, authorities can reduce network overhead by specifying long timesouts for entries that they expect to remain unchanged, while improving correctness by specifiying short timeouts for entries that they expect to change frequently.
 

What must a name resolver know to translate a name outside its own domain?

  • Cache file - Cache.dns - Used to resolve names outside the domains. Contains the addresses of root name servers; so the name resolver must have a cache of root name servers to fall back on.
 

What is a non-authoritative answer and what does a client does with it?

  • If the local server is not the authority, it checks its cache to see if the name has recently been translated for another user. If it has, the local server returns the translation as a non-authoritative answer along with the IP address of the authoritative server. The client can then choose to use the answer or revalidate it. If the name is not found in the cache, the server will contact other servers in the hierarchy to perform the translation. Since most name translations are for local hosts, the amount of network traffic is minimal.
 

Define a Network Virtual Terminal (NVT).

  • It is the way TELNET defines how data and command sequences are sent across the Internet.
  • Definition used by the TELNET protocol. An unenhanced NVT uses only seven bit ASCII and uses CR/LF for an end of line.
 

How are options negotiated in TELNET?

  • Either side (the host or the client) can initiate an option negotiation. One side sends the message "Will X?" which asks the question "will you let me use option X?". The other side responds with a "Do X" or "Don't X" message. If either side receives a request for something it doesn't understand it responds with a "Don't" message.
 

What performance problems are caused by TELNET and how are they addressed?

  • TELNET is inefficient because each keystroke travels from the user's jeyboard through the operating system to the client program, from the client program back through the operting system and accross the internet to the sever machine. After reaching the destination machine, the data must travel up through the server's operating system to the server application program, and from the server application program back into the server's operating system at a psuedo terminal entry point. Finally, the remote operating system delivers the character the charater to the appliction program the user is running. This process also needs a context switch every time keystrokes are made, eventhough this can be expensive, since humans are not fast typers this scheme is quite practical.
 

How does TELNET handle control functions (such as erase line, interrupt process)?

  • TELNET defines how data and command sequences are sent across the Internet. The definition is known as the network virtual terminal (NVT). The client software translates keystrokes and command sequences from the user's terminal into NVT format and sends them to the server. Server software translates incoming data and commands from NVT format into the format the remote system requires. For data returning, the remote server translates from the remote machine's format to NVT, and the local client translates from NVT to the lacal machines's format.
 

How does a TELNET server know where in the input stream an Interupt Process was pressed?

  • To pass control functions across the TCP connection, TELNET encodes them using an escape sequence. An escape sequence uses a reserved octet to indicate that a control code octet follows. In TELNET, the reserved octet that starts in escape sequence is known as the interpret as command (IAC) octet. So any of the TELNET signals on pg.491 generated by conceptual keys on an NVT keyboard each have a corresponding command.
 

How can new options be added to a TELNET server without having to change the client?

  • TELNET uses a symmetric option negotiation mechanism to allow clients and servers to reconfigure the parameters controlling their interaction. Because all TELNET software understands a basic NVT protocol, clients and servers can interoperate even if one understands options another does not. So the client and server must negotiate, and agree to make changes to either.
 

What are the advantages and disadvantages of Whole File Copying as compared to Online Shared Access?

  • Online Shared Access » allowing multiple progrmas to access a single file concurrently
    • Multiple programs access a single file concurrently
    • Usually many readers, zero or one writer
    • Usually many readers, zero or one writer
      • Advantages »
        • No changes to applications
        • Users have access to more data
      • Disadvantages »
        • Network delays
        • Application may not run w/o network
  • Whole File Copying » whenever a program wants to access a file, it obtains a local copy
    • Local copy is obtained
    • Usually read only
    • Changes must be copied back, reconciled
      • Advantages »
        • Less Network overhead
        • Applications can run without the Network; so locally
      • Disadvantages »
        • Can make changes
        • Users have less access to data
 

What are the connections used for a FTP session?

  • Control »
    • Control connection exists as long as session active
  • Data »
    • Data connection created for each transfer
 

What transport protocol does FTP use?

  • TCP, of the Transport Protocol.
 

What are the differences between FTP and TFTP?

  • FTP
    • Features »
      • Interactive Access
      • Format Specification
      • Authentication Control
  • TFTP » Trivial File Transfer Protocol is intended for application with simple needs where size may be important
    • Features »
      • Booting diskless workstations
      • Reliable local network
  • Difference »
    • FTP
      • Allows users to list names and copy files
      • Text / Binary Support
      • Uses control and data connections
    • TFTP
      • Trivial File Transfer Protocol
      • Simple but reliable
      • Uses UDP
      • Sorcerer's Apprentice Bug
 

What transport protocol does TFTP use?

  • UDP, of the Transport Protocol.
 

What rules does TFTP use to acheive reliability?

  • timeout.
  • retransmission
 

Explain what causes the Sorcerer's Appentice bug and how it is prevented.

  • Sorcerer's Apprentice Bug »
    • While symmetric retransmission guarantees robustness, it can lead to excessive transmissions. The Sorcerer's Apprentice bug arises when an acknowledgement for data packet k is delayed, but not lost. The sender retransmits the data packet, which the receiver acknowleges. Both acknowledgements eventually arrive, and end triggers a transmission of data packet k+1. The receiver will acknowlege both copies of data packet k+1, and the two acknowldgements will each cause the sender to transmit data packet k+2. The bug can also start if the underlying internet duplicates packets. Once started, the cycle continues indefinately with each data packet being transmitted exactly twice.
  • Prevention »
    • Nothing done to prevent it!
 

How/where does a function execute using RPC?

  • RPC Remote Procedure Call »
    • How? »
      • RPC is used for distributed applications
      • For a client side procedure, the programmer designates some procedures as remote and on the server side the programmer declares it part of the server. RPC automatically collects values for arguments, forms a message, sends the message to the remote server, awaits a response, and stores returned values in the designated arguments. In essense, communication with the remote server occurs automatically as a side-effect of a remote procedure call.
    • Where? »
      • Client side, Server side
      • though, RPC mechanisms hide all details of protocols
 

What makes the electronic mail protocols different from other protocols?

  • Most require source and target to be running
  • SMTP works when target is down or unreachable
  • Sender does not wait for message to be delivered
 

Describe the flow of a mail message from the sender to the receiver.

  • Mail systems use spooling (queueing)
  • Tries to deliver message in background
    • System stores message locally
    • Source server makes a connection to target server
    • Message kept at source until delivered
    • When successfully delivered, source deletes local copy
  • Returns undeliverable messages after period of time (3 days)
 

What is the difference between SMTP and POP?

  • SMTP Simple Mail Transport Protocol »
    • The TCP/IP standard protocol for transferring electronic mail messages from one machine to another. SMTP specifies how two mail systems interact and the format of control messages they exchnage to transfer mail
  • POP Post Office Protocol »
    • The protocol used to access and extract e-mail from a mail box.
  • Difference »
    • SMTP
      • Can only transfer 7-bit ASCII messages
      • Cannot transfer binary data such as pictures or sounds
      • Cannot transfer national language (diacritic) characters
    • POP
      • User logins to server
      • Retrieves and deletes messages from mailbox
      • Messages stored and transferred in 822 standard format
      • Requires two servers; SMTP and POP3
 

How are attachments or images included in a electronic mail message?

  • MIME Multipurpose Internet Mail Extensions
    • MIME does not change SMTP or POP3, nor does it replace them; MIME allows arbitrary data to be encoded in ASCII and then transmitted in a standard e-mail message i.e. image
    • this is accomplished through MIME such as content-type is an image and subtype is a gif
 

Describe the steps that a Web Browser takes when a user enters a URL.

  • Request/Response
    • Client parses hostname from URL
    • Looks up in DNS
    • Makes TCP connection to server
    • Sends request
    • Receives answer
    • Server closes connection to mark end of document
 

Describe the difference between a GET, HEAD, and POST request and when each is used.

  • Get (Page Request) »
    • The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity in the response and not the source text of the process, unless that text happens to be the output of the process.
    • a browser sends an HTTP GET command to request a Web page from a server
      • GET http://www.cs.purdue.edu/people/comer/ HTTP/1.1
  • Head (Header Request) »
    • The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information sent in response to a GET request. This method can be used for obtaining metainformation about the entity implied by the request without transferring the entity-body itself. This method is often used for testing hypertext links for validity, accessibility, and recent modification.
  • Post (Post request - form submittal) »
    • The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. POST is designed to allow a uniform method to cover the following functions:
      • Annotation of existing resources;
      • Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles;
      • Providing a block of data, such as the result of submitting a form, to a data-handling process;
      • Extending a database through an append operation.
 

Explain some of performance problems with HTTP 1.0 and how HTTP 1.1 addresses them.

  • Properties HTTP 1.0 »
    • One connection for each request
    • End of document indicated when connection is closed
    • Simple protocol
    • Web server is simple to write
  • Problems with HTTP 1.0 »
    • One TCP connection used for each document (or element)
    • Connection may be slow
    • Slow-start, short-lived
  • HTTP addresses them »
    • Persistent connections by default
      • Connection to server stays open
    • Also allows pipelining
      • Multiple simultaneous requests (images)
    • Each response is preceded by a length
 

How does HTTP 1.0 tell a client that the end of the document has been reached?

  • End of document indicated when connection is closed
 

How does HTTP 1.1 tell a client that the end of the document has been reached?

  • The connection stays open by default, but the connection closes from a message from the server: Connection: close.
 

How does HTTP 1.1 handle the case when the server does not know the length of the document?

  • If the server does not know the length, then the connection closes. The server tells the browser to expect a close, to do so the server includes a Connection hader before the item in place of a Content-Length header: Connection: close. Afterwards that, the browser knows the connection will close, so it is prohibited from sending further requests.

Next »




Updated: March 3, 2004; Joe Gakenheimer