1 For Summer Training on Computer Networking visit IP Addressing Prepared by : Swapan Purkait Director Nettech Private Limited and Routing
2 IP Addresses
3 Basic IP Addressing Each host connected to the Internet is identified by a unique IP address. An IP address is a 32-bit quantity. Expressed as a dotted-decimal notation W.X.Y.Z. Consists of two logical parts: A network number A host number This partition defines the IP address classes.
4 IP Address Classes There are five defined IP address classes. Class A UNICAST Class B UNICAST Class C UNICAST Class D MULTICAST Class E RESERVED There are some special-purpose IP addresses also.
5 Class Address Range Highorder bits Network bits Host bits A B C D E
6 Special-Purpose IP Addresses Address Range Purpose Unknown network, commonly represents default Reserved for private use Reserved for loopback/local address Reserved for private use Reserved for private use Limited broadcast
7 The class-based addressing is also known as the classful model. Different network classes lend themselves to different network configurations. Different network-to-hosts ratio.
8 Some Conventions Within a particular network (Class A, B or C), the first and last addresses serve special functions. The first address represents the network number (for example, ). The last address represents the directed broadcast address of the network (for example, ).
9 IP Subnetting
10 IP Subnet Basic concept: A subset of a class A, B or C network. IP addresses that do not use subnets consists of a network portion, and a host portion. Represents a static two-level hierarchical addressing model.
11 IP Subnet (contd.) IP subnets introduces a third level of hierarchy. a network portion a subnet portion a host portion Allow more efficient (and structured) utilization of the addresses. Uses network masks.
12 Natural Masks Network mask is applied to a class A network In binary, the mask is a series of contiguous 1 s followed by a series of contiguous 0 s Network portion Host portion
13 Natural Masks (contd.) Provide a mechanism to split the IP address into a network portion of 10, and a host portion of 20. Decimal Binary IP address: Mask: Network Host
14 Natural Masks (contd.) Class A, B and C addresses Have fixed division of network and host portions. Can be expressed as masks. Called natural masks. Natural Masks Class A :: Class B :: Class C ::
15 Creating Subnets using Masks Masks are very flexible. Using masks, networks can be divided into smaller subnets. How? By extending the network portion of the address into the host portion. Advantage gained: We can create a large number of subnets from one network. Can have less number of hosts per network.
16 Example: Subnets Network mask is applied to a class A network This divides the IP address into a network portion of 10, a subnet portion of 5, and a host portion of 20. The mask borrows a portion of the host space, and applies it to network space.
17 Subnets (contd.) What happens? Initially it was a single large Class A network ( hosts). We have now split the network into 256 subnets. From to The hosts pet subnet decreases to 65,534.
18 Subnets (contd.) Decimal Binary IP address: Mask: Host Network Subnet
19 Default Mask and Subnet mask IP Address AND Default Mask Network Address IP Address AND Subnet Mask Network Address : :
20 Subnets vrs Multiple Address Classes Subnets Management of subnets is done by local network administrator. Single entry in external router tables. Multiple Address Classes Multiple entries in external router tables. Additional overhead on the backbone (external) routers.
21 Comparison SUBNETS R R R R R R MULTIPLE ADDRESS CLASSES
22 Variable Length Subnet Mask (VLSM)
23 Variable Length Subnet Masks (VLSM) Basic concept The same network can be configured with different masks. Can have subnets of different sizes. Allows better utilization of available addresses.
24 Example: VLSM Suppose we are assigned a Class C network To be divided into three subnets. Corresponding to three departments. With 110, 45 and 50 hosts respectively. D1 (110) D2 (45) D3 (50)
25 The Example (contd.) Available subnet options The network mask will be the Class C natural mask Subnet masks of the form X Can be used to divide the network into more subnets.
26 The Subnet Options X X (in binary) No. of Subnets No. of Hosts Cannot satisfy the requirements.
27 The VLSM Option Basic concept: Use the mask to divide the network address into two subnets with 128 hosts each (.0 to.127) (.128 to.255)
28 The VLSM Option (contd.) Next subnet the second.128 subnet using a mask of Creates two subnets, 64 hosts each (.128 to.191) (.192 to.255)
29 The VLSM Option (contd.) Mask: (.0 to.127) (.128 to.255) Mask: (.128 to.191) (.192 to.255)
30 Interface 1 :: 128 hosts Network number: Network mask: Address: Interface 2 :: 64 hosts Network number: Network mask: Address: Interface 3 :: 64 hosts Network number: Network mask: Address:
31 128 Hosts E2 64 Hosts E3 ROUTER E4 64 Hosts Interface E2 :: 128 hosts Network number: Network mask: Address range: Interface E3 :: 64 hosts Network number: Network mask: Address range: Interface E4 :: 64 hosts Network number: Network mask: Address range:
32 VLSM :: Current Status All routing protocols do not support VLSM. Routing Information Protocol version 1 (RIP-1) do not carry network masks in routing updates. RIP-1 cannot implement VLSM. The following protocols support VLSM: Open Shortest Path First (OSPF) RIP-2 Enhanced IGRP (EIGRP) Administrators feel it difficult to move on to VLSM from older networks, where IP addresses were assigned somewhat haphazardly.
33 Classless Internet Domain Routing (Supernetting)
34 Running out of IP addresses Growing demand for IP addresses. Severe strain on the classful model. Due to wastage of address space. Measures taken: Creative allocation of IP addresses. Classless Inter-Domain Routing (CIDR). Private IP addresses, and Network Address Translation (NAT). IP version 6 (IPv6).
35 Creative IP Address Allocation The initial picture The IANA and the Internet Registry (IR) had complete control of address assignment. IP addresses were allocated to organizations sequentially. No concern about geographical factors. The modern approach Large, contiguous ranges of addresses are given to network service providers (NSP). NSP s allocate customer addresses from their own space. This funnel-down method results in more controlled and hierarchical method of IP address distribution.
36 A Partial Picture Address Space Area of Allocation Date Allocated APNIC Pacific Rim RIPE NCC Europe ARIN ARIN.. April 1997 April 1997 April 1997 July
37 Classless Inter-Domain Routing (CIDR) The size of the global routing tables have grown very fast in recent years. Caused routers to become saturated. Limits to processing power and available memory. Size of the tables have doubled every 10 months or so, between 1991 and 1995.
38 Without any remedial measure, the routing tables would have grown to about 80,000 routes in But early 2000 data shows that the size was around 76,000. Why this reduction? Planned IP address allocation. CIDR.
39 Growth of Internet Routing Tables '88 '94 '96 '98 '00 Year Routing Table Size
40 CIDR: Introduction CIDR is a new concept to manage IP networks. Classless Inter Domain Routing. No concept of class A, B, C networks. Reduces sizes of routing tables.
41 CIDR: Basic Idea An IP address is represented by a prefix, which is the IP address of the network. It is followed by a slash, followed by a number M. M: number of leftmost contiguous bits to be used for the network mask. Example: / 18
42 CIDR: An Important Rule The number of addresses in each block must be a power of 2. The beginning address in each block must be divisible by the number of addresses in the block. A block that contains 16 addresses cannot have beginning address as But the address is possible.
43 Example: CIDR An organization is allotted a block with beginning address: / 29 What is the range of the block? Start addr: End addr: There are 8 addresses in the block.
44 Example Suppose Company A needs IP addresses for 1000 machines Assign 4 contiguous Class C address blocks (last 8 bits 0)
45 Supernet: Address : Netmask: (last 10 bits 0) Also written as: /22 22 denotes size of network portion. Also called prefix. Routing done by prefix
46 Advantages Routing table at higher levels will have only one entry for the 4 networks. In classful addressing (that did not recognize masks), would have required 4 entries for the 4 networks. Possible only due to contiguous allocation. Higher level routers can just send it to lower level routers (in this case company A s router) using one entry only. Lower level router will distinguish.
47 Routing table at all higher level routers: /22 - send to host X (next hop on way to Company A s router RA) Routing table at RA: /24 send to router of first net /24 send to router of second net /24 send to router of third net /24 send to router of fourth net RA
48 Routers always do longest prefix match. If two entries match, longest match is taken. Example: two entries in table: one for /16 and one for /24. If address is , second entry will be used even though it matches both.
49 Recent Trend Move on to CIDR addressing. Existing classful networks can also be represented using this notation. Class A: W.X.Y.Z / 8 Class B: W.X.Y.Z / 16 Class C: W.X.Y.Z / 24 Recent routers support CIDR.
50 Routing Protocols
51 Connection Options 1. Connection-oriented Network layer protocol first makes a connection. All packets delivered as per the connection. 2. Connection-less Network layer protocol treats each packet independently. No relationship between packets.
52 Packet Delivery Options 1. Direct Delivery Host-to-host Router-to-host H1 Network H2 R
53 2. Indirect Delivery Through one or more routers. H1 N R1 N R2 H2 N
54 Routing Methods Several alternatives possible: a) Next-hop routing b) Network-specific routing c) Host-specific routing d) Default routing
55 a) Next-hop routing Routing tables based on next hop. H1 R1 R2 H2 Dest Next Hop Dest Next Hop Dest Next Hop H2 R1 H2 R2 H2 --
56 b) Network-specific routing Routing table based on destination network address. Dest N2 Next Hop R1 R1 H2 N1 N2 H1
57 c) Host-specific routing Can specify the address of a host. Dest Next Hop H2 R2 N2 N3 R1 R2 R1 N2 N1 R3 H1 R2 N3 H2
58 d) Default routing Follow a default path if no match found. H1 R1 N1 N2 Dest N2 Default Next Hop R1 R2 R2
59 Types of Routing Table 1. Static Contains information inserted manually. Does not change with time. 2. Dynamic Updated periodically depending on network condition. Uses protocols like RIP, OSPF, BGP, etc.
60 Typical Fields in a Routing Table Subnet mask Destination IP address Next hop address Flags U : router is up and running G : destination is in another network H : host-specific address D : added by redirection M : modified by redirection Interface
61 Example (Routing table for R1) Mask Dest NextHop Interface M M M0 M0 R R2 M
62 Routing Protocols RIP and OSPF
63 Routing Protocols Two classes of protocols: 1. Interior Routing Information Protocol (RIP) Open Shortest Path First (OSPF) 2. Exterior Border Gateway Protocol (BGP)
64 Autonomous Systems R N R N N AS R N AS R R N R N R N N AS R R N
65 What is an AS? A set of routers and networks managed by a single organization. The routers within the AS exchange information using a common routing protocol. The AS graph is connected (in the absence of failure).
66 Which class of protocols to use? Use interior router protocols to exchange information between routers within an AS. Use exterior routing protocol to pass exchange routing information between routers in different AS s.
67 Routing Information Protocol (RIP)
68 Routing Information Protocol (RIP) Routers within an autonomous system exchange messages. Distance vector routing using hop count. Table entries updated using values received from neighbors. Maintain timers to detect failed links. Used in first generation ARPANET.
71 Problems Slow convergence for larger networks. If a network becomes inaccessible, it may take a long time for all other routing tables to know this. After a number of message transfers. Routing loops may take a long time to be detected. Counting to infinity problem. Too much bandwidth consumed by routing updates.
72 Open Shortest Path First (OSPF)
73 Open Shortest Path First (OSPF) Widely used as the interior router protocol in TCP/IP networks. Basic concept: Computes a route that incurs the least cost. User configurable: delay, data rate, cost, etc. Each router maintains a database. Topology of the autonomous system to which the router belongs. Vertices and edges.
74 Two types of vertices: Router Network Two types of (weighted) edges: Two routers connected to each other by direct point-to-point link. A router is directly connected to a network. A router calculates the least-cost path to all destination networks. Using Dijkstra s algorithm. Only the next hop to the destination is used in the forwarding process.
75 At steady state All routers know the same network topology. Hello packets sent every 10 seconds (configurable) to neighbors. Link State Advertisement (LSA) flooded initially from each router. Absence of Hello packet for 40 seconds indicate failure of neighbour. Causes LSA to be flooded again. LSAs re-flooded every 30 minutes anyway.
76 OSPF Header Format Version T ype Message length SourceAddr AreaId Checksum Authentication type Authentication Authenticatio n
77 Packet types : 1 : Hello (check if neighbor is up) 2 : Database Description (synchronize database at beginning) 3 : Link State Request (request specific LSA) 4 : Link State Update (LSAs flooded) 5 : Link State Acknowledgement (flooded LSAs are explicitly ack ed reliable flooding)
78 Authentication type: Cleartext Encrypted (MD5 Hash, others possible)
79 Border Gateway Protocol (BGP)
80 What is BGP? Most widely used exterior router protocol for the Internet. Allows routers belonging to different autonomous systems to exchange routing information. Sent as messages over TCP connections. The router tables get updated.
81 Message Types in BGP Four types of messages: 1) Open: used to open a neighbor connection with another router. 2) Update: used to transmit information about a single route. 3) Keepalive: used to periodically confirm the neighbor connection. 4) Notification: used to notify about some error condition.
82 Types of error conditions reported: Message header error authentication and syntax. Open message error syntax errors and unrecognized options. Update message error. Hold timer expired used to close a connection if periodic messages are not received. Cease used by a router to close a connection with another router in the absence of any other error.
83 Functional Procedures in BGP Neighbor Acquisition Two routers agree to be neighbors by exchanging messages. Neighbor Reachability Check if the neighbor is still alive, and is maintaining the relationship. Network Reachability Each router maintains a list of the networks that it can reach, and the preferred routes.
84 All modern-day routers support BGP. The routers that are managed by ISP s actually run BGP. Organizational networks in many cases do not run BGP. Rely on the ISP s routers to route packets to the outside world. Default route will be to the ISP router.
85 Routing Examples
86 Configuration for routing example
87 Mask Dest. Next Hop I/f m m m m m m m0
88 Example 1 Router R1 receives 500 packets for destination ; the algorithm applies the masks row by row to the destination address until a match (with the value in the second column) is found.
89 Direct delivery & no match & no match & no match Host-specific & no match Network-specific & match
90 Example 2 Router R1 receives 100 packets for destination ; the algorithm applies the masks row by row to the destination address until a match is found.
91 Direct delivery & no match & match
92 Example 3 Router R1 receives 20 packets for destination ; the algorithm applies the masks row by row to the destination address until a match is found.
93 Direct delivery & no match & no match & no match Host-specific & no match
94 Network-specific & no match & no match Default & match
95 Example 4 Make the routing table for router R1 in the following figure.
96 Mask Destination Next Hop I/f m m m m0
97 Example 5 Make the routing table for router R1 in the following figure.
98 Mask Destination Next Hop I/f m m1 or or m m1 or or m ???????????? m0
99 Example 6 The routing table for router R1 is given below. Draw its topology. Mask Destination Next Hop I/f m m m m m m0
101 IP Version 6
102 Introduction The IP protocol forms the foundation of the Internet. IP version 4 is used widely today. IPv4 suffers from a number of drawbacks. Need to enhance the capabilities of the protocol. IP Next Generation IPng / IPv6
103 Problems with IPv4 Limited address space. 32-bit address is inadequate today. Applications demanding real-time response. Real-time audio or video. Must avoid changing routes frequently. Need for more complex addressing and routing capabilities. Two-level structure of IPv4 may not serve the purpose.
104 Main Features of IPv6 Something is common with IPv4: IPv6 is connectionless each datagram contains destination address and is routed independently. Header contains the maximum number of hops a datagram can make before being discarded. Some of the other general characteristics are also retained.
105 New features of IPv6: Address size: 128-bit addresses are used. 6x10 23 unique addresses per square meter of the earth s surface. Header format: IPv6 uses a series of fixed-length headers to handle optional information. A datagram consists of a base header followed by zero or more extension headers.
106 Support for real-time traffic: Allows a pair of stations to establish a high quality path between them. All datagrams flow through this path. Increased flexibility in addressing: Includes the concept of an anycast address, where a packet is delivered to one of a set of nodes. Provides for dynamic assignment of IP addresses.
107 IPv6 Datagram Format An IP datagram begins with a base header, followed by zero or more extension headers, followed by data (transport-layer PDU). 40 bytes base header Base Header Extension Header 1 Extension Header N Transport Layer PDU
108 IPv6 Base Header Format Version Priority Flow Label Payload Length Next Hdr Hop Limit Source Address (128 bits) Destination Address (128 bits)
109 The Fields Version (4 bits): contains the value 6. Priority (8 bits): specifies routing priority class. Flow Label (20 bits): used with applications that require performance guarantee. Payload Length (16 bits): total length of the extension headers and the transportlevel PDU. Next Header (8 bits): identifies the type of information that immediately follows the current header (IP extension, TCP or UDP).
110 Base Header Next=TCP TCP Data Base Header Next=Route Route Header Next=TCP TCP Data Hop Limit: decremented by 1 at each hop; discarded when it reaches 0. Source/destination addresses: 16 octets (128 bits) each.
111 IPv6 Extension Headers Routing Header Provides source routing. Hop-by-hop Options Header Defines special options that are processed at each hop. Fragment Header For fragmentation and reassembly. Authentication Header For packet integrity & authentication. All Extension headers chained in a linked list through Next Hdr field.
112 A Point About Fragmentation IPv6 fragmentation is similar to that in IPv4. Required information contained in a separate fragment extension header. Presence of the fragment header identifies the datagram as a fragment. Base header copied into all the fragments.
113 IPv6 Addressing Addresses do not have defined classes. A prefix length associated with each address (flexibility). Three types of addresses: Unicast: corresponds to a single computer. Multicast: Refers to a set of computers, possibly at different locations. Packet delivered to every member of the set.
114 Anycast: Refers to a set of computers with the same address prefix. Packet delivered to exactly one of the computers in the set. Required to support replication of services.
115 Colon Hexadecimal Notation An IPv6 address is 128 bits long. Dotted decimal notation too long. Use colon-hexadecimal notation. Each group of 16 bits written in hex, with a colon separating groups. Example: 7BD6:3DC:FFFF:FFFF:0:2D:F321:FFFF Sequence of zeros is written as two colons. 7BD6:0:0:0:0:0:0:B6 7BD6::B6
116 Aggregate Global Unicast Address 001 TLA Id (13) NLA Id (32) SLA Id (16) Interface Id (64) TLA: top-level aggregation NLA: next-level aggregation SLA: site-level aggregation Interface Id: typically based on hardware MAC address
117 IPv4-Mapped IPv6 Addresses Allow a host that supports both IPv4 and IPv6 to communicate with a host that supports only IPv4. IPv6 address is based on IPv4 address s, followed by 16 1 s, followed by a 32-bit IPv4 address.
118 IPv4 Compatible IPv6 Addresses Allows a host supporting IPv6 to talk IPv6 even if the local routers do not talk IPv6. Tell endpoint software to create a tunnel by encapsulating the IPv6 packet in an IPv4 packet s, followed by 16 0, followed by a 32-bit IP address.
119 Tunnelling Done automatically by the OS kernel when IPv4-compatible IPv6 addresses are used. IPv6 Host IPv4 Router IPv4 Router IPv6 Host IPv6 Datagram IPv4 Datagram
120 Transition from IPv4 to IPv6 Three alternate transition strategies: 1. Dual stack: Both IPv4 and IPv6 protocol stacks supported in the gateway. 2. Tunneling: An IPv6 datagram flows through an intermediate IPv4 network by encapsulating the whole IPv6 packet as payload. 3. Header translation: An IPv4 address is translated into a IPv6 address, and vice versa.
121 The Scenario Today Very few organizations have actually moved over to IPv6. IPv6 networks mostly confined to laboratories. Transition has to take anyway. The sooner the better.
122 Connect with us at Facebook Visit