You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now we can let root take over, and have it automatically discover the route.
86
+
87
+
We simply let root generate routing packets, and simulate sending them to the other nodes. In a real network, these packets need to be serialized and sent over the network.
// deliver the routing packet. in this simple example, the link isn't really used. in a real network, this link will give us information on how to send the packet
98
+
ifletSome(node) =nodes.get_mut(dest.as_str()){
99
+
node.handle_packet(&packet, &link, &dest).expect("Failed to handle packet");
100
+
}
101
+
}
102
+
103
+
fornodeinnodes.values_mut(){
104
+
node.full_update(); // performs route table calculations, and writes routing updates into outbound_packets
105
+
}
106
+
107
+
// lets observe bob's route table:
108
+
println!("Bob's routes in step {step}:");
109
+
for (neigh, Route::<SimpleExample>{ metric, next_hop, .. }) in&nodes["bob"].routes{
0 commit comments