W3_JTO_Ph2_Datacom_IT.pdf
Document Details
Uploaded by ProdigiousQuantum
null
2021
Tags
Full Transcript
JTO Ph-II DNIT INDEX JTO Phase - II DNIT (INDEX) Chapter Name of Chapter Page No No 1 IP routing principle...
JTO Ph-II DNIT INDEX JTO Phase - II DNIT (INDEX) Chapter Name of Chapter Page No No 1 IP routing principle 2 2 Overview of IPv6 18 3 Cisco Router configuration Basics 30 4 RIP 46 5 NAT 54 6 OSPF 62 7 Cisco Router Configuration: OSPF Normal/Stub/ 78 Totally Stub/NSSA, OSPF/RIP Redistribution 8 VLAN & VLAN Configuration 108 9 BGP 118 JTO Ph-II Version 3.0 Aug 2021 Page 1 of 136 For Restricted Circulation JTO Ph-II DNIT IP Routing Principles 1 IP ROUTING PRINCIPLES 1.1 LEARNING OBJECTIVES The objectives of this chapter is to understand i) Concept of Switching & Routing ii) Routed & Routing Protocol iii) Types of Routing: Static, Default, Dynamic iv) Routing Algorithm v) Distance Vector & Link State Routing 1.2 INTRODUCTION IP Routing is a process that sends packets from a host on one network to another host on a different remote network. It helps you examine the destination IP address of a packet, determine the next-hop address, and forward it. IP routers use routing tables to determine the next-hop address to which the packet should be delivered. 1.2.1 SWITCHING A typical electrical switch directs current to one of several wires of the electrical circuit. Once the connection is made, the switch appears as part of the wire - it (ideally) introduces no resistance, no attenuation, no delay. A networking switch is designed to behave in much the same way. Its primary feature is speed. Like an electrical switch, it is designed to appear much like a wire when relaying data signals. Networking Switches must implement a normal path selection algorithm; they just do it faster. Layer 2 switches bridge whereas layer 3 switches route. Normal Bridges and Routers will receive an entire packet, analyse its headers, make a forwarding decision, then transmit the packet. The packet is stored in the RAM (Random access Memory) while being processed. These RAM buffers can become bottlenecks in a busy network. Switches use special silicon chips than can forward packets directly from source to destination without passing through RAM buffers. Consider a typical Ethernet switch, which acts much like a standard IEEE 802.1d bridge. The difference is that as soon as an incoming packet's header has been received, a forwarding decision is immediately made, before the packet is completely received. If the destination Ethernet segment is idle, the packet begins transmission there immediately. As bits are received they are shunted through the switch fabric to the destination interface. On a 10 Mbps Ethernet, the net delay is perhaps one or two microseconds, as JTO Ph-II Version 3.0 Aug 2021 Page 2 of 136 For Restricted Circulation JTO Ph-II DNIT IP Routing Principles opposed to several milliseconds for a typical bridge. This is termed cut-through switching. With respect to Layer 3, the term switching implies, moving packets from one port to another port. This is different from Layer 2 switching functionality, which implies forwarding a packet from one port to another port based on the MAC address only. 1.2.2 ROUTING The primary function of a packet switching network is to receive packets from a source and deliver them to the destination. To achieve this, a path or route through the network has to be determined. More than one route may be possible. This requires a routing function/ algorithm to be implemented. The routing function must achieve the following requirements : Correctness Simplicity Robustness Stability Fairness Optimality Efficiency Correctness and Simplicity are self explanatory. Robustness has to do with the routing of packets through alternate routes in the network in case of route failures or overloads. Stability is an important aspect of the routing algorithm. It implies that the routing algorithm must converge to equilibrium as quickly as possible, however some never converge, no matter how long they run. Fairness and optimality are competing requirements. A trade-off exists between the two. Some performance criteria may give a higher priority to transportation of packets between adjacent/ nearby stations in comparison to those between distant stations. This results in higher throughput but is not fair to the stations which have to communicate with distant stations. Efficiency of a routing technique/ algorithm gets decided by the quantum of overhead processing required. Of course these have to be kept to a minimum. Thus, Routing is essentially a method of path selection and is an overhead activity. JTO Ph-II Version 3.0 Aug 2021 Page 3 of 136 For Restricted Circulation JTO Ph-II DNIT IP Routing Principles Routing Table ARP Table 100.3.4.0 100.1.1.5 7 100.1.1.5 3CE9... 100.3.6.0 100.1.1.9 100.1.1.9 3C76... 100.1.1.13 3C87... 100.3.7.0 100.1.1.13 6 5 4 3 Network 2 Data Link 1 Physical Figure 1: Routing & Switching 1.3 ROUTING & NETWORK LAYER ADDRESSES Routers relay a packet from one data link to another. To relay a packet, a router employs two basic functions : a path determination function and a switching function. Figure 2 illustrates how routers use the addressing for routing and switching functions. When a packet destined for network 100.1.0.0 arrives at Router 1, the router knows that the packet should be sent out on port S0. JTO Ph-II Version 3.0 Aug 2021 Page 4 of 136 For Restricted Circulation JTO Ph-II DNIT IP Routing Principles ROUTER R1 100.2.0.0 S1 S2 S0 100.1.0.0 100.3.0.0 S0 DESTINATION ROUTER NETWORK PORT S1 ADDRESS ROUTER R2 100.1.0.0 S0 100.4.0.0 100.2.0.0 S1 100.3.0.0 S2 100.4.0.0 S2 Figure 2: Use of Network Layer Addresses in Routing Although the path determination function sometimes is capable of calculating the complete path from the router to the destination, a router is responsible only for passing the packet to the best network along the path. This best path is represented as a direction to a destination network. For example, in figure 2, if a packet that is destined for network 100.4.0.0 arrives at Router 1, the router knows that the best direction to send the packet out is interface S2. Router 2 is the next hop, or router, along the path. The router uses the network portion of the address to make these path selections. The switching function enables a router to accept a packet on one interface and forward it on a second interface. The path determination function enables the router to select the most appropriate interface for forwarding a packet. Routing assumes that addresses have been assigned to network elements to facilitate data delivery. In particular, routing assumes that addresses convey at least partial information about where a host is located. This permits routers to forward packets without having to rely either on broadcasting or a complete listing of all possible destinations. At the IP level, routing is used almost exclusively, primarily because the Internet was designed to construct large networks in which heavy broadcasting or huge routing tables are not feasible. Three general prerequisites must be met to perform routing : Design : A plan must exist by which addresses are assigned. Typically, addresses are broken into fields corresponding to levels in a physical hierarchy. At each level of the hierarchy, only the corresponding field in the address is used, permitting addresses to be handled in blocks. In IP, the most common designs are IP Address Classes, Sub- netting, and CIDR. JTO Ph-II Version 3.0 Aug 2021 Page 5 of 136 For Restricted Circulation JTO Ph-II DNIT IP Routing Principles Implementation : The design plan must be implemented in switching nodes, which must be able to extract path information from the addresses. Since router programming is generally not under a designer's control, designs must be limited by the features provided by manufacturers. Subnetting's great appeal lies in its great flexibility, while using a fairly simple implementation model. Enforcement : The plan must be enforced in host addressing. A design is useless unless addresses are assigned in accordance with it. Addressing authority must be centralised. In the Internet environment, routing is almost always used at the IP level, and bridging almost always used at the Data Link Layer. For new network installations, the best approach is to plan for routing even if it's not used at first. This requires some advanced planning to design an addressing scheme that will work. However, the overhead is all human - hardware won't know the difference between organised and haphazard addressing schemes. Network should be planned for the ability to put routers in strategic locations, even if those locations will initially use bridges or just signal boosters (such as Ethernet hubs and repeaters). In this manner, routers can be easily added later. 1.3.1 ROUTED PROTOCOL A routed protocol is a protocol that contains sufficient network-layer addressing information for user traffic to be directed from one network to another network. Routed protocols define the format and use of the fields within a packet. Packets that use a routed protocol are conveyed from one end system to another end system through an internetwork. The internet protocol IP and Novell‘s IPX are examples of routed protocols. 1.3.2 ROUTING PROTOCOL A routing protocol provides mechanisms for sharing routing information. Routing protocol messages move between the routers. A routing protocol allows the routers to communicate with other routers to update and maintain routing tables. Routing protocol messages do not carry end-user traffic from network to network. A routing protocol uses the routed protocol to pass information between routers. 1.4 TYPES OF ROUTING : STATIC, DEFAULT, DYNAMIC 1.4.1 STATIC ROUTING It refers to routes to destinations being setup manually in the router. Network reachability in this case is not dependent on the existence and state of the network itself. Whether a destination is up or down, the static routes would remain in the routing table, and traffic would still be sent towards that destination. Static routing generally is not sufficient for large or complex networks because of the time required to define and maintain static route table entries. JTO Ph-II Version 3.0 Aug 2021 Page 6 of 136 For Restricted Circulation JTO Ph-II DNIT IP Routing Principles 1.4.2 DEFAULT ROUTING It refers to a ―last resort‖ outlet – traffic to destinations that are unknown to the local router are sent to the default outlet router. Default routing is the easiest form of routing for a domain connected to a single exit point. A default route is a path on which a router should forward a packet if it does not have specific knowledge about the packet‘s destination. Figure 3 below illustrates the concept of Static and default Routing. Static Routing Traffic to 10.1 R1 R2 WAN Figure 3: Static and Default Routing Send all traffic to 1.4.3 DYNAMIC ROUTING Default Routin It refers to routes being learnt via an internal or external routing protocol. Network reachability is dependent on the existence and state of the network. If a destination is down, the route would disappear from the routing table, and traffic will not be sent toward the destination. Dynamic routing is used to enable routers to build their routing tables automatically and make the appropriate forwarding decisions. This concept is illustrated in Figure 4 below. JTO Ph-II Version 3.0 Aug 2021 Page 7 of 136 For Restricted Circulation JTO Ph-II DNIT IP Routing Principles R2 Routing update : I can reach 100.1 X R2 R3 R1 100.1 Routing update : I can reach 100.1 Figure 4: Dynamic Routing Static and default routing are not our enemy. The most stable (but not so flexible) configurations are the ones based on static routing. Many people feel that they are not technologically up-to-date because they are not running dynamic routing. Trying to force dynamic routing on situations that do not really need it is just a waste of bandwidth, effort, and money. As networks keep on growing in size, the routing tables also grow proportionately. Considerable amount of router memory is consumed by these ever increasing tables. In addition, the processor time is eaten up in scanning these tables and bandwidth is consumed in sending status reports about the updated routing tables. At a certain stage, the network size becomes so large that it becomes impossible to have every router keep an entry of every other router in the network. Ultimately, the routing has to be done hierarchically, similar to a telephone network. 1.4.4 ROUTING ALGORITHMS Routing algorithms and protocols form the core of the hacker's Internet, because it is here that all the decisions get made. Network engineers assign costs to network paths, and routing protocols select the least-cost path to the destination. Routing protocols bear a resemblance to capitalist market economics. In both systems, there is a large group of "nodes", the decisions of each being driven by a cost- minimization algorithm. The end result is a reasonably efficient distribution of "resources". Furthermore, cost determination is done in similar ways. A router, like an import/export firm, will compute its cost, add on profit for its part in the transaction, and pass this cost along to customers. Both systems use this method to achieve reasonable efficiency. Routing is the main process used by Internet hosts to deliver packets. Internet uses a hop-by-hop routing model, which means that each host or router that handles a packet JTO Ph-II Version 3.0 Aug 2021 Page 8 of 136 For Restricted Circulation JTO Ph-II DNIT IP Routing Principles examines the Destination Address in the IP header, computes the next hop that will bring the packet one step closer to its destination, and delivers the packet to the next hop, where the process is repeated. To make this work, two things are needed : First, routing tables match the destination addresses with next hops. Second, routing protocols determine the contents of these tables. Routing algorithms can be grouped into two major classes : Non-Adaptive or Static Adaptive or Dynamic Non-Adaptive algorithms do not base their routing decisions on measurements or estimates of the current traffic and topology. Instead, the choice of the route to use to get from I to J (for all I to J) is computed in advance, off-line, and downloaded to the routers when the network is booted. This procedure is also called as Static Routing. Adaptive algorithms change their routing decisions to take into account changes in the topology, and sometimes the traffic as well. Adaptive algorithms will be classified depending on : where it gets the information from - whether locally, from adjacent Routers, or from all Routers When does the algorithm decide to change the routes - whether every T sec, when the load changes, or when the topology changes, and what metric (parameter) is used for optimisation i.e. either distance, number of hops, or estimated transit time. 1.5 DYNAMIC ROUTING OPERATIONS The success of dynamic routing depends on two basic router functions : Maintenance of a routing table Timely distribution of knowledge – in the form of routing updates – to other routers Dynamic routing relies on a routing protocol to disseminate knowledge. A routing protocol defines the set of rules used by a router when it communicates with neighbouring routers. Typically, a routing protocol describes: How updates are conveyed What knowledge is conveyed When to convey this knowledge How to locate recipients of the updates JTO Ph-II Version 3.0 Aug 2021 Page 9 of 136 For Restricted Circulation JTO Ph-II DNIT IP Routing Principles 1.5.1 CONVERGENCE Information about the network topology needs to be very accurate and also consistent from Router to Router. This consistency and accuracy is referred to as Convergence. The network is considered to have converged when all the Routers contain consistent information. 1.5.2 REPRESENTING DISTANCE WITH METRICS When a routing algorithm updates the routing table, its primary goal is to determine the best information to include in the table. Each routing algorithm will interpret ―best‖ in its own way. The algorithm generates a number – called the metric- for each path through the network. Typically, the smaller the metric, the better is the path. Metrics can be calculated based on a single characteristic of the path or by combining several key characteristics such as : 1) Hop Count : Refers to the number of routers a packet must go through, to reach a destination. The lower the hop count, the better is the path. Path length is used to indicate the sum of the hops to a destination. 2) Cost : Path cost is the sum of cost associated with each link to a destination. Costs are assigned (automatically or manually) to the process of crossing a network. Slower networks typically have a higher cost than faster networks. The lowest ‗cost‖ route is the one believed to be the fastest route available. 3) Bandwidth : The rating of a link‘s throughput. Routing through links with greater bandwidth does not always provide the best routes. For example, if a high-speed link is busy, sending a packet through a slower link might be faster. 4) Delay : Depends on many factors, including the bandwidth of network links, the length of queues at each router in the path, network congestion on links, and the physical distance to be travelled. A conglomeration of variables that change with internetwork conditions, delay is common and useful metric. 5) Load : Dynamic factor that can be based on a variety of measures, including CPU and packet processed per second. Monitoring these parameters on a continual basis can be resource intensive. Modern computer networks generally use dynamic routing algorithms rather than the static ones. Two dynamic algorithms in particular, distance vector routing and link state routing are the most popular. 1.5.3 DISTANCE VECTOR ROUTING Distance Vector Routing algorithms require that each router maintain a table (a vector) indicating the best known distance to each destination and which line/ port to use to reach there. These tables are constantly updated by exchanging information with the neighbours. The algorithms periodically pass copies of a routing table from router to JTO Ph-II Version 3.0 Aug 2021 Page 10 of 136 For Restricted Circulation JTO Ph-II DNIT IP Routing Principles router. Updates between routers also communicate topology changes immediately when they occur. The distance vector routing is also known by other names, viz; the distributed Bellman-Ford routing algorithm and the Ford-Fulkerson algorithm, after the researchers who developed it (Bellman, 1957; and Ford and Fulkerson, 1962). It was the original ARPANET routing algorithm and was also used in the Internet under the name RIP and in early versions of DECnet and Novell‘s IPX. In distance vector routing, each router maintains a routing table containing one entry for, each router in the subnet. This entry consists of two parts : 1) the preferred outgoing line/ port to use for that destination, and 2) an estimate of the time or distance to that destination. The metric used might be number of hops, time delay in milliseconds, total number of packet queued along the path, or something similar. The router is assumed to know the ―distance‖ to each of its neighbours. If the metric is hops, the distance is just one hop. If the metric is queue length, the router simply examines each queue. If the metric is delay, the router can measure it directly with special ECHO packets that the receiver just time-stamps and sends them back as fast as it can. B A C D D C B A Routing Routing Routing Routing Table Table Table Table Figure 5: Distance Vector Routing Updates Fig. 5 Distance Vector Routing Updates JTO Ph-II Version 3.0 Aug 2021 Page 11 of 136 For Restricted Circulation JTO Ph-II DNIT IP Routing Principles Each router receives a routing table from other routers connected to the same network, as shown in Figure 5. For example, in the figure, router B receives information from router A, its neighbouring router across the WAN link. Router B adds a distance vector number (such as the number of hops) thereby increasing the distance vector, and then passes the routing table to its other neighbouring router C. This Step-by-step process occurs in all directions between directly connected neighbour routers. In this way, the algorithm accumulates network distances so that it can maintain a database of network topology information. Distance vector algorithms do not allow a router to know the exact topology of an internetwork. Distance vector information is similar to the information found on signs at a highway intersection. A sign points toward a road leading away from the intersection and indicates the distance to the destination. Further down the highway, another sine also points towards the destination, but now the distance to the destination is shorter. As long as each successive point on the path shows that the distance to the destination is successively shorter, we know that the traffic is following the best path. Examples of distance vector routing protocols are IPX RIP and IP RIP. 1.5.4 DISTANCE VECTOR NETWORK DISCOVERY Each router using distance vector routing begins by identifying its own neighbours. In Figure 6 the interface to each directly connected network is shown in the routing tables as having a distance of 0. D B C 100.2.0.0 100.3.0.0 100.1.0.0 S2 S0 S2 S1 S1 S1 Routing Table Routing Table Routing Table 100.1.0.0 S1 0 100.2.0.0 S2 0 100.3.0.0 S0 0 100.2.0.0 S2 0 100.3.0.0 S1 0 100.4.0.0 S1 0 100.3.0.0 S2 1 100.4.0.0 S1 1 100.2.0.0 S0 1 100.4.0.0 S2 2 100.1.0.0 S2 1 100.1.0.0 S0 2 Fig. 6 Distance Vector Figure 6: Route Discovery Distance Vector Route Discovery As the distance vector network discovery process proceeds, routers discover the best path to destination networks based on accumulated metrics from each neighbour. JTO Ph-II Version 3.0 Aug 2021 Page 12 of 136 For Restricted Circulation JTO Ph-II DNIT IP Routing Principles For example, router A learns about other networks based on information it receives from router B. Each of the other network entries learnt from router B are placed in router A‘s routing table. 1.5.5 LINK STATE ROUTING Link State Routing replaced the Distance Vector Routing (used in the ARPANET) in 1979. Two problems caused the demise of Distance Vector algorithm. First, since the delay metric was queue length, it did not take line bandwidth into account when choosing the routes. It would have been possible to change the delay metric to take into account the line bandwidth, but a second problem existed, namely, the algorithm often took too long to coverage, even with enhancements like split horizon. For these reasons, it was replaced by an entirely new algorithm now called link state routing. Variants of link state routing are now widely used. The 5 step concept is stated below : 1. Discover the neighbors and learn their network addresses 2. Measure the delay or cost to each of the neighbors 3. Construct a packet telling all that has just been learnt 4. Send this packet to all other routers 5. Compute the shortest path to every other router When a router is booted, its first task is to learn who its neighbours are. This task is accomplished 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. Link-state routing algorithms - also known as shortest path first (SPF) algorithm maintain a complex database of topology information. Whereas the distance vector algorithm has entries for distant networks and a metric value to reach those networks but no knowledge of distant routers, a link state routing algorithm maintains full knowledge of distant routers and how they interconnect. Examples of link-state routing protocols are : NLSP, OSPF, and IS-IS. Link state routing is widely used in actual networks. The OSPF protocol, which is increasingly being used in the Internet, uses a link state algorithm. 1.5.6 LINK-STATE NETWORK DISCOVERY Link-state network discovery mechanisms are used to create a common picture of the entire internetwork. All routers employing the link state routing algorithm share this common view of the internetwork. In Figure 7, four networks (W,X,Y, and Z) are connected by three link-state routers (A,B, and C). JTO Ph-II Version 3.0 Aug 2021 Page 13 of 136 For Restricted Circulation JTO Ph-II DNIT IP Routing Principles A B C X Y W Z S1 S0 S0 S1 S1 Routing Table Routing Table Routing Table W S0 0 X S1 0 Y S1 0 X S1 0 Y S0 0 Z S0 0 Figure Fig. 7 Link State 7: Link State Routing Routing Link-State Network discovery proceeds as follows : Routers learn about their neighbours; that is, other routers that are on directly connected networks with them. This process is often referred to as neighbour notification. In link-state routing, each router connected to a network keeps track of its neighbours. Routers transmit LSPs (Link State Packets) on the network. The LSPs contain information about networks to which the routers are connected. Then, routers constructed their topological databases consisting of all the LSPs from the internetwork. The SPF algorithm computes network reachability, determining the shortest path from a router to each other network in the link-state protocol internetwork. The router uses the Dijkstra algorithm to construct this logical topology of shortest paths as an SPF tree with itself as root. The SPF tree expresses paths from the router to all destinations. The router computes its best paths and the ports to these destination networks and enters them in the routing table. After the routers dynamically discover the details of their internetwork, they can use the routing table for switching packet traffic. 1.6 COMPARISON OF DISTANCE VECTOR ROUTING & LINK- STATE ROUTING You can compare distance-vector routing to link-state routing in several key areas, as listed in Table 1. JTO Ph-II Version 3.0 Aug 2021 Page 14 of 136 For Restricted Circulation JTO Ph-II DNIT IP Routing Principles Table 1. Distance Vector Link State Network Topology is viewed from Entire Network Topology is common to all neighbours perspective Routers Metrics are incremented as the update Shortest Path to other Routers is calculated crosses one Router Periodic & Frequent Updates results in Updates are triggered by events. Results in slow convergence faster convergence Copies of Routing Tables are passed to Link State Packets are passed to other neighbouring Routers Routers 1.6.1 INTERIOR ROUTING Interior routing occurs within an autonomous system. Most common interior routing protocols are RIP and OSPF. The basic routable element is the IP network or subnetwork, or CIDR prefix for newer protocols. 1.6.2 EXTERIOR ROUTING Exterior routing occurs between autonomous systems, and is of concern to service providers and other large or complex networks. The basic routable element is the Autonomous System, a collection of CIDR prefixes identified by an Autonomous System number. While there may be many different interior routing schemes, a single exterior routing system manages the global Internet, based primarily on the BGP-4 (Border Gateway Protocol Version 4) exterior routing protocol. I GP Autonomous Systems B B GP GP I I GP GP B GP Figure 8: General illustration of Protocol relationships JTO Ph-II Version 3.0 Aug 2021 Page 15 of 136 For Restricted Circulation JTO Ph-II DNIT IP Routing Principles 1.6.3 DISTANCE VECTOR PROTOCOLS : 1) D-V Protocols such as RIP Version 1 were mainly designed for small network topologies. 2) The term Distance Vector derives from the fact that the protocol includes in its routing updates a vector of distances (hop counts). 3) Low speed links are treated equally or sometimes preferred over a high- speed link, depending on the calculated hop count in reaching a destination. This may lead to inefficient routing behaviour. 4) Count to infinity restriction : D-V Protocols have a finite limit of hops (15) after which a route is considered unreachable. This would restrict the propagation of routing updates and would cause problems for large networks. 5) The reliance on hop counts is one deficiency of distance vector protocols; another deficiency is the way that the routing information gets updated. 6) D-V Protocols work on the concept that routers exchange all the network numbers they can reach via periodic broadcasts of the entire routing table. In large networks, the routing table exchanged between routers becomes very hard to maintain, leading to slower convergence. 7) D-V Protocols are considered to be Flat. They present a lack of hierarchy, which translates into a lack of aggregation. This flat nature has made D-V Protocols incapable of scaling to larger and more efficient enterprise networks. 1.6.4 LINK STATE PROTOCOLS : 1) Link State Protocols work on the basis that routers exchange information elements, called link states, which carry information about links and nodes. 2) This means that routers running link state protocols do not exchange routing tables. Each router inside a domain will have enough bits and pieces of the big puzzle that it can run a shortest path algorithm and build its own routing table. 1.7 CONCLUSION IP Routing is an umbrella term for the set of protocols that determine the path that data follows in order to travel across multiple networks from its source to its destination. Data is routed from its source to its destination through a series of routers, and across multiple networks. The IP Routing protocols enable routers to build up a forwarding table that correlates final destinations with next hop addresses. JTO Ph-II Version 3.0 Aug 2021 Page 16 of 136 For Restricted Circulation JTO Ph-II DNIT IP Routing Principles A routing protocol specifies how routers communicate with each other to distribute information that enables them to select routes between nodes on a computer network. Routers perform the traffic directing functions on the Internet; data packets are forwarded through the networks of the internet from router to router until they reach their destination computer. Routing algorithms determine the specific choice of route. Each router has a prior knowledge only of networks attached to it directly. A routing protocol shares this information first among immediate neighbors, and then throughout the network. This way, routers gain knowledge of the topology of the network. The ability of routing protocols to dynamically adjust to changing conditions such as disabled connections and components and route data around obstructions is what gives the Internet its fault tolerance and high availability. JTO Ph-II Version 3.0 Aug 2021 Page 17 of 136 For Restricted Circulation JTO Ph-II DNIT Overview of IPv6 2 OVERVIEW OF IPV6 2.1 LEARNING OBJECTIVES The objectives of this chapter is to understand i) Importance Of IPv6 ii) IPv6 Address Representation iii) Parts Of IPv6 Address & Address Allocation Concept iv) IPv6 Protocols & Advantages v) Types And Scope Of IPv6 Address vi) Address Assignment Features Of IPv6 2.2 IPV6 INTRODUCTION IPv4 has been a solid and highly useful part of the growth of TCP/IP and the Internet. For most of the long history of the Internet, and for most corporate networks that use TCP/IP, IPv4 is the core protocol that defines addressing and routing. However, even though IPv4 has many great qualities, it does have some shortcomings, creating the need for a replacement protocol: IP version 6 (IPv6). IPv6 defines the same general functions as IPv4, but with different methods of implementing those functions. For example, both IPv4 and IPv6 define addressing, the concepts of subnetting larger groups of addresses into smaller groups, headers used to create an IPv4 or IPv6 packet, and the rules for routing those packets. At the same time, IPv6 handles the details differently; for example, using a 128-bit IPv6 address rather than the 32-bit IPv4 address. 2.3 WHY IS IPV6 IMPORTANT? IPv6 is the latest version of the Internet Protocol, which identifies devices across the internet so they can be located. Every device that uses the internet is identified through its own IP address in order for internet communication to work. In that respect, it‘s just like the street addresses and zip codes you need to know in order to mail a letter. The previous version, IPv4, uses a 32-bit addressing scheme to support 4.3 billion devices, which was thought to be enough. However, the growth of the internet, personal computers, smart phones and now Internet of Things devices proves that the world needed more addresses. Fortunately, the Internet Engineering Task Force (IETF) recognized this 20 years ago. In 1998 it created IPv6, which instead uses 128-bit addressing to support approximately 340 trillion trillion (or 2 to the 128th power, if you like). Instead of the IPv4 address method of four sets of one- to three-digit numbers, IPv6 uses eight groups of four hexadecimal digits, separated by colons. JTO Ph –II Version 3.0 Aug 2021 Page 18 of 136 For Restricted Circulation JTO Ph-II DNIT Overview of IPv6 2.4 FEATURES OF IPV6 To a great extent, IPv6 is a conservative extension of IPv4. Most transport- and application-layer protocols need little or no change to work over IPv6; exceptions are applications protocols that embed network-layer addresses (such as FTP or NTPv3). Applications, however, usually need small changes and a recompile in order to run over IPv6. 2.4.1 LARGER ADDRESS SPACE The main feature of IPv6 that is driving adoption today is the larger address space: addresses in IPv6 are 128 bits long versus 32 bits in IPv4. The larger address space avoids the potential exhaustion of the IPv4 address space without the need for NAT and other devices that break the end-to-end nature of Internet traffic. It also makes administration of medium and large networks simpler, by avoiding the need for complex Subnetting schemes. The drawback of the large address size is that IPv6 carries some bandwidth overhead over IPv4, which may hurt regions where bandwidth is limited (header compression can sometimes be used to alleviate this problem). 2.4.2 STATELESS AUTOCONFIGURATION OF HOSTS IPv6 hosts can be configured automatically when connected to a routed IPv6 network. When first connected to a network, a host sends a link-local multicast (broadcast) request for its configuration parameters; if configured suitably, routers respond to such a request with a router advertisement packet that contains network-layer configuration parameters. If IPv6 auto-configuration is not suitable, a host can use stateful auto- configuration (DHCPv6) or be configured manually. Stateless auto-configuration is only suitable for hosts: routers must be configured manually or by other means. 2.4.3 MULTICAST Multicast is part of the base protocol suite in IPv6. This is in opposition to IPv4, where multicast is optional. Most environments do not currently have their network infrastructures configured to route multicast; that is the link-scoped aspect of multicast will work but the site-scope, organization-scope and global-scope multicast will not be routed. 2.4.4 JUMBOGRAMS In IPv4, packets are limited to 64 KB of payload. When used between capable communication partners and on communication links with a MTU larger than 65,576 octets, IPv6 has optional support for packets over this limit, referred to as jumbograms which can be as large as 4 GB. The use of jumbograms may improve performance over high-MTU networks. JTO Ph –II Version 3.0 Aug 2021 Page 19 of 136 For Restricted Circulation JTO Ph-II DNIT Overview of IPv6 2.4.5 NETWORK-LAYER SECURITY IPsec, the protocol for IP network-layer encryption and authentication, is an integral part of the base protocol suite in IPv6; this is unlike IPv4, where it is optional (but usually implemented). IPsec, however, is not widely deployed except for securing traffic between IPv6 BGP routers. 2.4.6 MOBILITY Unlike mobile IPv4, Mobile IPv6 (MIPv6) avoids triangular routing and is therefore as efficient as normal IPv6. This advantage is mostly hypothetical, as neither MIP nor MIPv6 are widely deployed today. 2.4.7 ADDRESSING 128-bit length The primary change from IPv4 to IPv6 is the length of network addresses. IPv6 addresses are 128 bits long (as defined by RFC 4291), whereas IPv4 addresses are 32 bits; where the IPv4 address space contains roughly 4 billion addresses, IPv6 has enough room for 3.4×1038 unique addresses. IPv6 addresses are typically composed of two logical parts: a 64-bit (sub-)network prefix, and a 64-bit host part, which is either automatically generated from the interface's MAC address or assigned sequentially. Because the globally unique MAC addresses offer an opportunity to track user equipment, and so users, across time and IPv6 address changes, 2.5 IPV6 ADDRESS REPRESENTATION 64 bit Network prefix 64 bit Interface ID H H H H H H H H HHH HHH HHH HHH HHH HHH HHH HHH 128 bits HHHH = Hex value 0000 to FFFF Figure 9: IPv6 Address Format An IPv6 address is represented as (colon separated hexa decimal notation) eight groups of four hexadecimal digits, each group representing 16 bits (two octets, a group sometimes also called a hextet). The groups are separated by colons (:). An example of an IPv6 address is: 2001:0db8:85a3:0000:0000:8a2e:0370:7334 Notation IPv6 addresses are normally written as eight groups of four hexadecimal digits. JTO Ph –II Version 3.0 Aug 2021 Page 20 of 136 For Restricted Circulation JTO Ph-II DNIT Overview of IPv6 Example- 2001:0db8:85a3:08d3:1319:8a2e:0370:7334 is a valid IPv6 address. To reduce the complexity if a four-digit group is 0000, the zeros may be omitted and replaced with two colons(::). Example- 2001:0db8:0000:0000:0000:0000:1428:57ab can be shortened as 2001:0db8::1428:57ab. Following this rule, any number of consecutive 0000 groups may be reduced to two colons, as long as there is only one double colon used in an address. Leading zeros in a group can also be omitted. Thus, the addresses below are all valid and equivalent: 2001:0db8:0000:0000:0000:0000:1428:57ab 2001:0db8:0000:0000:0000::1428:57ab 2001:0db8:0:0:0:0:1428:57ab 2001:0db8:0:0::1428:57ab 2001:0db8::1428:57ab 2001:db8::1428:57ab Having more than one double-colon abbreviation in an address is invalid, as it would make the notation ambiguous. A sequence of 4 bytes at the end of an IPv6 address can also be written in decimal, using dots as separators. This notation is often used with compatibility addresses (see below). Thus, ::ffff:1.2.3.4 is the same address as ::ffff:0102:0304, and ::ffff:15.16.18.31 is the same address as ::ffff:0f10:121f. Literal IPv6 Addresses in URLs In a URL the IPv6-Address is enclosed in brackets. Example: http://[2001:0db8:85a3:08d3:1319:8a2e:0370:7344]/ This notation allows parsing a URL without confusing the IPv6 address and port number: http://[2001:0db8:85a3:08d3:1319:8a2e:0370:7344]:443/ Network notation IPv6 networks are written using CIDR notation. An IPv6 network (or subnet) is a contiguous group of IPv6 addresses the size of which must be a power of two; the initial bits of addresses, which are identical for all hosts in the network, are called the network's prefix. A network is denoted by the first address in the network and the size in bits of the prefix (in decimal), separated with a slash. Example- 2001:0db8:1234::/48 stands for the network with addresses JTO Ph –II Version 3.0 Aug 2021 Page 21 of 136 For Restricted Circulation JTO Ph-II DNIT Overview of IPv6 2001:0db8:1234:0000:0000:0000:0000:0000 through 2001:0db8:1234:FFFF:FFFF:FFFF:FFFF:FFFF Because a single host can be seen as a network with a 128-bit prefix, you will sometimes see host addresses written followed with /128. 2.5.1 GUIDELINES TO SHORTEN THE IPV6 ADDRESS REPRESENTATION: The standards provide flexibility in the representation of IPv6 addresses. The full representation of eight four-digit groups may be simplified by several techniques, eliminating parts of the representation. In general, representations are shortened as much as possible. IETF recommendations suggest the use of only lower case letters. For example, 2001:db8::1 is preferred over 2001:DB8::1. Leading zeros in each 16-bit field are suppressed, but each group must retain at least one digit in the case of the all-zero group. For example, 2001:0db8::0001:0000 is rendered as 2001:db8::1:0. The all-zero field that is explicitly presented is rendered as 0. The longest sequence of consecutive all-zero fields is replaced with two colons ("::"). If the address contains multiple runs of all-zero fields, then it is the leftmost that is compressed to prevent ambiguities. For example, 2001:db8:0:0:1:0:0:1 is rendered as 2001:db8::1:0:0:1 "::" is not used to represent just a single all-zero field. For example, 2001:db8:0:0:0:0:2:1 is shortened to 2001:db8::2:1, but 2001:db8:0000:1:1:1:1:1 is rendered as 2001:db8:0:1:1:1:1:1. These methods can lead to very short representations for IPv6 addresses. For example, the localhost (loopback) address, 0:0:0:0:0:0:0:1, and the IPv6 unspecified address, 0:0:0:0:0:0:0:0, are reduced to ::1 and ::, respectively. During the transition of the Internet from IPv4 to IPv6, it is typical to operate in a mixed addressing environment. For such use cases, a special notation has been introduced, which expresses IPv4-mapped and IPv4-compatible IPv6 addresses by writing the least-significant 32 bits of an address in the familiar IPv4 dot-decimal notation, whereas the 96 most-significant bits are written in IPv6 format. For example, the IPv4-mapped IPv6 address ::ffff:c000:0280 is written as ::ffff:192.0.2.128, thus expressing clearly the original IPv4 address that was mapped to IPv6. 2.5.2 PARTS OF IPV6 ADDRESS & ADDRESS ALLOCATION JTO Ph –II Version 3.0 Aug 2021 Page 22 of 136 For Restricted Circulation JTO Ph-II DNIT Overview of IPv6 Figure 10: IPv6 Address Components Only one eighth of the total address space is currently allocated for use on the Internet, 2000::/3, in order to provide efficient route aggregation, thereby reducing the size of the Internet routing tables; the rest of the IPv6 address space is reserved for future use or for special purposes. The address space is assigned to the RIRs in large blocks of /23 up to /12.The RIRs assign smaller blocks typically in sizes from /19 to /32 to local Internet registries that distribute them to users. These addresses are typically distributed in /48 sized blocks to the end users. Each RIR can divide each of its multiple /23 blocks into 512 /32 blocks, typically one for each ISP; an ISP can divide its /32 block into 65536 /48 blocks, typically one for each customer; customers can create 65536 /64 networks from their assigned /48 block, each having 264 (18,446,744,073,709,551,616) addresses. In contrast, the entire IPv4 address space has only 232 (exactly 4,294,967,296 or about 4.3×109) addresses. By design, only a very small fraction of the address space will actually be used. The large address space ensures that addresses are almost always available, which makes the use of network address translation (NAT) for the purposes of address conservation completely unnecessary. NAT has been increasingly used for IPv4 networks to help alleviate IPv4 address exhaustion. Figure 11: IPv6 Address Allocation – Prefix values 2.6 ADVANTAGES OF IPV6 a. More efficient address space allocation b. End to end addressing without NAT c. Fragmentation only at the source host d. Routers do not calculate header checksum e. No broadcast, uses multicast instead f. Built –in security mechanisms g. Auto-configuration of addresses h. Headers are modular/ extensible 2.7 IPV6 PROTOCOLS The primary purpose of the core IPv6 protocol mirrors the same purpose of the IPv4 protocol. That core IPv6 protocol, as defined in RFC 2460, defines a packet concept, addresses for those packets, and the role of hosts and routers. These rules allow the JTO Ph –II Version 3.0 Aug 2021 Page 23 of 136 For Restricted Circulation JTO Ph-II DNIT Overview of IPv6 devices to forward packets sourced by hosts, through multiple routers, so that they arrive at the correct destination host. IPv6 supports the following routing protocols: RIPng (RIP New Generation) OSPFv3 EIGRP for IPv6 IS-IS for IPv6 MP-BGP4 (Multiprotocol BGP-4) 2.7.1 ICMP UPGRADED TO ICMP VERSION 6 Internet Control Message Protocol (ICMP) worked well with IPv4 but needed to be changed to support IPv6. The new name is ICMPv6. 2.7.2 ARP REPLACED BY NEIGHBOR DISCOVERY PROTOCOL For IPv4, Address Resolution Protocol (ARP) discovers the MAC address used by neighbors. IPv6 replaces ARP with a more general Neighbor Discovery Protocol (NDP) 2.7.3 DYNAMIC HOST CONFIGURATION PROTOCOL VERSION 6 (DHCPV6) Network protocol for configuring Internet Protocol version 6 (IPv6) hosts with IP addresses, IP prefixes and other configuration data required to operate in an IPv6 network. It is the IPv6 equivalent of the Dynamic Host Configuration Protocol for IPv4. 2.8 COMPARE AND CONTRAST IPV6 ADDRESS TYPES IPv4 address is split by class, with Classes A, B, and C defining unicast IPv4 addresses. (The term unicast refers to the fact that each address is used by only one interface.) Then, within the Class A, B, and C address range, the Internet Assigned Numbers Authority (IANA) and the Internet Corporation for Assigned Names and Numbers (ICANN) reserve most of the addresses as public IPv4 addresses, with a few reserved as private IPv4 addresses. IPv6 does not use any concept like the classful network concept used by IPv4. 2.9 IPV6 ADDRESS TYPES IPv4 supports unicast, broadcast, and multicast addresses that basically define who or at least how many other devices we‘re talking to. IPv6 modifies that trio and introduces the anycast. Broadcasts, have been eliminated in IPv6 because of their cumbersome inefficiency. 2.9.1 GLOBAL UNICAST ADDRESSES (2000::/3) These are typical publicly routable addresses and they‘re the same as in IPv4. Global addresses start at 2000::/3. Figure 14.2 shows how a unicast address breaks down. The ISP can provide you with a minimum /48 network ID, which in turn provides you 16- bits to create a unique 64-bit router interface address. The last 64-bits are the unique host ID. JTO Ph –II Version 3.0 Aug 2021 Page 24 of 136 For Restricted Circulation JTO Ph-II DNIT Overview of IPv6 2.9.2 IPV6 GLOBAL ROUTING PREFIX IPv6 global unicast addresses allow IPv6 to work more like the original design of the IPv4 Internet. Each organization asks for a block of IPv6 addresses, which no one else can use. That organization further subdivides the address block into smaller chunks, called subnets. Finally, to choose what IPv6 address to use for any host, the engineer chooses an address from the right subnet. That reserved block of IPv6 addresses—a set of addresses that only one company can use— is called a global routing prefix. Each organization that wants to connect to the Internet and use IPv6 global unicast addresses should ask for and receive a global routing prefix. Very generally, you can think of the global routing prefix like an IPv4 Class A, B, or C network number from the range of public IPv4 addresses. The term global routing prefix might not make you think of a block of IPv6 addresses at first. The term actually refers to the idea that Internet routers can have one route that refers to all the addresses inside the address block, without a need to have routes for smaller parts of that block. Figure 12: IPv6 Global Routing Prefix 2.9.3 LINK-LOCAL ADDRESSES (FE80::/10) These are like the Automatic Private IP Address (APIPA) addresses that Microsoft uses to automatically provide addresses in IPv4 in that they‘re not meant to be routed. In IPv6 they start with FE80::/10, as shown in Figure 14.3. Think of these addresses as handy tools that give you the ability to throw a temporary LAN together for meetings or create a small LAN that‘s not going to be routed but still needs to share and access files and services locally. 2.9.4 UNIQUE LOCAL ADDRESSES (FC00::/7) These addresses are also intended for non-routing purposes over the Internet, but they are nearly globally unique, so it‘s unlikely you‘ll ever have one of them overlap. Unique local addresses were designed to replace site-local addresses, so they basically do almost exactly what IPv4 private addresses do: allow communication throughout a site while being routable to multiple local networks. Site-local addresses were deprecated as of September 2004. 2.9.5 MULTICAST (FF00::/8) As in IPv4, packets addressed to a multicast address are delivered to all interfaces tuned into the multicast address. Sometimes people call them ―one-to-many‖ addresses. It‘s really easy to spot a multicast address in IPv6 because they always start with FF. JTO Ph –II Version 3.0 Aug 2021 Page 25 of 136 For Restricted Circulation JTO Ph-II DNIT Overview of IPv6 2.9.6 ANYCAST Like multicast addresses, an anycast address identifies multiple interfaces on multiple devices. But there‘s a big difference: the anycast packet is delivered to only one device—actually, to the closest one it finds defined in terms of routing distance. And again, this address is special because you can apply a single address to more than one host. These are referred to as ―one-to nearest‖ addresses. Anycast addresses are typically only configured on routers, never hosts, and a source address could never be an anycast address. IETF did reserve the top 128 addresses for each /64 for use with anycast addresses. 2.9.7 SPECIAL IPV6 ADDRESS Like in case of IPv4 addresses are reserved for special purpose, in IPv6 as well addresses are reserved for special purpose as listed below. Special IPv6 Address Meaning This is the equivalent of IPv4‘s 0.0.0.0 and is typically the source address of a host before the host receives an IP addresswhen you‘re using DHCP-driven 0:0:0:0:0:0:0:0 Equals ::. stateful configuration. 0:0:0:0:0:0:0:1 Equals ::1. The equivalent of 127.0.0.1 in IPv4. This is how an IPv4 address would be written in a mixed 0:0:0:0:0:0:192.168.100.1 IPv6/IPv4 network environment. 2000::/3 The global unicast address range. FC00::/7 The unique local unicast range. FE80::/10 The link-local unicast range. FF00::/8 The multicast range. 3FFF:FFFF::/32 Reserved for examples and documentation. 2001:0DB8::/32 A Also reserved for examples and documentation. Used with 6-to-4 tunneling, an IPv4-to-IPv6 transition system. The structure allows IPv6 packets to be transmitted over an IPv4 network without the need to configure explicit 2002::/16 tunnels. Table 2. Special IPv6 Addresses JTO Ph –II Version 3.0 Aug 2021 Page 26 of 136 For Restricted Circulation JTO Ph-II DNIT Overview of IPv6 2.10 IPV6 ADDRESS ASSIGNMENTS OPTIONS: 2.10.1 MANUAL CONFIGURATION Network administrator can manually configure IPv6 address to routers interfaces. 2.10.2 STATELESS AUTOCONFIGURATION Stateless auto configuration requires no manual configuration of hosts, minimal (if any) configuration of routers, and no additional servers. The stateless mechanism enables a host to generate its own addresses. The stateless mechanism uses local information as well as non-local information that is advertised by routers to generate the addresses. Routers advertise prefixes that identify the subnet or subnets that are associated with a link. Hosts generate an interface identifier that uniquely identifies an interface on a subnet. An address is formed by combining the prefix and the interface identifier. In the absence of routers, a host can generate only link-local addresses. However, link-local addresses are only sufficient for allowing communication among nodes that are attached to the same link. 2.10.3 MODIFIED EUI-64 (EXTENDED UNIQUE ID-64) A 64-bit interface identifier is most commonly derived from its 48-bit MAC address. A MAC address 00-0C-29-0C-47-D5 is turned into a 64-bit EUI-64 by inserting FF-FE in the middle: 00-0C-29-FF-FE-0C-47-D5. When this EUI-64 is used to form an IPv6 address, it is modified: the meaning of the Universal/Local bit (the 7th most significant bit of the EUI-64, starting from 1) is inverted, so that a 1 now means Universal. To create an IPv6 address with the network prefix 2001:db8:1:2::/64 it yields the address 2001:db8:1:2:020c:29ff:fe0c:47d5 (with the Universal/Local bit, the second-least-significant bit of the underlined quartet, inverted to 1 in this case because the MAC address is universally unique). 2.10.4 STATEFUL AUTOCONFIGURATION In the stateful autoconfiguration model, hosts obtain interface addresses or configuration information and parameters from a DHCPv6 server. Servers maintain a database that checks which addresses have been assigned to which hosts. The stateful autoconfiguration protocol allows hosts to obtain addresses and other configuration information from a server. Stateless and stateful autoconfiguration complement each other. For example, a host can use stateless autoconfiguration to configure its own addresses, but use stateful autoconfiguration to obtain other information. 2.11 THE STRUCTURE OF AN IPV6 PACKET HEADER. The IPv6 packet as shown below is composed of two main parts: the header and the payload. The header is in the first 40 octets of the packet and contains both source and destination addresses (128 bits each), as well as the version (4-bit IP version), traffic class (8 bits, Packet Priority), flow label (20 bits, QoS management), payload length in bytes (16 bits), next header (8 bits), and hop limit (8 bits, time to live). The payload can be up to 64KiB in size in standard mode, or larger with a "jumbo payload" option. JTO Ph –II Version 3.0 Aug 2021 Page 27 of 136 For Restricted Circulation JTO Ph-II DNIT Overview of IPv6 Fragmentation is handled only in the sending host in IPv6: routers never fragment a packet, and hosts are expected to use PMTU discovery. The protocol field of IPv4 is replaced with a Next Header field. This field usually specifies the transport layer protocol used by a packet's payload. In the presence of options, however, the Next Header field specifies the presence of an extra options header, which then follows the IPv6 header; the payload's protocol itself is specified in a field of the options header. This insertion of an extra header to carry options is analogous to the handling of AH and ESP in IPsec for both IPv4 and IPv6. Figure 13: Structure of IPv6 Header 2.12 TRANSITION MECHANISM Until IPv6 completely supplants IPv4, which is not likely to happen in the foreseeable future, a number of so-called transition mechanisms are needed to enable IPv6-only hosts to reach IPv4 services and to allow isolated IPv6 hosts and networks to reach the IPv6 Internet over the IPv4 infrastructure contains an overview of the below mentioned transition mechanisms. 2.12.1 DUAL STACK Since IPv6 is a conservative extension of IPv4, it is relatively easy to write a network stack that supports both IPv4 and IPv6 while sharing most of the code. Such an implementation is called a dual stack, and a host implementing a dual stack is called a dual-stack host. Most current implementations of IPv6 use a dual-stack. Some early experimental implementations used independent IPv4 and IPv6 stacks. There are no known implementations that implement IPv6 only. JTO Ph –II Version 3.0 Aug 2021 Page 28 of 136 For Restricted Circulation JTO Ph-II DNIT Overview of IPv6 2.12.2 TUNNELING In order to reach the IPv6 Internet, an isolated host or network must be able to use the existing IPv4 infrastructure to carry IPv6 packets. This is done using a technique somewhat misleadingly known as tunnelling which consists in encapsulating IPv6 packets within IPv4, in effect using IPv4 as a link layer for IPv6. IPv6 packets can be directly encapsulated within IPv4 packets using protocol number 41. They can also be encapsulated within UDP packets e.g. in order to cross a router or NAT device that blocks protocol 41 traffic. 2.12.3 AUTOMATIC TUNNELING Automatic tunneling refers to a technique where the tunnel endpoints are automatically determined by the routing infrastructure. The recommended technique for automatic tunneling is 6to4 tunneling, which uses protocol 41 encapsulation. Tunnel endpoints are determined by using a well-known IPv4 anycast address on the remote side, and embedding IPv4 address information within IPv6 addresses on the local side. 6to4 is widely deployed today. Teredo is an automatic tunneling technique that uses UDP encapsulation and is claimed to be able to cross multiple NAT boxes. Teredo is not widely deployed today, but an experimental version of Teredo is installed with the Windows XP SP2 IPv6 stack. IPv6, 6to4 and Teredo are enabled by default in Windows Vista. 2.12.4 CONFIGURED TUNNELING Configured tunneling is a technique where the tunnel endpoints are configured explicitly, either by a human operator or by an automatic service known as a Tunnel Broker. Configured tunneling is usually more deterministic and easier to debug than automatic tunneling, and is therefore recommended for large, well-administered networks. Configured tunneling typically uses either protocol 41 (recommended) or raw UDP encapsulation. 2.12.5 PROXYING AND TRANSLATION When an IPv6-only host needs to access an IPv4-only service (for example a web server), some form of translation is necessary. The one form of translation that actually works is the use of a dual-stack application-layer proxy, for example a web proxy. 2.13 CONCLUSION An IPv6 address is a 128-bit alphanumeric value that identifies an endpoint device in an IPv6 network. IPv6 is the successor to a previous addressing infrastructure, IPv4, which had limitations IPv6 was designed to overcome. Notably, IPv6 has drastically increased address space compared to IPv4. JTO Ph –II Version 3.0 Aug 2021 Page 29 of 136 For Restricted Circulation JTO Ph-II DNIT CISCO Router Configuration Basics 3 CISCO ROUTERS CONFIGURATION BASICS 3.1 LEARNING OBJECTIVES The objectives of this chapter is to learn i) How to login to router & login options available ii) Modes of router configuration iii) How to check the links & router interfaces, protocols running iv) Verifying routing table contents v) Configure IP address & bring up router Interfaces to running state vi) Configure login banner on routers 3.2 INTRODUCTION A router is a device which is having its own specialized Operating System (OS), like all modern electronic devices have. Routers also have RAM, permanent storage, processor and the most important from the network point of view- interfaces or ports. The purpose of configuration of a router is to make it ready to use in the networks for forwarding the traffic. 3.3 BASIC COMPONENTS OF CISCO ROUTER : Interfaces The Processor (CPU) Internetwork Operating System (IOS) RXBoot Image RAM NVRAM ROM Flash memory Configuration Register 3.3.1 INTERFACES These allow us to use the router ! The interfaces are the various serial ports or ethernet ports which we use to connect the router to our LAN. There are a number of different interfaces but we are going to hit the basic stuff only. JTO Ph-II Version 3.0 Aug 2021 Page 30 of 136 For Restricted Circulation JTO Ph-II DNIT CISCO Router Configuration Basics Here are some of the names Cisco has given some of the interfaces: E0 (first Ethernet interface), E1 (second Ethernet interface). S0 (first Serial interface), S1 (second Serial interface), BRI 0 (first B channel for Basic ISDN) and BRI 1 (second B channel for Basic ISDN). Picture below shows the back view of a Cisco router Figure 14: Basic interfaces of a router 3.3.2 THE PROCESSOR (CPU) All Cisco routers have a main processor that takes care of the main functions of the router. The CPU generates interrupts (IRQ) in order to communicate with the other electronic components in the router. The Cisco routers use RISC processors. Usually the CPU utilisation on a normal router wouldn't exceed 20%. 3.3.3 THE IOS The IOS is the main operating system on which the router runs. The IOS is loaded upon the router's bootup. It usually is around 2 to 5MB in size, but can be a lot larger depending on the router series. The IOS gives the router its various capabilities and can also be updated or downloaded from the router for backup purposes. IOS is also available on a PCMCIA Flash card. This Flash card then plugs into a slot located at the back of the router and the router loads the IOS "image". Usually this image of the operating system is compressed so the router must decompress the image in its memory in order to use it. The IOS is one of the most critical parts of the router, without it the router is pretty much useless. Routers can also load the image off a network tftp server or from another router which might hold multiple IOS images for different routers, in which case it will have a large capacity Flash card to store these images. 3.3.4 THE RXBOOT IMAGE The RXBoot image (also known as Bootloader) is nothing more than a "cut- down" version of the IOS located in the router's ROM (Read Only Memory). If you had no Flash card to load the IOS from, you can configure the router to load the RXBoot image, which would give you the ability to perform minor maintenance operations and bring various interfaces up or down. JTO Ph-II Version 3.0 Aug 2021 Page 31 of 136 For Restricted Circulation JTO Ph-II DNIT CISCO Router Configuration Basics 3.3.5 THE RAM The RAM, or Random Access Memory, is where the router loads the IOS and the configuration file. It works exactly the same way as your computer's memory, where the operating system loads along with all the various programs. The amount of RAM your router needs is subject to the size of the IOS image and configuration file you have. Routing tables are also stored in the system's RAM so if you have large and complex routing tables, you will obviously need more RAM ! 3.3.6 THE NVRAM (NON-VOLATILE RAM) The NVRAM is a special memory place where the router holds its configuration. When you configure a router and then save the configuration, it is stored in the NVRAM. This memory is not big at all when compared with the system's RAM. Normally, when a router starts up, after it loads the IOS image it will look into the NVRAM and load the configuration file in order to configure the router. The NVRAM is not erased when the router is reloaded or even switched off. 3.3.7 ROM (READ ONLY MEMORY) The ROM is used to start and maintain the router. It contains some code, like the Bootstrap and POST, which helps the router do some basic tests and bootup when it's powered on or reloaded. You cannot alter any of the code in this memory as it has been set from the factory and is Read Only. 3.3.8 FLASH MEMORY The Flash memory is a card. It is, is an EEPROM (Electrical Eraseable Programmable Read Only Memory) card. It fits into a special slot normally located at the back of the router and contains nothing more than the IOS image(s). You can write to it or delete its contents from the router's console. Usually it comes in sizes of 4MB for the smaller routers (1600 series) and goes up from there depending on the router model. 3.3.9 CONFIGURATION REGISTER The Configuration Register determines if the router is going to boot the IOS image from its Flash, tftp server or just load the RXBoot image. This register is a 16 Bit register, in other words has 16 zeros or ones. A sample of it in Hex would be the following: 0x2102 and in binary is: 0010 0001 0000 0010. When you first power up a new Cisco Router, you have the option of using the ―setup‖ utility which allows you to create a basic initial configuration. However, Command Line Interface (CLI) mode may also be used for configuration. 3.4 MODES OF ROUTER There are mainly 5 modes in router: JTO Ph-II Version 3.0 Aug 2021 Page 32 of 136 For Restricted Circulation JTO Ph-II DNIT CISCO Router Configuration Basics a. User execution mode As soon as the interface up message appears and press enter, the router> prompt will pop up. This is called user execution mode. This mode is limited to some monitoring commands. b. Privileged mode As we type enable to user mode, we enter into Privileged mode where we can view and change the configuration of router. Different commands like show running- configuration, show IP interface brief etc can run on this mode which are used for troubleshooting purpose. c. Global configuration mode As we type configure terminal to the user mode, we will enter into the global configuration mode. Commands enter in these modes are called global commands and they affect the running-configuration of the router. In this mode, different configuration like making local database on router by providing username and password, can set enable and secret password etc. d. Interface configuration mode In this mode, only configuration of interfaces are done. Assigning an IP address to an interface, bringing up the interface are the common tasks done in this mode. e. ROMMON mode We can enter in this mode when we interrupt boot process of the router. Generally, we enter in this mode while password recovery process or Backing up of IOS on device like TFTP server. It is like BIOS mode of a PC 3.5 THE BASIC CLI MODES : Router> enable Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname Router1 Router1(config)#interface fastethernet 0/0 Router1(config-if)#ip address 192.168.1.1 255.255.255.0 Router1(config-if)#interface fastethernet 0/1 Router1(config-if)#ip address 192.168.4.1 255.255.255.0 Router1(config-if)# In Router 2 --- System Configuration Dialog --- Would you like to enter the initial configuration dialog? [yes/no]: no Router>enable Router#configure terminal Router(config)#hostname Router2 Router2(config)#interface fastethernet 0/0 Router2(config-if)#ip address 192.168.4.2 255.255.255.0 Router2(config-if)#interface fastethernet 0/1 Router2(config-if)#ip address 192.168.3.1 255.255.255.0 JTO Ph-II Version 3.0 Aug 2021 Page 39 of 136 For Restricted Circulation JTO Ph-II DNIT CISCO Router Configuration Basics Router2(config-if)#interface fastethernet 192.168.2.1 255.255.255.0 Router2(config-if)#interface fastethernet 1/0 Router2(config-if)#ip address 192.168.2.1 255.255.255.0 Router2(config-if)# 3.10.4 TASK 2 : CHECK THE IP ADDRESSES CONFIGURED IN TASK 1 & PUT ROUTER INTERFACES INTO RUNNING STATUS FROM DOWN STATUS In Router1 Router1(config-if)#exit Router1(config)#^Z Router1#show ip interface brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.1.1 YES manual administratively down down FastEthernet0/1 192.168.4.1 YES manual administratively down down Vlan1 unassigned YES unset administratively down down Router1# Bring up the interfaces of Router1: Router1#configure terminal Router1(config)#interface fastethernet 0/0 Router1(config-if)#no shutdown Router1(config-if)#interface fastethernet 0/1 Router1(config-if)#no shut down In Router2 JTO Ph-II Version 3.0 Aug 2021 Page 40 of 136 For Restricted Circulation JTO Ph-II DNIT CISCO Router Configuration Basics Router2#show ip interface brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.4.2 YES manual administratively down down FastEthernet0/1 192.168.3.1 YES manual administratively down down FastEthernet1/0 192.168.2.1 YES manual administratively down down FastEthernet1/1 unassigned YES unset administratively down down Vlan1 unassigned YES unset administratively down down Bring up the interfaces of Router2: Router2#configure terminal Router2(config)#interface fastEthernet 0/0 Router2(config-if)#no shutdown Router2(config-if)#interface fastEthernet 0/1 Router2(config-if)#no shutdown Router2(config-if)#interface fastEthernet 1/0 Router2(config-if)#no shutdown 3.10.5 TASK 3 CHECK THE CONTENTS OF ROUTING TABLE & ROUTER INTERFACES In Router1 Router1# Router1#show ip interface brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.1.1 YES manual up up FastEthernet0/1 192.168.4.1 YES manual up up Vlan1 unassigned YES unset administratively down down Router1#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP JTO Ph-II Version 3.0 Aug 2021 Page 41 of 136 For Restricted Circulation JTO Ph-II DNIT CISCO Router Configuration Basics D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set C 192.168.1.0/24 is directly connected, FastEthernet0/0 C 192.168.4.0/24 is directly connected, FastEthernet0/1 Router1# In Router2 Router2# Router2#show ip interface brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.4.2 YES manual up up FastEthernet0/1 192.168.3.1 YES manual up up FastEthernet1/0 192.168.2.1 YES manual up up FastEthernet1/1 unassigned YES unset administratively down down Router2#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route JTO Ph-II Version 3.0 Aug 2021 Page 42 of 136 For Restricted Circulation JTO Ph-II DNIT CISCO Router Configuration Basics Gateway of last resort is not set C 192.168.2.0/24 is directly connected, FastEthernet1/0 C 192.168.3.0/24 is directly connected, FastEthernet0/1 C 192.168.4.0/24 is directly connected, FastEthernet0/0 Router2# Observation: In both routers only their connected networks appears in the routing table. 3.10.6 TASK 4 RENAME THE ROUTER – FOR EASY IDENTIFICATION In Router 1 Router1>enable Router1#configure terminal Router1(config)#hostname CHN_CDR_KK_NGR CHN_CDR_KK_NGR(config)# CHN_CDR_KK_NGR(config)# In Router 2 Router2>enable Router2#configure terminal Router2(config)#hostname CHN_CORE_NIB CHN_CORE_NIB(config)# CHN_CORE_NIB(config)# 3.10.7 TASK 5 : CONFIGURE LOGIN BANNERS In Router 1 CHN_CDR_KK_NGR>enable CHN_CDR_KK_NGR#configure terminal CHN_CDR_KK_NGR(config)#banner login y ********* WARNING ******** Unauthorised users will be prosecuted - BSNL y CHN_CDR_KK_NGR(config)# In Router 2: Telnet to Router1 CHN_CORE_NIB> JTO Ph-II Version 3.0 Aug 2021 Page 43 of 136 For Restricted Circulation JTO Ph-II DNIT CISCO Router Configuration Basics CHN_CORE_NIB>telnet 192.168.4.1 (IP address of Router1) Table 6. Login Banner 3.10.8 TASK 6 SAVE THE CONFIGURATIONS: Router1>enable Router1#write Building configuration... [OK] Router2>enable Router1#write Building configuration... [OK] 3.10.9 LIST OF COMMANDS USED AND THEIR MEANING Command Purpose ENABLE Escalates privilege to admin role CONFIGURE TERMINAL Gets into global configuration mode INTERFACE Enters into i/f configuration mode JTO Ph-II Version 3.0 Aug 2021 Page 44 of 136 For Restricted Circulation JTO Ph-II DNIT CISCO Router Configuration Basics IP ADDRESS Assigns IP address and subnet mask NO SHUTDOWN Brings UP an interface HOSTNAME To rename a Cisco device To show login message (welcome/ BANNER LOGIN c c warning) ‗c‘ delimit character To come out from a specific configuration EXIT mode Saves the present running configuration as WRITE permanent configuration in NVRAM Table 7. Configuration Commands & their purpose 3.11 CONCLUSION Basic configuration of the router includes configuration of the IP address, host name, banner, secret password, user accounts, and other options. Cisco routers can be configured in several network environments, such as small office home office (SOHO), branch office (BO), regional office, and central site or Enterprise headquarters, with an easy-to-use web-based management interface. JTO Ph-II Version 3.0 Aug 2021 Page 45 of 136 For Restricted Circulation JTO PH-II IT RIP 4 ROUTING INFORMATION PROTOCOL 4.1 OBJECTIVE The objectives of this chapter is to understand Routing Information Protocol concepts RIP characteristics & features RIP functionality & format of RIPv2 update message Comparison between RIPv1 and RIPv2 Configuration procedure for RIPv2 4.2 INTRODUCTION TO ROUTING INFORMATION PROTOCOL A brief introduction on static and dynamic routing was given in the last chapters. This chapter discusses about routing information protocol in detail. PURPOSE OF ROUTING PROTOCOLS The roles played by routers are colossal in efficiently interconnecting different networks across Internet. For selection of best path between networks across countries router relies on routing table contents. The routing table contents may be static as dictated by network administrators. Since there are notable drawbacks in using static routing, larger networks prefer dynamic routing by enabling routing protocols. Routing protocols help in populating the routing table contents and keep the contents updated as and when network topology changes. It is not that entire Internet – Network of Networks runs using a single routing protocol. Many routing protocols run in different segments of Internet. Let us categorize them in the next section. Routing protocols‘ primary function is to update the routers‘ routing table. In simple terms routing protocols are languages by which routers speak about different networks they have in their topology. When a routing protocol is enabled on a particular router, that router will talk to other routers in which the same routing protocol is enabled in order to share network related information by exchanging route announcements. Most significant point to note is that, different routing protocols behave differently in exchanging network information. Based on the properties of routing protocols namely…. To which routers they share information? In what periodicity they exchange routing updates? What contents they exchange? JTO PH-II IT Version Page 46 of 136 For Restricted Circulation JTO PH-II IT RIP …… routing protocols are classified as shown in Figure below Figure 20: Classification of Routing Protocols Figure 21: Role of EGP & IGP Autonomous system An autonomous system (AS) is a collection of connected Internet Protocol (IP) routing prefixes along with their routers which are controlled under a single administration that follows a defined routing policy. Interior Gateway Protocols An interior gateway protocol (IGP) is a routing protocol that is used to exchange routing information within routers of an autonomous system (AS). Examples of IGP are RIP Routing Information Protocol, OSPF Open shortest Path First Protocol and EIGRP Enhanced Interior Gateway Routing Protocol. Exterior Gateway Protocols A routing protocol that exchanges routing information between different autonomous systems is termed as Exterior Gateway Protocol. BGP Border Gateway Protocol is an example of an EGP. JTO PH-II IT Version Page 47 of 136 For Restricted Circulation JTO PH-II IT RIP 4.3 ROUTING INFORMATION PROTOCOL - FEATURES Routing Information Protocol (RIP) is a distance vector protocol that measures the distance to reach a remote network by calculating hop count. RIP Metric: Figure 22: Calculation RIP metric The term hop count refers to the number of routers that a packet has to passes through from its source router to reach the destination network. RIP protocol uses Bellman Ford algorithm to find best route. Characteristics & features of Routing Information Protocol: 1. RIP is a distance vector routing protocol 2. RIP is an IGP Interior Gateway Protocol – works within AS 3. Administrative distance of RIP is 120 4. Supports classless routing and VLSM (RIPv2) 5. RIP uses metric – HOP COUNT to decide best path to reach a destination 6. RIP sends periodic update messages to next RIP routers 7. Entire routing table is sent each time 8. Maximum number of hops supported by RIP is 15 JTO PH-II IT Version Page 48 of 136 For Restricted Circulation JTO PH-II IT RIP 9. A route with Hop count 16 is considered as an invalid route. 10. A RIP update message carry a maximum of 25 routes 11. RIP uses UDP as transport layer and identified by port no 520 12. For avoiding routing loops RIP uses the following mechanisms: Split horizon - Don‘t send routes/ route updates learnt by a router back to it... Route poison - Routers send possibly down networks with Hop count 16 and keep them in HOLD DOWN status. Poison reverse - Is an acknowledgment for a route poison message, an exception to split horizon, send back a poisoned route with hop count set as 16. 13. RIP supports equal cost load balancing by default 14. RIP supports both manual and automatic route summarization (across major networks) 15. Timers used by RIP Update interval - 30 sec (routing updates scheduled) Invalid timer - 180 sec-(after last update, total 180 Sec) route is marked as invalid, but a part of routing update (metric is marked 16). Hold down timer - 180 sec (new routes are on hold) Flush timer - 240 sec - route is deleted Figure 23: RIP Timers 4.4 HOW RIP WORKS? RIP routers send their entire routing table contents of their table only to neighbor routers periodically. See Figure.5 The receiving router processes the route announcements and updates in its routing table if needed and forwards the contents of its own routing table to the next neighbor. This process repeats for all routers periodically. This type of exchanging routing information is referred as ―routing by rumor‖ JTO PH-II IT Version Page 49 of 136 For Restricted Circulation JTO PH-II IT RIP Figure 24: How RIP works The maximum hop count of the path is limited to 15 hops to prevent infinite routing loops; this limits the size of RIP networks. In RIPv1, the entire routing table contents are sent as route announcements as broadcast messages periodically, for every 30 seconds to only neighbors using the IP address 255.255.255.255. These entire routing contents are sent periodically to all devices as broadcast information. RIPv1 does not support VLSM. The improved version RIPv2 sends the entire routing table contents by using multicast address 224.0.0.9. RIPv2 supports VLSM and routing announcements contains subnet mask details. RIPv2 does automatic network address summarization. 4.5 COMPARISON OF RIPV1 AND RIPV2 FEATURES RIPv1 RIPv2 Supports classful routing Supports classless routing Support only FLSM Supports FLSM & VLSM Don‘t carry SNM in route update Carry SNM in route update messages messages Route updates are sent as broadcast Router updates are sent as multicast messages - 255.255.255.255 messages - 224.0.0.9 Auto summarizes routes across major Auto summarizes routes across network boundaries major network boundaries Supports manual route No manual route summarization support summarization Timed updates - every 30 seconds + Updates are timed - every 30 seconds triggered updates Support protocol authentication Does not support protocol authentication between RIPv2 routers JTO PH-II IT Version Page 50 of 136 For Restricted Circulation JTO PH-II IT RIP Table 8. Features of RIPv1 & RIPv2. RIP has little overhead regarding used bandwidth, configuration time and management time. It maintains only a single table – routing table. RIP is very easy to implement, suitable for small networks. 4.6 FORMAT OF RIPV2 UPDATE MESSAGE: Figure 25: Update Message Format of RIP 4.7 CONFIGURING RIPV2 When we enable static routes on a router, the unknown networks for that router needs to be configured. But while enable dynamic routing on a router, we configure directly connected routes under a routing protocol as given below… 4.8 STEPS TO CONFIGURE RIPV2: a. On each router,