diff options
author | Antonio Quartulli <ordex@autistici.org> | 2011-04-27 14:27:57 +0200 |
---|---|---|
committer | Sven Eckelmann <sven@narfation.org> | 2011-06-20 11:37:27 +0200 |
commit | cc47f66e6b9ec7e7d465f74739a6fc9844593894 (patch) | |
tree | 8fbda7f59267bca45f9e887d09ba1de2f3c62f8d /net/batman-adv/types.h | |
parent | a73105b8d4c765d9ebfb664d0a66802127d8e4c7 (diff) | |
download | blackbird-op-linux-cc47f66e6b9ec7e7d465f74739a6fc9844593894.tar.gz blackbird-op-linux-cc47f66e6b9ec7e7d465f74739a6fc9844593894.zip |
batman-adv: improved roaming mechanism
With the current client announcement implementation, in case of roaming,
an update is triggered on the new AP serving the client. At that point
the new information is spread around by means of the OGM broadcasting
mechanism. Until this operations is not executed, no node is able to
correctly route traffic towards the client. This obviously causes packet
drops and introduces a delay in the time needed by the client to recover
its connections.
A new packet type called ROAMING_ADVERTISEMENT is added to account this
issue.
This message is sent in case of roaming from the new AP serving the
client to the old one and will contain the client MAC address. In this
way an out-of-OGM update is immediately committed, so that the old node
can update its global translation table. Traffic reaching this node will
then be redirected to the correct destination utilising the fresher
information. Thus reducing the packet drops and the connection recovery
delay.
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/types.h')
-rw-r--r-- | net/batman-adv/types.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h index 3b642a9e086e..9c84fa9f0968 100644 --- a/net/batman-adv/types.h +++ b/net/batman-adv/types.h @@ -81,6 +81,12 @@ struct orig_node { int16_t tt_buff_len; spinlock_t tt_buff_lock; /* protects tt_buff */ atomic_t tt_size; + /* The tt_poss_change flag is used to detect an ongoing roaming phase. + * If true, then I sent a Roaming_adv to this orig_node and I have to + * inspect every packet directed to it to check whether it is still + * the true destination or not. This flag will be reset to false as + * soon as I receive a new TTVN from this orig_node */ + bool tt_poss_change; uint32_t last_real_seqno; uint8_t last_ttl; unsigned long bcast_bits[NUM_WORDS]; @@ -153,6 +159,12 @@ struct bat_priv { atomic_t ttvn; /* tranlation table version number */ atomic_t tt_ogm_append_cnt; atomic_t tt_local_changes; /* changes registered in a OGM interval */ + /* The tt_poss_change flag is used to detect an ongoing roaming phase. + * If true, then I received a Roaming_adv and I have to inspect every + * packet directed to me to check whether I am still the true + * destination or not. This flag will be reset to false as soon as I + * increase my TTVN */ + bool tt_poss_change; char num_ifaces; struct debug_log *debug_log; struct kobject *mesh_obj; @@ -167,6 +179,7 @@ struct bat_priv { struct hashtable_t *tt_local_hash; struct hashtable_t *tt_global_hash; struct list_head tt_req_list; /* list of pending tt_requests */ + struct list_head tt_roam_list; struct hashtable_t *vis_hash; spinlock_t forw_bat_list_lock; /* protects forw_bat_list */ spinlock_t forw_bcast_list_lock; /* protects */ @@ -174,6 +187,7 @@ struct bat_priv { spinlock_t tt_lhash_lock; /* protects tt_local_hash */ spinlock_t tt_ghash_lock; /* protects tt_global_hash */ spinlock_t tt_req_list_lock; /* protects tt_req_list */ + spinlock_t tt_roam_list_lock; /* protects tt_roam_list */ spinlock_t gw_list_lock; /* protects gw_list and curr_gw */ spinlock_t vis_hash_lock; /* protects vis_hash */ spinlock_t vis_list_lock; /* protects vis_info::recv_list */ @@ -219,8 +233,9 @@ struct tt_global_entry { uint8_t addr[ETH_ALEN]; struct orig_node *orig_node; uint8_t ttvn; - /* entry in the global table */ - struct hlist_node hash_entry; + uint8_t flags; /* only TT_GLOBAL_ROAM is used */ + unsigned long roam_at; /* time at which TT_GLOBAL_ROAM was set */ + struct hlist_node hash_entry; /* entry in the global table */ }; struct tt_change_node { @@ -234,6 +249,13 @@ struct tt_req_node { struct list_head list; }; +struct tt_roam_node { + uint8_t addr[ETH_ALEN]; + atomic_t counter; + unsigned long first_time; + struct list_head list; +}; + /** * forw_packet - structure for forw_list maintaining packets to be * send/forwarded |