# NDN network 1. [Brief NDN Introudction](https://www.cs.princeton.edu/courses/archive/fall18/cos561/papers/NDN18.pdf) 2. [Detail and Comprehensvie NDN Survey Paper](https://www.sciencedirect.com/science/article/pii/S1574013715300599?ref=pdf_download&fr=RR-2&rr=8617ad640e58843c) 3. [A tutorial survey on vehicular communication state of the art, and future research directions](https://www.sciencedirect.com/science/article/pii/S2214209618300901?ref=pdf_download&fr=RR-2&rr=87f801de5db78445) 4. [VANET via named data networking](https://ieeexplore.ieee.org/document/6849267) 5. [Named Data Networking in Vehicular Ad Hoc Networks: State-of-the-Art and Challenges](https://ieeexplore.ieee.org/abstract/document/8624354) 6. [美國放棄dsrc 轉向 c-v2x](https://www.ttia-tw.org/letters.php?wshop=ttia&Opt=detailed&tp=&lang=zh-tw&letters_id=2250774) ## zenoh_trace ### publisher ``` use zenoh::prelude::r#async::*; #[async_std::main] async fn main() { let session = zenoh::open(config::default()).res().await.unwrap();(1) session.put("key/expression", "value").res().await.unwrap();(2) session.close().res().await.unwrap();(3) } ``` (1)zenoh::open will return a config_builder, config stores information including id, medtadata, whoamI,connecting node,and so on. (detail in commons/zenog-config/src/libs) ![config_interface](https://hackmd.io/_uploads/HyYSGnIR6.png) Config stores connect and listen in node vector. Each node is EndPoint which records protocol, address, metadata, config.(detail in common/zenoh-protocol/endpoint.rs) ![Endpoint](https://hackmd.io/_uploads/HyhWN38Ca.png) What's more, ScoutingConf(include ScoutingMulticastConf and GossipConf) and RoutingConf parameter are set here, but their implementation is not here. In (zenoh/scouting.rs) ![scout](https://hackmd.io/_uploads/HJ0NUpLAT.png) It call Runtime::scout to send Udp packet.(in line 312) scout message ![scout message](https://hackmd.io/_uploads/ryd4R6PAa.png) In response to a scout message, a node will respond to Hello to show that it is reachable.(in commons/zenoh-protocol/scouting/hello.rs) ![hello](https://hackmd.io/_uploads/SJQyKa8RT.png) In Hello message, it consists of "locator". Locator have its node's <key1> = <value1>... information.(in commons/zenoh-protocol/core/locator.rs) ![locator](https://hackmd.io/_uploads/r1ZZzRv0T.png) Declare Interest message indicates what kind of key they want. For example, they could collect what node subscribes explicit key.(in commons/zenoh-protocl/network/declare.rs) ![declare interest](https://hackmd.io/_uploads/Sk-oDAv0T.png) (2)-1 session.put will call PutBuilder and call PublisherBuilder(in zenoh/session.rs). PublisherBuilder is to initialize Publisher.(in zenoh/publication.rs) ![Publisher](https://hackmd.io/_uploads/BkxostIC6.png) Publisher will call Publication which calls resolve_put(in zenoh/publication) ![resolve_put](https://hackmd.io/_uploads/HytTaY8Rp.png) send_push is in (zenoh/session.rs),there different type, but handle_data (in zenoh/session.rs) always be called in the end. ![handle_data](https://hackmd.io/_uploads/Hke-J9U06.png) Then finally it will use callbacks to push data. callbacks is SingleOrVec which is in (commons/zenoh-collections/single_or_vec.rs) (2)-2 matching_listener (undo) in (zenoh/publication) ![matching_listener example](https://hackmd.io/_uploads/B19c-980p.png) (3)not intersting ### subscriber ``` use futures::prelude::*; use zenoh::prelude::r#async::*; #[async_std::main] async fn main() { let session = zenoh::open(config::default()).res().await.unwrap();(1) let subscriber = session.declare_subscriber("key/expression").res().await.unwrap();(2) while let Ok(sample) = subscriber.recv_async().await { println!("Received: {}", sample); };(3) } ``` (1) as mentioned above (2) ### listen v.s. connect ![listen v.s. connect](https://hackmd.io/_uploads/Sksd-TJyA.png) ## geonetworking and TSN for remote driving: 事先計算分配time sensitive networking sharper.