Adhoc On-demand Distance Vector (AODV) Accept from the user as command line arguments on the client side: 1. the D flag described below 2. Number of messages to be sent from client to server 3. Server IP address Route Request (RREQ) Message Format -- Sent from client to server. 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type |J|R|G|D|U| Reserved | Hop Count | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RREQ ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Destination IP Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Destination Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Originator IP Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Originator Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The format of the Route Request message is illustrated above, and contains the following fields: D Destination only flag; indicates only the destination may respond to this RREQ. NOTE: Accept a command line argument which will tell you whether to set this field or not. In the server, extract this value and print it. Reserved Sent as 0; ignored on reception. Hop Count Set to 0. RREQ ID A sequence number uniquely identifying the particular RREQ. Increase it monotonically. Print it in server. Destination IP Address The IP address of the server. Destination Sequence Number The latest sequence number received in the past. Use 0 first time and subsequent messages from client should use the value returned by server in previous round. Originator IP Address The IP address of the client. Originator Sequence Number The current sequence number - monotonically increasing for client. Route Reply (RREP) Message Format -- Sent from server to client 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type |R|A| Reserved |Prefix Sz| Hop Count | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Destination IP address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Destination Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Originator IP address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Lifetime | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The format of the Route Reply message is illustrated above, and contains the following fields: Type 2 A Acknowledgment required; Reserved Sent as 0; ignored on reception. Prefix Size Set it to zero Hop Count The number of hops from the Originator IP Address to the Destination IP Address. Set it to any number and print this in client. Destination IP Address The IP address of the server for which a route is supplied. Destination Sequence Number The destination sequence number associated to the route - server increases this value monotonically when replying to a route request from client. Originator IP Address The IP address of the node which originated the RREQ (client) for which the route is supplied. Lifetime Set to 0. Group 1: Implement as a TCP concurrent server with processes Group 2: Implement as a TCP concurrent server with threads Group 3: Implement as a TCP iterative server with select