1. Draw the sliding window positions at transmitter A and receiver B in case of sliding window protocol using 3 bit sequence number and maximum window size of4 for the following situations:
a. Starting window positions at A and B before any frames are sent
b. A sends frames 0 and 1 and B acknowledges Frame 0 and it is received by A
c. A sends frame 2 and B acknowledges frame 2 and the acknowledgement has not yet been received by A.
2. Obtain the IPv6 address of your computer. If necessary, obtain the IPv6 address of a computer on the USF campus
a. Write it down in the canonical form as reported
b. Write the address in full form, i.e. 8 blocks of 4 hex characters each
c. Expand the hex notation to full 128-bit binary representation
3. Read the paper, “Successful strategies for IPv6 rollouts.: Really,” by Thomas A. Limoncelli and Vinton G. Cerf, Communications of the ACM, 54(4), April 2011.
a. Who is Vint Cerf? What is his claim to fame?
b. What are the potential strategies for IPv6 rollouts? What are the merits and handicaps of each strategy?
c. If you had the choice, which of these or other strategies would you choose to roll out IPv6? Why?
4. Build on the client-server code sample discussed in class to accomplish the following:
a. Send a response from the server to the client and display it on the console
b. Read text input larger than the buffer size and display it on the console. For example, in the code sample given in the appendix, the buffer sizes have been reduced to 6 bytes each. Use these buffer sizes to send, receive and print the message “Hello World!” on the console. You may note that this message is 12 bytes in size.
c. Send a text file from the client and display it at the server console
d. Send a file from the client and save it at the server
Notes on q4:
(1) The standard method to read and transmit large blocks of information is to perform these operations inside a loop, i.e. read <buffersize> bytes, transmit, read again, transmit again, proceed until there are no more bytes to read.
1. You may hard-code file names and assume there are no errors in the input.
APPENDIX: Simple client-server code in C#
usingSystem.Net.Sockets;
usingSystem.Linq;
using System.Net;
using System;
usingSystem.Text;
// At USF, the program should be on a local drive.
//http://www.switchonthecode.com/tutorials/csharp-tutorial-simple-threaded-tcp-server
namespaceClientServerDemo
{
classProgram
{
staticvoid Main(string[] args)
{
int port = 9999; // any number higher than 1023
byte[] receivedData = newbyte[6]; // can be any length
byte[] sentData = newbyte[6]; // use a loop to read if necessary
intbytesRead;
try
{
// start server listening on local host
TcpListener server = newTcpListener(IPAddress.Any, port);
server.Start();
// create client socket and connect to server listening on localhost
IPHostEntrylocalhostName = Dns.GetHostEntry(“localhost”);
IPEndPointipe = newIPEndPoint(localhostName.AddressList.ElementAt(1), port);
Socket localhostSocket = newSocket(ipe.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
localhostSocket.Connect(ipe);
NetworkStreamserverStream = newNetworkStream(localhostSocket, true);
// accept the client’s incoming connection request
TcpClient client = server.AcceptTcpClient();
NetworkStreamclientStream = client.GetStream();
// once the connection is established, get the client to send data
sentData = Encoding.ASCII.GetBytes(“Hello world!!!”);
serverStream.Write(sentData, 0, sentData.Length);
// read this data at the server and print it
bytesRead = clientStream.Read(receivedData, 0, receivedData.Length);
Console.Write(Encoding.ASCII.GetString(receivedData, 0, bytesRead));
// hack to keep the console open for viewing
Console.Read();
}
catch (Exception e)