make rhizome over mdp block size configurable.

1K seems too big to be reliable on our prototype UHF radio links,
as CRCs fail almost all the time. #48
This commit is contained in:
gardners 2013-02-17 17:01:23 +10:30 committed by Jeremy Lakeman
parent 57013c3a03
commit a23612428b
3 changed files with 27 additions and 2 deletions

View File

@ -312,6 +312,7 @@ ATOM(int, enable, 1, cf_opt_int_boolean,, "If true, server
STRING(256, datastore_path, "", cf_opt_absolute_path,, "Path of rhizome storage directory, absolute or relative to instance directory")
ATOM(uint64_t, database_size, 1000000, cf_opt_uint64_scaled,, "Size of database in bytes")
ATOM(uint64_t, max_internal_blob_size, 10000000000, cf_opt_uint64_scaled,, "Size of largest bundle to store internally in database.")
ATOM(uint64_t, rhizome_mdp_block_size, 512, cf_opt_uint64_scaled,, "Rhizome MDP block size.")
ATOM(uint32_t, fetch_delay_ms, 50, cf_opt_uint32_nonzero,, "Delay from receiving first bundle advert to initiating fetch")
SUB_STRUCT(rhizome_direct, direct,)
SUB_STRUCT(rhizome_api, api,)

View File

@ -1118,7 +1118,8 @@ static int rhizome_fetch_mdp_touch_timeout(struct rhizome_fetch_slot *slot)
// 266ms @ 1mbit (WiFi broadcast speed) = 32x1024 byte packets.
// But on a packet radio interface at perhaps 50kbit, this is clearly
// a bad policy. Ideally we should know about the interface speed
// and adjust behaviour accordingly.
// and adjust behaviour accordingly. Also the packet size should be smaller
// on lossy links. 1K packets seem to get through only very rarely.
// For now, we will just make the timeout 1 second from the time of the last
// received block.
unschedule(&slot->alarm);
@ -1270,7 +1271,7 @@ static int rhizome_fetch_switch_to_mdp(struct rhizome_fetch_slot *slot)
slot->mdpIdleTimeout=RHIZOME_IDLE_TIMEOUT; // give up if nothing received for 5 seconds
slot->mdpRXBitmap=0x00000000; // no blocks received yet
slot->mdpRXBlockLength=1024;
slot->mdpRXBlockLength=config.rhizome.rhizome_mdp_block_size; // Rhizome over MDP block size
rhizome_fetch_mdp_requestblocks(slot);
} else {
/* We are requesting a manifest, which is stateless, except that we eventually

View File

@ -283,6 +283,29 @@ test_FileTransferMultiMDP() {
done
}
doc_FileTransferBigMDPExtBlob="Big new bundle transfers to one node via MDP, external blob file"
setup_FileTransferBigMDPExtBlob() {
setup_common
set_instance +B
executeOk_servald config set rhizome.http.enable 0
set_instance +A
executeOk_servald config set rhizome.http.enable 0
dd if=/dev/urandom of=file1 bs=1k count=16k 2>&1
echo x >>file1
ls -l file1
rhizome_add_file file1
start_servald_instances +A +B
foreach_instance +A assert_peers_are_instances +B
foreach_instance +B assert_peers_are_instances +A
}
test_FileTransferBigMDPExtBlob() {
wait_until bundle_received_by $BID:$VERSION +B
set_instance +B
executeOk_servald rhizome list
assert_rhizome_list --fromhere=0 file1
assert_rhizome_received file1
}
doc_FileTransferMultiMDPExtBlob="New bundle transfers to four nodes via MDP, external blob files"
setup_FileTransferMultiMDPExtBlob() {
setup_common