ip_addressing & routing.ppt

51
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 IP Addressing & ROUTING Network Layer

Upload: surendra-tripathi

Post on 19-Jul-2016

34 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: IP_ADDRESSING & ROUTING.ppt

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

IP Addressing & ROUTING

Network Layer

Page 2: IP_ADDRESSING & ROUTING.ppt

Network Layer Design Network Layer Design IssuesIssues

• Implementation of Connectionless Service• Implementation of Connection-Oriented

Service• Comparison of Virtual-Circuit and Datagram

Subnets

Page 3: IP_ADDRESSING & ROUTING.ppt

Implementation of Connectionless Implementation of Connectionless ServiceService

Routing within a diagram subnet.

Page 4: IP_ADDRESSING & ROUTING.ppt

Implementation of Connection-Oriented Implementation of Connection-Oriented ServiceService

Routing within a virtual-circuit subnet.

Page 5: IP_ADDRESSING & ROUTING.ppt

Network LayerLogical Addressing Scheme

(IP Addressing)

Page 6: IP_ADDRESSING & ROUTING.ppt

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:

Page 7: IP_ADDRESSING & ROUTING.ppt

An IPv4 address is 32 bits long.

IPV4

Page 8: IP_ADDRESSING & ROUTING.ppt

The IPv4 addresses are unique and universal.

IPV4

Page 9: IP_ADDRESSING & ROUTING.ppt

The address space of IPv4 is 232 or 4,294,967,296.

IPV4

Page 10: IP_ADDRESSING & ROUTING.ppt

Dotted-decimal notation and binary notation for an IPv4 address

Page 11: IP_ADDRESSING & ROUTING.ppt

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.

Page 12: IP_ADDRESSING & ROUTING.ppt

In classful addressing, the address space is divided into five classes:

A, B, C, D, and E.

Classfull Addressing

Page 13: IP_ADDRESSING & ROUTING.ppt

Classfull AddressingClassfull Addressing

IP address formats.

Page 14: IP_ADDRESSING & ROUTING.ppt

Figure Finding the classes in binary and dotted-decimal notation

Page 15: IP_ADDRESSING & ROUTING.ppt

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.

Page 16: IP_ADDRESSING & ROUTING.ppt

Table Number of blocks and block size in classful IPv4 addressing

Page 17: IP_ADDRESSING & ROUTING.ppt

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:

Page 18: IP_ADDRESSING & ROUTING.ppt

Two-level hierarchy in an IPv4 address

Page 19: IP_ADDRESSING & ROUTING.ppt

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

Page 20: IP_ADDRESSING & ROUTING.ppt

Three-level hierarchy in an IPv4 address

Page 21: IP_ADDRESSING & ROUTING.ppt

Each address in the block can be considered as a three-level

hierarchical structure: the n bits defines

the netid, subnetid,And hostid.

Note:

Page 22: IP_ADDRESSING & ROUTING.ppt

CLASSLESS ADDRESSING CLASSLESS ADDRESSING SCHEMESCHEME

Page 23: IP_ADDRESSING & ROUTING.ppt

Classful addressing, which is almost obsolete, is replaced with classless

addressing.

Classless Addressing

Page 24: IP_ADDRESSING & ROUTING.ppt

Classless addressing, uses slash notation or CIDR(Classless Inter Domain

Routing) notation.

Classless Addressing

Page 25: IP_ADDRESSING & ROUTING.ppt

Table Default masks for classful addressing

Page 26: IP_ADDRESSING & ROUTING.ppt

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

Page 27: IP_ADDRESSING & ROUTING.ppt

The first address in the block can be found by setting the rightmost

32 − n bits to 0s.

Note

Page 28: IP_ADDRESSING & ROUTING.ppt

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

Page 29: IP_ADDRESSING & ROUTING.ppt

The last address in the block can be found by setting the rightmost

32 − n bits to 1s.

Note

Page 30: IP_ADDRESSING & ROUTING.ppt

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

Page 31: IP_ADDRESSING & ROUTING.ppt

Figure A network configuration for the block 205.16.37.32/28

Page 32: IP_ADDRESSING & ROUTING.ppt

The number of addresses in the block can be found by using the formula

232−n.

Note

Page 33: IP_ADDRESSING & ROUTING.ppt

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.

Page 34: IP_ADDRESSING & ROUTING.ppt

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

Page 35: IP_ADDRESSING & ROUTING.ppt

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

Page 36: IP_ADDRESSING & ROUTING.ppt

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

Page 37: IP_ADDRESSING & ROUTING.ppt

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

Page 38: IP_ADDRESSING & ROUTING.ppt

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.

Page 39: IP_ADDRESSING & ROUTING.ppt

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.

Page 40: IP_ADDRESSING & ROUTING.ppt

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

Page 41: IP_ADDRESSING & ROUTING.ppt

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.

Page 42: IP_ADDRESSING & ROUTING.ppt

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.

Page 43: IP_ADDRESSING & ROUTING.ppt

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

Page 44: IP_ADDRESSING & ROUTING.ppt

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

Page 45: IP_ADDRESSING & ROUTING.ppt

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

Page 46: IP_ADDRESSING & ROUTING.ppt

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

Page 47: IP_ADDRESSING & ROUTING.ppt

Solution Answer : A

Page 48: IP_ADDRESSING & ROUTING.ppt

Problem: GATE 2014 Problem on TTL Question no: 25

Page 49: IP_ADDRESSING & ROUTING.ppt

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Routing

Page 50: IP_ADDRESSING & ROUTING.ppt

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

Page 51: IP_ADDRESSING & ROUTING.ppt