politecnico di milanohome.deib.polimi.it/redondi/fcn/e5-ip addressing.pdf · to serve an old lan...

30
Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione E5 IP Addressing

Upload: doquynh

Post on 18-May-2018

217 views

Category:

Documents


2 download

TRANSCRIPT

Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione

E5 IP Addressing

Exercise 1

o  To an IP network is assigned the following set of IP addresses: n  address: 208.57.0.0 n  netmask: 255.255.0.0

o  It is necessary to partition the network so as to serve an old LAN with 4000 hosts

o  a) What netmask is necessary to define the subnet for the 4000 hosts?

o  b) What network address can be used? o  c) How many subnets of the same size can be

accommodated? o  d) How many subnets with 60 hosts can be

accommodated and with which netmak?

11010000.00111001.00000000.00000000 1111111.11111111.00000000.00000000

Solution 1

o  For the host-ID with 4000 hosts we need 12 bits (212=4096) and then:

o  A netmask with 20 consecutive 1s: 255.255.240.0 o  Possible subnet addresses are those obtained with any

value of the last four bits:

o  For instance: o  Corresponding to: 208.57.0.0/20

o  4 bits can take any value so 16 subnets in total, 15 subnets in addition to the one with 4000 hosts just assigned

11010000.00111001.xxxx0000.00000000 11010000.00111001.00000000.00000000

Solution 1

o  For an host-ID with at least 60 addresses we need 6 bits (26=64). Each of the 15 subnets of previous point c) have 12 bits of the host-ID and therefore can be subdivided using 6 bits (12-6=6) into 64 smaller subnets. In total: 64x15=960.

1101000.00111001.XXXXxxxx.xx000000

16-1=15 26=64

/16 /20

. . .

. . . /26

. . .

Exercise 2

o  For a network we have a class B address: 129.174.0.0. In the network we need to create at least 15 subnets connected through a router a)  Subdivide the addressing space and indicate the

network address of each subnet b)  How many hosts can be accommodated in each

subnet? c)  To which subnet the following addresses belong:

o  129.174.28.66 o  129.174.99.122 o  129.174.130.255 o  129.174.191.255 Are they host addresses or special addresses?

Solution 2 o  The network 129.174.0.0 has a host-ID of

16 bits and a net-ID of 16 bits o  Thorough the netmask we can divide the

host-ID so as to obtained a subnets o  With a 4 bits of the subnet ID we can

obtained 16 subnets o  Therefore, the netmask will have

16+4=20 bits set to 1 and 12 to 0. n  255.255.240.0

1 0 0 0 0 0 0 0 1281 1 0 0 0 0 0 0 1921 1 1 0 0 0 0 0 2241 1 1 1 0 0 0 0 2401 1 1 1 1 0 0 0 2481 1 1 1 1 1 0 0 2521 1 1 1 1 1 1 0 2541 1 1 1 1 1 1 1 255

Solution 2

n  The remaining 12 bits for the host-ID can accommodate up to 212-2=4094 hosts

n  Subnet addresses are:

0 0 0 0 0 0 0 0 00 0 0 1 0 0 0 0 160 0 1 0 0 0 0 0 320 0 1 1 0 0 0 0 480 1 0 0 0 0 0 0 640 1 0 1 0 0 0 0 800 1 1 0 0 0 0 0 960 1 1 1 0 0 0 0 1121 0 0 0 0 0 0 0 1281 0 0 1 0 0 0 0 1441 0 1 0 0 0 0 0 1601 0 1 1 0 0 0 0 1761 1 0 0 0 0 0 0 1921 1 0 1 0 0 0 0 2081 1 1 0 0 0 0 0 2241 1 1 1 0 0 0 0 240

129.174. .0/20

Solution 2

Ø  129.174.28.66 129.174.16.0/20 (host) Ø  129.174.99.122 129.174.96.0/20 (host) Ø  129.174.130.255 129.174.128.0/20 (host) Ø  129.174.191.255 129.174.176.0/20 (broadcast)

0 0 0 0 0 0 0 0 00 0 0 1 0 0 0 0 160 0 1 0 0 0 0 0 320 0 1 1 0 0 0 0 480 1 0 0 0 0 0 0 640 1 0 1 0 0 0 0 800 1 1 0 0 0 0 0 960 1 1 1 0 0 0 0 1121 0 0 0 0 0 0 0 1281 0 0 1 0 0 0 0 1441 0 1 0 0 0 0 0 1601 0 1 1 0 0 0 0 1761 1 0 0 0 0 0 0 1921 1 0 1 0 0 0 0 2081 1 1 0 0 0 0 0 2241 1 1 1 0 0 0 0 240

129.174. .0/20

Exercise 3

o  To the network in the figure is assigned the network address:

195.56.78.0/23 1100001.00111000.01001110.00000000

Internet R2

Bridge

eth0

eth1

eth2 R1 R3

eth3 R4

pp1

pp2

pp3

Rx

190.131.99.1

eth4 R5

pp4

190.131.99.2

Exercise 3 o  LANs must be dimensioned to accommodate at

least a number of hosts equal to: n  eth0: 150 n  eth1: 60 n  eth2: 55 n  eth3:57 n  eth4: 61

o  Point-to-point links are indicated as “pp” and are assumed to be full-duplex

a)  Divide the network in subnets indicating for each of them address and netmask (both LANs and P2P links)

b)  Assign to router interfaces addresses compatible with the subnets they are connected to

c)  Fill in routing tables of all routers

E, F, G e H 2 hosts

A 210 hosts

B 55 hosts

C 57 hosts

D, 61 hosts

Solution 3

o Subnets:

Internet R2

Bridge

eth0

eth1

eth2 R1 R3

eth3 R4

pp1

pp2

pp3

Rx 190.131.99.1

eth4 R5

pp4

Solution 3

o  For Subnet A we need a hostID with 8 bits o  For Subnets B, C and D we need a hostID with 6 bits o  For Subnets E, F, G and H we need a hostID with 2

bits

195.56.78.0/23

/24

/26

. . . /30

Subnet A

Subnet B

Subnet C

Subnet D Subnet E

Subnet F

Subnet G

Subnet H

Solution 3

195.56.78.0/23

/24 195.56.78.0/24

195.56.79.0/24

1100001.00111000.01001110.00000000

1100001.00111000.01001111.00000000

Subnet A

Solution 3

/26

195.56.79.0/24

1100001.00111000.01001111.00000000 195.56.79.0/26

195.56.79.64/26

195.56.79.128/26

195.56.79.192/26

1100001.00111000.01001111.01000000

1100001.00111000.01001111.10000000

1100001.00111000.01001111.11000000

Subnet B

Subnet C

Subnet D

Solution 3

195.56.79.192/26

1100001.00111000.01001111.11000000

. . .

/30 195.56.79.192/30

1100001.00111000.01001111.11000100 195.56.79.196/30

1100001.00111000.01001111.11001000 195.56.79.200/30

1100001.00111000.01001111.11001100 195.56.79.204/30

. . .

Subnet E

Subnet F

Subnet G

Subnet H

Solution 3

o  Interfaces:

Internet

R2

R1 R3

R4

Rx

190.131.99.1

R5

190.131.99.2

195.56.78.0/24

195.56.79.0/26

195.56.79.64/26

195.56.79.128/26

195.56.78.254/24

195.56.79.62/26

195.56.79.126/26

195.56.79.190/26

195.56.79.196/30

195.56.79.193

195.56.79.194 195.56.79.198

195.56.79.197

195.56.79.201

195.56.79.202

195.56.79.205

195.56.79.206

Solution 3

o Routing tables:

Internet

R2

R1 R3

R4

Rx

190.131.99.1

R5

190.131.99.2

195.56.79.193

195.56.79.194 195.56.79.198

195.56.79.197

195.56.79.201

195.56.79.202

195.56.79.205

195.56.79.206

network netmask first hop0.0.0.0 0.0.0.0 195.56.79.194

network netmask first hop0.0.0.0 0.0.0.0 195.56.79.198

network netmask first hop0.0.0.0 0.0.0.0 195.56.79.201

network netmask first hop0.0.0.0 0.0.0.0 195.56.79.205

network netmask first hop195.56.78.0 255.255.254.0 190.131.99.2

network netmask first hop195.56.78.0 255.255.255.0 195.56.79.193195.56.79.0 255.255.255.192 195.56.79.197195.56.79.64 255.255.255.192 195.56.79.202195.56.79.128 255.255.255.192 195.56.79.2060.0.0.0 0.0.0.0 190.131.99.1

Exercise 4 o  Consider the network in the figure o  Configure interfaces and provide a

routing table for routers A and B

A

Subnet 131.175.21.0/24

Subnet 131.175.16.0/24

INTERNET

Subnet 131.175.15.0/24

Subnet 131.175.70.0/24

B

Subnet 131.175.75.0/24

Solution 4

A

Subnet 131.175.21.0/24

Subnet 131.175.16.0/24

INTERNET

Subnet 131.175.15.0/24

Subnet 131.175.70.0/24

x.x.x.254

x.x.x.52 x.x.x.254 x.x.x.33

B

x.x.x.254

Subnet 131.175.75.0/24

x.x.x.254

x.x.x.254

Solution 4

network netmask first hop131.175.15.0 255.255.255.0 131.175.16.33131.175.70.0 255.255.255.0 131.175.16.330.0.0.0 0.0.0.0 131.175.21.254

Routing table of A Interfaces of A interface address netmaskA 131.175.21.52 255.255.255.0B 131.175.16.254 255.255.255.0C 131.175.75.254 255.255.255.0

network netmask first hop131.175.21.0 255.255.255.0 131.175.16.254131.175.75.0 255.255.255.0 131.175.16.2540.0.0.0 0.0.0.0 131.175.16.254

Routing table of B Interfaces of B interface address netmaskA 131.175.16.33 255.255.255.0B 131.175.70.254 255.255.255.0C 131.175.15.254 255.255.255.0

network netmask first hop0.0.0.0 0.0.0.0 131.175.16.254

Exercise 5

o  The topology of the network of the CS dept of university of california is indicated in the figure. To network the following addressing space is assigned: 131.175.96.0/22.

R1

INTERNETINTERNET

tr0

R2 R3

R4

eth0

eth1

eth2

eth3

pp0

pp1

1 2

34

R1

INTERNETINTERNET

tr0

R2 R3

R4

eth0

eth1

eth2

eth3

pp0

pp1

1 2

34

Exercise 5

o  Design an addressing plan with the following requirements:

o  tr0: IP subnet with at least 120 host o  eth0: IP subnet with at least 500 host o  eth1: IP subnet with at least 120 host o  eth2: IP subnet with at least 120 host o  eth3: IP subnet with at least 50 host o  pp0: point to point link o  pp1: point to point link

o  For each subnet indicate network address, netmask, and direct broadcast address.

o  Assign an address to router interfaces and provide a valid routing table for R2.

Solution 5

131.175.96.0/22

131.175.98.0/23 Da suddividere

131.175.96.0/23 eth0

131.175.98.0/23 131.175.98.128/25 eth1

131.175.98.0/25 tr0

131.175.99.0/25 eth2 131.175.99.128/25 Da suddvidere

Solution 5

131.175.99.128/25

131.175.99.192/26 Da suddividere

131.175.99.128/26 eth3

131.175.99.192/26 131.175.99.196/30 pp1

131.175.99.192/30 pp0

… …

Solution 5 o  Eth0

o  Address: 131.175.96.0/23 o  Broadcast: 131.175.97.255

o  Tr0 o  Address: 131.175.98.0/25 o  Broadcast: 131.175.98.127

o  Eth1 o  Address: 131.175.98.128/25 o  Broadcast: 131.175.98.255

o  Eth2 o  Address: 131.175.99.0/25 o  Broadcast: 131.175.99.127

o  Eth3 o  Address: 131.175.99.128/26 o  Broadcast: 131.175.99.191

o  pp0 o  Address: 131.175.99.192/30 o  Broadcast: 131.175.99.195

o  pp1 o  Address: 131.175.99.196/30 o  Broadcast: 131.175.99.199

Solution 5

Interfaces: o  R2

n  If1: 131.175.98.129 n  If2: 131.175.99.197 n  If3: 131.175.99.193 n  If4: 131.175.98.1

o  R1 on tr0: n  131.175.98.2

o  R4 on pp1: n  131.175.99.198

o  R3 on pp0: n  131.175.99.194

R1

INTERNETINTERNET

tr0

R2 R3

R4

eth0

eth1

eth2

eth3

pp0

pp1

1 2

34

R1

INTERNETINTERNET

tr0

R2 R3

R4

eth0

eth1

eth2

eth3

pp0

pp1

1 2

34

Solution 5

o  Routing table for R2:

R1

INTERNETINTERNET

tr0

R2 R3

R4

eth0

eth1

eth2

eth3

pp0

pp1

1 2

34

R1

INTERNETINTERNET

tr0

R2 R3

R4

eth0

eth1

eth2

eth3

pp0

pp1

1 2

34

network netmask next hop 131.175.99.0 255.255.255.128 131.175.99.198

131.175.99.128 255.255.255.192 131.175.99.194

0.0.0.0 0.0.0.0 131.175.98.2

Other exercises

Exercise 6

Internet

R2

R1

LAN da 10 host

R6 R5

pp1

Switch

Switch

Switch

… …

R3

Switch

Switch

Switch

… … Switch

R4

Switch

Switch

Switch

pp2

pp3

1 60 1 60

1 25

1 60 1 60

1 50 1 50

1 50

o  To the network in the figure the following addressing space is assigned: 131.175.200.0/23.

Exercise 6

o  Design an addressing plan compatible with the number of hosts indicated in the figure

o  Identify each subnet graphically on the figure o  For each subnet indicate network address, netmask,

and direct broadcast address. o  Assign an address to router interfaces and provide a

valid routing table for R1.