|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgps.protocol.BT.algorithm.BTAlgorithmReChoking
public class BTAlgorithmReChoking
BT Rechoking algorithm. Choking is based on session rather than node. i.e. it considers only connections for that file Choking algorithm should meet several criteria: It should cap the number of simultaneous uploads for good TCP performance. It should avoid choking and unchoking quickly, known as 'fibrillation' It should reciprocate to peers who let it download. It should try out unused connections once in a while to find out a better one, i.e. optimistic unchoking.
| Field Summary | |
|---|---|
static int |
DEFAULT_RECHOKING_INTERVAL
default rechoking interval |
static int |
DEFAULT_UNCHOKE_NUMBER
default peer number that each session can unchoke |
| Constructor Summary | |
|---|---|
BTAlgorithmReChoking(BTSession session)
constructs rechoking object |
|
BTAlgorithmReChoking(BTSession session,
int n,
int i)
chonstructs rechoking object with unchoke number and unchoke interveral set |
|
| Method Summary | |
|---|---|
int |
getUnchokeNum()
gets unchoke num set for this simulation |
boolean |
handle(SimEvent e)
handles rechoking events |
boolean |
isRunning()
check running status |
void |
nextSchedule()
sets up next rechoking event |
void |
run()
starts rechoking |
java.lang.String |
toString()
gets string description |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_UNCHOKE_NUMBER
public static final int DEFAULT_RECHOKING_INTERVAL
| Constructor Detail |
|---|
public BTAlgorithmReChoking(BTSession session)
session - bt session this unchoking is working for
public BTAlgorithmReChoking(BTSession session,
int n,
int i)
session - bt session this unchoking is working forn - unchoke numberi - unchoke intervel| Method Detail |
|---|
public boolean isRunning()
public void run()
public int getUnchokeNum()
public boolean handle(SimEvent e)
handle in interface SimEventHandlere - rechoking event
public void nextSchedule()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||