0% found this document useful (0 votes)
22 views8 pages

Ch4-exercises

The document contains exercises on subnet addressing, NAT, and IPv6 tunneling. It includes questions and solutions regarding private and public IP addresses, subnet addresses, broadcast addresses, and datagram forwarding. The exercises illustrate concepts related to IP addressing and routing in both IPv4 and IPv6 networks.

Uploaded by

Osama Rashad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views8 pages

Ch4-exercises

The document contains exercises on subnet addressing, NAT, and IPv6 tunneling. It includes questions and solutions regarding private and public IP addresses, subnet addresses, broadcast addresses, and datagram forwarding. The exercises illustrate concepts related to IP addressing and routing in both IPv4 and IPv6 networks.

Uploaded by

Osama Rashad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Ch4 -Exercises

SUBNET ADDRESSING
Q1. Consider the router and the two attached subnets below (A and B).
The number of hosts is also shown below. The subnets share the 24
high-order bits of the address space: 10.186.192.0/24

QUESTION LIST
1. Is the address space public or private? Private

2. How many hosts can there be in this address space? 2 8 - 2 = 254

3. What is the subnet address of subnet A? (CIDR notation) 10.186.192.64/27

4. What is the broadcast address of subnet A? 10.186.192.95

5. What is the starting address of subnet A? 10.186.192.65

6. What is the ending address of subnet A? 10.186.192.94

7. What is the subnet address of subnet B? (CIDR notation) 10.186.192.0/26

8. What is the broadcast address of subnet B? 10.186.192.63

9. What is the starting address of subnet B? 10.186.192.1

10. What is the ending address of subnet B? 10.186.192.62


----------------------------------------------------------------

Summary:
The address space: 10.186.192.0/24
B- 10.186.192.0/26 (64 Ips)

A- 10.186.192.64/27 (32 Ips)


----------------------------------------------------------------
SOLUTION

1. The address 10.186.192.0/24 is private.

2. Maximum number of hosts = 2^x - 2 = 2^8 - 2 = 254.

3. Subnet A is 10.186.192.64/27. It has 21 hosts, so it will need at least 23


addresses (for the subnet ID and broadcast address). The least number of
bits that satisfy this is 5 bits. Knowing that, we take the prior subnet and add
32.

4. The broadcast address of subnet A (10.186.192.64/27) is 10.186.192.95,


because it is the last address in the IP range.

5. The first IP address of subnet A (10.186.192.64/27) is 10.186.192.65,


found by adding 1 to the subnet address.

6. The last IP address of subnet A (10.186.192.64/27) is 10.186.192.94,


found by subtracting 1 from the broadcast address (10.186.192.95).

7. subnet B is 10.186.192.0/26. It has 42 hosts, so it will need at least 44


addresses (for the subnet ID and broadcast address). The least number of
bits that satisfy this is 6 bits. Knowing that, we take the prior subnet and add
64.

8. The broadcast address of subnet B (10.186.192.0/26) is 10.186.192.63,


because it is the last address in the IP range.

9. The first IP address of subnet B (10.186.192.0/26) is 10.186.192.1, found


by adding 1 to the subnet address.

10. The last IP address of subnet B (10.186.192.0/26) is 10.186.192.62,


found by subtracting 1 from the broadcast address (10.186.192.63).

Q2. Consider the router and the three attached subnets below (A, B, and C). The number
of hosts is also shown below. The subnets share the 24 high-order bits of the address
space: 53.194.246.0/24

QUESTION LIST
1. Is the address space public or private? Public
2. How many hosts can there be in this address space? 28 - 2 = 254

3. What is the subnet address of subnet A? (CIDR notation) 53.194.246.0/25

4. What is the broadcast address of subnet A? 53.194.246.127

5. What is the starting address of subnet A? 53.194.246.1

6. What is the ending address of subnet A? 53.194.246.126

7. What is the subnet address of subnet B? (CIDR notation) 53.194.246.160/27

8. What is the broadcast address of subnet B? 53.194.246.191

9. What is the starting address of subnet B? 53.194.246.161

10. What is the ending address of subnet B? 53.194.246.190

11. What is the subnet address of subnet C? (CIDR notation) 53.194.246.128/27

12. What is the broadcast address of subnet C? 53.194.246.159

13. What is the starting address of subnet C? 53.194.246.129

14. What is the ending address of subnet C? 53.194.246.158


------------------------------------------------------------
Summary:
The address space: 53.194.246.0/24

A- 128 Ips 53.194.246.0/25 (128 Ips)


C- 32 Ips 53.194.246.128/27 (32 Ips)

B- 32 Ips 53.194.246.160/27 (32 Ips)

---------------------------------------------------------

SOLUTION
1. The address 53.194.246.0/24 is public.

2. Maximum number of hosts = 2^x - 2 = 2^8 - 2 = 254. The reason we have to subtract 2
from the final number is because there are always 2 addresses allocated for each address
block: the subnet ID (the first address) and the broadcast address (the last address); for
example, if you have 5 bits for hosts, you can have 30 hosts, because 2 of the addresses
are for the subnet ID and the broadcast address which when added equals 32, which is
2^5.

3. Subnet A has 93 hosts, so it will need at least 95 addresses (for the subnet ID and
broadcast address). The least number of bits that satisfy this is 7 bits. Knowing that, we
take the prior subnet and add 128, the result of which is 53.194.246.0/25

4. The broadcast address of subnet A (53.194.246.0/25) is 53.194.246.127, because it is


the last address in the IP range.

5. The first IP address of subnet A (53.194.246.0/25) is 53.194.246.1, found by adding 1 to


the subnet address.

6. The last IP address of subnet A (53.194.246.0/25) is 53.194.246.126, found by


subtracting 1 from the broadcast address (53.194.246.127).

7. Similar to the prior subnet, subnet B has 19 hosts, so it will need at least 21 addresses
(for the subnet ID and broadcast address). The least number of bits that satisfy this is 5
bits. Knowing that, we take the prior subnet and add 32, the result of which is
53.194.246.160/27

8. The broadcast address of subnet B (53.194.246.160/27) is 53.194.246.191, because it is


the last address in the IP range.

9. The first IP address of subnet B (53.194.246.160/27) is 53.194.246.161, found by


adding 1 to the subnet address.

10. The last IP address of subnet B (53.194.246.160/27) is 53.194.246.190, found by


subtracting 1 from the broadcast address (53.194.246.191).

11. Similar to the prior two subnets, subnet C has 23 hosts, so it will need at least 25
addresses (for the subnet ID and broadcast address). The least number of bits that satisfy
this is 5 bits. Knowing that, we take the prior subnet and add 32, the result of which is
53.194.246.128/27

12. The broadcast address of subnet C (53.194.246.128/27) is 53.194.246.159, because it


is the last address in the IP range.

13. The first IP address of subnet C (53.194.246.128/27) is 53.194.246.129, found by


adding 1 to the subnet address.
14. The last IP address of subnet C (53.194.246.128/27) is 53.194.246.158, found by
subtracting 1 from the broadcast address (53.194.246.159).
NETWORK ADDRESS TRANSLATION
Q3. Consider the scenario below in which three hosts, with private IP addresses 10.0.1.13,
10.0.1.16, 10.0.1.21 are in a local network behind a NAT'd router that sits between these
three hosts and the larger Internet. IP datagrams being sent from, or destined to, these
three hosts must pass through this NAT router. The router’s interface on the LAN side has
IP address 10.0.1.27, while the router’s address on the Internet side has IP address
135.122.198.206

Before doing this problem, you might want to reread the section on the NAT protocol in
section 4.3.4 in the text.

Suppose that the host with IP address 10.0.1.13 sends an IP datagram destined to host
128.119.168.190. The source port is 3426, and the destination port is 80.

QUESTION LIST
1. Consider the datagram at step 1, after it has been sent by the host but before it has
reached the router. What is the source IP address for this datagram? 10.0.1.13

2. At step 1, what is the destination IP address? 128.119.168.190

3. Now consider the datagram at step 2, after it has been transmitted by the router.
What is the source IP address for this datagram? 135.122.198.206

4. At step 2, what is the destination IP address for this datagram? 128.119.168.190

5. Will the source port have changed? Yes or No. Yes

6. Now consider the datagram at step 3, just before it is received by the router. What is
the source IP address for this datagram? 128.119.168.190
7. At step 3, what is the destination IP address for this datagram? 135.122.198.206

8. Last, consider the datagram at step 4, after it has been transmitted by the router but
before it has been received by the host. What is the source IP address for this datagram?
128.119.168.190
9. At step 4, what is the destination IP address for this datagram? 10.0.1.13

SOLUTION
1. The source address will be the local host's IP, which is 10.0.1.13

2. The destination address will be the remote machine's IP, which is 128.119.168.190

3. The source address will be the router's public IP, which is 135.122.198.206

4. The destination address will be the remote machine's IP, which is 128.119.168.190

5. Yes, the NAT will change the source port.

6. The source address will be the remote machine's IP, which is 128.119.168.190

7. The destination address will be the router's public IP, which is 135.122.198.206

8. The source address will be the remote machine's IP, which is 128.119.168.190

9. The destination address will be the local host's IP, which is 10.0.1.13

IPV6 TUNNELING AND ENCAPSULATION


Q4. Consider the network shown below which contains four IPv6 subnets, connected by a
mix of IPv6-only routers(shaded blue), IPv4-only routers (shaded red) and dual-capable
IPv6/IPv4 routers (shaded blue with red interfaces to IPv4 routers). You might want to
review Section 4.3.4 in the textbook before doing this problem.
Suppose that a host of subnet D wants to send an IPv6 datagram to a host on subnet B.
Assume that the forwarding between these two hosts goes along the
path: D --> E --> d --> b --> c --> B

QUESTION LIST
1. Is the datagram being forwarded from D to E an IPv4 or IPv6 datagram? IPv6

2. What is the source address of this D to E datagram?


3C7A:38E9:BA22:EED3:8EA3:A439:7FEC:5F62

3. What is the destination address of this D to E datagram?


C272:DEE2:5816:1E21:4E99:D661:6974:B3F9

4. Is this D to E datagram encapsulating another datagram? Yes or No. No

5. Is the datagram being forwarded from E to d an IPv4 or IPv6 datagram? IPv4

6. What is the source address of this E to d datagram? 113.153.129.245

7. What is the destination address of this E to d datagram? 184.85.136.75

8. Is this E to d datagram encapsulating another datagram? Yes or No. Yes

9. What is the source address of this encapsulated datagram?


3C7A:38E9:BA22:EED3:8EA3:A439:7FEC:5F62

10. What is the destination address of this encapsulated datagram?


C272:DEE2:5816:1E21:4E99:D661:6974:B3F9

11. Is the datagram being forwarded from d to b an IPv4 or IPv6 datagram? IPv4

12. What is the source address of this d to b datagram? 113.153.129.245

13. What is the destination address of this d to b datagram? 184.85.136.75

14. Is this d to b datagram encapsulating another datagram? Yes or No. yes

17. Is the datagram being forwarded from c to B an IPv4 or IPv6 datagram? Ipv4
18. What is the source address of this c to B datagram? 113.153.129.245

19. What is the destination address of this c to B datagram? 184.85.136.75

20. Is this c to B datagram encapsulating another datagram? Yes or No.yes

23. What router is the 'tunnel entrance'? Give the router's letter Router E

24. What router is the 'tunnel exit'? Give the router's letter Router B

25. Which protocol encapsulates the other, IPv4 or IPv6? IPv4 encapsulates IPv6
datagrams

Check out the online interactive exercises for more examples:


http://gaia.cs.umass.edu/kurose_ross/interactive/

You might also like