[Description]
The process of the communication between your client program and dvServer program is the following:
1. C ---> S, client initiate TCP connection to server.
2. C <--- S, server send the initial information to client.
3. C ---> S, client send 3 byte including: isPoisonReverse and port, ex. 3000.
4. client and server close the TCP socket.
5c.client open the UDP socket and wait for exchanging distance vector. 
5s.server simulate 6 nodes on 6 different UDP socket to exchange distance vector with each other. Your client program can get each port from the UDP headers.
6. client program should print out distance table everytime your table get updated.
7. If client program work fine, it should achieve a converged state.  

Reminder. after exchange the initial information, all distance vector exchange through UDP socket which is slightly different from the document.

[Test Program Usage]
# To run the dvServer with your client program
type: java dvServer [Server's Port] [isSelfTest]
Example:java dvServer 2000 0

# To run the dvServer "without" your client program 
Usage: 	java dvServer [Server's Port] [isSelfTest]
Example:java dvServer 2000 1

P.S. The port nodethread listen from 6001 to 6006, do not use the same port here.

[Binary packet format]
# Initial information 
info = "00751521485466"  (which is the byte value in java)

info[0]:network id
info[1]:network id(cont.d) which is 0
info[2]:total numbers in the network which is 7
info[3]:numbers of your neighbors which is 5 
info[4]:1st neighbor's node id which is 1.
info[5]:1st neighbor's distance which is 5.
info[6]:2nd neighbor's node id which is 2.
info[7]:2nd neighbor's distance which is 1.
info[8]:3rd neighbor's node id which is 4.
info[9]:3rd neighbor's distance which is 8.
info[10]:4th neighbor's node id which is 5.
info[11]:4th neighbor's distance which is 4.
info[12]:5th neighbor's node id which is 6.
info[13]:5th neighbor's distance which is 6.

#Distance vector
pakcet = "001705000107-1-1-1-1-1-1" (which is the byte value in java)

network id: packet[0]&[1] which is 0
node id: packet[3] which is 1
L: packet[4] which is 7
Do:packet[5]&[6] which is 5
D1:packet[7]&[8] which is 0
D2:packet[9]&[10] which is 1
D3:packet[11]&[12] which is 65535 means unkown
D4:packet[11]&[12] which is 65535 means unkown
D5:packet[11]&[12] which is 65535 means unkown
D6:packet[11]&[12] which is 65535 means unkown

  Source Node ID: 1
   Destination: 0  Weight:  5
   Destination: 1  Weight:  0
   Destination: 2  Weight:  1
   Destination: 3  Weight:  7
   Destination: 4  Weight:  65535
   Destination: 5  Weight:  65535
   Destination: 6  Weight:  65535

[Test Topology]
The test topology is the one in hw5-1, your client program act as node E. And I also attached the graph of topology. Our server program will play the node 1 - 6 using port from 6001 to 6006.

[Grading policy]
Grading by serveral milestones,
1. Successfully exchange the information with dvServer and display the initial distance table.
2. Successfully work without poison reverse.
3. Successfully work with poison reverse.
4. Fail to achieve the stable state but can hanlde the exchange of distance vector with our nodes.


Good luck! 
--TA