CS422 CLASS NOTES

10/23

Two types of Network

Connectionless Networks (CL)
  1. No setup is required before transmitting data
  2. Each packet is handled independently
  3. No clean up is necessary after sending data
  4. Think of 'postcard'
Connection Oriented (CO)
  1. It leaves the connection open while sending data
  2. It terninates connection when there is no more data to transmit
  3. Think of 'telephone calls'
CO vs CL
  1. CO has a setup overhead
  2. CO is reliable
  3. CO can reserve bandwidth in some networks (phone line, ATM)
  4. Example for CO: TCP, Telephone system, ATM
  5. CL has less overhead
  6. In CL, application has more control in message retransmission error handling, etc...
  7. CL allows broadcasts and multicasts
  8. Example for CL: UDP, IP
When to use TCP or UDP
  1. TCP: used in applications that need high (complete) reliability: e-mail, file transfer, ...
  2. UDP: (1). used in applications that do not need a high degree of reliability but require high response: voice over internet; (2). used in applications that want to have more control in the delivery of messages. This application has to implement reliability on top of UDP (Danger of using UDP: application may try to "invent" TCP); (3). used in application that need broadcast or multicast.
Take-home message:
when in doubt, use TCP instead of UDP except for broadcast and multicast.

Network Performance Measurement

10/25

Delay Throughput Product

        Net                bits in transit
0 1 0 1 ........................ 1 0


Delay = 0.5 secs    Throughput = 128 Kbps
# bits in transit = 0.5 X 128 = 64 Kbits

Protocols

Internetworking Router

A device used in the internet to connect heterogeneous networks. It is also called
- internet router
- internet gateway

- the router eill have one interface per network
A router can connect networks that have different

The internet is a collection of Goal of Internet 10/27

Debuging a Server

cgi-bin

If a request has the form: GET /cgi-bin/<prog>?a=b&c=d
then:
        processHTTPRequest(ss)    /* in a child process */
        {
            .
            .
            .
            if /cgi-bin as prefix in a request
                get <prog>
                get <query>    /* query is a=b&c=d in this case */
                set env vars
                // buid the string using malloc and sprintf()
                s1 = QUERY_STRING = <query>
                s2 = REQUEST_METHOD = GET
                putenv(s1);
                putenv(s2);    /* set up env vars */
            .
            .
            .
        }

Write header just before content-type
Redirect stdout to slave socket ss
Execvp for http-root-dir/cgi-bin/<prog>