1 / 86

Networking

Networking. Network Layer. Networking – Network Layer. The Network Layer is part of the Internet Protocol stack The Network Layer sits between the Transport Layer and the Link/Physical Layer The Network Layer provides communication services to the physical hosts and devices in the network.

trula
Download Presentation

Networking

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Networking Network Layer

  2. Networking – Network Layer • The Network Layer is part of the Internet Protocol stack • The Network Layer sits between the Transport Layer and the Link/Physical Layer • The Network Layer provides communication services to the physical hosts and devices in the network

  3. Networking – Network Layer • The Transport Layer (TCP/UDP) only ”lives” in the end hosts – a router does not know about TCP/UDP protocols • The Network Layer (IP) ”lives” in end hosts and routers

  4. Networking – Network Layer • Two main categories of Network-Layer services • Network Layer connection-oriented service (virtual circuits) • Network Layer connectionless service (datagrams) • IP (Internet Protocol) offers connectionless service, which we will focus on

  5. Networking – Network Layer • Main properties of IP • A best-effort service – no guarantees on bandwidth, delays, order or integrity… • Data is transferred through routing – no central entity is responsible for transferring data from Sender to Receiver

  6. Networking – Network Layer • The general problem of routing: • Given • A source • A destination • A network that contains at least one path from source to destination • Find • The cheapest path from source to destination

  7. Networking – Network Layer A destination The source

  8. Networking – Network Layer A path (cost = 12) A destination The source

  9. Networking – Network Layer A destination A path (cost = 4) The source

  10. Networking – Network Layer • How is an optimal path calculated in practice? • Global routing algorithms – all information about the available network is known in advance, by a central unit • Decentralised routing algorithms – each ”node” in the network only has knowledge about its own, local costs

  11. Networking – Network Layer • Global routing in a network is a very well-known mathematical problem • Algorithm is called Link State algorithm (aka Dijkstra’s algorithm) • Global state could be learned if all nodes braodcast their state prior to calculation

  12. Networking – Network Layer • Link State algorithm: calculate the cheapest path from a source node A to all other nodes in the network • Is an iterative algorithm; it extends the set of known cheapest paths in each step

  13. Networking – Network Layer • Terminology • c(i,j): Cost of link from node i to node j • D(v): Cost of the cheapest path from A to v that is currently known • p(v): Previous node to v along the currently known cheapest path • N: The set of nodes for which the cheapest path is definitely known

  14. Networking – Network Layer // Initialisation N = {A} for (all nodes v) { if (v is adjacent to A) D(v) = c(A,v) else D(v) = ∞; // infinity }

  15. Networking – Network Layer

  16. Networking – Network Layer // Iteration Pick w: (D(w) is minimal) AND (w not in N) Add w to N for (all nodes v: (adjacent to w) AND (not in N)) { if ((D(w) + c(w,v)) < D(v)) { D(v) = D(w) + c(w,v); } }

  17. Networking – Network Layer

  18. Networking – Network Layer

  19. Networking – Network Layer

  20. Networking – Network Layer

  21. Networking – Network Layer

  22. Networking – Network Layer // Link State Algorithm Initialisation; while (still nodes that are not in A) { Iteration; }

  23. Networking – Network Layer • When we are done, we have • The cost of the cheapest path from the source to any destination • The cheapest path itselffrom the source to any destination • How did we get the path itself…?

  24. Networking – Network Layer • Link State algorithm is fast, and is guaranteed to pro-duce the optimal solution… • …BUT when do we ever have global information available…? • On the Internet as such, never…

  25. Networking – Network Layer • In practice, we will often have to rely on locally available information • The Distance Vector algorithm is such an algorithm • Main features • Iterative • Asynchronous • Distributed

  26. Networking – Network Layer • Setup for Distance Vector algorithm • Each node in the network has a number of direct neighbours DN • Each node also knows about a number of destinations DE • Each node maintains a distance table • One row for each member of DE • One column for each member of DN

  27. Networking – Network Layer

  28. Networking – Network Layer DX(Y,Z) • This means… • How much will it cost for node X… • …to route something to the destination Y… • …via the direct neighbour Z

  29. Networking – Network Layer • If the value of DX(Y,Z) is known for all entries in the distance table for X, then X would always know where to route data • How is the distance table built up? • How is the distance table maintained?

  30. Networking – Network Layer DX(Y,Z) = c(X,Z) + minw(DZ(Y,w)) Ahhhrrhhhggg, MATH ANGST!

  31. Networking – Network Layer DX(Y,Z) = c(X,Z) + minw(DZ(Y,w)) • This means… • How much will it cost for node X… • …to route something to the destination Y… • …via the direct neighbour Z

  32. Networking – Network Layer DX(Y,Z) = c(X,Z) + minw(DZ(Y,w)) • This means… • The direct cost of sending data from X to Z • X knows this, since Z is a direct neighbour of X

  33. Networking – Network Layer DX(Y,Z) = c(X,Z) + minw(DZ(Y,w)) • This means… • How much will it cost for node Z… • …to route something to the destination Y… • …via the direct neighbour w

  34. Networking – Network Layer DX(Y,Z) = c(X,Z) + minw(DZ(Y,w)) • This means… • Find the minimal value of the expression in the brackets, for all the direct neighbours to Z

  35. Networking – Network Layer • In other words… • …if a node knows – or can get – the distance tables for all its neighbours, it can build up its own distance table

  36. Networking – Network Layer

  37. Networking – Network Layer

  38. Networking – Network Layer // The algorithm runs on each node // Initialisation for (all nodes v adjacent to myself (X)) { DX(*,v) = ∞; // * means ”all rows” DX(v,v) = C(X,v); } for (all destinations y) { // w: over all X’s neighbours send minw(D(y,w)) to each neighbour; }

  39. Networking – Network Layer // The algorithm runs on each node // Loop…forever wait; // until a message is received if (message to update cost to all destinations via the neighbour v by the amount d) { for (all destinations y) DX(y,v) = DX(y,v) + d; } if (message that shortest path from v to some y has changed) { DX(y,v) = c(x,v) + newValue; } for (all neighbours y) send(new value of minw(D(y,w)));

  40. Networking – Network Layer • A slightly more complex algorithm, but still fairly few lines of code… • Can we be sure it will ”settle down”? • Not really, but will provide a reasonable ”snapshot” of the total state at any time

  41. Networking – Network Layer • The algorithm has some weak spots… • Good news travels fast – if a link cost is decreased, the information will quickly spread • Bad news travels slow - if a link cost is increased, the information spreads slowly (the count-to-infinity problem) • Bad news can cause loops – we can get peculiar routes like A-B-A-D-E

  42. Networking – Network Layer • There are certain ”tricks” available to avoid the problems • Poisoned reverse: Injecting false information into the network (white lies…) • Total algorithm not trivial…

  43. Networking – Network Layer • Practical routing problems • The internet is too big! There are billions of possible destinations! • We can never use a fully global routing algorithm! • We can never create a complete routing table!

  44. Networking – Network Layer • In practice, routing is hierarchical • Routers are divided into ”regions” or so-called autonomous systems (AS) • An AS could e.g.be • A company • A university • A geographic region • …

  45. Networking – Network Layer • Within an AS, all routers • Know each other • Run the same routing algorithm • This is called the intra-AS routing protocol • Some routers will also be responsible for exchanging data with other ASs – these are called gateway routers

  46. Networking – Network Layer • Since gateway routers talk other gateway routers in other ASs, they need to use an inter-AS routing protocol for this purpose

  47. Networking – Network Layer • Routing from A (in AS X) to B (in AS Y) • Route from A to gateway router GX in X, using intra-AS protocol • Route from gateway router GX in X to gateway router GY in Y using inter-AS protocol • Route from gateway router GY in Y to B,using intra-AS protocol

  48. Networking – Network Layer X Y GX GY A B

  49. Networking – Network Layer • Note: still only one routing table… • …but certain entries may be populated in different ways

  50. Networking – Network Layer • The actual Network Layer protocol used on the Internet is called IP (Internet Protocol) • IP implements a best-effort service – no guarantees on delivery time, order or delivery at all… • Two main variants, IPv4 and IPv6

More Related