0% found this document useful (0 votes)
32 views187 pages

Unit-4 Network Layer - Auk

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
32 views187 pages

Unit-4 Network Layer - Auk

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 187
UNIT-4 The Network Layer The Network Layer Design Issues — Store and Forward Packet Switching-Services Provided to the Transport layer- Implementation of Connectionless Service-Implementation of Connection Oriented Service- Comparison of Virtual Circuit and Datagram Networks, Routing Algorithms-The Optimality principle-Shortest path, Flooding, Distance vector, Link state, Hierarchical, Congestion Control algorithms-General principles of congestion control, Congestion prevention polices, Approaches to Congestion Control-Traffic Aware Routing- Admission Control-Traffic Throttling-Load Shedding. Traffic Control Algorithm-Leaky bucket & Token bucket. Internet Working: How networks differ- How networks can be connected- Tunnelling, intemetwork routing-, Fragmentation, network layer in the internet — IP protocols-IP Version 4 protocol-IPV4 Header Format, IP addresses, Class full Addressing, CIDR, NAT-, Subnets-IP Version 6-The main IPV6 header. Transition from IPV4 to IPV6, Comparison of IPV4 & IPV6- Internet control protocols- ICMP-ARP- DHCP ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Network Layer Design Issues e Store-and-forward packet switching ¢ Services provided to transport layer * Implementation of connectionless service ¢ Implementation of connection-oriented service ¢ Comparison of virtual-circuit and datagram networks A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Store-and-Forward Packet Switching = Customer equipment (outside the oval) = Carrier’s equipment: routers connected by transmission lines ISP’s equipment The environment of the network layer protocols. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Store-and-Forward Packet Switching Q) Data is divided into small parts (packets) QO) Packets are transmitted from node to node, processed and forwarded QO) Also known as store-and-forward switching QO) Two connection types Q) Connectionless: datagram Q) Connection-oriented: virtual circuit ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Services Provided to the Transport Layer 1. Services independent of router technology. 2. Transport layer shielded from number, type, topology of routers. 3. Network addresses available to transport layer use uniform numbering plan — even across LANs and WANs ™ Network layer designers have freedom in writing specs of services to transport layer A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Implementation of Connectionless Service = Internet community: connectionless » routers job is moving packets and nothing else » subnet is inherently unreliable » hosts should provide error & flow control =» Telephone companies: connection-oriented » subnet should provide reliable service » successful experience with telephone system » without connections, QoS is hard to achieve ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Implementation of Connectionless Service ISP’s equipment Router Process P1 B P2 a D eS A E ! F — Host H1 2 2 H2 LAN Packet c A's table (initially) A's table (later) C’s Table E's Table Dest. Line Routing within a datagram network ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Implementation of Connectionless Service No connection setup Message is broken into packets Called datagram (in analogy with telegram) Each packet is individually routed Routers decides line based on routing table Packets may follow different paths Not guaranteed to arrive in order ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Implementation of Connection-Oriented Service =» Path from source to destination must be established before any data can be sent = Connection is called a VC (virtual circuit) » analogy with physical circuit in phone system » why virtual? = Avoid choosing new route for each packet = Same route used for all packets in connection = Each packet has ID for which VC it belongs to ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Implementation of Connection-Oriented Service P3 ISP’s equipment Router B P2 =! D H3 1 Process P1 A E B < 2 H2 2 LAN Packet c Host Hi As table C’s Table E's Table Hi] 7 |[c Skt cjTijT—Fit tes] 1 | bee] c In Out Routing within a virtual-circuit network ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Example Connection-Oriented Service ™ H_1has established connection 1 with H2 First entry in each routing table H3 later establishes connection with H2 A's table ieee eee mes Tae roe era Be ate a eee pie wed Send it to router C, A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Example Connection-Oriented Service = A can easily know connection 1 packets of H1 from connection 1 packets of H3 = Ccannot do this =» Thus, A assigns different connection ID to outgoing traffic for second connection = To avoid conflicts, routers need ability to replace connection IDs in outgoing packets » This is called label switching ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Comparison of Virtual-Circuit and Datagram Networks source and destination address Issue Datagram network Virtual-circuit network Circuit setup Not needed Required Addressing Each packet contains the full Each packet contains a short VC number State information Routers do not hold state information about connections Each VC requires router table space per connection Routing Each packet is routed independently Route chosen when VC is set up; all packets follow it Effect of router failures None, except for packets lost during the crash All VCs that passed through the failed router are terminated Quality of service Difficult Easy if enough resources can be allocated in advance for each VC Congestion control Difficult Easy if enough resources can be allocated in advance for each VC Comparison of datagram and virtual-circuit networks ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Trade-Offs @ VC allow packets to contain short ID @ datagram must contain full destination address ™ for short packets, significant overhead ™ OTOH, VC need table space in routers m Datagram subnet needs entry for every possible destination @ VC subnet just needs an entry for each VC @ But!! VC setup packet have to be routed ™ same as datagram ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Trade-Offs a) Inside the subnet, several trade-offs exist betw- een virtual circuits and datagrams. b) One trade-off is between router memory space and bandwidth. Virtual circuits allow packets to contain circuit numbers instead of full destination addresses. If the packets tend to be fairly short, a full destination address in every packet may represent a significant amount of overhead and hence, wasted bandwidth. The price paid for using virtual circuits internally is the table space within the routers. Depending upon the relative cost of communication circuits versus router memory, one or the other may be cheaper. Trade-Offs a) Another trade-off is setup time versus address parsing time. e Using virtual circuits requires a setup phase, which takes time and consumes resources. However, figuring out what to do with a data packet in a virtual-circuit subnet is easy: the router just uses the circuit number to index into a table to find out where the packet goes. In a datagram subnet, a more complicated lookup procedure is required to locate the entry for the destination. -_ A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Trade-Offs a) Virtual circuits have some advantages in guaranteeing quality of service and avoiding congestion within the subnet. b) The loss of a communication line is fatal to virtual circuits using it but can be easily compensated for if datagrams are used. Datagrams also allow the routers to balance the traffic throughout the subnet, since S routes can be changed partway through a _~ long sequence of packet transmissions. A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Routing Algorithms ° Routing is a process of transferring the packets from source m/c to destination machine, while routing algorithms (RA) are s/w responsible for deciding which outgoing line an incoming packet should be transmitted on. e The purpose of RA is to decide which route is to be followed by a packet on the basis of following parameters: e Availability of channels (paths/links/routes) e Link transmission delay e Traffic intensity, and e Capacity (bandwidth) of the link A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Routing Algorithms e On the basis of nature of information used in the algorithm, Routing Algorithms are categorized into two classes: Non-Adaptive: These do not base their routing decisions on the measurements/estimates of current traffic or topology, instead the choice of route to get from node ‘I’ to node ‘j’ is computed in advance or off-line, and hence also called as ‘Static Routing’ or ‘Pre-determined Routing’. Adaptive: It attempts to change their routing decisions to reflect changes in topology and the current traffic. e On the basis of scope of information used in the algorithm, Routing Algorithms are classified into three types: Centralized Routing: The global algorithm uses information collected from the entire subnet in an attempt to make optimal decision. Isolated Routing: The local algorithm runs separately on each IMP and uses information only available there e.g., queue length. Distributed Routing: These use information available locally as well as information available at their neighbors. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Routing Algorithms Properties of the R.A.: (SCRSFO) Simplicity: The algorithm should not use very complex features. Correctness: The algorithm should clearly say about the start and end of the route searching Robustness: The algorithms should either be capable of correcting smaller mistakes or displaying message to the user to correct errors (Detection and Corrections). Stability: In the event of failure of one or few IMPs, the total system should not be crashed or down. Fairness: Nothing should be ambiguous, everything should be stated clearly and the algorithms should not lead to congestion. Optimality: The algorithms should ensure to minimize the mean packet delay time as well as maximize the total throughput of the network (maximum number if message transmission with minimum delay). ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Routing Algorithms (1) Optimality principle Shortest path algorithm Flooding Distance vector routing Link state routing Routing in ad hoc networks A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Fairness vs. Efficiency Network with a conflict between fairness and efficiency. A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER The Optimality Principle It states that if router J is on the optimal path from router | to router K, then the optimal path from J to K also falls along the same route. The goal of routing algorithms is to discover and use the sink trees for all routers. (a) (>) (a) Anetwork. (b) A sink tree for router B. The set of optimal routes from all sources to a given destination form a tree rooted at the destination. Such a tree is called a sink tree. Shortest Path Algorithm (1) ¢ This algorithm finds the shortest path between any two given nodes on the basis of any of the following (metrics): ¢ Number of hops * Geographical distance * Mean queuing delay * In general, the labels of the arcs can be function of distance, bandwidth, average traffic, communication cost, mean queuing delay or transmission delay. Many algorithms may be designed using these parameters. * One such algorithms is designed by Dijkstra (1959) to determine the shortest path between two nodes. A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Shortest Path Algorithm (1) Steps of Dijkstra’s SPA algorithm to determine the shortest path between two nodes: 1. 2. Initially, no path is Known. So all the nodes are labeled as at an infinite distance from source node. As the algorithm proceeds, the labels of the nodes changes accordingly reflecting a better path from the given source to the given sink. Start from a node, and examine all adjacent node(s) to it. If the sum of labels of nodes and distance from working node to the node being examined is less than the label on that node, then we have a shortest path, and the node is re-labeled. In a similar fashion, all the adjacent nodes to the working node are inspected and the tentative labels are changed. If possible the entire graph is searched for tentatively labeled nodes with the smallest value, the node is made the permanent node. With the progress of the algorithm, all permanent nodes are encircled, so the shortest path could be reconstructed. A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Shortest Path Algorithm (1) L(B) = min(~, 042)= 2 L(G) = min(~, 0+6)= 6 B(2,A) mE B) he) F (c0 y > Deo) recaneeare Kes —— Wen B(2,A) C(@,B) G6,E) H(9,6) The first five steps used in computing the shortest path from A to D. The arrows indicate the working node C(9,B) ‘A. UDAY KUMAR, GVPCEW B(2,A) C (ce, -) E(o.- A So Geran L(C) = min(#, 2+7)=9 G46, A) wa 4 2, 242) s L(E) = min(, 2+2)=4 B(2,A) C(9,B) a = B) é ys F(6,E) DD(~,1) ~~ 665) (ee, -) B(2,A) (9, B) E (4, B) Aa c oe E) PD (=) G(5,E) H(8,F) 0) / COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Shortest Path Algorithm (2) #define MAX_NODES 1024 /* maximum number of nodes */ #define INFINITY 1000000000 /* a number larger than every maximum path */ int n, dist({MAX_NODES][MAX_NODES]; /* dist[i][] is the distance from i to j */ void shortest_path(int s, int t, int path]]) { struct state { /* the path being worked on */ int predecessor, /* previous node */ int length; /* length from source to this node */ enum {permanent, tentative} label; /* label state */ } state[MAX_NODES]; int i, k, min; struct state *p; Dijkstra’s algorithm to compute the shortest path through a graph. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Shortest Path Algorithm (3) for (p = &state[0]; p < &state[n]; p++) { /* initialize state */ p->predecessor = -1; p->length = INFINITY; p->label = tentative; } state[t].length = 0; state{t].label = permanent; k=t /* k is the initial working node */ do { /* Is there a better path from k? */ for (i= 0; 1 = 0); Dijkstra’s algorithm to compute the shortest path through a graph. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Shortest Path Algorithm Disadvantages: * Total traffic is routed via the calculated single path, which may lead to congestion. * Sometimes, there exists some more paths that are equally good, but packets can’t be routed through these paths to reduce congestion. Solution: To overcome these problems, a new algorithm called Multipath Algorithm, was designed by Evan (1975). A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER b) c) d) Flooding Flooding algorithm:every incoming packet is sent out on every outgoing line except the one it arrived on. Flooding obviously generates vast numbers of duplicate packets, in fact, an infinite number unless some measures are taken to damp the process. One such measure is to have a hop counter contained in the header of each packet, which is decremented at each hop, with the packet being discarded when the counter reaches zero. An alternative technique for damming the flood is to keep track of which packets have been flooded, to avoid sending them out a second time. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER a) Flooding A variation of flooding that is slightly more practical is selective flooding.In this algorithm the routers do not send every incoming packet out on every line, only on those lines that are going approximately in the right direction. Applications of flooding algorithm: 1. military applications 2. distributed database applications 3. wireless networks 4. as a metric against which other routing algorithms can be compared ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER A dynamic routing algorithm Distance vector routing algorithms operate by having each router maintain a table (i.e, a vector) giving the best known distance to each destination and which line to use to get there. These tables are updated by exchanging information with the neighbors. (also named the distributed Bellman-Ford routing algorithm and the Ford- Fulkerson algorithm ) Lester Randolph Ford OL Toee Chm Ceti NO PHOTO NO PHOTO August 26, 1920 SeptcmDer Zool 7 ee PAu a Cob ~ March 19, 1984 J ~ ~ January 10, ei Distance Vector Routing a) Table content: In distance vector routing, each router maintains a routing table indexed by, and containing one entry for, each router in the subnet. This entry contains two parts: the preferred outgoing line to use for that destination and an estimate of the time or distance to that destination. Table updating method:Assume that the router knows the delay to each of its neighbors. Once every T msec each router sends to each neighbor a list of its estimated delays to each destination. It also receives a similar list from each neighbor. Imagine that one of these tables has just come in from neighbor X, with X, being X's estimate of how long it takes to get to router i. If the router knows that the delay to X is m msec, it also knows that it can reach router i via X in X, +m msec. By performing this calculation for each neighbor, a router can find out which estimate seems the best and use that estimate and the corresponding line in its new routing table. Note that the old routing table is not used in the calculation. A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Distance Vector Routing Router delay from J HK + Line a o 0 o a > = rACcC—-TrOWM™OOD oo [03 |S els oss Od | |D> I |O | ae als AIA! |—|LILl—|—| LI} —| > |> 17 20 0 19 12 PT SE zit: (EOE)! Etat) ||(20%| 127 /c10 9 11 me 10 oO 24 22 22 0 6 29 33 9 9 15 JA Jl JH JK CS delay delay delay delay New is is is is routing 8 10 12 6 table —E—E for J Vectors received from J's four neighbors (a) (b) (a) Anetwork. (b) Input from A, /, H, K, and the new routing table for J. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER 1. The Count-to-Infinity Problems A B Cc D E A B c D E o—__e__e—__e—_e o—_e—__e—__+__e . . . e Initially 1 2 3 4 Initially 1 . ° e After 1 exchange 3 2 3 4 After 1 exchange 1 2 ° e After 2 exchanges 3 4 3 4 After 2 exchanges 1 2 3 e After 3 exchanges 5 4 5 4 After 3 exchanges 1 2 3 4 After 4 exchanges 5 6 5 6 After 4 exchanges 7 6 7 6 After 5 exchanges 7 8 7 8 After 6 exchanges . . . . (a) (b) 2. Delay metric was queue length, it did not take line bandwidth into account, when choosing routes. Initially all the lines were 50 kbps, and hence no problem, but later some were upgraded to 230 kbps, and others to 1.544 Mbps. A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER oe w Dd Link State Routing A dynamic routing algorithm The idea behind link state routing can be stated as five parts. Each router must do the following: .Discover its neighbors and learn their network addresses. .Measure the delay or cost to each of its neighbors. .Construct a packet telling all it has just learned. .Send this packet to all other routers. .Compute the shortest path to every other router. In effect, the complete topology and all delays are experimentally measured and distributed to every router. Then Dijkstra's algorithm can be run to find the shortest path to every other router. ‘A. UDAY KUMAR, GVPCEW COMPUTER NEI WORKS- UNII-4: NETWORK LAYER? Learning about the Neighbors (1) H@~— Router LAN Nine routers and a broadcast LAN. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Learning about the Neighbors (1) 1. Learning about the Neighbors It accomplishes this goal by sending a special HELLO packet on each point-to-point line. The router on the other end is expected to send back a reply telling who it is. These names must be globally unique because when a distant router later hears that three routers are all connected to F, it is essential that it can determine whether all three mean the same F. 2. Measuring Line Cost The most direct way to determine this delay is to send over the line a special ECHO packet that the other side is required to send back immediately. By measuring the round-trip time and dividing it by two, the sending router can get a reasonable estimate of the delay. For even better results, the test can be conducted several times, and the average used. Of course, this method implicitly assumes the delays are symmetric, which may not always be the case. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Learning about the Neighbors (2) D E G H B Cc A E | N Agraph model of previous slide. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Building Link State Packets 3. Building Link State Packets ¢ The packet starts with the identity of the sender, followed by a sequence number and age (to be described later), and a list of neighbors. For each neighbor, the delay to that neighbor is given. Link State Packets A B c D E F Seq Seg. | | Seq. | | Seq.| | Seg} | Seq Age Age Age Age Age Age B/4| [A] 4] [BJ 2] [c[3] [A[5| [Bjeé E/5| [cl2| [p/3| [Fl 7] [e[1| [o[7 F[6| [e[4 F[8| [eE/8 (a) (b) (a) Anetwork. (b) The link state packets for this network. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Distributing the Link State Packets The basic distribution algorithm:The fundamental idea is to use flooding to distribute the link state packets. To keep the flood in check, each packet contains a sequence number that is incremented for each new packet sent. Routers keep track of all the (source router, sequence) pairs they see. When a new link state packet comes in, it is checked against the list of packets already seen. If it is new, it is forwarded on all lines except the one it arrived on. If it is a duplicate, it is discarded. If a packet with a sequence number lower than the highest one seen so far ever arrives, it is rejected as being obsolete since the router has more recent data. Send flags ACK flags — Source Seq. Age A C F A C F Data A 21 60 o;1/1)1/0/0 FE 21 60 1}/1/0/0]/0)1 E 21 59 o;1/0);1/0/1 c 20 60 1;0/1/0]/1)0 D 21 59 1;/o0/;/0/;/0};1)1 A. UDAY vowheRacket b uffer fo rro uter Bil PAVIQUE,S! iSGonx LAYER ae State Routing b) c) First problem with this algorithm:i¥ the sequence numbers wrap around, confusion will reign. The solution here is to use a 32-bit sequence number. With one link state packet per second, it would take 137 years to wrap around, so this possibility can be ignored. Second problem :if a router ever crashes, it will lose track of its sequence number. If it starts again at 0, the next packet will be rejected as a duplicate. Third problem :if a sequence number is ever corrupted and 65,540 is received instead of 4 (a 1-bit error), packets 5 through 65,540 will be rejected as obsolete, since the current sequence number is Speer to be 65,540. The solution to all these problems Is to include the age of each packet after the sequence number and decrement it once per second. When the age hits zero, the information from that router is discarded. Link State Routing 5. Computing the New Routes ¢ Once a router has accumulated a full set of link state packets, it can construct the entire subnet graph because every link is represented. * Now Dijkstra's algorithm can be run locally to construct the shortest path to all possible destinations. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Hierarchical Routing e The routers are divided into what we will call regions, with each router knowing all the details about how to route packets to destinations within its own region, but knowing nothing about the internal structure of other regions. ° For huge networks, a two-level hierarchy may be insufficient; it may be necessary to group the regions into clusters, the clusters into zones, the zones into groups, and so on, until we run out of names for aggregations. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Hierarchical Routing A. UDAY K_ entries. ¢ The full routing table for router 1A has 17 entries, as shown in (b). When routing is done hierarchically, as in (c), there are entries for all the local routers as before, but all other regions have been condensed into a single router, so all traffic for region 2 goes via the 1B -2A line, but the rest of the remote traffic goes via the 1C -3B line. Hierarchical routing has reduced the table from 17 to 7 ~. .. — KS- UNIT-4; NETWORK LAYER Hierarchical Routing Full table for 1A Hierarchical table for 1A Dest. Line Hops Dest. Line Hops Region 1 Region 2 wal_- | - a= T - ies ARB 18| 78 18| 78 (4 4 \ 1c|_ 1c 1c|_1¢ 2A| 1B 2| 18 28| 18 3|_1c 4} 1c 5| 1¢ a}olr|n{s{= w]e }ofor fn] |= et Ne? Region 4 Region 5 Region 3 Hierarchical routing. @ 3 3 enfor enon] Ja | feo |r Unfortunately, these gains in space are not free. There is a penalty to be paid, and this penalty is in the form of increased path length. For example, the best route from 1A to SC is via region 2, but with hierarchical routing all traffic to region 5 goes via region 3, because that is better ,. for most destinations in region 5. Broadcast Routing a)Sending a packet to all destinations simultaneously is called broadcasting. 2)The source simply sends a distinct packet to each destination. Not only is the method wasteful of bandwidth, but it also requires the source to have a complete list of all destinations. 3)Flooding. ¢ The problem with flooding as a broadcast technique is that it generates too many packets and consumes too much bandwidth. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Broadcast Routing 1)Multi-destination routing. eIf this method is used, each packet contains either a list of destinations or a bit map indicating the desired destinations. When a packet arrives at a router, the router checks all the destinations to determine the set of output lines that will be needed. (An output line is needed if it is the best route to at least one of the destinations.) The router generates a new copy of the packet for each output line to be used and includes in each packet only those destinations that are to use the line. In effect, the destination set is partitioned among the output lines. After a sufficient number of hops, each packet will carry only one destination and can be treated as a normal packet. coy ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Broadcast Routing 1)A fourth broadcast algorithm makes explicit use of the sink tree for the router initiating the broadcast—or any other convenient spanning tree for that matter. b)A spanning tree is a subset of the subnet that includes all the routers but contains no loops. c)If each router knows which of its lines belong to the spanning tree, it can copy an incoming broadcast packet onto all the spanning tree lines except the one it arrived on. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Broadcast Routing 1) Reverse path forwarding. ¢ When a broadcast packet arrives at a router, the router checks to see if the packet arrived on the line that is normally used for sending packets to the source of the broadcast. If so, there is an excellent chance that the broadcast packet itself followed the best route from the router and is therefore the first copy to arrive at the router. This being the case, the router forwards copies of it onto all lines except the one it arrived on. If, however, the broadcast packet arrived on a line other than the preferred one for reaching the source, the packet is discarded as a likely duplicate. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Broadcast Routing B Cc A e_« a fPp~ > oe @ a —~@ ee a F H J Ww é | a l { / \ ) \ val a if @®OQ ee k@©oOw He et | je i IN ‘ T LT Pa PN J —E) © c dD NK) KN iS A a\ H A: ) & )H Mm T I it B Reverse path forwarding. (a) A network. (b) A sink tree. (c) The tree built by reverse path forwarding. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER ° Distance Vector Algorithm Bellman-Ford Equation (dynamic programming) Define d,(y) := cost of least-cost path from x to y Then d,(y) = min {c(x,v) + dy) } where min is taken over all neighbors v of x ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Bellman-Ford example Clearly, d(z) = 5, d,(z) = 3, d,(z) = 3 B-F equation says: d,(z) = min { c(u,v) + d\(z), e(u,x) + d,(z), e(u,w) + d,,(z) } =min{2+5, 1+3, 5+3}=4 Node that achieves minimum is next hop in shortest path > forwarding table ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Distance Vector Algorithm OD,(y) = estimate of least cost from x to y 5 Distance vector: D, = [D,(y): ye N ] © Node x knows cost to each neighbor v: ¢(x,v) G Node x maintains D, = [D,(y): ye N ] G Node x also maintains its neighbors’ distance vectors 0 For each neighbor v, x maintains D, = [Dy(y): yeN ] ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Distance vector algorithm (4) Basic idea: Each node periodically sends its own distance vector estimate to neighbors 1 When a node x receives new DV estimate from neighbor, it updates its own DV using B-F equation: D,(y) — min,{c(x,v) + D,(y)} for each node y €N 3 Under minor, natural conditions, the estimate D.(y) converge to the actual least cost d,(y) ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Distance Vector Algorithm (5) Iterative, asynchronous: Each node: each local iteration caused by: © local link cost change wait for (change in local link © DV update message from cost of msg from neighbor) neighbor Distributed: / recompute estimates Geach node notifies neighbors only when its DV changes if DV to any dest has 2 neighbors then notify their neighbors if changed, notify neighbors necessary ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER D,(y) = min {c(x,y) + D(y), c(x,z) + D,(y)} D(z) = min{c(x,y) + =min{2+0, HH} =2 — Dz), e(x,z) + 0{z)} node x table = min{2+1 , 7+0} = 3 cost to cost to cost to x y Z xyz e * 027 E 01203 2 Y | coc 2 201 © Zhe @\\ aac node tab fst to cost to nye z xyz X | eo 2° 02 3 € € 5 y(@0 1 \e 201 Z| e000 eo 310 node z table cost to cost to nye z x yz = x}O 2 3 X | co 20 co Ee E ee /§ gy|201 "7 Os _ 7349 oo oe time ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Congestion Control Algorithms Congestion = When number of packets sent is within subnet carrying capacity, all are delivered » As traffic increases, packet loss happens = At very high traffic, performance collapses = Both transport and network layers share responsibility of handling congestion = Network layer is directly affected ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Congestion Congestion eo Lene Ol _ae oo 2 2 © ¥ response & res Congestion a Onset of 3 \ collapse ° Ss o Offered Load (packet/sec) Goodput: rate at which useful packets are delivered by the network. When too much traffic is offered, congestion sets in and performance degrades sharply. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER How Congestions Happens = Incoming packets from multiple inputs need to go to same output line; queue builds up » Ifinsufficient memory, packets lost Adding memory helps to some point = Even with co memory, congestion gets worse « delayed packets timeout, retransmitted « duplicates increase load = Congestion collapse: load exceeds capacity ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER How Congestions Happens H Slow processors @ CPU slow in doing bookkeeping tasks ™@ queues build up @ Low bandwidth lines ™ can’t forward packets same as arriving speeds m@ Mismatch between system parts ™ upgrading some parts only shifts bottleneck ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Congestion VS Flow Control H Congestion control @ make sure subnet is able to carry offered traffic @ = global, involve behavior of all hosts H@ all factors that diminish carrying capacity @ Flow control ™ traffic between a given sender & given receiver ™ ensure fast sender not overwhelm slow receiver ™ involve feedback from receiver to sender ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Example: Congestion VS Flow Control m Flowcontrol fiber optic network with 1000 Gbps S.Computer try to transfer file toa PC @ 1Gbps no congestion flow control needed to slow SC H Congestion control @ network with 1 Mbps lines, 1000 computers @ half of them trying to transfer @ 100 kbps ™@ no overpowering problem @ but total traffic exceed network capacity ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Congestion Control Algorithms ¢ Approaches to congestion control ¢ Traffic-aware routing e Admission control ¢ Traffic throttling * Load shedding A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Approaches to Congestion Control * Many problems in complex systems, such as computer networks, can be viewed from a control theory point of view. * This approach leads to dividing all solutions into two groups: * open loop and closed loop. * Open loop solutions attempt to solve the problem by good design. * Tools for doing open-loop control include deciding when to accept new traffic, deciding when to discard packets and which ones, and making scheduling decisions at various points in the network. * Closed loop solutions are based on the concept of a feedback loop. Network Traffic-aware Admission Traffic Load provisioning routing control throttling shedding mM sJ_t—— +7! +> Slower Faster (Preventative) (Reactive) Timescales of approaches to congestion control ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Approaches to Congestion Control This approach has three parts when applied to congestion control: 1. Monitor the system to detect when and where congestion occurs. 2. Pass this information to places where action can be taken. 3. Adjust system operation to correct the problem. A variety of metrics can be used to monitor the subnet for congestion. Chief among these are the percentage of all packets discarded for lack of buffer space, the average queue lengths, the number of packets that time out and are retransmitted, the average packet delay, and the standard deviation of packet delay. In all cases, rising numbers indicate growing congestion. The second step in the feedback loop is to transfer the information about the congestion from the point where it is detected to the point where something can be done about it. In all feedback schemes, the hope is that knowledge of congestion will cause the hosts to take appropriate action to reduce the congestion. The presence of congestion means that the load is (temporarily) greater than the resources (in part of the system) can handle. Two solutions come to mind: increase the resources or decrease the load. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Approaches to Congestion Control CONGESTION PREVENTION POLICIES * The methods to control congestion by looking at open loop systems. These systems are designed to minimize congestion in the first place, rather than letting it happen and reacting after the fact. They try to achieve their goal by using appropriate policies at various levels. In Fig. 5-26 we see different data link, network, and transport policies that can affect congestion (Jain, 1990). ‘A. UDAY KUMAR Layer Transport Network Data link Policies « Retransmission policy Out-of-order caching policy * Acknowledgement policy Flow control policy '* Timeout determination Virtual circuits versus datagram inside the subnet Packet queueing and service policy Packet discard policy * Routing algorithm * Packet lifetime management « Retransmission policy © Out-of-order caching policy Acknowledgement policy * Flow control policy NETWORK LAYER ADMISSION CONTROL * One technique that is widely used to keep congestion that has already started from getting worse is admission control. * Once congestion has been signaled, no more virtual circuits are set up until the problem has gone away. + An alternative approach is to allow new virtual circuits but carefully route all new virtual circuits around problem areas. For example, consider the subnet of Fig. 5- 27(a), in which two routers are congested, as indicated. Virtual 7 circuit Congestion fa) (b) Figure 5-27. (a) A congested subnet. (b) A redrawn subnet that eliminates the congestion. A virtual circuit from A to B is also shown. Traffic-Aware Routing * These schemes adapted to changes in topology, but not to changes in load. The goal in taking load into account when computing routes is to shift traffic away from hotspots that will be the first places in the network to experience congestion. * The most direct way to do this is to set the link weight to be a function of the (fixed) link bandwidth and propagation delay plus the (variable) measured load or average queuing delay. Least-weight paths will then favor paths that are more lightly loaded, all else being equal. * Ifload is ignored and only bandwidth and propagation delay are considered, this problem does not occur. Attempts to include load but change weights within a narrow range only slow down routing oscillations. Two techniques can contribute to a successful solution. The first is multipath routing, in which there can be multiple paths from a source to a destination. In our example this means that the traffic can be spread across both of the East to West links. The second one is for the routing scheme to shift traffic across routes slowly enough that it is able to converge. A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Traffic-Aware Routing / West | East >\ ' \ g | / 1 | | 1 | \ B c 1 FE | \ 1 { \ ! \ \ A 1 a \ | ' ) | E; 1 ( } ' : } i ( D ' i 1 1 Anetwork in which the East and West parts are connected by two links. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Traffic Throttling (1) Slow down when congestion is approaching Monitor resource usage @ utilization of output links @ buffering of queued packets inside router = number packets lost for lack of buffer space Packet loss: too late @ Average utilization: not account for bursts Queue delay directly captures congestion ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Traffic Throttling (1) = Maintain good estimate of queue length: d ® dnew = @doig + (1 — @)s = Ss: sample of instantaneous queue length = a < 1: how fast router forgets recent history = EWMA: Exponentially Weighted Moving Average = smooth fluctuations = equivalent to low-pass filter = When d > threshold: report congestion ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Traffic Throttling (1) Example Suppose measured delays are 20, 40, 25, 31 ms, respectively. The current estimated delay is 30 ms. Calculate the estimated delay (a) ifa = 0.2 dnew = 0.2 X 30 + 0.8 x 20 = 22 ms dnew = 0.2 X 22 +.0.8 x 40 = 36.4ms dnew = 0.2 X 36.4 + 0.8 X 25 = 27.28 ms dnew = 0.2 X 27.28 + 0.8 x 31 = 30.256 ms (b) ifa = 0.6 dnew = 0.6 X 30 + 0.4 x 20 = 26ms dnew = 0.6 X 26 + 0.4 x 40 = 31.6 ms dney = 0.6 X 31.6 + 0.4 x 25 = 28.96 ms dnew = 0.6 X 28.96 + 0.4 x 31 = 29.776 ms ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Traffic Throttling (1) = Choke Packets = most direct way, tell sender directly = send choke packet back to source host = original packet is tagged, so will not generate another choke packet, then forwarded as usual = Hop-by-hop backpressure = affect every hop it passes through = provide quick relief at the point of congestion ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER en. Orn, A. UDAY KUMAR, GVPCEW & i Bik I COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Load Shedding (2) = When other methods fail = Throw excess packets away = Term taken from electricity = blacking certain areas to save entire grid = on hot summer days with high demand = Choosing packets to discard = random, may cause retransmissions = priority-based, required coop from senders ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Load Shedding (2) =» Random Early Detection (RED) = drop packets before situation become hopeless = routers maintain average queue length = if exceeds threshold, line said to be congested = router can’t tell which source most trouble = pick packet randomly from congested queue = TCP responds to lost packets by slowing = in wired networks, loss is result of congestion = form of indirect feedback = in wireless networks, cannot be used ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Traffic Shaping (1) Host iO > } fx j | Check / Take out —— bucket water/tokens B here 7 j Rate R Network \ (a) (b) (c) Rate . Pacts ES pin zl B 00/00 (a) Shaping packets. (b) A leaky bucket. (c) A token bucket ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Traffic Shaping (2) Rate (Mbps) 100 125 MB/s for ‘— 125msec gs MBis for 250msec (a) With R=25 MB/s, B=9600 eS (b) With R=25 MB/s, B=0 ¥ Time (msec) 4000 (c) (a) Traffic from a host. Output shaped by a token bucket of rate 200 Mbps and capacity (b) 9600 KB, (c) 0 KB. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Traffic Shaping (3) Bucket (KB) 16000” (d) Bucket empties, 7 traffic delayed (e) Bucket always empty ° Time (msec) 1000 (f) Token bucket level for shaping with rate 200 Mbps and capacity (d) 16000 KB, (e) 9600 KB, and (f) OKB.. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Internetworking * When two or more networks are connected to form an internetwork, or more simply an internet. * Numerous protocols are in widespread use across these networks in every layer. * Networks can differ in many ways. * Some of the differences, such as different modulation techniques or frame formats, are internal to the physical and data link layers. * Others can be exposed to the network layer that makes internetworking more difficult than operating within a single network. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Internetworking * Discusses the issues that arise when two or more networks are connected to form an internet — Variety of networks and network protocols * TCP/IP * SNA « ATM networks * NCP/IPX or AppleTalk ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Connecting Networks Notebook Connéction [IO Le computer to Internet Ethernet 802.11 ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Internetworking e How Networks Differ ¢ How Networks Can Be Connected © Concatenated Virtual Circuits © Connectionless Internetworking ¢ Tunneling e Internetwork Routing e Fragmentation ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER How Networks Differ Item Some Possibilities Service offered Connectionless versus connection oriented Addressing Different sizes, flat or hierarchical Broadcasting Present or absent (also multicast) Packet size Every network has its own maximum Ordering Ordered and unordered delivery Quality of service Present or absent; many different kinds Reliability Different levels of loss Security Privacy rules, encryption, etc. Parameters Different timeouts, flow specifications, etc. Accounting By connect time, packet, byte, or not at all Some of the many ways networks can differ ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER How Networks Can Be Connected * There are two basic choices for connecting different networks. 1. Build devices that translate or convert packets from each kind of network into packets for each other network. * The devices are placed at the boundaries between networks. 2. Add a layer of indirection and building a common layer on top of the different networks. * This approach has been tremendously successful, and the layer they proposed was_ eventually separated into the TCP and IP protocols. Almost four decades later, IP is the foundation of the modern Internet. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER How Networks Can Be Connected 7 Packet (a) Ethernet Soiree Router Router Destination Data from sarees layer tl | G — Gee] Geo a poz.17fP| |fe2.1 i fovresiel | mecsiP| |} Em [| Let [el] Daa “I l [ff (a) Apacket crossing different networks. (b) Network and link layer protocol processing. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER How Networks Can Be Connected * Having an internet comprised of 802.11, MPLS, and Ethernet networks. Suppose that the source machine on the 802.11 network wants to send a packet to the destination machine on the Ethernet network. * At a high level, how interconnection with a common network layer can be used to interconnect dissimilar networks? ¢ Since these technologies are different, and they are further separated by another kind of network (MPLS), some added Processing is needed at the boundaries between the networks. * The source accepts data from the transport layer and generates a packet with the common network layer header, which is IP in this vi example. The network header contains the ultimate destination address which is used to determine that the packet should be sent via the fast router. A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS: UNIT-4: NETWORK LAYER How Networks Can Be Connected “* There is an essential difference between the routed case and the switched (or bridged) case. “* With a router: ¥ The packet is extracted from the frame and the network address in the packet is used for deciding where to send it. v Routers have to understand the network layer protocol being used to route packets. ¥ Routers connect different networks at the network layer. “+ With a switch (or bridge): ¥ The entire frame is transported on the basis of its MAC address. ¥ Switches do not have to understand the network layer protocol. being used to switch packets. Y Bridges are used to connect the same kind of network at the link layer. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER How Networks Can Be Connected ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER How Networks Can Be Connected QiThere have been many network protocols over time. Getting everybody to agree on a single format is difficult when companies perceive it to their commercial advantage to have a proprietary format that they control. Q)Ex.: IPv4 and IPv6. While these are both versions of IP they are not compatible (or it would not have been necessary to create |Pv6). QIA router that can handle multiple network protocols is called a multiprotocol router. It must either translate the protocols, or leave connection for a higher protocol layer. Neither approach is entirely satisfactory. O The alternative is to translate packets between the networks. QUIf packets’ formats are significantly different, conversions will always be incomplete and often doomed to failure. Vv |Pv6 (128-bits address) and IPv4 (32-bits address). ¥ Connectionless and Connection-oriented network protocols. () Thus, conversion is only rarely attempted. A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS: UNIT-4: NETWORK LAYER How Networks Can Be Connected Internetworking using concatenated virtual circuits. Multiprotocol router AQ End-to-end concatenated virtual circuits ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER How Networks Can Be Connected * a sequence of virtual circuits is set up from the source through one or more gateways to the destination. * Each gateway maintains tables telling which virtual circuits pass through it, where they are to be routed, and what the new virtualcircuit number is. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER How Networks Can Be Connected Connectionless Internetworking Packets travel individually and can take different routes ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER How Networks Can Be Connected Connectionless Internetworking * routing decision is made separately for each packet — possibly depending on the traffic at the moment the packet is sent. * This strategy can use multiple routes and thus achieve a higher bandwidth than the concatenated virtual-circuit model. * there is no guarantee that the packets arrive at the destination in order ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER How Networks Can Be Connected Connectionless Internetworking * Issues — if each network has its own network layer protocol — Different addressing methods * Key design idea — to design a universal "internet" packet ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER How Networks Can Be Connected concatenation of virtual circuit subnets ¢ Advantages — buffers can be reserved in advance — sequencing can be guaranteed — short headers can be used — the troubles caused by delayed duplicate packets can be avoided * Disadvantages — table space required in the routers for each open connection, — no alternate routing to avoid congested areas — vulnerability to router failures along the path — Difficult to implement if one of the networks involved is an unreliable datagram network ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER How Networks Can Be Connected Connectionless Internetworking ¢ Advantages — more potential for adapting to congestion — robustness in the face of router failures — can be used over subnets that do not use virtual circuits inside. * Many LANs, mobile networks (e.g., aircraft and naval fleets), and even some WANs fall into this category. * Disadvantages — longer headers needed — Less reliable ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Tunneling This case is where the source and destination hosts are on the same type of network, but there is a different network in between. QO example, think of an international bank with an IPv6 network in Paris, an IPv6 network in London and connectivity between the offices via the IPv4 Internet. To send an IP packet to a host in the London office, a host in the Paris office constructs the packet containing an IPv6 address in London, and sends it to the multiprotocol router that connects the Paris IPvé network to the IPv4 Internet. When this router gets the IPv6é packet, it encapsulates the packet with an IPv4 header addressed to the IPv4 side of the multiprotocol router that connects to the London IPv6 network. That is, the router puts a (IPv6) packet inside a (IPv4) packet. When this wrapped packet arrives, the London router removes the original IPv6 packet and sends it onward to the destination host. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Tunneling Router Tunneling a packet from Paris to London. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Tunneling Q) Tunneling is widely used to connect isolated hosts and networks using other networks. The network that results is called an overlay since it has effectively been overlaid on the base network. Q) Deployment of a network protocol with a new feature is a common reason. QO) The disadvantage of tunneling is that none of the hosts on the network that is tunneled over can be reached, because the packets cannot escape in the middle of the tunnel. Q This limitation of tunnels is turned into an advantage with VPNs (Virtual Private Networks). A VPN is simply an overlay that is used to provide a measure of security. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Tunneling (2) i English Channel Tunneling a car from France to England ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Tunneling (2) Acts like a serial line Multiprotocol Ethernet in Paris router Ethernet in London Ethernet frame canes Ethemet frame IP packet inside payload field of the WAN packet ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER: Internetwork Routing * Convert the internetwork into a graph * Make a graph model — every router can directly access every other router connected to any network to which it is connected * Two-level routing algorithm — interior gateway protocol within each network — exterior gateway protocol between the networks ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Internetwork Routing router ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Internetwork Routing * The networks may internally use different routing algorithms that would make it unclear how to find the shortest paths across the internet. * Networks run by different operators lead to bigger problems: ° Different ideas about what is a good path through the network (delay, cost, ...). The weights will not be comparable across networks, so shortest paths on the internet will not be well defined. * One operator may not want another operator to even know the details of the paths in its network, perhaps because the weights and paths may reflect sensitive information (such as the monetary cost) that represents a competitive business advantage. ¢ The internet may be much larger than any of the networks that comprise it. It may therefore require routing algorithms that scale well by using a hierarchy, even if none of the individual networks need to use a hierarchy. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Internetwork Routing OThese lead to a two-level routing algorithm: v¥ Within each network, an intradomain or interior gateway protocol is used for routing. v¥ Across the networks that make up the internet, an interdomain or exterior gateway protocol is used. OThe networks may all use different intradomain protocols, but they must use the same interdomain protocol. OIn the Internet, the interdomain routing protocol is called BGP (Border Gateway Protocol). QIAS (Autonomous System): a that network is operated independently of all the others. Ex., ISP network. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Internetwork routing vs intranetwork routing Internetwork routing may require crossing international boundaries * Cost — different networks may be under different managements, and one route may be less expensive than another * Quality of service — QoS offered by different networks may be different, and this may be a reason to choose one route over another ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Packet Fragmentation * Each network imposes some maximum size on its packets — Hardware (e.g., the size of an Ethernet frame) — Operating system (e.g., all buffers are 512 bytes). — Protocols (e.g., the number of bits in the packet length field) — Compliance with some (inter)national standard — Desire to reduce error-induced retransmissions to some level. — Desire to prevent one packet from occupying the channel too long. * Maximum payloads for some common technologies are 1500 bytes for Ethernet and 2272 bytes for 802.11. IP is more generous, allows for packets as big as 65,515 bytes. A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Packet Fragmentation * Two possible solution for nuisance due to packet being transferred between different network: |. Prevention: By sending a packet of size Path MTU (Path Maximum Transmission Unit). But hard to do as source doesn't know the networks a packet my transferred through. 2. Fragmentation: by breaking up packets to smaller portions. Each fragment is sent as a separate network layer packet. Converting a large packet into small fragments is considerably easier than the reverse process. Packet-switching networks, too, have trouble putting the fragments back together again. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER * Issue: —a large packet wants to travel through a network whose maximum packet size is too small * Solution — allow gateways to break up packets into fragments — sending each fragment as a separate internet packet * How to recombine? * Two strategies — Transparent fragmentation — Non transparent fragmentation. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Transparent fragmentation * make fragmentation caused by a "small-packet" network transparent to any subsequent networks * When an oversized packet arrives at a gateway, the gateway breaks it up into fragments. * Each fragment is addressed to the same exit gateway, where the pieces are recombined Network 1 Network 2 Packet oO ogo G,|G50—+|G, a 94 G, Gy, G, fragments reassembles G, fragments reassembles a large packet the fragments again again ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Transparent fragmentation * Problems — the exit gateway must know when it has received all the pieces, so either a count field or an "end of packet" bit must be provided —all packets must exit via the same gateway — overhead required to repeatedly reassemble and then refragment a large packet passing through a series of small-packet networks « ATM networks ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Non transparent fragmentation. ¢ Recombination occurs only at the destination host * Once a packet has been fragmented, each fragment is treated as though it were an original packet Packet oo000 o00 o000 000 The fragments are not reassembled G, fragments until the final destination (a host) is reached a large packet ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Non transparent fragmentation ¢ Problems: — requires every host to be able to do reassembly. — when a large packet is fragmented, the total overhead increases because each fragment must have a header ¢ Example :IP ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Fragmentation define an elementary fragment size small enough that the elementary fragment can pass through every network. When a packet is fragmented, all the pieces are equal to the elementary fragment size except the last one, which may be shorter. The internet header must provide the original packet number and the number of the elementary fragment contained in the packet. there must be a bit indicating whether it is the last elementary fragment contained within the internet packet Fragmentation (2) Number of the first elementary fragment in this packet eDiets) Pe PebEre ei elbePeP) eee) elit (c) Fragmentation when the elementary data size is 1 byte. (a) Original packet, containing 10 data bytes. (b) Fragments after passing through a network with maximum packet size of 8 payload bytes plus header. (c) Fragments after passing through a size 5 gateway. Packet Fragmentation Number of the first elementary fragment in this packet Packet End of number packet bit 1 byte Header Fragmentation when the elementary data size is 1 byte. (a) Original packet, containing 10 data bytes. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Packet Fragmentation 27 0 fola|s c|p elFic]x| [Jef] [| a ae =a Header Header Fragmentation when the elementary data size is 1 byte (b) Fragments after passing through a network with maximum packet size of 8 payload bytes plus header. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Packet Fragmentation 27 folafefe}ole| —— [2] s [ole |e | | Header a) Header 27| 8 ‘| | A | a Header Fragmentation when the elementary data size is 1 byte (c) Fragments after passing through a size 5 gateway. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Packet Fragmentation OQ) This second solution leads us back to the original solution of getting rid of fragmentation in the network. The process is called path MTU(Maximum Transmission Unit) discovery. Q) Each IP packet is sent with its header bits set to indicate that no fragmentation is allowed to be performed. Q If a router receives a packet that is too large, it generates an error packet, returns it to the source, and drops the packet. (1 When the source receives the error packet, it uses the information inside to re-fragment the packet into pieces that are small enough for the router to handle. Q If a router further down the path has an even smaller MTU, the process is repeated. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Packet Fragmentation J Packet (with length) Source 7 sacs ww ry 12008__-- Sry 9003..----" Destination Path MTU Discovery ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Packet Fragmentation QO) The advantage of Path MTU discovery: Q The source now knows what length packet to send. If the routes and path MTU change, new error packets will be triggered and the source will adapt to the new path. As the higher layers learn the path MTU and pass the right amount of data to IP. Fragmentation has still been moved out of the network and into the hosts, regardless the compatibility with other protocols. QO) The disadvantage of Path MTU discovery: QO There may be added startup delays simply to send a packet. More than one round-trip delay may be needed to probe the path and find the MTU before any data is delivered to the destination. Q Is there are better designs? Q Yes. If each router simply truncates packets that exceed its MTU. This would ensure that the destination learns the MTU as rapidly as possible (from the amount of data that was delivered) and receives some of the data. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER THE NETWORK LAYER IN THE INTERNET A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER Collection of Subnetworks Leased lines Leased A European backbone to Asia AUS. backbone transatlantic line Regional network IP router National network IP Ethernet IP Ethernet LAN IP token ring LAN LAN The Internet is an interconnected collection of many networks. Leased Leased lines RU Stren transatlantic A European backbone to Asia = lines | = = 1 | = = 7 a x = 5 Mobile network National Regional + a network BS—_$_eq network (\ x) Y& ea == } a WiMAX —/ | IP router Company ao network es eS ~— Cable Home network Ethernet Figure 5-45. The Internet is an interconnected collection of many networks. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER The IP Version 4 Protocol An |Pv4 datagram consists of a header part and a body or payload part. The header has a 20-byte fixed part and a variable- length optional part. + 32 Bits . pidiriit eee ey pourri try iririiit Version IHL Type of service Total length Identification 3 Fragment offset Time to live Protocol Header checksum Source address Destination address a Options (0 or more words) * Figure 5-46. The IPv4 (Internet Protocol) header. ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER The IP Version 4 Protocol <------- 4 byte word ------- > “7K” (Ver[Hlen] DS Datagram length ) “[ abit] 15 | s-bit 16-bit I n Identifier Flags] Fragmentation l 2 X+1 3-bit | Offset 13-bit 1 ia Time-to-live] Protocol | Header checksum ! 16 8 Oo 89 OSPF] to detect bit errors i2 -1 Header 15X4 Source Address 165535 bytes 192.16 I sees = SaaS i rarely > 192.168.1.104 1 1500 bytes Option I WY... filled | ! => paind) = Jy. 20 - 60 bytes ‘A. UDAY KUMAR, GVPCEW COMPUTER NETWORKS- UNIT-4: NETWORK LAYER The IP Version 4 Protocol * The Version field keeps track of which version of the ‘A. UDAY KUMAR, GVPCEW protocol the datagram belongs to. The IHL field is provided to tell how long the header is, in 32-bit words. The minimum value is 5 (5x32 bit = 20 bytes), which applies when no options are present. The maximum value is 15 (15x32 bit = 60 bytes). The Type of service field is intended to distinguish between different classes of service. Ex: Various combinations of reliability and speed are possible. — For digitized voice, fast delivery beats accurate delivery. — For file transfer, error-free transmission is more important than fast transmission. COMPUTER NETWORKS- UNIT-4: NETWORK LAYER

You might also like