Docsity

Chapter 3 Network Layer: Logical Addressing, Lecture notes of Computer Networks

Partial preview of the text

Download Chapter 3 Network Layer: Logical Addressing and more Lecture notes Computer Networks in PDF only on Docsity!

Chapter 3

Network Layer:

Logical Addressing

Computer NetworksAl-Mustansiryah UniversityElec. Eng. Department College of Engineering Fourth Year Class

3-1 IPv4 ADDRESSES

An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a device (for example, a computer or a router) to the Internet.

Figure 3.1 Dotted-decimal notation and binary notation for an IPv4 address

Change the following IPv4 addresses from binary notation to dotted-decimal notation.

Example 3.

Solution We replace each group of 8 bits with its equivalent decimal number and add dots for separation.

Find the error, if any, in the following IPv4 addresses.

Example 3.

Solution a. There must be no leading zero (045). b. There can be no more than four numbers. c. Each number needs to be less than or equal to 255. d. A mixture of binary notation and dotted-decimal notation is not allowed.

In classful addressing, the address

space is divided into five classes:

A, B, C, D, and E.

Find the class of each address. a. 00000001 00001011 00001011 11101111 b. 11000001 10000011 00011011 11111111 c. 14.23.120. d. 252.5.15.

Example 3.

Solution a. The first bit is 0. This is a class A address. b. The first 2 bits are 1; the third bit is 0. This is a class C address. c. The first byte is 14; the class is A. d. The first byte is 252; the class is E.

Table 3.1 Number of blocks and block size in classful IPv4 addressing

In classful addressing, a large part of the

available addresses were wasted.

What is the subnetwork address if the destination address is 200.45.34.56 and the subnet mask is 255.255.240.0?

11001000 00101101 00100010 00111000 11111111 11111111 11110000 00000000 11001000 00101101 00100000 00000000

The subnetwork address is 200.45.32.0.

Solution

Example

Example

What is the subnetwork address if the destination address is 19.30.84.5 and the mask is 255.255.192.0?

Solution

The last address(broadcast) in the block

can be found by setting the rightmost

32 − n bits to 1s.

Note

Find the last address (broadcast)for the block in Example 3.5.

Solution The binary representation of the given address is 11001101 00010000 00100101 00100111 If we set 32 − 28 rightmost bits to 1, we get 11001101 00010000 00100101 00101111 or 205.15.37. This is actually the block shown in Figure 5.3.

Example 3.

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

Host IP Address : 138.101.114.  Network Mask : 255.255.0.  Subnet Mask : 255.255.255. Given the following Host IP Address, Network Mask and Subnet mask find the following information:  Major Network InformationMajor Network AddressMajor Network Broadcast AddressRange of Hosts if not subnettedSubnet InformationSubnet AddressRange of Host Addresses (first host and last host)Broadcast AddressOther Subnet InformationTotal number of subnetsNumber of hosts per subnet

Subnetting – Example