Sunday, May 6, 2012

DVHint

Code for node1.cpp


#include "stdafx.h"
#include "DV.h"


extern int TRACE;
extern int YES;
extern int NO;

int connectcosts1[4] = { 0,  1,  3, 7};

static distance_table dt;


/* students to write the following two routines, and maybe some others */

void rtinit1()
{
   struct rtpkt  rtpacket;
   // for all destinations y in N:
    for(int j=0;j<4;j++)
  for(int k=0;k<4;k++) dt.costs[j][k] = 999;
   dt.costs[0][0] = connectcosts1[0];
   dt.costs[0][1] = connectcosts1[1];
   dt.costs[0][2] = connectcosts1[2];
   dt.costs[0][3] = connectcosts1[3];

 

   // for each neighbor  source is "me" must change in other files.
   rtpacket.sourceid = 1;
   rtpacket.mincost[0] = dt.costs[rtpacket.sourceid][0];
   rtpacket.mincost[1] = dt.costs[rtpacket.sourceid][1];
   rtpacket.mincost[2] = dt.costs[rtpacket.sourceid][2];
   rtpacket.mincost[3] = dt.costs[rtpacket.sourceid][3];

   for(int i = 0;i<4;i++)
  if ((i!=rtpacket.sourceid)&&(dt.costs[rtpacket.sourceid][i]!=999))
  {
          rtpacket.destid = i;
 tolayer2(rtpacket);
  }
}


void rtupdate1(struct rtpkt *rcvdpkt)
{
   struct rtpkt  rtpacket;
   // the node sending me information is "from" or v in the text on page 383
   int v = rcvdpkt->sourceid;
 

   // x is "me"  the node that i am at.  must change in other files.
   int x = 1;

   //
   bool DV_Changed = false;

   // update the location in my cost table
   dt.costs[v][0] = rcvdpkt->mincost[0];
   dt.costs[v][1] = rcvdpkt->mincost[1];
   dt.costs[v][2] = rcvdpkt->mincost[2];
   dt.costs[v][3] = rcvdpkt->mincost[3];
 
   // The node that sent me information is v;
   // page 383

   // dt.costs os c on page 383 in the text
   int c_v_x = dt.costs[x][v];  // this is part of line 14
   for (int y = 0;y<4;y++)
   {  
  if (y != x)
  {
  int D_x_y = dt.costs[x][y];
           int D_v_y = dt.costs[v][y];
  int new_D_x_y = c_v_x + D_v_y;
  if (new_D_x_y < D_x_y)
  {
  dt.costs[x][y] = new_D_x_y;
               DV_Changed = true;
  }
  }
   }
   if (DV_Changed)
   {
  // tell my neighbors
  rtpacket.sourceid = x;
  rtpacket.mincost[0] = dt.costs[rtpacket.sourceid][0];
  rtpacket.mincost[1] = dt.costs[rtpacket.sourceid][1];
  rtpacket.mincost[2] = dt.costs[rtpacket.sourceid][2];
  rtpacket.mincost[3] = dt.costs[rtpacket.sourceid][3];

  for(int i = 0;i<4;i++)
if ((i!=rtpacket.sourceid)&&(dt.costs[rtpacket.sourceid][i]!=999))
{
rtpacket.destid = i;
tolayer2(rtpacket);
}
   }
}


void printdt1(struct distance_table *dtptr)
 
{
  printf("                via     \n");
  printf("   D0 |    1     2    3 \n");
  printf("  ----|-----------------\n");
  printf("     1|  %3d   %3d   %3d\n",dtptr->costs[1][1],
dtptr->costs[1][2],dtptr->costs[1][3]);
  printf("dest 2|  %3d   %3d   %3d\n",dtptr->costs[2][1],
dtptr->costs[2][2],dtptr->costs[2][3]);
  printf("     3|  %3d   %3d   %3d\n",dtptr->costs[3][1],
dtptr->costs[3][2],dtptr->costs[3][3]);
}

Tuesday, April 24, 2012

Wireshark Lab 7: DHCP

1. DHCP messages are sent over UDP.

3. 58:6d:8f:0f:dd:9f

4. The identification value seems to be the only thing that differentiates the messages.

5. The transaction ID value of the first set is: 0x868096c4
The transaction ID value of the second set is: 0x44575b0c
The purpose of the transaction ID seems to be a way for the messages to stay grouped together.

6. The value used until an IP address is assigned appears to be 0.0.0.0.
Discover:   Source: 0.0.0.0     Destination: 255.255.255.255
Offer:        Source: 10.33.37.126   Destination: 10.33.37.45
Request:    Source: 0.0.0.0     Destination: 255.255.255.255
ACK:        Source: 10.33.37.126   Destination: 10.33.37.45

7. 10.40.4.45

8. 10.33.37.45.  The DHCP offer message contains it.

9. The fact that the relay agent's address in the screenshot is 0.0.0.0 indicates that there isn't one. My experiment does contain a relay agent. The address of it is: 10.33.37.126.

10. The subnet mask and router lines in the frame are necessary to correctly route the data to my computer.

11. The same thing happens. The IP address is requested.

12. The "lease time" refers to how long you can use that particular IP address. The lease time on my current IP address is one day.

13. The release packet signifies that the host wants to stop using that particular IP address. There is no acknowledgement for a release packet. If the packet wasn't received, you would just continue using your existing IP address.

14. There was a large amount of ARP packets present.

Wireshark Lab 6: Ethernet and ARP

(Like the last few assignments, I've completed this one using the capture file provided by the book's authors)

1.  00:d0:59:a9:3d:68

2. 00:06:25:da:af:73.

3-5. I can't seem to find the information required to answer these questions.

6. 00:06:25:da:af:73.

7. 00:d0:59:a9:3d:68. I can't tell if it's my computer's ethernet address as I'm using the premade capture file.

8-10. Like above; I cannot seem to find the info required to answer these questions.

11. Screenshot of ARP cache: http://img801.imageshack.us/img801/1988/arpcache.png

12. Source: 00:d0:59:a9:3d:68     Destination: ff:ff:ff:ff:ff:ff

14.
c. Yes, the IP address is present in the ARP message.

16: Source: 00:06:25:da:af:73         Destination: 00:d0:59:a9:3d:68


Monday, April 23, 2012

Wireshark Lab 5: ICMP

(The ping command doesn't seem to be working. Every site I try to ping just returns "Request Timed Out". Here's a screenshot of a ping on Google timing out:
http://img706.imageshack.us/img706/7663/googletimeout.png )


1. Host IP: 149.152.37.45
Destination IP: 143.89.14.34

2. IMCP is a session-less protocol, therefore it doesn't use ports.

3. The ping request packet has "type: 8" and "code: 0". The other fields are: checksum(be), checksum(le), sequence number(le) and sequence number(be).

4. I can't answer this question since I wasn't able to get a response from any of the hosts I pinged.

(These questions were answered with the capture file provided by the book's authors.)

5. Host IP: 192.168.1.101
Destination IP: 138.96.146.2

6. Yes, it would.

7. No. They're the same.

8. The extra fields in the error packets seem to be extra copies of the IPv4 header.

9. They contain less information, and have different Time To Live values and identification values. They're different because the ICMP packets were actually received, and didn't get an error.

10. I can't answer this question, as tracert also causes a time out when I try to use it, like ping.

Wireshark Lab 4: IP

(NOTE: I'm using the capture file provided by the book's authors because the traceroute program wasn't working as it should)

1. 192.168.1.102

2. ICMP (1)

3.  There are 20 bytes in the IP header. There should be 36 bytes in the payload, since the packet size was 56 bytes and the header size is 20 bytes.

4. They do appear to be fragmented, as there are many IPv4 packet fragments in the capture window.

5. The TTL (Time To Live) is different in each one. The identification field also changes.

6. The host, destination, header size and fragment offset fields all stay the same.

7. The identification field changes by one for each new packet.

8. The TTL is 254, and the identification field is 0.

9. Yes, the values stay constant for all the TTL exceeded replies from that particular router.

10. Yes, it has been fragmented across more than one IP datagram.

11. I know this packet is fragmented because there is a field that says "Reassembled IPv4 in frame 100", which implies that it is a fragment. This datagram fragment is 1480 bytes.

12. There doesn't seem to be anything in the header that indicates that it is not the first fragment. There are more fragments, I can tell by looking in the capture window.

13. Identification and Time To Live are the fields that get changed between fragments.

14. Two fragments were created from the original datagram.

15. The Time To Live, header checksum and fragment offset fields all change between the fragments.

Monday, March 12, 2012

Wireshark Lab 3: DNS

Part 1: nslookup

1.  nslookup 2chan.net
Server: ecsu-sv26.easternct.edu
Address: 10.40.4.44

2. nslookup -type=ns ox.ac.uk
Authoritive:
ns2.ja.net     193.63.105.17

3. This particular question caused a time out each time.

Part 3: Tracing DNS with Wireshark

4. They are both sent over UDP.

5. The destination port for the query is 53. The source port is also 53.

6. The DNS request is sent to 10.40.4.44. This is the same as my local DNS server.

7. It is a "standard query". There is no "answer" in the request.

8. There is one answer. It contains the site's hostname, IP address, time to live, and a few other things.

9. Yes, they are sent to the IP that is in the DNS query response.

10. Yes, there is a new DNS query for each image.

11. The destination port for the query is 53. The response port is also 53.

12. The query was sent to 10.40.4.44, which is the same as my local DNS server.

13. It is a standard DNS query. There are no "answers" in the DNS query.

14. The query response contains one answer, which has the same info as the other one. Hostname, IP address, time to live and other things.

15. Screenshot: http://img205.imageshack.us/img205/3815/wiresharkscreenshotq15.png

16. The DNS query is sent to 10.40.4.44, same as the others. Yes, this is my local DNS server.

17. It is a standard query, and doesn't contain any "answers"

18. The MIT nameservers it contains are: bitsy.mit.edu, strawb.mit.edu and w20ns.mit.edu. Yes, the IP addresses are also included.

19.Screenshot: http://img28.imageshack.us/img28/581/wiresharkscreenshotq19.png

20. As with the others before, the query is sent to 10.40.4.44, which is my local DNS server.

21. It is a standard query. It contains no answers.

22. The response contains one answer. The info in the answer is the same as all the other answers: Hostname, IP address, time to live and others.

23. Screenshot: http://img269.imageshack.us/img269/728/wiresharkscreenshotq23.png

Sunday, March 11, 2012

Wireshark Lab 2: HTTP

Part 1: The Basic HTTP GET/response interaction

1. My browser is running HTTP 1.1. (GET /wireshark-labs/HTTP-wireshark-file1.html HTTP/1.1\r\n). The server is running HTTP 1.1. (HTTP/1.1 200 OK\r\n)

2. My web browser accepts HTML, XHTML and XML.
 (Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n)

3. My IP is 10.33.37.39, and the server's IP address is 128.119.245.12.

4. That status code returned by the server is 200, meaning connection is OK.

5. The file was last modified Sunday, March 11th, 2012 at 8:03 PM GMT.    (Last-Modified: Sun, 11 Mar 2012 20:03:01 GMT\r\n)

6. 482 Bytes are being returned to my browser. (Frame 14: 482 bytes on wire (3856 bits), 482 bytes captured (3856 bits))

7. I do not see any differing headers in the packet content window and the packet listing window.

Part 2: The HTTP CONDITIONAL GET/response interaction

8. I do not see an "If Modified since" line.

9. The server doesn't appear to have explicitly returned the contents of the file.

10. There is an IF-MODIFIED-SINCE line. It is as follows: If-Modified-Since: Sun, 11 Mar 2012 20:22:02 GMT\r\n.

11. The response code is 304 Not Modified (HTTP/1.1 304 Not Modified\r\n). Once again, the server does not appear to have explicitly returned the contents of the file.

Part 3: Retrieving Long Documents

12. There were two HTTP GET request messages sent by my browser.

13. There were four TCP segments. (4 Reassembled TCP Segments (4803 bytes): #19(1460), #20(1460), #22(1460), #23(423))

14. The response was 200 OK for the first GET message, and 404 NOT FOUND for the second GET message.

15. There doesn't seem to be any HTTP response messages in the data transmission associated with a TCP induced "continuation"

Part 4: HTML documents with embedded objects

16. There were three GET messages sent out by my browser. One was sent to the gaia.umass server. One was sent to the aw-bc.com site, and the last one was sent to manic.cs.umass.edu.

17. I assume they were downloaded in parallel, as the time on the response messages for both images is identical.

Part 5: HTTP Authentication

18. The response to the first GET message is 401 Authentication Required.

19. The new field in the second GET message is a field called "Authorization" that appears to contain the username and password I used to log in.

Sunday, March 4, 2012

Programming Project 2: Part 1; SMTPconnection.java

package clavette;

import java.net.*;
import java.io.*;
import java.util.*;

/**
 * Open an SMTP connection to a mailserver and send one mail.
 *
 */
public class SMTPConnection {
    /* The socket to the server */
    private Socket connection;

    /* Streams for reading and writing the socket */
    private BufferedReader fromServer;
    private DataOutputStream toServer;
 
    private static final String localSMTPServer = "localhost";
    private static final int SMTP_PORT = 25;
    private static final String CRLF = "\r\n";

    /* Are we connected? Used in close() to determine what to do. */
    private boolean isConnected = false;

    /* Create an SMTPConnection object. Create the socket and the
       associated streams. Initialize SMTP connection. */
    public SMTPConnection(Envelope envelope) throws IOException {
connection = new Socket(envelope.DestHost,SMTP_PORT);
fromServer = new BufferedReader(new InputStreamReader(connection.getInputStream()));
     toServer = new DataOutputStream(connection.getOutputStream());


   
   
/* Read a line from server and check that the reply code is 220.
  If not, throw an IOException. */
   
   
String SMTPResponse = fromServer.readLine();
System.out.println(SMTPResponse);
if(parseReply(SMTPResponse)!= 220)
{
throw new IOException();
}
 

/* SMTP handshake. We need the name of the local machine.
  Send the appropriate SMTP handshake command. */
String localhost = "myMachine.nowhere.org";
sendCommand("HELO "+localhost,250);

isConnected = true;
    }

    /* Send the message. Write the correct SMTP-commands in the
       correct order. No checking for errors, just throw them to the
       caller. */
    public void send(Envelope envelope) throws IOException {

   
    sendCommand("MAIL FROM ", 250);
/* Send all the necessary commands to send a message. Call
  sendCommand() to do the dirty work. Do _not_ catch the
  exception thrown from sendCommand(). */

    }

    /* Close the connection. First, terminate on SMTP level, then
       close the socket. */
    public void close() {
isConnected = false;
try {
   sendCommand("QUIT ",221); //has to be completed
   // connection.close();
} catch (IOException e) {
   System.out.println("Unable to close connection: " + e);
   isConnected = true;
}
    }

    /* Send an SMTP command to the server. Check that the reply code is
       what is is supposed to be according to RFC 821. */
    private void sendCommand(String command, int rc) throws IOException {
   
    toServer.writeBytes(command);
    String SMTPResponse = fromServer.readLine();
    if(parseReply(SMTPResponse)!= rc)
    {
    throw new IOException();
    }
   

    }

    /* Parse the reply line from the server. Returns the reply code. */
    private int parseReply(String reply) {
    StringTokenizer myTokenizer = new StringTokenizer(reply, " ");
    String returnCodeString = myTokenizer.nextToken();
    int returnCodeInt = Integer.parseInt(returnCodeString);
    return returnCodeInt;
    }

    /* Destructor. Closes the connection if something bad happens. */
    protected void finalize() throws Throwable {
if(isConnected) {
   close();
}
super.finalize();
    }
}


Wednesday, February 22, 2012

Programming Project 1: Multi-threaded Webserver Part 2

WebServer.java


package clavetter;
import java.io.*;
import java.util.*;
import java.net.*;



public class WebServer{

   
    public static void main(String[] args) throws Exception {
   

        int port = 80;
        ServerSocket wS = new ServerSocket(port);
       
       
       
        while(true) {
            Socket cS = wS.accept();
            HttpRequest request = new HttpRequest(cS);
            Thread thread = new Thread(request);
            thread.start();
           
           
        }      
    }
}


Programming Project 1: Multi-threaded Webserver Part 1

HttpRequest.java

package clavetter;
import java.io.*;
import java.net.*;
import java.util.*;



public final class HttpRequest implements Runnable {

    final static String CRLF = "\r\n";
    Socket socket;
   
    //constructor
   
    public HttpRequest(Socket socket) throws Exception
    {
        this.socket = socket;
    }
   
    public void run()
    {
    try{
        processRequest();
    } catch(Exception e) {
        System.out.println(e);
    }
       
       
       
    }
   
    private void processRequest() throws Exception
    {
        InputStream is = socket.getInputStream();
        DataOutputStream os = new DataOutputStream(socket.getOutputStream());
       
        //Setup input stream filters
        BufferedReader br = new BufferedReader(new InputStreamReader(is));
        //Get the request line of HTTP request message
        String requestLine = br.readLine();
       
        System.out.println();
        System.out.println(requestLine);
       
        // Extract the filename from the request line.
        StringTokenizer tokens = new StringTokenizer(requestLine);
        tokens.nextToken();  // skip over the method, which should be "GET"
        String fileName = tokens.nextToken();
        System.out.println(fileName);
        // Prepend a "." so that file request is within the current directory.
        fileName = "." + fileName;


       
//comment out when done       
        // Get and display the header lines.
        //String headerLine = null;
        //while ((headerLine = br.readLine()).length() != 0) {
            //System.out.println(headerLine);
    //    }
//comment ^^^^^ out when done   
       
        // Open the requested file.
        FileInputStream fis = null;
        boolean fileExists = true;
        try {
            fis = new FileInputStream(fileName);
        } catch (FileNotFoundException e) {
            fileExists = false;
        }

        // Construct the response message.
        String statusLine = null;
        String contentTypeLine = null;
        String entityBody = null;
        if (fileExists) {
            statusLine = "HTTP/1.1 200 OK: ";
            contentTypeLine = "Content-Type: " +
                contentType( fileName ) + CRLF;
        } else {
            statusLine = "HTTP/1.1 404 Not Found: ";
            contentTypeLine = "Content-Type: text/html"+ CRLF;
            entityBody = "<HTML>" +
                "<HEAD><TITLE>Not Found</TITLE></HEAD>" +
                "<BODY>Not Found</BODY></HTML>";
        }
        // Send the status line.
        os.writeBytes(statusLine);

        // Send the content type line.
        os.writeBytes(contentTypeLine);

        // Send a blank line to indicate the end of the header lines.
        os.writeBytes(CRLF);

        // Send the entity body.
        if (fileExists)    {
            sendBytes(fis, os);
            fis.close();
        } else {
            os.writeBytes(entityBody);
        }



       
       
       
   
        DataOutputStream outToClient = new DataOutputStream(socket.getOutputStream());
        outToClient.writeBytes("HTTP/1.1 200 OK");
        outToClient.writeBytes("Content-Length: 100");
        outToClient.writeBytes("Content-Type: text/html\n\n");
        outToClient.writeBytes("<html><body><h1>My First Heading</h1><p>My first paragraph</p></body></html>");
        outToClient.close();
        os.close();
        br.close();
        socket.close();
       
    }
   
   
   
   

private static String contentType(String fileName)
{
    if(fileName.endsWith(".htm") || fileName.endsWith(".html")) {
        return "text/html";
    }
    if(fileName.endsWith(".png")) {
        return "image/png";
    }
    if(fileName.endsWith(".gif")) {
        return "image/gif";
    }
    if(fileName.endsWith(".jpg")|| fileName.endsWith(".jpeg")) {
        return "image/jpeg";
    }
    return "application/octet-stream";
}

private static void sendBytes(FileInputStream fis, OutputStream os)
throws Exception
{
   // Construct a 1K buffer to hold bytes on their way to the socket.
   byte[] buffer = new byte[1024];
   int bytes = 0;

   // Copy requested file into the socket's output stream.
   while((bytes = fis.read(buffer)) != -1 ) {
      os.write(buffer, 0, bytes);
   }
}




}

Sunday, February 19, 2012

HW 2

R5: The host uses a series of messages between it and the other host to determine the processes running on the other host.

R.8:  The first class is Reliable Data Transfer, which is only on TCP. The next is throughput, which is on both TCP and UDP. The next is timing, which is on both TCP and UDP. The last one is security, which is on both services.


P1.
A. True.
B. False, as a persistent connection is a TCP connection between the client and a certain server.
C. True. It is called a parallel connection.
D. False. The DATE: header specifies when the request was created and sent by the server.
E. True. The message wouldn't be doing anything if the entity body were to be empty.

P2.
CDUP - Change to Parent Directory
SMNT - Structure Mount
STOU - Store Unique
RMD - Remove Directory
MKD - Make Directory
PWD - Print Directory
SYST - System

P5.
A. Yes. The reply was provided on Tuesday, March 7th 2008.
B. Saturday, December 10th 2005.
C. 3874
D. Yes, the server agreed to a persistent connection.


P11.

A. Yes, the parallel connections do let him load web pages faster because he's getting a larger share of the bandwidth.
B. In this case no, they would all be about equal since they are getting the same amount of bandwidth.

P18.

A. A WHOIS database is a collection of information about registered domain names.
B.  I used MarkMonitor and Network Solutions LLC.
C. I found that for a popular site (facebook) each of the different types are all hosted in the same place, by facebook. For a less popular site, I found they relegated some things like the nameserver to another company.
D. No, Eastern only has one IP address.
E. Eastern's site didn't show up on the ARIN database, but they don't have a range anyway since they just have one IP.
F. By using WHOIS and nslookup an attacker will be able to easily figure out the IP address and locations of servers for certain services, which gives them some of the info they need to make an attack.
G. WHOIS databases should be available because you should always be able to figure out who the owner of a server is, in case they are hosting illegal content, or are doing something else unsavory.

P19.

A.
;; QUESTION SECTION:
;easternct.edu.   IN A

;; ANSWER SECTION:
easternct.edu.  3502 IN A 149.152.32.102

;; AUTHORITY SECTION:
easternct.edu.  172702 IN NS ecsu-dns2.easternct.edu.
easternct.edu.  172702 IN NS ecsu-dns7.easternct.edu.
easternct.edu.  172702 IN NS ecsu-dns6.easternct.edu.
  
B. 
;; QUESTION SECTION:
;amazon.com.   IN A

;; ANSWER SECTION:
amazon.com.  60 IN A 72.21.211.176
amazon.com.  60 IN A 72.21.214.128
amazon.com.  60 IN A 72.21.194.1

;; AUTHORITY SECTION:
amazon.com.  398 IN NS ns4.p31.dynect.net.
amazon.com.  398 IN NS pdns5.ultradns.info.
amazon.com.  398 IN NS pdns4.ultradns.org.
amazon.com.  398 IN NS pdns2.ultradns.net.
amazon.com.  398 IN NS ns1.p31.dynect.net.
amazon.com.  398 IN NS ns3.p31.dynect.net.
amazon.com.  398 IN NS pdns3.ultradns.org.
amazon.com.  398 IN NS ns2.p31.dynect.net.
amazon.com.  398 IN NS pdns6.ultradns.co.uk.
amazon.com.  398 IN NS pdns1.ultradns.net.

;; ADDITIONAL SECTION:
ns1.p31.dynect.net. 48880 IN A 208.78.70.31
ns2.p31.dynect.net. 48880 IN A 204.13.250.31
ns3.p31.dynect.net. 48880 IN A 208.78.71.31
ns4.p31.dynect.net. 48880 IN A 204.13.251.31
pdns1.ultradns.net. 1056 IN A 204.74.108.1
pdns1.ultradns.net. 1056 IN AAAA 2001:502:f3ff::1
pdns2.ultradns.net. 1191 IN A 204.74.109.1
pdns3.ultradns.org. 1056 IN A 199.7.68.1
pdns4.ultradns.org. 1056 IN A 199.7.69.1
 
P22. 
Client-Server:
When N=10 it will take 750 seconds to download.
When N=100 it will take 5000 seconds to download. 
When N=1000 it will take 50000 seconds to download.
P2P:
When N=10 and U = 300 kbps it will take at minimum 750 seconds to download.
When N=10 and U = 700kbps it will take at minimum 214 seconds to download.
When N=10 and U = 2mbps it will take at minimum 75 seconds to download.
When N = 100 and U = 300kbps it will take at minimum 50 seconds to download.
When N=100 and U = 700kbps it will take at minimum 21 seconds to download.
When N=100 and U = 2mbps it will take at minimum 7.5 seconds to download.
When N=1000 and U = 300 kbps it will take at minimum 50 seconds to download.
When N=1000 and U=700kbps it will take at minimum 2.5 seconds to download.
When N=1000 and U=2mbps it will take at minimum .75 seconds to download.
 

Sunday, February 12, 2012

Chapter 1 Homework

P3.

A.  The network can hold 4n simultaneous connections.
B.  It would support 2n simultaneous connections.

P5.

A.  d(prop) = m / s
B.  d(trans) = L / R
C.  d(end-end) = N(d[prop] + d[trans])    (where N is equal to the number of routers)
D.  Ignoring the other delays, the last bit of the packet should just be arriving at the router at time t = d(trans)
E.  The first bit of the packet should be nearing it's destination at time t = d(trans)
F.  At time t = d(trans), the first bit of the packet should just leaving to it's destination
G.  d(prop) and d(trans) will be approximately equal at a distance of 50,000,000 meters.


P18.

A. The average round trip time was 6ms.
B.  There were always six different routers.
C.  There appeared to be only two different ISPs.
D.  The inter-continental connection was much more complex. There were fourteen different routers and three different ISPs on each trial. The average round trip time was 73ms.



P30.

A.  It should take ~200 minutes.
B.  It should take 3 seconds for the first packet to reach its final destination. The second packet should arrive at 4 seconds.
C. It should take ~67 minutes for the final packet to reach the final destination. This is much faster than the non-message switched file.
D. There are a couple downsides to message segmentation. First of all, the packets have to be reassembled at the final destination, taking time. Also, since the header size of packets is usually the same, regardless of size, you'll end up with much more data to transfer with multiple packets.