diff --git a/docs/lectures/acn/01_intro.md b/docs/lectures/acn/01_intro.md new file mode 100644 index 0000000..3776395 --- /dev/null +++ b/docs/lectures/acn/01_intro.md @@ -0,0 +1,79 @@ +### Module contents + +##### Part 1 + +* Mobile Ad Hoc Networks (MANETs) +* Delay/Disconnection Tolerant Networks (DTNs) +* Vehicular Ad Hoc Networks (VANETs) + +##### Part 2 + +* Network experimentation, criteria and evaluations. This part is to help with coursework + +##### Part 3 + +* Peer to Peer (P2P) +* Content Centric Networks (CCNs) +* Information Centric Networks (ICNs) + +##### Part 4 + +* Software Defined Networks (SDNs) and Applications + +# Mobile Social Networks + +They have two parts: physical part and a social part + +Social structures are vital for these networks - think covid tracking networks + +![p2p](/lectures/acn/img/a.png) + +Clouds have multiple layers + +* Network interfaces + * Request & accept sensor data + * resource management + * communicate with other clouds +* Processing layer + * Store raw data + * filter noise +* Analysing layer + * produce trend chart + * learn & predict user behaviour +* Services + * Interactive dashboard + * notification service + * sharing access + + + +## Vehicle Ad Hoc Networks + +Have social characteristics as they are driven by humans + +VANETs may refer to robots or drones. + +This can be used to exchange warning and beacon messages via V2V (vehicle to vehicle) as well as V2I (vehicle to infrastructure) channels. + +### Fully autonomous Vehicles + +![img](/lectures/acn/img/b.png) + +Vehicles can connect to the cloud and share & request information to help other vehicles. + +![img](/lectures/acn/img/c.png) + +An example of transient clouds - in this case vehicular clouds. + +This can be useful for informing cars behind about congestion. This is real time communication (order of ms which is needed for when cars are moving at 70 mph), cloud communication is not fast enough, due to the data needing to be processed before shared. + +## Challenges + +* Optimal forwarding/routing +* Congestion avoidance and control +* Security and privacy aware communications + * black & grey hole attacks +* Energy efficient communications + * Important for mobile devices & electric cars +* Service provision + * Location based services diff --git a/docs/lectures/acn/02_MANET_and_DTN.md b/docs/lectures/acn/02_MANET_and_DTN.md new file mode 100644 index 0000000..5527929 --- /dev/null +++ b/docs/lectures/acn/02_MANET_and_DTN.md @@ -0,0 +1,70 @@ +# Mobile Ad Hoc Networks (MANETs) + +* An infrastructure-less network formed by mobile wireless nodes +* Nodes in MANET can communicate via single or multi-hop approach (due to absence of centralised network infrastructure) +* Nodes operate as clients, routers and servers at the same time to forward packets +* The mobility of nodes results in frequent and unpredictable changes in network topology + +One of the core features of a MANET node is the ability to autonomously connect to other nodes and configure itself for data transmission over the network. + + +#### MANET Routing + +* Mobile wireless nodes create a temporary connection between them to forward data +* Because some nodes may not be cooperative or faulty, they may drop/compromise packets +* Typically routing is split into **route discovery** and **actual data transmission**. + * Nodes have to self organise in order to route. + +![img](/lectures/acn/img/d.png) + +(green boxes is route chosen) + +The source has a limited range of nodes it can detect, it cannot send it direct to the destination as it doesn't know where the destination is. Hops are decided by communication protocols. + +#### Proactive MANETs + +* Also known as table driven routing protocol +* Nodes in the network maintain a comprehensive routing information of the network + * This is done by spreading network status information to nodes and tracking changes in network topology - think the network is constantly pinged + * These status updates can slow the network with the traffic +* Useful if the network is not that large + +#### Reactive MANETs + +* Also known as on-demand routing +* Network nodes only store information of paths to destination nodes +* Nodes delay the search for routes to new destinations in order to reduce communication overheads + * i.e. if a route is found between A and B, this route will be stored and not recalculated +* May be slower, as a shorter path may not be used + +#### Hybrid MANETs + +* Hybrid protocols combine the advantages of proactive and reactive protocols to reduce traffic overheads and route discovery delays + +Table showing all different protocols of MANETs + +![img](/lectures/acn/img/e.png) + +### Delay/Disconnection Tolerance + +Traditional MANET routing protocols like DSR and AODV (both reactive) cannot work in intermittent infrastructure-less environments because they require a complete path from source to destination for communication. + +* Messages get dropped at intermediate nodes when the link to the next hop is none existent in MANETs +* DTNs expand MANETs to allow more intermittent and sparse connections of nodes caused by node mobility or low transmission range. + +#### Store-carry-forward Paradigm + +* DTN routing protocols allow forwarding of messages by using a 'store-carry-forward' approach. + * messages are stored by nodes and moved in hops throughout the network until messages reach their destination + * This approach is used by DTN routing protocols to increase the probability of message delivery. + +#### DTN Protocol Classifications + +##### Flooding based + +* Flooding based routing protocols spread a message and have multiple copies of the message in the network. +* This is done to increase the probability of messages reaching their destination and also decrease the time of delivery + +##### Forwarding based + +* Forwarding based routing protocols gather information about the nodes in a network to select the best path to forward messages with the aim of enhancing message delivery networks with limited resources. diff --git a/docs/lectures/acn/03_VANET_and_DTN.md b/docs/lectures/acn/03_VANET_and_DTN.md new file mode 100644 index 0000000..5eb6d67 --- /dev/null +++ b/docs/lectures/acn/03_VANET_and_DTN.md @@ -0,0 +1,102 @@ +# Vehicular Ad Hoc Networks + +* VANETs are a special type of Mobile Ad Hoc network which is used to + * provide communication between vehicles that are nearby (V2V) + * between vehicles on the road and fixed infrastructures on the roadside (V2I) +* VANETs provide complementary approach for intelligent transport system (ITS) and are characterised by **high node mobility** and the limited degree of freedom in the mobility patterns. + +##### Categories of information + +1. Safety application information + * e.g. information regarding an accident that has just occurred + * the current conditions of the road +2. Convenience application + * traffic information + * parking availability +3. Commercial application for pleasure + * games + * real-time video relay + +### Why do VANETs need different protocols to MANETs + +###### Large scale + +> All vehicles on the road are potential nodes in the VANET. + +###### Predictive Mobility + +> The nodes in a VANET cannot follow arbitrary direction, they have to stay on the road and cannot suddenly change their direction. + +###### High Mobility + +> The network mobility in a VANET changes rapidly due to vehicular speeds. + +###### Partitioned Network + +> The ranges of wireless communication used in V2V networks is near 1 km but vehicles can get disconnected. Can be thought of many disconnected networks. + +The nodes in the VANET can move at **high speeds** which **reduces transmission capacity**, this causes the following issues: + +* **Rapid changes in the network topology** because the state of connectivity between nodes is dynamically changing. + +* **Occasional disconnections due to low traffic density**. This keeps the nodes distant from each other and results to **link failure** that could last for awhile. + +* **Node congestion**, a high traffic situation which affects protocol performance. + +### WAVE IEEE 802.11p + +WAVE - Wireless Access for Vehicular Environment + +* In WAVE vehicles communicate in a **hop by hop** manner with each other +* The area of coverage for the WAVE node is limited to 300m-800m + * Beyond this range cars cannot communicate + +If there is dense traffic in the coverage region, **nodes become easily congested** because all nodes will be transmitting the same message to every other node. + +> To overcome the limitation of restricted coverage region, the use of DTNs was implemented which uses a **store-carry-forward paradigm**. +> +> With the store-carry-forward approach, a vehicle stores a message in a buffer and carries the message with it. When it comes into contact with another node, it forwards the message. +> +> * This introduced the idea of the **Vehicular Delay Tolerant Network (VDTN)** concept + +#### Vehicular Delay Tolerant Network (VDTN) + +VDTNs enable communication in the face of connectivity issues such as + +* long and variable delay +* sparse and intermittent connectivity +* high error rates +* high latency +* high asymmetric data rate + +Communication is made possible in the network when intermediate nodes become **custodians** of the message being transmitted and then forward the message only when a opportunity arises. + +###### Fixed DTN nodes + +* The stationary or relay nodes have store and forward capabilities and are located at **road-side intersections** (road side units) +* They allow mobile nodes that pass by to collect and leave data on them. +* They contribute to increasing the frequency of node contacts and improve **delivery ratio** and **delivery delay**. + +![img](/lectures/acn/img/f.png) + +## Categories of VANETs + +##### Pure cellular/WLAN + +> Pure cellular VANETs may use **fixed cellular gateways and WiMAX access points at road** intersections to gather information +> +> * note these road side gateways may not be feasible due to cost of infrastructure +> +> The information collected from sensors of a vehicle in the VANET can become valuable in notifying other nodes about the situation of the traffic in the network. + +##### Pure Ad-Hoc + +> Pure Ad-Hoc architecture is **not reliant** on infrastructure nodes +> +> In this architecture, nodes perform vehicle to vehicle (V2V) communication with each other. + +##### Hybrid + +> The hybrid category is a combination of the first two. It provides a richer content and offers great **flexibility in the sharing of data** +> +> * Some vehicles with WLAN and cellular capabilities may be used as **gateways** and **mobile routers** so that vehicles with only WLAN capabilities can interact and communicate effectively with them via multi-hop links. diff --git a/docs/lectures/acn/04_DTN_Protocols.md b/docs/lectures/acn/04_DTN_Protocols.md new file mode 100644 index 0000000..ac41961 --- /dev/null +++ b/docs/lectures/acn/04_DTN_Protocols.md @@ -0,0 +1,65 @@ +# DTN Protocols + +### Forwarding Based + +Where each message may only be under the custody of a single node. + +* Upon forwarding the message, the receiving node also takes on the responsibility of custody. +* This means there will exist only one copy of the message within the network at any period of time. + +#### Direct Transmission + +* Direct transmission is the simplest single-copy forwarding protocol possible. +* Once the source has generated a message, it will retain custody and carry it until it encounters the destination. +* Once a connection with the destination is established, the message is forwarded directly + * This uses minimal resources + * Has unbounded amounts of latency + * Probability of a message being delivered is only as likely as the probability of the node encountering the destination node + +#### First Contact + +* First contact is a single-copy based forwarding protocol - it randomly chooses a node out of all possible nodes and forwards as many messages as possible to that node. +* If no connections are available, the first encountered node will be used. +* Once the message(s) are sent, the messages on the original node are deleted, relinquishing custody to the new node. +* This protocol routes messages throughout the network via a random walk pattern. + * This can lead to packets being routed to dead ends. + * Packets can make negative progress or getting stuck in a loop. + +### Replication Based + +Replication-based protocols disseminate messages throughout the network via replication of the messages. + +* When one node encounters another, it will forward the message while retaining the local copy it has. + * The existence of multiple copies increases the probability of message delivery and reduces latency. + * The more nodes carrying the message, the more chance one node encounters the destination. +* However this also means there are many redundant messages on the network - therefore more resources are needed. + +#### Epidemic + +* Utilising the flooding concept, Epidemic aims to achieve message delivery by flooding the network with message copies. +* When any two nodes meet, they compare messages. + * They then exchange messages they do not have in common + * This is repeated allowing the messages to spread similar to an epidemic. +* This method achieves minimal latency & high delivery probabilities however suffers from limited resources. + +#### MaxProp + +* Like epidemic, maxprop floods the network, however each message has a priority. + * Messages stored in a **ordered-queue** in the **message buffer**. + * Messages with a higher probability of being delivered have a higher priory of being forwarded first. +* To determine the probability, it looks at **history of encounters**, maintaining a vector with **tracks the likelihood of the node encountering any other node in the network**. + * When two nodes meet, they exchange messages and vectors, updating their own local copy. + * These vectors are then used to compute the shortest path for each message, messages are then ordered within the buffer by destination cost. +* MaxProp uses overhead messages to acknowledge when a message has reached it destination + * Once this ACK signal is received, all local copies of redundant messages are dropped. + +#### PROPHET + +Probabilistic Routing Protocol using History of Encounters and Transitivity (PRoPHET) + +* PROPHET maintains a vector that keeps track of a history of the encountered nodes. +* It uses this vector to calculate the probability of a message copy reaching its destination by being forwarded to a particular node. + * When a source node forwards a message copy, it selects a subset of nodes that it can possibly send to. + * The algorithm then **ranks these nodes** based on the calculated probabilities, with the copy being forwarded to the highest ranked nodes first. +* This is effective however the routing tables **rapidly grow** as a result of the amount of information on the nodes required to calculate the probability predictions. + diff --git a/docs/lectures/acn/05_DTN_advanced_protocols.md b/docs/lectures/acn/05_DTN_advanced_protocols.md new file mode 100644 index 0000000..0a07018 --- /dev/null +++ b/docs/lectures/acn/05_DTN_advanced_protocols.md @@ -0,0 +1,44 @@ +# DTN Protocols - Advanced + +**Rate control** - addresses easing network congestion by controlling the rate of traffic on the network. + +**Adaptive forwarding** - to direct traffic away from congestion hot spots. + +#### Spray and Focus + +* Spray and focus replicates an allowable number of messages from source in the spray phase. +* **The focus phase allows** each node to forward a copy of its messages to other potential nodes until the messages gets to its destination. +* The protocol uses a single-copy utility based routing scheme to forward a copy of the message further. +* Forwarding decisions are made based on **timers** which record the times nodes come in communication range of each other. +* Node $$A$$ forwards message with destination $$D$$ to node $$B$$ , **if and only if** $$B$$ has a higher potential of delivering the message to $$D$$. + +#### SimBet + +* A source node with no prior knowledge of the destination node will forward a message to a more central node that has the potential of finding a suitable relay node. + * A central node has the ease of connecting other nodes in a network. + * This is known as **centrality** a measure of the **structural importance** of a node in a network. +* A central node uses **similarity and betweenness centrality** to avoid unnecessary information exchange in the entire network. +* SimBet maintains a single copy of each message in the network to reduce resource overheads. + +### Replication Management + +Replication Management refers to easing network congestion by managing the amount and frequency that messages are replicated. + +* This is particularly notable concern as it is often the replication of messages that leads to congestion in DTNs, with surplus and redundant messages causing wastage within node message buffers. + +#### Café + +* Congestion Aware Forwarding Algorithm (Café) + * Single-copy + * Adaptive forwarding techniques - to reduce network congestion by directing traffic away from nodes experiencing congestion to less congested areas of the network. + * Uses **Contact Manager** and **Congestion Manager** + +**Contact Manager** - deals with nodes forwarding heuristics, updating statistics for each contact such as frequency and duration's. + +**Congestion Manager** - focuses on calculating the availability of nodes, keeping and updating a record of information such as the amount of available buffer and delays expected from each contacted node. + +#### CafREP + +* Congestion Aware Forwarding and Replication (CafREP) + * replication-based + * builds on Cafe protocol by coalescing the proposed **adaptive forwarding algorithm with an adaptive replication management technique** diff --git a/docs/lectures/acn/06_DTN_congestion_control.md b/docs/lectures/acn/06_DTN_congestion_control.md new file mode 100644 index 0000000..a8e6715 --- /dev/null +++ b/docs/lectures/acn/06_DTN_congestion_control.md @@ -0,0 +1,96 @@ +# Framework for Congestion Control in Delay Tolerant Opportunistic Networks + +DTNs mainly focus on increasing the probability to deliver to the destination and on minimising delays + +* Using complex graph theory techniques +* Where load is unfairly distributed towards the better connected nodes +* May lead to network congestion + +## CAFREP + +CAFREP or Congestion Aware Forwarding and Replication + +* Detects the congested nodes and parts of the network +* Moves the traffic away from hot-spots and spreads it around while preserving the directionality of the traffic and not overwhelming non-interested nodes with unwanted content +* Adaptively change message replication rates + +When deciding on the best carrier and the optimal number of messages, CAFREP dynamically combines three heuristics + +1. **Contact** analytics +2. Predictive **node congestion** (node storage and in-network delays) +3. Predictive **ego network congestion** + +![img](/lectures/acn/img/g.png) + +Each layer you go up, the more information is exchanged between the nodes. + +### Metrics + +###### Node Retentiveness + +- Aims to avoid or replicate proportionally less at the **nodes** that have lower buffer availability. + +$$ +Ret(X) = B_c(X) - \sum^N_{i=1} \space M^i_{size}(X) +$$ + +For a node $$X$$, it has buffer of size $$B_c(X)$$. When a message of size $$M^i_{size}$$ is sent to node $$X$$, it's buffer size is the total buffer minus the memory taken by the sum of all messages in the buffer. + +###### Node Receptiveness + +- Aims to avoid or decrease sending rates to the **nodes** that have higher in network delays + +$$ +Rec(X) = \sum^N_{i=1}(T_{now} - M^i_{received}(X)) +$$ + +How long a node keeps a message before forwarding it on. If a high level of receptiveness is found on a node, it means the node isn't useful as messages aren't forwarded. Could mean the node has limited connections. + +###### Node Congestion Rate + +- Aims to avoid or decrease sending rates to **nodes** that congest at the higher rate + +$$ +CR(X) = \frac{100\cdot T_{FullBuffer}(X)/T_{TotalTime}(X)}{\frac{1}{N}\cdot \sum^N_{i=1}(T_iend(X) - T_istart(X))} +$$ + +Estimates the time between a node being full and full again. Measures the time the node is unusable. + +#### Ego Network Congestion Metrics + +###### Ego Network Retentiveness + +* Aims to replicate less at the **parts of the network** with lower buffer availability. + +$$ +EN_{Ret}(X) = \frac{1}{N}\sum^N_{i=1}Ret(C_i(X)) +$$ + +Gets the average of the retentiveness of node $$X$$ and it's neighbours $$c_i(X)$$ + +###### Ego Network Receptiveness + +* Aims to replicate less at **parts of the network** with higher delays. + +$$ +EN_{Rec}(X) = \frac{1}{N}\sum^N_{i=1}Rec(c_i(X)) +$$ + +###### Ego Network Congestion Rate + +- Aims to send less to the **parts of the network** that have higher congestion rates. +- This is useful as if a node isn't congested, but all connected nodes are. It stops it from being used. + +$$ +EN_{CR}(X) = \frac{1}{N}\sum^N_{i=1}CR_i(X) +$$ + +#### Contents of CAFREP Node + +![img](img/h.png) +$$ +Replication\space rate = M \times \frac{TotalUtil(Y)}{TotalUtil(X) + TotalUtil(Y)} +$$ +Total utility, changes constantly. The replication limit grows to take advantage of all available resources, and backs off when congestion increases. + +Social utility prevents replication at a high rate on free nodes that are not on the path to the destination. diff --git a/docs/lectures/acn/07_information_centric_networks.md b/docs/lectures/acn/07_information_centric_networks.md new file mode 100644 index 0000000..d77f57f --- /dev/null +++ b/docs/lectures/acn/07_information_centric_networks.md @@ -0,0 +1,102 @@ +# Information Centric Networks + +#### Problems with today's Networks + +* URLs and IP addresses are overloaded with locator and identifier functionality. +* No consistent way to keep track of *identical copies*. +* Information dissemination is inefficient. + * Cannot benefit from existing copies + * Can lead to problems like Flash-Crowd effect and Denial of service +* Can't trust a copy received from an un-trusted node + * Security is host-Centric + * Based on *securing channels* (encryption) and trusting servers (authentication) +* Application and content providers are independent of each other + * CDNs focus on web content distributions for major players + +![img](/lectures/acn/img/i.png) + +**Important requirements for ICNs** (Information Centric Networks) + +1. Accessing named resources - not hosts +2. Scalable distribution through replication and caching +3. Good control of resolution / routing and access + +## Content-based Routing for ICNs + +Apart from routing protocols that use direct identifiers of nodes, networking can take place based directly on content. + +* Content can be **collected** from the network, **processed** in the network and **stored** in the network. +* The goal is to provide a network infrastructure capable of providing services better suited to today's application requirements + * Content distribution and mobility + * More resilience to disruption and failures + +#### Network Evolution + +**Traditional networking** + +- Host-Centric communications, addressing and end-points + +**ICNs** + +- Data-Centric communications addressing information +- Decoupling in space - neither sender nor receiver need to know their partner. +- Decoupling in time - *answer* not necessarily directly triggered by a *question*. **asynchronous communication**. + +#### Approach + +* Named Data Objects (NDOs) +* In-network caching/storage +* Multi-party communication through replication +* Senders decoupled from receivers + +### Dissemination Networking + +* Data is requested by name, using any and all means available (IP, VPN tunnels, multi-cast, proxies etc) +* Anything that hears the request and has a valid copy of the data can respond. +* The returned data is signed, and optionally secured, so its integrity & association with name can be validated (data-Centric security) + +![ICN Stack](img/j.png) + +* Change of network abstraction from **named host** to **named content** (content chunks). +* Security is built in - **secures content** and **not the hosts**. +* **Mobility** is present by design. +* Can handle **static** and **dynamic** content. + +#### Naming Data + +###### Solution 1 - Name the data + +- **Flat** - non human readable identifiers + - `1HJKRH535KJH252JLH3424JLBNL` +- **Hierarchical** - meaningful structured names + - `/nytimes/sport/baseball/mets/game0224143` + +###### Solution 2 - Describe the data + +- With a set of tags + - `baseball, new york, mets` +- With schema that defines attributes, values and relations among attributes + +##### Using Names in CCNs (Content Centric Networks) + +- The hierarchical structure is used to do *longest match look-ups* which guarantees $$log(n)$$ state scaling for globally accessible data. +- Although CCN names are longer than IP identifiers, their **explicit structure** allows look-ups as efficient as IP's. + +### ICN Forwarding + +* Consumer *broadcasts* and *interest* over all available communication media +* Interest identifies a *collection of data* whose name has the interest as a prefex. +* Anything that hears the interest and has an element of the collection can respond with that data. + +### ICN Transport + +* Data that matches an interest, *consumes* it. +* Interest must be re-expressed to get new data. + * Controlling re-expressions allows for traffic management and congestion control. +* Multiple (distinct) interests in the same collection may be expressed + +### ICN Caching + +* Storage and caching are integral part of the ICN service +* All nodes potentially have caches. Requests for data can be satisfied by any node holding a copy in it's cache. +* ICN combines caching at the network edge with in-network caching. diff --git a/docs/lectures/acn/08_content_centric_networks.md b/docs/lectures/acn/08_content_centric_networks.md new file mode 100644 index 0000000..5822879 --- /dev/null +++ b/docs/lectures/acn/08_content_centric_networks.md @@ -0,0 +1,96 @@ +# Content Centric Networks + +A Brief History of Networking + +- Gen 1. The **phone system** (focus on the **wires**) + - The utility of the system depends on running wires to every home & office. + - Wires are the dominant cost. + - A *call* is not the conversation, its the **PATH** between two end-office line cards. + - A *phone number* is not the name/address of the caller, its a **program** for the end-office switch fabric to build a path to the destination line card. + - switch board + - Path building is **non-local** and **encourages centralisation** and **monopoly**. + - Calls fail is any element in the path fails so reliability goes down exponentially as the system scales up. + - Data cannot flow until the path is set up so efficiency decreases with setup time. + +- Gen 2. The **Internet** (focus on the **endpoints**) + - Data sent in independent chunks and each chunk contains the name of the final destination. + - Nodes forward packets onward using routing tables. + - **ARPAnet** was built on top of the existing phone system. + +- Gen 3. **dissemination** (focus on the **data**) + +#### TCP/IP + +###### Pros + +- Adaptive routing lets system **repair failures** +- **Reliability increases exponentially** with **system size**. +- **No call setup** means **high efficiency** at any bandwidth and scale. +- Distributed routing supports any topology and tends to spread load and avoid a hierarchy's hot spots. + +###### Cons + +- *Connected* is a binary attribute. +- Becoming part of the internet requires a globally unique, globally know IP address that's topologically stable on routing time scales. + - Connecting is a heavy weight operation + - The net struggles with moving nodes + +#### Conversation and Dissemination + +Acquiring chunks of data (web pages, emails, videos etc) is not a conversation, it's *dissemination*. + +In a dissemination **the data matters**, not the supplier. + +- Data is request by name. +- Anything that hears the request, and has a valid copy can respond. +- The return data is signed, so integrity and association can be validated. + +CCN can run over and be run over anything e.g. IP. + +#### CCN Packets + +![img](/lectures/acn/img/l.png) + +**Interest** - similar to HTTP `GET` + +**Data** - similar to HTTP response + +#### Content Based Security + +Data packets are authenticated with digital signatures. + +![img](/lectures/acn/img/m.png) + +#### CCN Forwarding + +Consumer *broadcasts* and *interest* over all available communication media + +- e.g. `get '/parc.com/van/presentation.pdf'` +- response: `heres '/parc.com/van/presentation.pdf/p1' ` + +##### Names and Meaning + +* Like IP, CCN nodes imposes no semantics on names +* Meaning comes from **application**, **institution** and **global conventions** reflected in prefix forwarding rules. +* Globally meaningful name leveraging the DNS global naming structure + * `/parc.com/van/presentation.pdf` +* Local and context sensitive, it refers to different objects depending on the room you're in. + * `/thisRoom/projector` + +#### Strategy Layer + +* When you do not care who you are talking to, you don't care if they change +* When you are not having a conversation, there's no need to migrate conversation state. +* Multi-point gives you multi-interface for free. +* When all communication is locally flow balanced, your stack knows exactly whats working and how well. + +In the current Internet, Quality of Service (QoS) Problems are highly localised + +* Roughly half the problems are from serial dependencies created by queues +* The other half are caused from a lack of receiver based control over bottle-necked links. + +Unlike IP, CCN is **local**, don't have queues and receivers have complete control + +![img](/lectures/acn/img/n.png) + +Tree serves as transport state diff --git a/docs/lectures/acn/09_DTN_security.md b/docs/lectures/acn/09_DTN_security.md new file mode 100644 index 0000000..cef5da0 --- /dev/null +++ b/docs/lectures/acn/09_DTN_security.md @@ -0,0 +1,138 @@ +# Delay Tolerant Networks Security + +#### Applications of DTNs + +##### Interplanetary communication + +DTN in space + +> **Characteristics** +> +> * High intermittent connectivity +> * Extremely long message travel time +> * Delay: finite speed of light +> * Low Transmission reliability +> * Inaccurate position +> * Limited visibility +> * Low asymmetric Data Rate +> +> **Security** +> +> - CCSDS protocol +> - space End to End security +> - space end to end reliability + +##### Military + +> No consistent network infrastructure and frequent disruptions +> +> **Characteristics** +> +> * High intermittent connectivity +> * Mobility, destruction, noise & attacks, interference +> * Low transmission reliability +> * positioning inaccuracy +> * limited visibility +> * Low data rate +> +> **Security** +> +> - Mainly MANET security +> - Distribution of CAs (Certificate Authorities) in mobile ad hoc networks cannot provide military level security +> - Combining a self-organised approach with an off-line trusted third-party + +##### Rural Areas + +>Providing internet connectivity to rural/developing areas +> +>**Characteristics** +> +>- Intermittent connectivity +>- Mobility - sparse development +>- High propagation delay +>- Asymmetric data rate +> +>![img](/lectures/acn/img/p.png) +> +>**Security** +> +>- Standard cryptographic techniques such as PKI and transparent encrypted file systems + +- Disaster struck areas +- Disconnected kiosks in rural areas +- Remote sensing applications + +But also + +- Bulk data distribution in urban areas +- Sharing of individual contents in urban areas +- Mobile location-aware sensing application +- Social mobile applications + +#### DTN Security Goals + +Due to the resource-causticity that DTNs have, the focus is on protecting the DTN infrastructure from unauthorised access and use. + +* Prevent **access** by unauthorised applications. +* Prevent unauthorised applications from asserting control over DTN infrastructure. +* Prevent authorised applications from sending bundles at a rate or class of service for which they **don't have permissions for**. +* Detect and discard bundles that were sent from unauthorised applications/users. +* Detect and discard bundles who's headers have been modified. +* Detect and discard compromised entities. + +Secondary emphasis is on providing optional end-to-end security services to bundle applications. + +#### DTN Security Challenges + +* High round-trip times and disconnections + * Do not allow frequent distribution of a large number of certificates and encryption keys end-to-end. + * More scalable to use user's keys and credentials at neighbouring or nearby nodes. +* Delays or loss of connectivity to a key or certificate server + * Multiple certificate authorities desirable but not sufficient and certificate revocation not appropriate +* Long delays + * Messages may be valid for days/weeks, so message expiration may not be able to be depended on to rid the network of unwanted messages as efficiently as in other types of networks. +* Constrained Bandwidth + * Need to minimise the cost of security in terms of network overhead (header bits). + +###### Traditional PKI not applicable + +* Traditional symmetric cryptography approaches are not suitable for DTNs for two major reasons + * In PKI a user authenticates another users public key using a certificate + * This is not possible without online access to the receivers public key or certificates + * PKIs implement key revocation based on frequently updated online certificate revocation lists + * In the absence of instant online access to CAs servers, a receiver cannot authenticate the sender's certificate. + +###### Identity Based Cryptography not applicable + +Identity Based Cryptography (IBC) schemes where the public key of each entity is replaced by its identity and associated public formatting policies are not suitable for the security in DTNs + +- IBC does not solve the key management problem in DTNs +- It is not scalable because it assumes that a user must know the public parameters for all the trusted parties. + +###### Mobile ad hoc Key Management Proposals not applicable + +- Virtual Certificate Authority + - Not applicable due to no trusted third parties +- Certificate chaining based on pretty good privacy (PGP) + - Not applicable due to insufficient density of certificate graphs +- Peer-to-peer key management based on mobilty + - Not applicable due to certificate revocation mechanism + +#### Existing Mandatory DTN Security + +Based on the *bundle* protocol + +* Hop-by-hop bundle integrity +* Hop-by-hop bundle sender authentication +* Access Control (only legit users with right permissions) +* Limited protection from DoS attacks + +![img](/lectures/acn/img/q.png) + +- Payload Security Header is computed once at the source bundle agent, carried unchanged, and checked at the destination bundle agent (and possibly also security boundary bundle agents) + +- Bundle Authentication Header is computed at every sending bundle agent and checked at every receiving hop along the way from the source to the destination. + +Current DTN security initiative is based on pre-shared secrets and involves no trust dynamics mechanisms + +- Works well against external threats but not applicable to internal threats diff --git a/docs/lectures/acn/10_drones.md b/docs/lectures/acn/10_drones.md new file mode 100644 index 0000000..6eb544e --- /dev/null +++ b/docs/lectures/acn/10_drones.md @@ -0,0 +1,40 @@ +# Enabling Real-Time communications and Services in Heterogeneous Networks of Drones and Vehicles + +### Real World Experiments + +#### Agricultural Monitoring Application + +- Agricultural context in UK +- The production of potatoes or livestock has always been a major part of farming +- There has always been a need for farmers to be able to observe their field crops or animals as often as possible so that they are informed quickly about potential deep rooted problems in the fields. + +Enable mobile reliable multi-hop DTN communications (in field near Nottingham) + +- 2 Flying drones +- 1 Vehicle +- 2 Static ground sensing nodes + - Raspberry Pis + - These capture and send data to the drones, which forward it to a node with higher computational output + +The two static sensing nodes are deployed on two different sides of the field out of reach of each other while the drone acts as a intermediaries. + +All sensing nodes could measure + +- Air temp +- wind speed +- soil temp + +We measure average edge to edge (E2E) delays of content query and dissemination in the network + +- Two drones and one vehicle (3 intermediaries) result in lower delays + +#### Smart City Applications + +- More focused on single hop + - 1 Hovering drone (publisher) + - Moving vehicle (subscriber) + - The drone continuously sends information such as sensors readings, street images, traffic videos to the vehicle which monitors road conditions +- Single hop communications is significantly affected by physical obstructions + - Therefore the latency went down in suburbs compared to city centres + - Height of the drone is important as well + diff --git a/docs/lectures/acn/11_connecting.md b/docs/lectures/acn/11_connecting.md new file mode 100644 index 0000000..a42eec5 --- /dev/null +++ b/docs/lectures/acn/11_connecting.md @@ -0,0 +1,157 @@ +# Connecting + +#### Elasticity: Supply and Demand + +This is about **resource management** + +- **Supply** - Available link capacity on path +- **Demand** - Host transmitting and receiving traffic +- **Elastic** - capacity reduces -> demand is scaled back + - Hosts stop sending / send less +- **Inelastic** - applications can’t handle this + +TCP manages resource usage based on observed loss and latency + +#### Quality of Service + +If capacity > demand, there is no need for quality of service + +If capacity < demand, we need to keep queuing minimal + +- As queuing directly impacts latency, jitter and loss + - In stable networks + - **Jitter**: The difference in delays, a measure of stability + +#### IP Type of Service + +- Single IP header byte + +``` +Bits 0-2: Precedence. +Bit 3: 0 = Normal Delay, 1 = Low Delay. +Bits 4: 0 = Normal Throughput, 1 = High Throughput. +Bits 5: 0 = Normal Reliability, 1 = High Reliability. +Bit 6-7: Reserved for Future Use. +``` + +- Precedence for *special* traffic + +``` +0 1 2 3 4 5 6 7 ++-----+-----+-----+-----+-----+-----+-----+-----+ +| | | | | | | +| PRECEDENCE | D | T | R | 0 | 0 | +| | | | | | | ++-----+-----+-----+-----+-----+-----+-----+-----+ + +Precedence + +111 - Network Control +110 - Internetwork Control +101 - CRITIC/ECP +100 - Flash Override +011 – Flash +010 – Immediate +001 – Priority +000 - Routine +``` + +### Differentiated Services (DiffServ) + +- Operates on *traffic aggregates* + - Label packets with desired class via ToS + - Routers apply different queuing as operator sees fit +- Four service classes, or *per-hop behaviour* + - **Default**: best effort + - No QoL applied + - **Expedited Forwarding**: low delay, loss & jitter + - **Assured Forwarding**: low loss if within rate + - **Class Selector**: use ToS precedence bits + +##### Problems + +- End to end semantics +- Mapping to service level agreement + - If an internet company sells a network with a certain speed, this might have legal repercussions if QoS are enacted +- Mapping to application demands + +### Integrated Services (IntServ) + +- Operates on explicitly signalled *flows* + - Think phone switchboards + - The network signals exactly what it can and can’t do to the destination nodes +- Flow setup specifies some quality of service +- Routers perform **C**onnection **A**dmission **C**ontrol + - CDA can accept and reject traffic based on whether or not the route/path is available + +##### Problems + +- Complexity + - Hard to scale +- Mapping requirements to parameters + - This was easier when ATM did it as they owned all the infrastructure + - Whereas now it is difficult to map across all different companies +- Per-flow state + - Extremely difficult + +## NAT + +### Address Shortages + +**IPv4** supports 32 bit addresses + +- 95% allocated already (440,000 netblocks) + +**IPv6** supports 128 bit address + +- Loads of addresses :white_check_mark: +- Routing protocols need to ported :negative_squared_cross_mark: +- Associated services needing to move :negative_squared_cross_mark: + +### Network Address Translation + +Because IPv6 did not magically solve address shortage problem and not all routers are ipv6 aware, we had to rely on NAT. + +- Private Addressing, `RFC1918` + - `172.16/12`, `192.168/16`, `10/8` + - Devices with these local IPs should never be externally routed + - Not for security reasons - just for getting more addresses +- Traditional NAT, `RFC3022` is the standard + - Use private addresses internally (within the local network) + - Map into a (small) set of routable addresses + - Use source ports to distinguish connections + - For large scale **carrier grade NAT** [`RFC6598`] on `100.64/10` + +#### Implementation + +- Requires IP, TCP/UDP header rewriting + - Addresses, ports and checksums all need to be recalculated +- Behaviours + - Network Address Translation + - Network Address and Port Translation + +###### Full Cone + +![image-20220124180451508](/home/jay/.config/Typora/typora-user-images/image-20220124180451508.png) +``` +ea:ep - NAT address : NAT port +``` + +When client receives packet from server 1 `da:dp`, the NAT translates the NAT address `ea:ep` to the clients internet address and port `ia:ip`. + +###### Address Restricted Cone NAT + +![image-20220124181009792](/home/jay/.config/Typora/typora-user-images/image-20220124181009792.png) +In this case server 2 is not trusted and therefore any request will be dropped. + +###### Port Restricted Cone NAT + +![image-20220124181127801](/home/jay/.config/Typora/typora-user-images/image-20220124181127801.png) + +If the router receives a packet from a bad IP or bad port, it will be dropped. + +###### Symmetric NAT + +![image-20220124181325935](/home/jay/.config/Typora/typora-user-images/image-20220124181325935.png) + +Here the internal address is obfuscated from the external servers, same client can use different ports for different communications. diff --git a/docs/lectures/acn/12_naming.md b/docs/lectures/acn/12_naming.md new file mode 100644 index 0000000..adc8935 --- /dev/null +++ b/docs/lectures/acn/12_naming.md @@ -0,0 +1,139 @@ +# Naming + +IPs are not human readable. + +Not always the appropriate granularity + +- The address names an interface +- This however does not give information about the kind of service / hardware + +A file maps names to addresses + +- Unix & Linux + - `/etc/hosts` +- Windows + - `C:\Windows\System32\drivers\etc\hosts` + +These are simple but neither automatic or scalable which led to **DNS**. + +- Was initially `RFC882` +- Now is `RFC1035, 1987` + +DNS is a consistent namespace + +- No reference to addresses, routes etc +- Is hierarchical, distributed & cache + - All of which to help with scalability +- **Federated** - sources control trade-off + - This just means DNS are worldwide +- **Flexible** - many record +- Simple client-server name resolution protocol + +#### Components + +- *Domain name space* and *resource records* + - Tree structured name space + - Data associated with names +- *Name server* + - Contains records for a sub tree + - May cache information about any part of the tree +- Resolver + - Extract information from tree upon client requests + - `gethostbyname()` + +![img](/lectures/acn/img/aa.png) + +###### Root + +- Ultimate authority with the US Dept. of commerce (NITA) +- Managed by IANA, operated by ICANN, maintained by Verisign +- Started with only thirteen root server clusters + - Now much more +- Top level Domains, TLDs + - Operated by registrars, delegated by ICANN +- Delegate zones to other registrars + - and so on down the hierarchy +- Eventually customer rents a name - their **zone** + - Registrar installs appropriate *resource records* + - Associated with names within the zone + +#### Query + +- Query generated by resolver + - e.g. call to `gethostbyname()`, `gethostbyaddr()` +- Carried in single UDP/53 packet + - Or more rarely TCP/53 in case of truncation + - UDP is not smart and therefore does not follow traffic routing (it is selfish) + - It is beneficial for the internet as a whole to use UDP sometimes +- Header followed by question + - ID, Q/R, opcode, AA/TC/RD/RA, response code, counts + - Query type, query class, query name + +Response consists of three RRsets following the header and question + +- **Answers**: RRs that the server had for the QNAME +- **Authoritatives**: RRs pointing to an authority for the name +- **Additionals**: RRs related to the question but don’t answer it + +###### Common Resource Records + +- `A` / `CNAME` / `PTR` + +``` +www.cs.nott.ac.uk. 61272 IN CNAME pat.cs.nott.ac.uk. + +pat.cs.nott.ac.uk. 68622 IN A 128.243.20.9 + +pat.cs.nott.ac.uk. 68622 IN A 128.243.21.19 + +9.20.243.128.in-addr.arpa. 39617 IN PTR pat.cs.nott.ac.uk. +``` + +`cname` refers to the mapping of the domain name to its IP (or another domain) & ports + +Can have 2 authoritative records + +- `NS` + +``` +cs.nott.ac.uk. 10585 IN NS ns1.nottingham.ac.uk. +cs.nott.ac.uk. 10585 IN NS ns2.nottingham.ac.uk. +cs.nott.ac.uk. 10585 IN NS marian.cs.nott.ac.uk. +cs.nott.ac.uk. 10585 IN NS extdns1.warwick.ac.uk. +cs.nott.ac.uk. 10585 IN NS extdns2.warwick.ac.uk. +``` + +It is good practice to have an external DNS, UoN uses Warwick as an external DNS. + +- `MX` + +``` +nott.ac.uk. 3600 IN MX 1 mx191.emailfiltering.com. +nott.ac.uk. 3600 IN MX 2 mx192.emailfiltering.com. +nott.ac.uk 3600 IN MX 3 mx193.emailfiltering.com. +``` + +What happens when the resolver queries a server that doesn't know the answer? two solutions: + +1. **Iterative** (required) + - Server responds indicating who to ask next + - This method is slower and more difficult to retrieve an answer +1. **Recursive** (optional) + - Server generates a new query to the next server + +![img](/lectures/acn/img/ab.png) + +#### Load Balancing + +DNS may have multiple servers, when a query comes various algorithms can be used to choose the best one, this can be geographical location. + +#### Operational & Security Issues + +- Usually need primary and secondary servers + - Separate IP netblocks, physical networks - more robust + - DNS is a *very* common single point of failure +- Cache poisoning + - Caching and soft-state means bad data propagates and can persist for some time + - Even if through simple mistakes (or of course malicious attacks) +- Man-in-the-middle attacks + - Can happen with both iterative & recursive queries diff --git a/docs/lectures/acn/13_reliability.md b/docs/lectures/acn/13_reliability.md new file mode 100644 index 0000000..d57c348 --- /dev/null +++ b/docs/lectures/acn/13_reliability.md @@ -0,0 +1,235 @@ +# Reliability + +Achieving reliability: + +- Re-transmitting lost data + - This is done by detecting lost via explicit acknowledgment + - These can be positive or negative + +### Stop ‘n’ Wait + +Simplest possible paradigm + +- Transmit `seq(x)` +- Wait for `ack(x)` +- Transmit `seq(x+1)` + +![img](/lectures/acn/img/a.jpeg) + +This has really poor performance in high latency and uses high bandwidth (half the bandwidth is overhead (acknowledgements)) + +**Rate control**: Never sending too fast for the network + +**Sliding window**: allow unacknowledged data in flight (data to be sent) + +**Retransmission TimeOut**: how long to wait to decide a segment is lost + +- This requires estimates of dynamic quantities + +- Permit N segments in flight +- Timeout implies loss +- Retransmit from lost packet onward + - This is bad as imagine if only packet 3 is lost out of 5, this means client will resend 3-5. + +##### Congestion Collapse + +When network load is too high, it causes *congestion collapse* + +Why? + +- The routers buffers fill up, traffic is discarded, hosts retransmit +- Retransmit rates increase since more data was lost +- This was solved in “Congestion Avoidance and Control” + +#### Stability of the Internet + +Flows and protocols **include some sort of congestion control** and adaptation so that they moderate their bandwidth use, limit packet loss as well as get approximately fair share of available network bandwidth + +1. **Responsiveness** defined as a number of round-trip times of sustained congestion required to reduce the rate by half +2. **Stability and smoothness** defined as the largest reduction of the sending rate in one round trip time in a steady state scenario +3. **Fairness** towards other flows when competing for bandwidth + +Mimicking TCP behaviour for multimedia congestion control results in fairness towards TCP but also in significant oscillations in bandwidth + +- Multimedia streaming applications need to **have much lower variation at throughput** over time compared to TCP to result in relatively smooth sending rates that are of importance to the end-user perceived quality. +- The penalty for having smoother throughput than TCP while competing for bandwidth is that multimedia congestion control responds slower than TCP to changes in available bandwidth. +- Thus, if multimedia traffic wants smooth throughput, it needs to avoid TCP’s halving of the sending rate in response to a single packet drop. + +###### Packet Loss + +- When choosing the method for packet loss detection, it is important to choose a method that **detects packet losses as early and accurately as possible** + - Incorrect detection & late packet delivery can lead to incorrect packet loss estimation + - This causes unresponsive & unfair behaviour +- Calculating packet loss rates can be done over various lengths of time intervals. + - Shorter intervals result in more responsive behaviour but are more susceptible to noise + - Longer intervals = smoother but less responsive + - It is important to find a balance +- In order to guarantee sufficient responsiveness to congestion and preserver smoothness, methods for detecting & calculating packet loss must be chosen carefully. + 1. What mechanism can be used for packet loss detection? + 2. What algorithm can be used for packet loss rate calculation? + 3. Where can packet loss detection and calculation happen? + +###### Approach + +- All sent packets are marked with consecutive sequence of numbers +- When a packet is sent a timeout value for this packet is computed and an entry containing the sequence number and the timeout value is inserted into a list and kept there until packet delivery is acknowledged or considered to be lost + - If the timeout expires before the packet is acknowledged, the corresponding packet is considered to be lost +- In order to adapt to varying and unpredictable network conditions, the timeout is not fixed, but computed based on one of the algorithms for TCP timeout computation + +##### Timeout Based Approaches + +This is mostly used for multimedia situations + +RTT - round trip times + +- Before the first packet is ACK and RTT measurement is made, the sender sets the TIMEOUT to a certain initial value + - This value is usually **2.5-3 seconds for TCP** + - For real time interactive multimedia traffic, the timeout value should be set to **0.5 seconds** as this is the time where audio delay affects media +- When the first `RTT` measurement is taken the sender sets the smoothed `RTT` (`SRTT`), `RTT` variance (`RTTVAR`) and `TIMEOUT` in the following way + - `SRTT = RTT` + - `RTTVAR = RTT/2` + - `TIMEOUT = `$\Mu\cdot$`SRTT + 4*RTTVAR` + - Where $\Mu$ is a constant, which in this implementation is 1.08 (obtained experimentally) +- When subsequent `RTT` measurements are made the sender sets the `RTTVAR`, `SRTT`, TIMEOUT + - `RTTVAR`$= (1 - \frac{1}{4}) \times$`RTTVAR`$+ \frac14 \times |$`SRTT`$-$`RTT`$|$ + - `SRTT`$= (-\frac18)\times$`SRTT`$+\frac18\times$`RTT` + - `TIMEOUT`$= \Mu\times$`SRTT`$+ 4\times$`RTTVAR` + +###### Packet loss rate calculation + +- Real time interactive multimedia approaches typically use the **weighted Loss Interval Average (WLIA)** +- It relies on **using loss events** and **loss intervals** for correct computation of packet loss rate and is in accordance with how TCP performs packet loss calculation +- A **loss event** is defined as a number of packets lost within a single RTT + +This can be done either on the sending or receiving side + +**Sender-side**: if the packet loss detection is done in the sender, the sender can use timeout mechanism for each packet or gap in sequence numbers of the acknowledged + +- The receiver has to acknowledge either every packet or every packet not received +- Acknowledging every packet can introduce high levels of traffic between between sender and receiver +- This is solved by having receivers send report summaries of losses every nth packet or nth RTT + +**Receiver-side**: Packet loss is detected in the receiver and explicitly reported back to the sender + +- Noticing the gap in the sequence number - a loss event can be assumed +- A loss event is directly forwarded to the sender + +##### Sender vs Receiver Detection + +Receiver driven packet loss discovery is preferred. + +- This is because loss events are sent early as possible +- This means high responsiveness + +In the case of very high congestion - where there is no feedback from the receiver + +- The pure receiver based loss detection is useless because the sender has no way of calculating packet loss +- In these cases sender enters **self-limitation** - where packet loss is assumed and sending rate is decreased or even stopped + +#### Adaption + +Once the parameters of a given link are measured (packet loss and round trip times), there is a range of approaches that could be followed when choosing rate adaptation scheme(s). + +**Equation-based control** uses a control equation that explicitly gives the maximum acceptable sending rate as a function of the recent loss event rate (loss rates). + +**Additive Increase Multiplicative Decrease (AIMD) control** of in response to a single congestion indication. + +###### Decision Function + +Options for Decision function: + +- **On congestion** (overload/packet loss/packet loss increase), **decrease the rate immediately, or periodically**** +- On absence of congestion** (underload/no packet loss, packet loss decrease), **increase the rate immediately** + +###### Increase/decrease function + +Options for **increase phase**: (during underload) + +- constant additive increase rate, +- straight jump to the expected value or value calculated by the formula +- multiplicative increase rate + +The default for the Internet is **constant linear increase**. + +One could argue that a loss estimate of zero indicates that there is no congestion and thus the sending rate should be increased with the maximum possible increase factor until a loss event occurs. + +- However, this approach **causes instabilities** in the sending rate and is very susceptible to a noisy packet drop rates. + +Options for **decrease phase** + +- constant multiplicative decrease factor, TCP-like or TCP-similar like. +- linear decrease +- straight jump to the expected value (calculated by the formula) + +The default for the internet is multiplicative decrease (halving) + +- Because congestion recovery should be exponential and not linear + +Options for **decision frequency** + +Decision frequency specifies **how often to change the rate.** **Based on system control theory, optimal adjustment frequency depends on the feedback delay.** + +- The feedback delay **is the time between changing the rate and detecting the network’s reaction to that change.** + - It is suggested that equation-based schemes adjust their rates **not more than once per RTT**. + - Changing the rate too often results in oscillation + - Infrequent change of the rate leads to an unresponsive behaviour. + +###### Self Clocking + +Aim is that transmission spacing matches bottleneck rate + +- Avoids consistent queuing at bottleneck +- Queue to smooth out short-term variation + +##### Congestion Control + +Aim to obey **conversation of packets** + +- In equilibrium flow is conservative +- New packet doesn't enter until one leaves + +This fails in three ways: + +1. Connection doesn't reach equilibrium +2. Sender transmits too soon +3. Resource limits prevent equilibrium being reached + +Solutions: + +**Slow-start** + +- Each ACK opens congestion window by 1 packet + - Every ACK, `cwnd += 1` + - Every RTT `cwnd *= 2` +- If a stop occurs, stop or `cwnd == ssthresh` +- Else multiplicative increase + +![img](img/ac.png) + +**Congestion Avoidance** + +1. Network signals congestion occurring + - Detect loss +2. Host responds by reducing sending rate + - `ssthresh := cwnd/2` multiplicative decrease + - `cwnd := 1` initialises slow start + +Avoid congestion by slow increase + +`cwnd += 1/cwnd` window increases 1 per window + +TCP is not always useful + +- Reliability can cause untimely delivery + +Audio/Video codecs usually produce frames (not continuous bytestream) + +- Losing a frame is better than delaying all subsequent data + +UDP encapsulates media using **R**eal **T**ime **P**rotocol + +- Sequencing, time stamping, delivery monitoring, no quality of service +- Adds a control channel + - Back channel to report statistics & participants +- Transport only + - Leaves encodings & floor control to application diff --git a/docs/lectures/acn/14_bgp.md b/docs/lectures/acn/14_bgp.md new file mode 100644 index 0000000..1108d43 --- /dev/null +++ b/docs/lectures/acn/14_bgp.md @@ -0,0 +1,163 @@ +# Border Gateway Protocol + +#### Routing Protocols + +The main job is to distribute the data to build forwarding tables + +- These are **intra-domain routing protocols** + - Or **Interior gateway protocols** + - When the source and destination are **inside** the **same network** + +It is important to distinguish between local and global protocols + +- Interior vs Exterior Gateway Protocol (IGP vs EGP) + +##### BGPv4 + +The internet inter-domain routing protocol + +- Derives from GGP & EGP +- Deals in IP prefixes and **autonomous systems** + - autonomous systems are purely administrative + - Purpose is to enable *policy* to be applied + - Only prefixes matter in the data-plane +- Internet policy domains + - Logical construct only + - No meaning outside BGP + - Do not map simply onto ISPs or networks +- Currently ~493,000 prefixes & ~46,000 ASs + - Because we have less ASs, the routing is easily -> less complex + - Reduces complexity + - Speeds up performance + +BGP uses TCP as transport + +- `OPEN`, `UPDATE`, `KEEPALIVE`, `NOTIFICATION` + +Sessions between peers have: + +- Simple capability negotiation +- Manage simultaneous `OPEN` connections +- Lose everything on session failure + +#### Sessions and Routing Information Base (RIBs) + +A BGP peer typically has many sessions + +- Logically, for each peer, it receives the information about routing from peers, this is sorted into `Adj-RIB-in` table. +- After processing, it produces a `Adj-RIB-out` table which it sends to other peers + - Advertisements received and to be sent +- Generates a local RIB table from `Adj-RIB-in` + - Routes to use and potentially distribute + - Resolved into per-port forwarding tables +- Generate `Adj-RIB-out` from `Loc-RIB` and policy + +#### Update messages + +- Incremental - indicate *changes* to state + - These updates could be: + - Withdrawn routes + - Path attributes, common to all advertised routes + - Advertised routes, known as NLRI +- There are ~27 path attributes + - Only ~12 are in common use + - Communicate information about prefixes + - Used to apply policy in BGP *decision process* + +##### Path Attributes + +Mandatory - every AS has to inform the other ASs about these 3 attributes: + +- Next hop +- AS Path +- Origin + +Discretionary + +- Local preferences + - Allows prioritisation of ASs + +Optional & transitive + +- Aggregator +- Community +- Extended Communities + +Optional & non-transitive + +- Multi-exit discriminator +- Originator ID + +### Path Vectors + +**Distance Vector** - prefer lowest cost path (not always) + +**Path Vector** + +- How do we know if an AS has seen this advert before +- Store the list of ASs in the packet + - This is called the `AS_PATH` +- This way loops can be broken + - If our ASN appears in a received `AS_PATH`, drop the advert + +##### Decision Process + +Drop prefix if: + +- `NEXT_HOP` is unreachable via local routing table +- Local AS appears in `AS_PATH` (packet in a loop) + +Then (commonly) apply following preference: + +1. Higher `weight` (local to this router) +2. Highest `LOCAL_PREF` +3. Shortest `AS_PATH` +4. Lowest `ORIGIN` +5. Lowest `MED` +6. `EGP` to `IGP` (hot potato) +7. Shortest internal path +8. Prefer oldest route + - Oldest routes are often most stable +9. Lowest interface IP address + +### Consistency + +Learn external routes on `EBGP` sessions + +- `EBGP` defined as peers having different ASNs +- Must ensure every router knows all external routes +- Redistribute external routes inside the network + - Via `IGP` - only in small networks + - via `IBGP` - gives full control over route distribution + +###### Scaling + +Can distribute `IBGP` routes on `IBGP` sessions + +- Have to maintain $N\cdot \frac{(N-1)}{2}$ `IBGP` sessions + - Each carrying up to 490k routes x2 tables +- Two standard solutions + 1. **Route Reflectors** + - Super nodes re-advertising `IBGP` routes + - Allows for hierarchy + 2. **AS Confederations** + - split AS up into mini-ASs + +###### Failures + +- Handling link failures + - Bind to loopback + - If it cant talk to other nodes, will only support communication internally + - Flap damping + - A warning message saying don't send traffic to me + - This can make things worse if this message is delayed +- Process failures + - Out of memory error due to too many routes + +##### Network Inter-connection + +- Networks interconnect via `EBGP` sessions + - POPs - points of presence or IX internet exchanges +- Multi-homing + - This is all logical + - http://0x0.st/ooCs.png diff --git a/docs/lectures/acn/img/a.jpeg b/docs/lectures/acn/img/a.jpeg new file mode 100644 index 0000000..a74f102 Binary files /dev/null and b/docs/lectures/acn/img/a.jpeg differ diff --git a/docs/lectures/acn/img/a.png b/docs/lectures/acn/img/a.png new file mode 100644 index 0000000..d4e7348 Binary files /dev/null and b/docs/lectures/acn/img/a.png differ diff --git a/docs/lectures/acn/img/aa.png b/docs/lectures/acn/img/aa.png new file mode 100644 index 0000000..ced4b13 Binary files /dev/null and b/docs/lectures/acn/img/aa.png differ diff --git a/docs/lectures/acn/img/ab.png b/docs/lectures/acn/img/ab.png new file mode 100644 index 0000000..0ee3442 Binary files /dev/null and b/docs/lectures/acn/img/ab.png differ diff --git a/docs/lectures/acn/img/ac.png b/docs/lectures/acn/img/ac.png new file mode 100644 index 0000000..377fbdb Binary files /dev/null and b/docs/lectures/acn/img/ac.png differ diff --git a/docs/lectures/acn/img/b.png b/docs/lectures/acn/img/b.png new file mode 100644 index 0000000..7ef5125 Binary files /dev/null and b/docs/lectures/acn/img/b.png differ diff --git a/docs/lectures/acn/img/c.png b/docs/lectures/acn/img/c.png new file mode 100644 index 0000000..b246717 Binary files /dev/null and b/docs/lectures/acn/img/c.png differ diff --git a/docs/lectures/acn/img/d.png b/docs/lectures/acn/img/d.png new file mode 100644 index 0000000..16acbec Binary files /dev/null and b/docs/lectures/acn/img/d.png differ diff --git a/docs/lectures/acn/img/e.png b/docs/lectures/acn/img/e.png new file mode 100644 index 0000000..ce69fd5 Binary files /dev/null and b/docs/lectures/acn/img/e.png differ diff --git a/docs/lectures/acn/img/f.png b/docs/lectures/acn/img/f.png new file mode 100644 index 0000000..2000812 Binary files /dev/null and b/docs/lectures/acn/img/f.png differ diff --git a/docs/lectures/acn/img/g.png b/docs/lectures/acn/img/g.png new file mode 100644 index 0000000..2529f1f Binary files /dev/null and b/docs/lectures/acn/img/g.png differ diff --git a/docs/lectures/acn/img/h.png b/docs/lectures/acn/img/h.png new file mode 100644 index 0000000..7956564 Binary files /dev/null and b/docs/lectures/acn/img/h.png differ diff --git a/docs/lectures/acn/img/i.png b/docs/lectures/acn/img/i.png new file mode 100644 index 0000000..907020c Binary files /dev/null and b/docs/lectures/acn/img/i.png differ diff --git a/docs/lectures/acn/img/j.png b/docs/lectures/acn/img/j.png new file mode 100644 index 0000000..698cf6b Binary files /dev/null and b/docs/lectures/acn/img/j.png differ diff --git a/docs/lectures/acn/img/k.png b/docs/lectures/acn/img/k.png new file mode 100644 index 0000000..940e0cf Binary files /dev/null and b/docs/lectures/acn/img/k.png differ diff --git a/docs/lectures/acn/img/l.png b/docs/lectures/acn/img/l.png new file mode 100644 index 0000000..86f584e Binary files /dev/null and b/docs/lectures/acn/img/l.png differ diff --git a/docs/lectures/acn/img/m.png b/docs/lectures/acn/img/m.png new file mode 100644 index 0000000..e8d56a7 Binary files /dev/null and b/docs/lectures/acn/img/m.png differ diff --git a/docs/lectures/acn/img/n.png b/docs/lectures/acn/img/n.png new file mode 100644 index 0000000..56a9caa Binary files /dev/null and b/docs/lectures/acn/img/n.png differ diff --git a/docs/lectures/acn/img/o.png b/docs/lectures/acn/img/o.png new file mode 100644 index 0000000..b57d156 Binary files /dev/null and b/docs/lectures/acn/img/o.png differ diff --git a/docs/lectures/acn/img/p.png b/docs/lectures/acn/img/p.png new file mode 100644 index 0000000..b2f79d5 Binary files /dev/null and b/docs/lectures/acn/img/p.png differ diff --git a/docs/lectures/acn/img/q.png b/docs/lectures/acn/img/q.png new file mode 100644 index 0000000..90dce1b Binary files /dev/null and b/docs/lectures/acn/img/q.png differ diff --git a/mkdocs.yml b/mkdocs.yml index 66fd241..cfd4825 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -98,3 +98,18 @@ nav: - File Systems 1: lectures/osc/15_file_systems1.md - File Systems 2: lectures/osc/16_file_systems2.md - File Systems 3: lectures/osc/17_file_systems3.md + - Advanced Computer Networks: + - Intro: lectures/acn/01_intro.md + - MANET And DTN: lectures/acn/02_MANET_and_DTN.md + - VANET And DTN: lectures/acn/03_VANET_and_DTN.md + - DTN Protocols: lectures/acn/04_DTN_Protocols.md + - DTN Advanced Protocols: lectures/acn/05_DTN_advanced_protocols.md + - DTN Congestion Control: lectures/acn/06_DTN_congestion_control.md + - Information Centric Networks: lectures/acn/07_information_centric_networks.md + - Content Centric Networks: lectures/acn/08_content_centric_networks.md + - DTN Security: lectures/acn/09_DTN_security.md + - Drones: lectures/acn/10_drones.md + - Connecting: lectures/acn/11_connecting.md + - Naming: lectures/acn/12_naming.md + - Reliability: lectures/acn/13_reliability.md + - BGP: lectures/acn/14_bgp.md