You are on page 1of 3

Advance Computer Networks

Assignment No 3
Distribution Date: 1/11/2010
Due Date: 11/11/2010 at 11:59 p.m.

Read Instructions Carefully:

o Total Marks of this assignment are 50.


o Either submit a printed hard-copy solution or send your assignment by email.
o Programming part (if any) of assignment MUST send via email to amerzaheer@gmail.com,
leoyasir@gmail.com and CC to amir_qayyum@yahoo.com.
o Copy Paste from the given research paper or web site, etc., in answer to any question, will not be
accepted, and MAY result in zero credit for the question. Give answers to assignment questions
in your own words.
o Late assignment will not be accepted in any case. This is student’s responsibility to send
assignment in given time.
o Do not send multiple copies through mail, only last copy will consider if you send multiple
copies.
o Submit .txt or .doc file. No other format is acceptable.
o Submission of compressed files in .zip format is allowed. .rar compression format is not allowed.
o Name of the file that you submit should be of the format “Assign-no-Full-Name-MAJU-regno.
doc". For example, Assign03-Amer Zaheer-PC101005.doc
o You MUST NOT send your assignment to the course mailing list: it will NOT be accepted, and
You may get discredit.
Part I Linux Utilities: (Answer should not exceed 3 lines) 10 Marks

• What is the purpose of ping utility? Also describe its functionality with two different
options? (2 Marks)
• Try pinging two different sites and give summary of results in each case (1 Mark).
• What is difference between the ping and traceroute(2 Mark)?
• What is the purpose of ifup and ifdown?(2 Marks)
• What is the purpose of tcpdump? Store its results in .txt file and send file in mail. (3
Marks).
Note: Read the man pages of all utilities/commands to address the above questions.
Part II Network Architecture: 15 Marks

Q No 1: 3 Marks
Show that two-dimensional parity allows detection of all 3-bit errors.
Q No 2: 5 Marks
Compare the channel requirements for voice traffic with the requirements for the real-time
transmission of music, in terms of bandwidth, delay, and jitter. What would have to improve? By
approximately how much? Could any channel requirements be relaxed?
Q No 3: 3+4 Marks
Hosts A and B are each connected to a switch S via 10-Mbps links as in Figure. The propagation delay
on each link is 20 µs. S is a store-and forward device; it begins retransmitting a received packet 35 µs
after it has finished receiving it. Calculate the total time required to transmit 10,000 bits from A to B

A S B

a) as 1500 bit packets.


b) as two 7500 bit packets sent one right after the other.

Part IV Programming: Marks 25

When we run the “ls” command on the terminal, it lists down all the files and the directories present in
the current location. For this assignment we will be working with “ls” command that we mostly use on
the terminal to gain information about the different contents and directories of our system, but as this is
the course of computer networks so we have to get the network involved as well, as a result we will
implement our own version of “ls” command and we will call this command as “nls” (Network ls).

Functionality of nls command:

Ø The user on the client side will enter the "nls" command on the screen
Ø As a result the program will display on the client screen all the files that are present in the
directory in which our server is running on the server side.
Ø “nls” command will be given to the client but it will list down the files and directories that are
present in the folder of the server.

To get you all familiar with the formulation of packets, the communication between the client and the server
will be in the form of proper packets. Before sending any data on the network proper packets will be formulated
and after receiving the packet, it will be interpreted by the receiver and the required activity will be performed
accordingly.

Ø The server will only be able to handle one client at a time (sequential server) but it will be in
continuous mode meaning that the server can handle any other client after handling one client.
Multiple processes are not required for this application. Also no signaling is required for this
application.
Ø The server must bind on port number 9999.
Ø When the connection is established, the server will send the welcome message, in ASCII text, to the
client (“Welcome user: CLIENT-IP-ADDRESS, CLIENT-PORTNUMBER”).
Ø When the connection is established and the client gets the welcome message from the server, it will
display the welcome message on screen, and will ask the user "Enter the command to execute" and will
wait for the response from the user.
Ø The user will enter command on the terminal.
Ø The client will formulate a packet according to the following format and will send it to the server.

| RequestType | PacketLength | Data(RequestName) |


RequestType (1 byte ) è for nls it will be 5
PacketLength (variable) è Complete length of the packet.
Data(RequestName) (variable) è “nls” (or whatever character stream for nls command)

Ø The server will receive the packet, and will read RequestType, it will decide that it has to execute the
“nls” command.
Ø For “nls” command it will retrieve all the directories and the files using some type of system call
(explore the system calls that perform this task and use them).
Ø The server will formulate the packet according to the following packet format and send it to the client

| PacketType | ReplyType | PacketLength | Data(ACK) |


PacketType (1 byte ) è 1 for ACK and 2 for Data
ReplyType (1 byte ) è 6 for ACK and 5 for Data
PacketLength (variable) è Complete length of the packet.
Data è ACK or Command Output

Instructions
You are required to use a Makefile to compile you client and server applications. Make sure that your
application will follow the same API as required. Your application should also be able to run with ANY other
application having the SAME specifications. Make your application to support the asked specifications ONLY.
Also provide a README file if you made any assumptions. Please make sure to enable your application to
support the APPROPRIATE BYTE ORDERING whenever necessary.

(Clean & structured code & comments: 3 + appropriate data structures: 2 + successful compilation:
3+ Makefile: 2 + functionality: 15)

You might also like