Okay, either you don't really know what you are doing, or you are not explaining it well.
You can research "client server c++" and then use libpcap to capture packets and separate them on one side, but that's about as much help as we can give you until you clarify your requirements a bit more.
hi,we have to implement the 2 algorithms given,
Algorithm 1 Adaptive Rate Control
1: ARC with Multi-rate Retransmission and AIMD ST Adjustment.
2: while receiving a packet P dequed from one of the FIFO queues do
3: NextHop = daddr(p);
4: P.dataRate = NextHop.dataRate;
5: send(P);
6: if recvACK() then
7: if retry == 0 then
8: Success++; Failure = 0; Recovery = 0;
9: if Success ≥ ST then
10: NextHop.dataRate ++;
11: Success = 0;
12: ST+ = α; Recovery = 1;
13: end if
14: else if retry > 0 then
15: Success = 0; Failure++;
16: oldRate = NextHop.dataRate;
17: if Failure ≥ FT || Recovery == 1 then
18: NextHop.dataRate −−;
19: Failure = 0;
20: end if
21: if Recovery == 1 then
22: ST+ = α;
23: else if oldRate < NextHop.dataRate then
24: ST/ = β;
25: end if
26: Recovery = 0;
27: end if
28: end if
29: if ACKtimeout() then
30: P.dataRate = lookupMultirateRetry();
31: if retry < retryLimit then
32: retry ++; retransmit(P);
33: else
34: Error++; Success = 0; Failure = 0;
35: Recovery = 0; drop(P);
36: end if
37: end if
38: end while
in the first algorithm we send packets and receive the ACK,if 10 packets sent and only got 2 ACKs we reduce the data rate and send and the process continues..
and in the second algorithm we give the 1st algorithm as a input to the second and schedule the packets..
Algorithm 2 Weighted Fair Scheduling
1: Weighted Fair Scheduling: Gi
wi
=
Gj
wj
, ∀1 ≤ i, j ≤ N.
2: while receiving a packet P from the upper layer do
3: Enque(P);
4: if not blocked then
5: return P = Dequeue();
6: end if
7: end while
1: void Enque(P):
2: qid = findEnqueID(P.daddr());
3: flowQueue[qid].enque(P);
1: Packet* Dequeue():
2: if has not dequed any packet then
3: init_wi();
4: else
5: update_wi() using stochastic approximation;
6: end if
7: for all NextHopi do
8: compute Gi = E[Gi(ri, si)] by (1);
9: WeightedG[i] = ciGi;
10: end for
11: qid = selectBest(WeightedG[ ]);
12: return flowQueue[qid].deque();
please do help..we do this in C++ LINUX environment