IP_ADDRESSING & ROUTING.ppt
-
Upload
surendra-tripathi -
Category
Documents
-
view
40 -
download
4
Transcript of IP_ADDRESSING & ROUTING.ppt
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
IP Addressing & ROUTING
Network Layer
Network Layer Design Network Layer Design IssuesIssues
• Implementation of Connectionless Service• Implementation of Connection-Oriented
Service• Comparison of Virtual-Circuit and Datagram
Subnets
Implementation of Connectionless Implementation of Connectionless ServiceService
Routing within a diagram subnet.
Implementation of Connection-Oriented Implementation of Connection-Oriented ServiceService
Routing within a virtual-circuit subnet.
Network LayerLogical Addressing Scheme
(IP Addressing)
IPv4 ADDRESSESIPv4 ADDRESSES
An An IPv4 addressIPv4 address is a is a 32-bit32-bit address that uniquely and address that uniquely and universally defines the connection of a device (for universally defines the connection of a device (for example, a computer or a router) to the Internet.example, a computer or a router) to the Internet.
Classeful Addressing
Classless Addressing
Routing
Network Layer covers:Network Layer covers:
An IPv4 address is 32 bits long.
IPV4
The IPv4 addresses are unique and universal.
IPV4
The address space of IPv4 is 232 or 4,294,967,296.
IPV4
Dotted-decimal notation and binary notation for an IPv4 address
Change the following IPv4 addresses from binary notation to dotted-decimal notation.
Example 1
SolutionWe replace each group of 8 bits with its equivalent decimal number and add dots for separation.
In classful addressing, the address space is divided into five classes:
A, B, C, D, and E.
Classfull Addressing
Classfull AddressingClassfull Addressing
IP address formats.
Figure Finding the classes in binary and dotted-decimal notation
In the IPv4 addressing format, the number of networks allowed under Class C addresses is:(A) 214 (B) 27 (C) 221 (D) 224
Example 2 GATE 2012: 1 Marks
Solution : CExplanation. For class C address, size of network field is 24 bits. But first 3 bits are fixed as 110 for the representation of class; hence total number of networks possible is 221.
Table Number of blocks and block size in classful IPv4 addressing
In classful addressing, a large part of the available addresses were wasted.The efficiency of addressing can be
improved with help of Subnetting and Supernetting
Limitations of Classfull addressing:
Two-level hierarchy in an IPv4 address
Each address in the block can be considered as a two-level
hierarchical structure: the leftmost n bits (prefix) define
the network identity;the rightmost 32 − n bits define
the host identity.
Note
Three-level hierarchy in an IPv4 address
Each address in the block can be considered as a three-level
hierarchical structure: the n bits defines
the netid, subnetid,And hostid.
Note:
CLASSLESS ADDRESSING CLASSLESS ADDRESSING SCHEMESCHEME
Classful addressing, which is almost obsolete, is replaced with classless
addressing.
Classless Addressing
Classless addressing, uses slash notation or CIDR(Classless Inter Domain
Routing) notation.
Classless Addressing
Table Default masks for classful addressing
In IPv4 addressing, a block of addresses can be defined as
x.y.z.t /nin which x.y.z.t defines one of the
addresses and the /n defines the mask.
Note
The first address in the block can be found by setting the rightmost
32 − n bits to 0s.
Note
A block of addresses is granted to a small organization. We know that one of the addresses is 205.16.37.39/28. What is the first address in the block?
Example
Solution: The binary representation of the given address is
11001101 00010000 00100101 00100111 If we set 32−28 rightmost bits to 0, we get 11001101 00010000 00100101 00100000
or 205.16.37.32
The last address in the block can be found by setting the rightmost
32 − n bits to 1s.
Note
Find the last address for the block in previous.
SolutionThe binary representation of the given address is
11001101 00010000 00100101 00100111If we set 32 − 28 rightmost bits to 1, we get
11001101 00010000 00100101 00101111 or
205.16.37.47This is actually the block shown in Figure.
Example
Figure A network configuration for the block 205.16.37.32/28
The number of addresses in the block can be found by using the formula
232−n.
Note
Find the number of addresses in above problem.
Example
SolutionThe value of n is 28, which means that numberof addresses is 2 32−28 or 16.
In a class B network on the internet has a IP Address 144.97.17.132Subnet Mask 255.255.255.192Calculate the net id and host id for the IP address.
Solution: Subnet Mask: 11111111 11111111 11111111
11000000 Net id ……………………..
Host id ……………………….
Problem:1
In a class B network on the internet has a Subnet Mask 255.255.240.0Calculate the maximum no. of host per subnet.
Solution: Subnet Mask: 11111111 11111111 11111111
11000000 No of Host per Subnet: ?
Problem:2
The Subnet mask for a particular network is 255.255.31.0Which of the following pairs of IP Addresses could belong to this network?a. 172.57.88.62 to 172.56.87.62.2b. 10.35.28.2 to 10.35.29.2c. 191.203.31.87 to 191.234.31.88d. 128.8.129.43 to 128.8.161.55
Problem: GATE 2003
Solution : c & d: c & dExplanation. Both ranges belongs to class B. Both ranges belongs to class B
An organization has a class B network and wishes to from subnets for 64 departments. The subnet mask should be:a. 255.255.0.0b. 255.255.64.0c. 255.255.128.0d. 255.255.252.0
Problem: GATE 2005
Solution : dExplanation. For class B network 64 sub networks can be created by using 26 . So 6 bits will be used to create sub network. So mask will be :
11111111 11111111 11111100 00000000
Two computers C1 and C2 are configured as follows. C1 has IP address
203.197.2.53 and net mask 255.255.128.0. C2 has IP address 203.197.75.201
and net mask 255.255.192.0. which one of the following statements is true?
a. C1 and C2 both assume they are on the same network b. C2 assumes C1 is on same network, but C1 assumes C2 is on a different network c. C1 assumes C2 is on same network, but C2 assumes C1 is on a different network d. C1 and C2 both assume they are on different networks.
Problem: GATE 2006
Solution :: c cExplanation: IP address of C1 is 203.197.2.53 and Subnet mask is 255.255.128.0 ending gives the network id which is 203.197.0.0.
Explanation: Continuied…Explanation: Continuied… When C1 sees the ip address 203.197.75.201, to find the
network id it will and with its subnet mask, which gives 203.197.0.0.
So C1 assumes that C2 is on the same network with C1. Similarly, IP address of C2 is 203.197.75.201, subnet mask is
255.255.192.0 ending gives the network id which is 203.197.64.0.
When this computer looks at IP address of C1, to find the network id, it will and with its network mask giving 203.197.0.0.
Therefore C1 assumes that C2 is on the same network with Therefore C1 assumes that C2 is on the same network with C2, but C2 assumes C1 is on a different network.C2, but C2 assumes C1 is on a different network.
If a class B network on the Internet has a subnet mask of 255.255.248.0, what is the maximum number of hosts per subnet ?
a. 1022 b. 1023c. 2046 d. 2047
Problem: GATE 2008
Solution :: c cExplanation:Number of bits for subnet mask = 21 Number of bits for host = 11 Number of hosts = 211-2 = 2046
Suppose computers A and B have IP addresses 10.105.1.113 and 10.105.1.91 respectively and they both use the same net mask N. Which of the values of N given below should not be used if A and B should belong to the same network?(A) 255.255.255.0 (B) 255.255.255.128(C) 255.255.255.192 (D) 255.255.255.224
Problem: GATE 2010
Solution :: d dExplanation: For both IP address of A & B if Subnet mask is 255.255.255.0 gives the same network id for A & B which is 10.105.1.0.
Explanation: Continued…Explanation: Continued… For both IP address of A & B if Subnet mask is 255.255.255.128
gives again the same network id which is 10.105.1.0.
For both IP address of A & B if Subnet mask is 255.255.255.192 gives again the same network id which is 10.105.1.64.
For both IP address of A & B if Subnet mask is 255.255.255.224 gives the different network id which is 10.105.1.92 for A and 10.105.1.64 for B.
Therefore Subnet mask is 255.255.255.224 should not be Therefore Subnet mask is 255.255.255.224 should not be used for A & B different network.used for A & B different network.
The first address in a block is normally not assigned to any device; it is used as the network address that
represents the organization to the rest of the world.
Note
Problem:GATE 2012 Problem:GATE 2012
An Internet Service Provider (ISP) has the following chunk of CIDR-based IP addresses available with it: 245.248.128.0/20. The ISP wants to give half of this chunk of addresses to Organization. A, and a quarter to Organization B, while retaining the remaining with itself. Which of the following is a valid allocation of addresses to A and B?
(A) 245.248.136.0/21 and 245.248.128.0/22 (B) 245.248.128.0/21 and 245.248.128.0/22 (C) 245.248.132.0/22 and 245.248.132.0/21 (D) 245.248.136.0/24 and 245.248.132.0/21
Solution: (A) Explanation: Since half of 4096 host addresses must be
given to organization A, we can set 12th bit to 1 and include that bit into network part of organization A, so the valid allocation of addresses to A is 245.248.136.0/21
Now for organization B, 12th bit is set to ‘0’ but since we need only half of 2048 addresses, 13th bit can be set to ‘0’ and include that bit into network part of organization B so the valid allocation of addresses to B is 245.248.128.0/22
Problem:GATE 2011Problem:GATE 2011
A layer-4 firewall (a device that can look at all protocol headers up to the transport layer) CANNOT
(A) Block entire HTTP traffic during 9:00PM and 5:00AM
(B) Block all ICMP traffic (C) Stop incoming traffic from a specific IP address
but allow outgoing traffic to the same IP address (D) Block TCP traffic from a specific user on a
multi-user system during 9:00PM and 5:00Am
Solution Answer : A
Problem: GATE 2014 Problem on TTL Question no: 25
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Routing
Problem: GATE 2012(Ques:40)Problem: GATE 2012(Ques:40)
Consider the directed graph shown in the figure below. There are multiple shortest paths between vertices S and T. Which one will be reported by Dijkstra’s shortest path algorithm? Assume that, in
any iteration, the shortest path to a vertex v is updated
only when a strictly shorter path to v is discovered.
(A) SDT (B) SBDT (C) SACDT (D) SACET