Information Technology III – EE3104 Lecture 03 – Addressing in a Network
Information Technology III – EE3104
Lecture 03 – Addressing in a Network
Addressing with TCP/IPAddress
PortAddress
LogicalAddress
PhysicalAddress
MAC Address
IP Address
Port Address
Identify a Computer
Identify a Process
Physical Address Stored in the Network Interface Card (NIC)
A hardware setting set by the manufacturer of NIC .
UnchangeableEx :- MAC address
For Ethernet, the MAC address is a 48 bit or 12 Hex number Ex : 5A:B3:87:F1:93:7C5A-B3-87-F1-93-7C
MAC address operates in the Data Link Layer (Layer 2)
CRC/FCS DATA DA SA SOF PreambleEthernet Frame
Logical Address Address scheme depends on the used protocol
Widely used protocol is TCP/IP Ex :- IP Address
192.168.16.5310.39.40.3
Logical address operates at the Network Layer (Layer 3)
IP Address The worldwide IP Address (high level) is decided by Internet
Assigned Numbers Authority (IANA)
Within Sri Lanka Internet Address authority is Asia Pacific Network Information Center (APNIC )
IP Addresses
IP Version 6 (IPV6) (IPng) 128 bit scheme
IP Version 4 (IPV4) 32 bit scheme
IP Version 4 (IPV4) The 32 bits are represented in following manner.
Byte 1. Byte 2. Byte 3. Byte 4( 1 byte = 8 bits)
IP Version 4 (IPV4) cont.
IP Version 4 (IPV4) cont. The minimum value of a byte
00000000 = 0
The maximum value of a byte 11111111 = 255
The minimum IP Address0.0.0.0
The maximum IP Address 255.255.255.255
Example Change the following IPV4 addresses from binary to dotted decimal notation
10000001 00001011 00001011 11101111 11000001 10000011 00011011 11111111 11100111 11011011 10001011 01101111 11111001 10011011 11111011 00001111
Change the following IPV4 addresses from dotted decimal notation to binary format 111.56.45.78 221.34.7.82 241.8.56.12 75.45.34.78
Network ID and Host ID
IP Addresses - Network ID + Host ID
Part of the IP Address is allocated to Network ID
Remaining part is allocated to Host ID (Computer ID)
Classes of IP addresses
Class Net ID Host IDA 1 Byte 3 BytesB 2 Bytes 2 BytesC 3 Bytes 1 Byte
Five IP Address ClassesIP Address Class
Format Purpose Higher Order Bit(s)
Address range No Bits Network/
Host
Max. Host
A N.H.H.H Large organizations 0 1.0.0.0 to 126.0.0.0
7/24 16777214
B N.N.H.H Medium size organizations
1,0 128.1.0.0 to 191.254.0.0
14/16 65634
C N.N.N.H Small organizations 1,1,0 192.0.1.0 to 223.255.254.0
21/8 254
D N/A Multicast groups 1,1,1,0 224.0.0.0 to 239.255.255.255
N/A N/A
E N/A Experimental 1,1,1,1 240.0.0.0 to 254.255.255.255
N/A N/A
Classes of IP addresses cont. Class D is introduced for Multicasting
Class E is reserved
Class A 10 . 0 . 0 . 0
0000 1010 . 0000 0000 . 0000 0000 . 0000 0000
1 byte (8 bits) allocated for Network ID and remaining 3 bytes (24 bits) allocated to Host ID
The maximum number of Networks 28 = 256
The maximum number of Hosts per each network 224
Both in Network ID and Host ID all 0s and all 1s are reserved for special purposes.
The actual maximum no. Networks = 28 - 2 = 254The actual maximum no. of Hosts per Network =224 - 2
Network ID Host ID
Class Theoretical Maximum number of Networks
Theoretical Maximum number of Hosts per
Networks
A 28 =256 224=16777216
B 216= 65536 216= 65536
C 224=16777216 28 =256
0
1 0
1 1 0
Class A byte 1
Class B byte 1
Class C byte 1
Class Minimum Network ID Maximum Networks ID
A00000000
001111111
127
B10000000.00000000
128.010111111.11111111
191.255
C11000000.00000000.00000000
192.0.011011111.11111111.11111111
223.255.255
Network Address and Broadcast Address For the Network Address,
the Host ID part of the IP Address will be considered as All 0s
For the Broadcast Address, the Host ID part of the IP Address will be considered as All 1s
Ex : 103.58.35.1This is a Class A address
Net ID is = 103Host ID is = 58.35.1
Network Address 103.0.0.0 Broadcast Address 103.255.255.255
198 . 8 . 0 . 11100 0110 . 0000 1000 . 0000 0000 . 0000 0001
The actual maximum no. Networks = 224 - 2
The actual maximum no. of Hosts per Network =28 - 2 = 254
Network Address : 1100 0110 . 0000 1000 . 0000 0000 . 0000 0000 (198.8.0.0)
Broadcast Address : 1100 0110 . 0000 1000 . 0000 0000 . 1111 1111 (198.8.0.255)
Network ID : 3 bytes (24 bits) Host ID : 1 byte (8 bits)
Class C
Example Find the class of each address
00000001 00001011 00001011 11101111 11000001 10000011 00011011 11111111 10100111 11011011 10000101 01101111 11110011 10011011 11111011 00001111
Find the class of each address 227.12.14.87 193.14.56.22 14.23.120.8 252.5.15.111
Example Find the number of addresses in the block, the first address and the last
address for following addresses 73.22.17.25 180.8.17.9 200.11.8.45
Classful Addressing
Classful Addressing - Subnet Mask
Net ID part : All 1’sHost ID part : All 0’s
• A network mask or a default mask in classful addressing is a 32-bit number with n leftmost bits all set to 1s and (32 − n) rightmost bits all set to 0s.
• Since n is different for each class in classful addressing, we have three default masks in classful addressing as shown in Figure
Masking Concept
AND Operation
Example
Find the beginning address (network address) for following network addresses. 23.56.7.91 132.6.17.85 201.180.56.5
Subnetting/Supernettingand
Classless Addressing
A network with two levels of hierarchy (not subnetted)
A network with three levels of hierarchy (subnetted)
Addresses in a network with and without subnetting
Default mask and subnet mask
Example 1
What is the subnetwork address if the destination address is 200.45.34.56 and the subnet mask is 255.255.240.0?
Solution
11001000 00101101 00100010 00111000
11111111 11111111 11110000 00000000
11001000 00101101 00100000 00000000
The subnetwork address is 200.45.32.0.
Example 2
What is the subnetwork address if the destination address is 19.30.80.5 and the mask is 255.255.192.0?
Solution
See Figure 5.6
Comparison of a default mask and a subnet mask
Example 3
A company is granted the site address 201.70.64.0 (class C). The company needs six subnets. Design the subnets.
Solution (Continued)
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 (23). 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
Solution (Continued)
11111111 11111111 11111111 11100000or
255.255.255.224
The number of subnets is 8.The number of addresses in each subnet is 25 (5 is the number of 0s) or 32.
Example 3
Example 4
A company is granted the site address 181.56.0.0 (class B). The company needs 1000 subnets. Design the subnets.
Solution (Continued)
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 26 (6 is the number of 0s) or 64.
Example 4
SUPERNETTING
The problem Most Class A or B network addresses have already
been assigned.
The problem is compounded by the fact that Class C networks are limited to a maximum of 254 hosts.
Solution To create a supernetwork, or supernet, an
organization uses a block of IP addresses assigned to several Class C networks to create one large network.
With supernetting you can combine small networks into one larger network.
A supernetwork
Rules:** The number of blocks must be a power of 2 (1, 2, 4, 8, 16, . . .).
** The blocks must be contiguous in the address space (no gaps between the blocks).
** The third byte of the first address in the superblock must be evenly divisible by the number of blocks. In other words, if the number of blocks is N, the third byte must be divisible by N.
Example 5 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
198.47.32.0 198.47.33.0 198.47.34.0 198.47.35.0
Solution
1: No, there are only three blocks. 2: No, the blocks are not contiguous.3: No, 31 in the first block is not divisible by 4. 4: Yes, all three requirements are fulfilled.
In subnetting, we need the first address of the subnet and the subnet mask to define the range of addresses.
In supernetting, we need the first address of
the supernet and the supernet mask to
define the range of addresses.
Comparison of subnet, default, and supernet masks
Example 6
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 00000000or
255.255.240.0
Example 7
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.44205.16.42.56205.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.0205.16.42.56 AND 255.255.248.0 205.16.40.0205.17.33.76 AND 255.255.248.0 205.17.32.0Only the first address belongs to this supernet.
Example 8
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 23 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.