computer network notes in network layer.

shivanigarv9115 20 views 13 slides Sep 04, 2024
Slide 1
Slide 1 of 13
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13

About This Presentation

computer network third unit


Slide Content

UNIT-3.3 NETWORK LAYER

What is IP? An IP stands for internet protocol. An IP address is assigned to each device connected to a network. Each device uses an IP address for communication. It also behaves as an identifier as this address is used to identify the device on a network. It defines the technical format of the packets. Mainly, both the networks, i.e., IP and TCP, are combined together, so together, they are referred to as a  TCP/IP . It creates a virtual connection between the source and the destination. We can also define an IP address as a numeric address assigned to each device on a network. An IP address is assigned to each device so that the device on a network can be identified uniquely. To facilitate the routing of packets, TCP/IP protocol uses a 32-bit logical address known as IPv4(Internet Protocol version 4). An  IP  address consists of two parts, i.e., the first one is a network address, and the other one is a host address. There are two types of IP addresses: IPv4 IPv6 What is IPv4? IPv4 is a version 4 of IP. It is a current version and the most commonly used IP address. It is a 32-bit address written in four numbers separated by 'dot', i.e., periods. This address is unique for each device. For example,  66.94.29.13

Supernetting in Network Layer Supernetting  is the opposite of  Subnetting . In subnetting, a single big network is divided into multiple smaller subnetworks. In Supernetting , multiple networks are combined into a bigger network termed as a Supernetwork or Supernet . Supernetting is mainly used in Route Summarization, where routes to multiple networks with similar network prefixes are combined into a single routing entry, with the routing entry pointing to a Super network, encompassing all the networks. This in turn significantly reduces the size of routing tables and also the size of routing updates exchanged by routing protocols. More specifically, When multiple networks are combined to form a bigger network, it is termed as super-netting Super netting is used in route aggregation to reduce the size of routing tables and routing table updates There are some points which should be kept in mind while supernetting : All the Networks should be contiguous. The block size of every networks should be equal and must be in form of 2 n . First Network id should be exactly divisible by whole size of supernet . Example –  Suppose 4 small networks of class C: Network Id Subnet Mask Interface 200.1.0.0 255.255.255.0 A 200.1.1.0 255.255.255.0 B 200.1.2.0 255.255.255.0 C 200.1.3.0 255.255.255.0 D Build a bigger network which have a single Network Id. Explanation –  Before Supernetting routing table will be look like as:

First, lets check whether three condition are satisfied or not: Contiguous:  You can easily see that all network are contiguous all having size 256 hosts. Range of first Network from 200.1.0.0 to 200.1.0.255. If you add 1 in last IP address of first network that is 200.1.0.255 + 0.0.0.1, you will get the next network id that is 200.1.1.0. Similarly, check that all network are contiguous. Equal size of all network:  As all networks are of class C, so all of the have a size of 256 which in turn equal to 2 8 . First IP address exactly divisible by total size:  When a binary number is divided by 2 n  then last n bits are the remainder. Hence in order to prove that first IP address is exactly divisible by while size of Supernet Network. You can check that if last n v=bits are 0 or not. In given example first IP is 200.1.0.0 and whole size of supernet is 4*2 8  = 2 10 . If last 10 bits of first IP address are zero then IP will be divisible. Last 10 bits of first IP address are zero (highlighted by green color). So 3rd condition is also satisfied. Therefore, you can join all these 4 networks and can make a Supernet . New Supernet Id will be 200.1.0.0. Advantages of Supernetting – Control and reduce network traffic Helpful to solve the problem of lacking IP addresses Minimizes the routing table Disadvantages of Supernetting – It cannot cover different area of network when combined All the networks should be in same class and all IP should be contiguous

Example : Given IP address 132.6.17.85 and default class B mask, find the beginning address (network address). Solution : The default mask is 255.255.0.0, which means that the only the first 2 bytes are preserved and the other 2 bytes are set to 0. Therefore, the network address is 132.6.0.0.   Subnetting:   Dividing a large block of addresses into several contiguous sub-blocks and assigning these sub-blocks to different smaller networks is called subnetting. It is a practice that is widely used when classless addressing is done. Classless Addressing To reduce the wastage of IP addresses in a block, we use sub-netting. What we do is that we use host id bits as net id bits of a classful IP address. We give the IP address and define the number of bits for mask along with it (usually followed by a ‘/’ symbol), like, 192.168.1.1/28. Here, subnet mask is found by putting the given number of bits out of 32 as 1, like, in the given address, we need to put 28 out of 32 bits as 1 and the rest as 0, and so, the subnet mask would be 255.255.255.240.  

IP Addressing | Classless Addressing Network Address and Mask Network address – It identifies a network on internet.  Using this, we can find range of addresses in the network and total possible number of hosts in the network. Mask – It is a 32-bit binary number that gives the network address in the address block when AND operation is bitwise applied on the mask and any IP address of the block. The default mask in different classes are : Class A – 255.0.0.0 Class B – 255.255.0.0 Class C – 255.255.255.0

Classless Addressing To reduce the wastage of IP addresses in a block, we use sub-netting. What we do is that we use host id bits as net id bits of a classful IP address. We give the IP address and define the number of bits for mask along with it (usually followed by a ‘/’ symbol), like, 192.168.1.1/28. Here, subnet mask is found by putting the given number of bits out of 32 as 1, like, in the given address, we need to put 28 out of 32 bits as 1 and the rest as 0, and so, the subnet mask would be 255.255.255.240.   Some values calculated in subnetting : 1. Number of subnets : Given bits for mask – No. of bits in default mask 2. Subnet address : AND result of subnet mask and the given IP address 3. Broadcast address : By putting the host bits as 1 and retaining the network bits as in the IP address 4. Number of hosts per subnet : 2 (32 – Given bits for mask)  – 2 5. First Host ID : Subnet address + 1 (adding one to the binary representation of the subnet address) 6. Last Host ID : Subnet address + Number of Hosts   Example :  Given IP Address – 172.16.0.0/25, find the number of subnets and the number of hosts per subnet. Also, for the first subnet block, find the subnet address, first host ID, last host ID and broadcast address. Solution  : This is a class B address. So, no. of subnets = 2 (25-16)  = 2 9  = 512. No. of hosts per subnet = 2 (32-25)  – 2 = 2 7  – 2 = 128 – 2 = 126 For the first subnet block, we have subnet address = 0.0, first host id = 0.1, last host id = 0.126 and broadcast address = 0.127

IPv4 Classless Subnet equation Problem –  How to calculate IP address subnet information (Network, Broadcast, First IP, Last IP)? It’s too simple equation to calculate IPv4 Subnet Network ID. *Used and Tested with Class C Subnets. First Of All, Keep this Subnet Hosts Map in mind (Number of Hosts per Prefix): Network Prefix: Number of IPs 24 : 256 Ips 25 : 128 IPs 26 : 64 IPs 27 : 32 IPs 28 : 16 IPs 29 : 8 IPs 3 30 : 4 IPs Using Equation: Network ID: floor(Host Address/Subnet Number of Hosts) * Subnet Number of Hosts Broadcast ID: (Host ID + (Subnet Number of Hosts-1)) First Host: Network ID + 1 Last Host: Broadcast ID - 1

65/16 = 4.0625 Network ID: 4*16 = 64 (192.168.1.64) Broadcast ID: 64+(16-1) = 79 (192.168.1.79) First Host ID: 64 + 1 = 65 (192.168.1.65) Last Host ID: 79 - 1 = 78 (192.168.1.78) Ex1: 192.168.1.65/28: 166/128 = 1.296875 Network ID: 1*128 = 128 (192.168.20.128) Broadcast ID: 128+(128-1) = 255 (192.168.20.255) First Host ID: 128 + 1 = 129 (192.168.20.129) Last Host ID: 255 - 1 = 254 (192.168.20.254) 200.10.20.40/28 Ex2: 192.168.20.166/25:

200.10.20.40/28 calculate broadcast id network id first host id last host id subnet mask : 11111111.11111111.11111111.11110000 255.255.255.240 200.10.20.00101000 00100000

14/8 = 1.75 Network ID: 1*8 = 8 (192.168.30.8) Broadcast ID: 8+(8-1) = 15 (192.168.30.15) First Host ID: 8 + 1 = 9 (192.168.30.9) Last Host ID: 15 - 1 = 14 (192.168.30.14) Ex3: 192.168.30.14/29: 86/4 = 21.5 Network ID: 21*4 = 84 (192.168.20.84) Broadcast ID: 84+(4-1) = 87 (192.168.20.87) First Host ID: 84 + 1 = 85 (192.168.20.85) Last Host ID: 87 - 1 = 86 (192.168.20.86) Ex4: 192.168.20.86/30:

Drawback of IPv4 Currently, the population of the world is 7.6 billion. Every user is having more than one device connected with the internet, and private companies also rely on the internet. As we know that IPv4 produces 4 billion addresses, which are not enough for each device connected to the internet on a planet. Although the various techniques were invented, such as variable- length mask, network address translation, port address translation, classes, inter-domain translation, to conserve the bandwidth of IP address and slow down the depletion of an IP address. In these techniques, public IP is converted into a private IP due to which the user having public IP can also use the internet. But still, this was not so efficient, so it gave rise to the development of the next generation of IP addresses, i.e., IPv6. What is IPv6? IPv4 produces 4 billion addresses, and the developers think that these addresses are enough, but they were wrong. IPv6 is the next generation of IP addresses. The main difference between IPv4 and IPv6 is the address size of IP addresses. The IPv4 is a 32-bit address, whereas IPv6 is a 128-bit hexadecimal address. IPv6 provides a large address space, and it contains a simple header as compared to IPv4. It provides transition strategies that convert IPv4 into IPv6, and these strategies are as follows: Dual stacking:  It allows us to have both the versions, i.e., IPv4 and IPv6, on the same device. Tunneling:  In this approach, all the users have IPv6 communicates with an IPv4 network to reach IPv6. Network Address Translation:  The translation allows the communication between the hosts having a different version of IP.

This hexadecimal address contains both numbers and alphabets. Due to the usage of both the numbers and alphabets, IPv6 is capable of producing over 340 undecillion (3.4*10 38 ) addresses. IPv6 is a 128-bit hexadecimal address made up of 8 sets of 16 bits each, and these 8 sets are separated by a colon. In IPv6, each hexadecimal character represents 4 bits. So, we need to convert 4 bits to a hexadecimal number at a time Address format The address format of IPv4:                    The address format of IPv6:                                  The above diagram shows the address format of IPv4 and IPv6. An IPv4 is a 32-bit decimal address. It contains 4 octets or fields separated by 'dot', and each field is 8-bit in size. The number that each field contains should be in the range of 0-255. Whereas an IPv6 is a 128-bit hexadecimal address. It contains 8 fields separated by a colon, and each field is 16-bit in size.