Starting from:
$29.99

$23.99

Homework Assignment III Solution

1. IP Address (10 pts)

 

1.   Convert the IP address whose hexadecimal representation is CB44AFA2 to dotted decimal notation. (2 pts)

 

 

2.   What is the 32-bit binary equivalent of the IP address 100.114.20.107? (2pts)

 

3.   A network on the Internet has a subnet mask of 255.255.192.0. What is the maximum number of hosts it can handle (note: network address and local broadcast address are not assigned to individual hosts)?  (2 pts)

 

4.   Suppose an organization owns the block of addresses of the form

129.17.129.96/28.  Suppose it wants to create four IP subnets from this block,

with each block having the same number of IP addresses. What are the prefixes

(of form xxx.xxx.xxx/y) for the four IP subnets? (4pts)

 

 

 

 

 

 

2. IP Datagram Forwarding (10 pts)

 

Considering a datagram network using 8-bit host addressing (totally 254 hosts), suppose  a router use longest prefix matching  and has following  forwarding  table. How many host addresses will the router route through interface 0, interface 1 respectively (5pt each)? (hint: when host id is all 0, the address is network address and when host id is all 1’s, the address is local broadcast address. Both are not host addresses)

 

 

3. Link State Routing (10 pts)

 

Consider the network shown below. Show the operation of Dijkstra’s (link-state) algorithm for computing the least cost path from A to all destinations using the table below (8 pts).

What is the shortest path from A to F, and what is the cost of this path (2 pts)?

 

 

 

4. Hand-on Practice: DHCP (10 pts)

 

In this practice, we’ll take a quick look at DHCP. In order to observe DHCP in action, we’ll perform several DHCP-related commands and capture the DHCP messages exchanged as a result of executing these commands. Do the following as in Figure:

 

1.   Enter “ipconfig /release” to releases your current IP address, so that your host’s IP

address becomes 0.0.0.0. (sudo dhclient –r is used in linux)

2.   Start up the Wireshark packet sniffer, with “bootp” as the filter (Note to see

DHCP packets in the current version of Wireshark, you need to enter “bootp” and not “dhcp” in the filter.)

3.   Enter “ipconfig /renew”. This instructs your host to obtain a network configuration, including a new IP address.

1.   Stop Wireshark packet capture.

 

Provide two screen shots: command line screen similar to the figure above and a wireshark screen that captures the DHCP interaction (you can have similar screenshots in unix)

 

Based on the screenshots, answer the following questions:

 

1.   Are DHCP messages sent over UDP or TCP? (2pts)

 

2.   Explain the purpose of the router and subnet mask lines in the DHCP offer message. (2pts)

 

3.   Explain the purpose of the lease time. How long is the lease time in your experiment? (2pts)

 

4.   Explain the purpose of the DHCP release message? What would happen if the client’s DHCP release message is lost? (2pts)

 

5.   In a certain network configuration, the DHCP server might not be located at the same network as your machine. In this case, DHCP request are relayed by a relay agent. Is there a relay agent in your experiment? Justify your answer. (2pts)

 

5. Hand-on Practice: ICMP (10 pts.)

 

In this practice, we capture the packets generated by the Traceroute program. You may recall that the Traceroute program can be used to figure out the path a packet takes from source to destination. Traceroute is discussed in Section 1.3 and in Section 4.4 of the text.

 

 

Do the following:

1.   Start up the Wireshark packet sniffer, and begin Wireshark packet capture.

2.   Type “tracert hostname”.   Choose a host outside of north America such as

www.inria.fr , a computer science research institute in France.

3.   When the Traceroute program terminates, stop packet capture in Wireshark.

 

You should hand in a screen shot of the output of tracert command, then answering the following question:

 

1.   How many ICMP echo packets are sent? Justify the observed number from wireshark, based on the output of tracert command. (4pts)

 

 

 

2.   Examine the last three ICMP error packets received by the source host. How are these packets different from the previous ICMP error packets? Why are they different? (6pts)

 

6. Programming assignment: Host lookup and performance measurement

(50 points)

 

 
1.
This problem requires building a directory server, an app-server and an app-client. You can use the provided db-server and do not have to develop it.
 

2.
 

You may implement the programs in the language of your choice. Provide a short
 
description about compiling/running your program in the README file.
 

3.
 

During development, it may be simpler to run all the programs on the same
 
machine using the loopback interface. However, for actual measurement, please
 
follow the instructions provided.
 

4.
 

Please use port numbers between 9000 and 10000 when running your programs.
 

5.
 

In order for these servers and clients to properly communicate with each other, it
 
is important that all of them agree upon the message format. For this assignment,
 
you can assume that:
 
‘\r’ (Carriage return) indicates end of a line

‘\r\n’ (Carriage return + newline) indicates end of a message

When print messages on the screen, print each part of the message on a new line. See the example below for clarity.
 
 

For example:
 
an app-server’s registration message should be formatted like this:
 
“register 128.101.37.1 9123\r\n”
 
 

an app-client’s list-servers message should be formatted like this:
 
“list-servers\r\n”
 
 

The directory server’s response to the list-servers message will be like this:
 
“success\r128.101.37.1 9123\r128.101.37.2 9321\r128.101.38.1 9321\r\n”
 
 

Print the response on the console like this:
 
success
 
 
128.101.37.1 9123
 
 
128.101.37.2 9321
 
 

6.
 

All performance measurement must be performed on the client side.
 
 
Implementation requirements and suggestions (must read)

 

 

For this assignment, you will build a dir-server, an app-server and an app-client. You will transfer data from the app-client to the app-server and measure the performance of the network path between them. You will then upload the performance results to the provided db-server.

 

Here is the sequence of operations that must be followed:

1.   Start the dir-server on a specified port on apollo.cselabs.umn.edu and the

db-server on a specified port on atlas.cselabs.umn.edu

 

 

2.   Start two or more app-servers on different UNIX machines in Keller Hall. Each app-server must register itself with the directory server by providing its IP address and port number.

 

3.   Start the app-client on one of the UNIX machines in Lind Hall. The app-client must query the directory server for the list of app servers.

 

4.   The app-client must then connect to one of the app-servers and upload some data over a TCP connection and measure the time taken.

 

5.   The app-client must then connect to the provided db-server and upload the results.

6.   Finally, the app-client must download the results from the db-server and display them on the console.

 

Directory server

You must run the dir-server on apollo.cselabs.umn.edu.

1.   The dir-server will be invoked as follows:

$ ./dir-server <ds_port

The dir-server must start listening for TCP connections on the port specified by

ds_port.

 

2.   The app-server will try to register itself by sending the register message. The dir- server must respond and indicate success or failure.

 

3.   The app-client will query the dir-server for a list of available servers by sending the list-servers message. The dir-server must respond and indicate success or failure. If successful, the list of servers needs to be returned to the client.

 

4.   Print all received messages on the console and provide a screenshot of the same.

 

 

 

 

 

app-server

You must run at least two app-servers. Each app-server must run on one of the UNIX

machines in Keller Hall.

The app-server will be invoked as follows:

$ ./app-server <ds_port

The app-server must:

1.   Create a TCP socket bound to a random port assigned by the operating system.

(Hint: Set sin_port = htons(0); before calling bind())

 

2.   Print the following message on the console (without the quotes):

“<ip_address, <port”

<ip_address is the address of the machine on which the app-server is running,

and <port is the port number which has been assigned to this socket by the operating system. (Hint: Use getsockname() or equivalent)

 

3.   Establish a TCP connection with the dir-server, which should be running on

apollo.cselabs.umn.edu on the port specified by ds_port.

 

 

4.   Register  with  the  dir-server,  by  sending  the  register  message,  using  the  IP address and port number determined in step 2. Print the response from the dir- server on the console.

 

5.   Listen for app-clients on the socket created in step 1. An app-client will connect to this app-server and upload some data. The app-server must respond with an acknowledgement after all the data has been uploaded.

 

6.   Print all received messages on the console and provide a screenshot of the same.

 

app-client

You must run the app-client on one of the machines in Lind Hall. The app-client will be

invoked as follows:

$ ./app-client <ds_port <db_port

The app-client must:

1.   Connect to the dir-server and obtain a list of available app-servers by sending the

list-servers message. Print the response from the dir-server on the console.

 

 

2.   Establish a TCP connection to one of the app-servers in the list by using the provided IP address and port number. Upload 10KB of data to the app-server. The app-server will respond with an acknowledgement after all the data has been uploaded. Measure the time taken for transmission (Time from start of transmission till reception of application level acknowledgement; Do not include time  for  I/O).  Repeat  this  operation  at  least  five  (5)  times  and  compute  the average time taken for upload.

 

3.   Upload the performance measurements to the db-server by sending the set-record message. Print the response from the db-server on the console.

 

4.   Repeat step 3 for different data sizes (10KB, 100KB, 1000KB and 10000KB)

 

 

5.   Connect to the other app-server and repeat steps (2), (3) and (4).

 

6.   Connect      to      the      db-server      which      should      be      running      on

atlas.cselabs.umn.edu on the port specified by db_port.

 

 

7.   Fetch records from the db-server by sending a get-records message to the db- server. Print the response from the db-server on the console.

 

8.   Print  all  received  messages  on  the  console.  Attach  one  or  more  screenshots showing the results of steps (1), (3) and (7).

 

 

db-server

You must run the db-server on atlas.cselabs.umn.edu.

You may use the provided db-server - You DO NOT have to develop your own. You can start the db-server by executing:

$ ./db-server <db_port

1.   An app-client can query the db-server for a list of available records by sending the

get-records message.

 

 

2.   An app-client can try to set a record in the db-server by sending the set-record message.

 

3. The db-server will store all the records in a plaintext file called client_records.dat. Delete this file if you want to clear the records in the db-server and start again.

 

 

 

Deliverables:

1.   You must upload a single archive file (.zip or .tar or .tar.gz) on moodle.

When extracted, the archive file must be a single folder. The name of the folder should be your student ID. The folder should contain the following files:

●   Readme

●   app-server source files

●   app-client source files

●   MS Word/PDF document

2.   DO NOT include the test files

 

For example, here is a sample submission:

1234567/

    Readme

    PA3.doc

    app-server/

        app-server.c

   Makefile

    app-client/

        app-client.c

        Makefile

    dir-server/

        dir-server.c

        Makefile

 

You can create an archive file from the contents of the above directory as follows:

$ tar cvf 1234567.tar.gz 1234567/

 

Grading:

README, Makefiles, comments, readability: 3 points

Packaging the submission as specified: 2 points app-server registration & screenshots: 5 points app-client list-servers screenshot: 10 points

app-client data upload and performance measurement: 10 points

app-client set-records: 10 points

app-client get-records screenshot: 10 points

More products