Understanding ISO, OSI Model, TCP/IP & IP Addressing

ISO and OSI Model Fundamentals

ISO: Established in 1947, the International Organization for Standardization is a multinational body dedicated to developing international standards.

OSI Model: An ISO standard that covers all aspects of network communications. It was developed in the 1970s. ISO is the organization, OSI is the model.

OSI Model Layers Explained

Physical Layer: Responsible for the movement of individual bits from one node to another. Communication unit: bit. Physical address.

Data Link Layer: Responsible for moving frames from one node to the next. Communication unit: frames. Physical address.

Network Layer: Responsible for delivering individual packets from the source host to the destination host. Communication unit: datagram. Logical address.

Transport Layer: Responsible for delivering a message from one process to another. Communication unit: segment, user datagram, or packet, depending on the specific protocol used in this layer. Port addresses.

Session Layer: For establishing, managing, and terminating sessions.

Presentation Layer: For translating, encrypting, and compressing data.

Application Layer: For allowing access to network resources. Communication unit: message. Application-specific address.

TCP/IP Protocol Suite

TCP/IP: Composed of 5 layers: physical, data link, network, transport, and application.

IP Addressing Concepts

Physical Address: Changes from hop to hop.

Logical Address: Remains the same. Identifier used in the IP layer of the TCP/IP protocol to identify each Internet device. Also called IP address. 32-bits, unique, identifies only one connection to the Internet. 2^32.

Classful Addressing Architecture

Classful Addressing: IP addresses initially used the concept of classes. This architecture is called classful addressing. In the 90s, a new architecture called classless addressing was introduced.

  • Class A = 2^31 addresses, bit 1 = 0, from 0 to 127, millions of addresses wasted.
  • Class B = 2^30, bit 2 = 0, from 128 to 191, many addresses wasted.
  • Class C = 2^29, bit 3 = 0, from 192 to 223, fewer addresses than the needs of many organizations.
  • Class D = 2^28, bit 4 = 0, from 224 to 239, used for multicasting, only one block.
  • Class E = 2^28, bit 5 = 0, from 239 to 255, reserved for future uses, a large part of the block wasted.

Network and Special Addresses

Network Address: Initial address of each block, can be found by applying the default mask to any address in the block.

Multihomed Host: Computer connected to different networks and having more than one address, possibly belonging to different classes. Routers are multihomed.

Special Addresses:

  • Network = network.0.0.0 (A)
  • Direct broadcast = network.255.255.255 (A) used by router
  • Limited broadcast = 255.255.255.255 used by host
  • This host on this network = 0.0.0.0 as source and 255.255.255.255 as destination
  • Specific host on this network = 0.0.0.host (A)
  • Loopback address = 127.x.y.z for checking software, does not leave the machine, between client and server processes on the same machine.

Addresses for Private Networks:

  • A = 10.0.0 with one block
  • B = 172.16 to 172.31 with 16 blocks
  • C = 192.168.0 to 192.168.255 with 256 blocks


IP Addressing Exercises

Exercise 1: Subnet Design

A company is granted the site address 201.70.64.0 (class C). The company needs six subnets. Design the subnets.

Solution:

  • The number of 1s in the default mask is 24 (class C).
  • The company needs six subnets. This number 6 is not a power of 2. The next number that is a power of 2 is 8 (2^3). We need 3 more 1s in the subnet mask. The total number of 1s in the subnet mask is 27 (24 + 3).
  • The total number of 0s is 5 (32 – 27). The mask is 11111111 11111111 11111111 11100000 or 255.255.255.224
  • The number of subnets is 8.
  • The number of addresses in each subnet is 2^5 (5 is the number of 0s) or 32.

Exercise 2: Subnetting Class B Addresses

A company is granted the site address 181.56.0.0 (class B). The company needs 1000 subnets. Design the subnets.

Solution:

  • The company needs 1000 subnets. This number is not a power of 2. The next number that is a power of 2 is 1024 (2^10). We need 10 more 1s in the subnet mask.
  • The total number of 1s in the subnet mask is 26 (16 + 10).
  • The total number of 0s is 6 (32 – 26). The mask is 11111111 11111111 11111111 11000000 or 255.255.255.192
  • The number of subnets is 1024.
  • The number of addresses in each subnet is 2^6 (6 is the number of 0s) or 64.

Exercise 3: Supernetting Class C Blocks

A company needs 600 addresses. Which of the following set of class C blocks can be used to form a supernet for this company?

198.47.32.0 198.47.33.0 198.47.34.0 198.47.32.0 198.47.42.0 198.47.52.0 198.47.62.0 198.47.31.0 198.47.32.0 198.47.33.0 198.47.52.0

Solution:

(198.47.32.0 198.47.33.0 198.47.34.0 198.47.35.0) because they are 4 blocks that is a power of 2, they are continuous, and the third byte of the initial address is divisible by the number of blocks.

Exercise 4: Supernet Mask Calculation

We need to make a supernetwork out of 16 class C blocks. What is the supernet mask?

Solution:

We need 16 blocks. For 16 blocks, we need to change four 1s to 0s in the default mask. So the mask is 11111111 11111111 11110000 00000000 or 255.255.240.0.

Exercise 5: Supernet Membership

A supernet has a first address of 205.16.32.0 and a supernet mask of 255.255.248.0. A router receives three packets with the following destination addresses: 205.16.37.44, 205.16.42.56, 205.17.33.76 Which packet belongs to the supernet?

Solution:

We apply the supernet mask to see if we can find the beginning address.

  • 205.16.37.44 AND 255.255.248.0 = 205.16.32.0
  • 205.16.42.56 AND 255.255.248.0 = 205.16.40.0
  • 205.17.33.76 AND 255.255.248.0 = 205.17.32.0

Only the first address belongs to this supernet.

Exercise 6: Supernet Block Size and Range

A supernet has a first address of 205.16.32.0 and a supernet mask of 255.255.248.0. How many blocks are in this supernet and what is the range of addresses?

Solution:

The supernet has 21 1s. The default mask has 24 1s. Since the difference is 3, there are 2^3 or 8 blocks in this supernet. The blocks are 205.16.32.0 to 205.16.39.0. The first address is 205.16.32.0. The last address is 205.16.39.255.

Exercise 7:

Imagen


Exercise 8: Beginning Address of a Block

Which of the following can be the beginning address of a block that contains 16 addresses? 205.16.37.32/ 190.16.42.44/ 17.17.33.80/ 123.45.24.52

Solution:

The address 205.16.37.32 is eligible because 32 is divisible by 16. The address 17.17.33.80 is eligible because 80 is divisible by 16.

Exercise 9: Beginning Address of a Larger Block

Which of the following can be the beginning address of a block that contains 1024 addresses ? 205.16.37.32/ 190.16.42.0/ 17.17.32.0/ 123.45.24.52

Solution:

To be divisible by 1024, the rightmost byte of an address should be 0 and the second rightmost byte must be divisible by 4. Only the address 17.17.32.0 meets this condition.

Exercise 10: Range of a Block with Prefix Length

A small organization is given a block with the beginning address and the prefix length 205.16.37.24/29 (in slash notation). What is the range of the block?

Solution:

The beginning address is 205.16.37.24. To find the last address, we keep the first 29 bits and change the last 3 bits to 1s.

Beginning: 11001111 00010000 00100101 00011000

Ending : 11001111 00010000 00100101 00011111

There are only 8 addresses in this block.

Exercise 11: Network Address from an IP Address and Prefix

What is the network address if one of the addresses is 167.199.170.82/27?

Solution:

The prefix length is 27, which means that we must keep the first 27 bits as is and change the remaining bits (5) to 0s. The 5 bits affect only the last byte. The last byte is 01010010. Changing the last 5 bits to 0s, we get 01000000 or 64. The network address is 167.199.170.64/27.

Exercise 12: Last Address in a Block (Method 1)

Using the first method, find the last address in the block if one of the addresses is 140.120.84.24/20.

Solution:

We found in the previous Exercises that the first address is 140.120.80.0/20 and the number of addresses is 4096. To find the last address, we need to add 4095 (4096 − 1) to the first address.

140.120.80.0 + 15.255 = 140.120.95.255

The last address is 140.120.95.255/20.

Exercise 13: Last Address in a Block (Method 2)

Using the second method, find the last address in the block if one of the addresses is 140.120.84.24/20.

Solution:

00000000 00000000 00001111 11111111 –> 140.120.80.0+ 15.255 = 140.120.95.255.

The last address is 140.120.95.255/20.

Imagen



Exercise 14: Finding the Block

Find the block if one of the addresses is 190.87.140.202/29.

Solution:

The number of addresses is 2^(32-29) = 8. The first address is 190.87.140.200/29, the last address is 190.87.140.207/20.

Exercise 15: Subnetting an Organization’s Block

An organization is granted the block 130.34.12.64/26. The organization needs to have four subnets. What are the subnet addresses and the range of addresses for each subnet?

Solution:

The suffix length is 6. This means the total number of addresses in the block is 64 (2^6). If we create four subnets, each subnet will have 16 addresses. Let us first find the subnet prefix (subnet mask). We need 4 subnets, which means we need to add two more 1s to the site prefix. The subnet prefix is then /28.

  • Subnet 1: 130.34.12.64/28 to 130.34.12.79/28
  • Subnet 2: 130.34.12.80/28 to 130.34.12.95/28
  • Subnet 3: 130.34.12.96/28 to 130.34.12.111/28
  • Subnet 4: 130.34.12.112/28 to 130.34.12.127/28

Exercise 16: Designing Subnets with Varying Sizes

An organization is granted a block of addresses with the beginning address 14.24.74.0/24. There are 2^(32−24)= 256 addresses in this block. The organization needs to have 11 subnets as shown below:

  1. two subnets, each with 64 addresses.
  2. two subnets, each with 32 addresses.
  3. three subnets, each with 16 addresses.
  4. four subnets, each with 4 addresses.

Design the subnets:

The first 128 addresses are used for the first two subnets, each with 64 addresses. The mask for each network is /26. The subnet address for each subnet is given in the figure. Use the next 64 addresses for the next two subnets, each with 32 addresses. The mask for each network is /27. The subnet address for each subnet is given in the figure. Use the next 48 addresses for the next three subnets, each with 16 addresses. The mask for each network is /28. The subnet address for each subnet is given in the figure. Use the last 16 addresses for the last four subnets, each with 4 addresses. The mask for each network is /30. The subnet address for each subnet is given in the figure.

Imagen


Imagen

IPv6 Addressing

Global unicast address: This block in the address space that is used for unicast (one-to-one) communication between two hosts in the Internet is called global unicast address block.

  • CIDR notation for the block is 2000::/3, which means that the three leftmost bits are the same for all addresses in this block (001).
  • The size of this block is 2^125 bits, which is more than enough for the Internet expansion in the many years to come.


Unspecified address: should not be used as a destination address, ::/128

Imagen

Loopback address: ::1/128

Imagen

Compatible address:

Imagen

Mapped address:

Imagen

Unique local unicast address:

Imagen


Link local address:

Imagen

Multicast address:

Imagen

Global unicast address:

Imagen

Imagen

Mapping for EUI-64:

Imagen

Mapping for Ethernet MAC:

Imagen

Imagen


Exercise 19: IPv6 Subnet CIDR Notation

An organization is assigned the block 2000:1456:2474/48. What is the CIDR notation for the blocks in the first and second subnets in this organization?

Solution:

Theoretically, the first and second subnets should use the blocks with subnet identifier 0001 base 16 and 0002 base 16. This means that the blocks are 2000:1456:2474:0000/64 and 2000:1456:2474:0001/64.

Exercise 20: EUI-64 Interface Identifier

Using the format we defined for Ethernet addresses, find the interface identifier if the physical address in the EUI is (F5-A9-23-EF-07-14-7A-D2) base 16.

Solution:

We only need to change the seventh bit of the first octet from 0 to 1 and change the format to colon hex notation. The result is F7A9:23EF:0714:7AD2.

Exercise 21: Ethernet MAC Interface Identifier

Using the format we defined for Ethernet addresses, find the interface identifier if the Ethernet physical address is (F5-A9-23-14-7A-D2)base 16.

Solution:

We only need to change the seventh bit of the first octet from 0 to 1, insert two octets FFFE16 and change the format to colon hex notation. The result is F7A9:23FF:FE14:7AD2 in colon hex.

Exercise 22: IPv6 Address from Physical Address

An organization is assigned the block 2000:1456:2474/48. What is the IPv6 address of an interface in the third subnet if the IEEE physical address of the computer is (F5-A9-23-14-7A-D2) base 16?

Solution:

The interface identifier for this interface is F7A9:23FF:FE14:7AD2 (see ejercicio 21). If we append this identifier to the global prefix and the subnet identifier, we get: 2000:1456:2474:0003:F7A9:23FF:FE14:7AD2/128.

Exercise 23: Global Unicast Address Creation

Assume a host with Ethernet address (F5-A9-23-11-9B-E2) base 16 has joined the network. What would be its global unicast address if the global unicast prefix of the organization is 3A21:1216:2165 and the subnet identifier is A245:1232?

Solution:

The host first creates its interface identifier as F7A9:23FF:FE11:9BE2 using the Ethernet address read from its card. The host then creates its link local address as: FE80::F7A9:23FF:FE11:9BE2.

Exercise 24: Router Solicitation and Advertisement

Assuming that this address is unique, the host sends a router solicitation message and receives the router advertisement message that announces the combination of global unicast prefix and the subnet identifier as 3A21:1216:2165:A245:1232. The host then appends its interface identifier to this prefix to find and store its global unicast address as: 3A21:1216:2165:A245:1232:F7A9:23FF:FE11:9BE2.

Exercise 25: IPv4 and IPv6 Unspecified Address Comparison

Compare the unspecified address in IPv4 with that of IPv6: In both architectures, the unspecified address is an all-0s address. In IPv4, this address is part of the class A addresses; in IPv6, this address is part of the reserved block.

Exercise 26: IPv4 and IPv6 Loopback Address Comparison

Compare the loopback address in IPv4 with that of IPv6: There are two differences in this case. In classful addressing, an entire block is designated for loopback addresses, and the loopback address is part of the class A block. In IPv6, only one address is assigned to the loopback address, and there is only one address in the reserved block.