You are on page 1of 33

Module 6 IP Addressingl

Understanding Network Basics

IP Addressing

Understanding Network Basics

Module 6 IP Addressingl

Module 6 IP Addressing

Overview
There are two kinds of addresses that networks recognize: Logical and Physical addresses. The hardware addresses are given to the devices NIC card at the factory by its manufacturer. Logical addresses can be assigned manually or automatically. These addresses must adhere to protocol standards. For the TCP/IP protocol suite, Internet Protocol (IP) is the protocol that decides the logical addresses assigned for computers. Therefore, addresses on TCP/IP networks are called IP addresses. Each IP address is a unique 32-bit number, divided into four octets, or sets of 8-bits, that are separated by decimal points. An example of a valid IP address is 144.92.43.178. An IP address can be divided into two parts: network and host. The first octet determines the network class. There are three types of network classes used on modern LANs: Class A, Class B, and Class C.

Lessons covered in this module


IP addressing

Understanding Network Basics

Module 6 IP Addressingl

Lesson 6.1 IP Addressing

Introduction
The most important feature of Internet Protocol (IP) is to assign address to packets and is responsible for carrying the data and route them to the correct destination. Hence it is essential to understand an IP Address and its components. For each computer to communicate a unique IP address is required. IP Address has two parts - Network Address and Host Address. In this lesson, the details of IP addressing are discussed in detail.

Understanding Network Basics

Module 6 IP Addressingl

Lesson 6.1 IP Addressing

Topics covered in this lesson are


MAC Address IP Address (IPv4, IPv6) Subnet Private and Public IP Addressing

Understanding Network Basics

Module 6 IP Addressingl

Topic 1 MAC Address

MAC Address

Media Access Control or MAC address is a hardware address which uniquely identifies each node of a network. MAC addresses are physical addresses, which are 12-digit hexadecimal numbers. It is also known as hardware addresses or physical addresses. By convention, MAC addresses are usually written in one of the following two formats: MM:MM:MM:SS:SS:SS MM-MM-MM-SS-SS-SS

Why MAC Address?

MAC address generally functions at the data link layer and they allow computers to uniquely identify themselves on the network at this relatively low level.

Understanding Network Basics

Module 6 IP Addressingl

Topic 1 MAC Address


The IP address of the machine exists on the third layer of the OSI

model and when a packet reaches the computer, it will travel upwards from layer 1 (Physical layer) to layer 2 (Datalink layer).

Understanding Network Basics

Module 6 IP Addressingl

Topic 1 MAC Address


Identify MAC Address in Windows

In Windows 95, Windows 98 and Windows ME, the winipcfg utility displays the MAC Address. In Windows NT and the other versions of Windows, the ipconfig utility using /all option is used to display the MAC Address. Windows 95
If you have TCP/IP installed, run winipcfg to display the MAC Address. Click on Start menu, then Run, type winipcfg in the text box. Once the program runs, look for a box marked Adapter Address and the MAC Address is displayed.

Understanding Network Basics

Module 6 IP Addressingl

Topic 1 MAC Address

Windows NT
If you have TCP/IP installed, run ipconfig /all from an MS-DOS shell window. Go to the Start menu. Select Run, the following window opens. Type ipconfig /all in the following text box, the command prompt displays the 12-digit Physical Address (MAC Address) as shown in the below figure.

Understanding Network Basics

Module 6 IP Addressingl

Topic 1 MAC Address

Windows 2000
If you have TCP/IP installed, run ipconfig/all from a Command Prompt window. Click Start menu, then Run, type cmd in the text box. Type ipconfig/all in the Command Prompt Windows.

Windows XP
If you have TCP/IP installed, run ipconfig/all from a Command Prompt window. Click Start menu, then Run, type cmd in the text box. Type ipconfig/all in the Command Prompt Windows. The command prompt displays the physical address as shown in the above figure.

Understanding Network Basics

Module 6 IP Addressingl

Topic 1 MAC Address

Identify MAC address on Linux


On Linux operating systems, the ethernet device is typically called eth0. In order to find the MAC address of the ethernet device, you must first become root, through the use of su (super user). Then, type ifconfig a, the following information is displayed as shown below: # ifconfig -a eth0 Link encap:Ethernet HWaddr 00:60:08:C4:99:AA inet addr:131.225.84.67 Bcast:131.225.87.255 Mask:255.255.248. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:15647904 errors:0 dropped:0 overruns:0 TX packets:69559 errors:0 dropped:0 overruns: Interrupt:10 Base address:0x300

10

Understanding Network Basics

Module 6 IP Addressingl

Topic 2 IP Address
IP Addressing

Internet Protocol (IP) address is a unique number used to identify a computer and communicate with each other on a network. The IP address is a 32-bit value which is divided into four 8 bit fields called octet. An IP Address consists of two parts, a network address and a host address. The numbers in the IP addresses range from 1.0.0.0 to 255.255.255.255. This is known as dotted decimal notation. The two parts of IP address are:
Network Address Host Address

11

Understanding Network Basics

Module 6 IP Addressingl

Topic 2 IP Address

Network Address
Network Address is the first part of the IP address which is used to uniquely identify the network in a large TCP/IP Network environment.

Host Address
The Host address is used to uniquely identify the host in the particular network identified by the Network portion of the IP Address.

Why IP Addressing?
Every host on a TCP/IP network needs to have a unique address to send the data from one host to another. Every data packet contains addressing information in the header, and the IP address in the header is used to route packets. IP addresses are unique on each network to identify the appropriate host. IP addressing is basically configuring each TCP/IP host with a valid IP address.

12

Understanding Network Basics

Module 6 IP Addressingl

Topic 2 IP Address
IP Address Classes An IP Address is given to a system to identify the system uniquely on the Network. The IP Address is made of 32 Bits and has two portions namely the Network portion and the Host Portion. The 32 Bits are divided into four octets each octet having 8 bits. The binary digits are converted into decimal and they are represented in dotted decimal format.
Class Value of first byte Value of first bits No.of Network s/No.of bits for N/W 126/8 16,384/16 2,097,152/24 ----No.of Hosts/N o.of Bits for Hosts 16,777,214/24 65,534/16 254/8 ----Large network devices with many Purpose

A B C D E

1-126 128-191 192-223 224-239 240-254

0 10 110 1110 1111

Medium sized to Large Sized network Small networks used for LAN Used for Multicasting Reserved for Future use

13

Understanding Network Basics

Module 6 IP Addressingl

Topic 2 IP Address
The different classes of IP address is represented as follows: N - Network Address H - Host Address

Class A

0NNNNNNN

HHHHHHHH

HHHHHHHH

HHHHHHHH

Class B

10NNNNNN

NNNNNNNN

HHHHHHHH

HHHHHHHH

Class C
110 NNNNN NNNNNNNN NNNNNNNN HHHHHHHH

14

Understanding Network Basics

Module 6 IP Addressingl

Topic 2 IP Address
Class A

Class A addresses are used for large networks with many devices. Class A comprises networks 1.0.0.0 through 127.0.0.0. The first octet is only used to identify the network number; the next three are used to identify the hosts on the network. The Class A address ranges from 1-126 Network.Host.Host.Host

Class B

Class B addresses is used for medium sized networks. Class B comprises networks 128.0.0.0 through 191.255.0.0. In Class B networks the first bit value in the first octet is 1 and second bit value is 0. The Class B address ranges form 128-191.

15

Understanding Network Basics

Module 6 IP Addressingl

Topic 2 IP Address
Class C Class C addresses are used for small networks. The Class C has the first bit value as 110, which is split as first bit value is 1, second bit value is 1 and third bit value is 0 in the first octet. It contains networks 192.0.0.0 through 223.255.255.0. The network number is in the first three octets and last octet is used to identify host. In Class C, the first three bits of the first octet is reserved. So the remaining is 5+8+8= 21 bits. This means that there are 2,097,150 (221 -2) Class C networks each with 254 (28 -2) hosts. Class D Class D addresses are multicast addresses. It has first bit value of 1, second bit value of 1, third bit value of 1 and fourth bit value of 0. The other 28 bits are used to identify the group of computers to which multicast messages are intended for.

Class E

Class E addresses are reserved; it cannot be used on IP networks. Some research organizations use Class E addresses for experimental purpose. It has first bit value of 1, second bit value of 1, third bit value of 1 and fourth bit value of 1.

16

Understanding Network Basics

Module 6 IP Addressingl

Topic 2 IP Address
Identify the components and structure of IP address (IPv4, IPv6) There are two versions of IP which are in use today. Most of all the networks use IP version 4 (IPv4) but a number of educational and research networks have adopted the next generation IP version 6 (IPv6).

IPv4 Addressing Notation


IPv4 addresses are 32-bits (4-byte) also called as octets. Each byte is 8 bits in length and each octet in an IP address ranges from a minimum of 0 to a maximum of 255. Therefore, the full range of IP addresses is from 0.0.0.0 through 255.255.255.255, which limits the address space to 4,294,967,296 possible unique addresses. Example: 10.0.0.1

IPv6 Addressing Notation


IPv6 addresses are 128 bits (16 bytes) long. It is intended to provide more addresses for networked devices allowing each cell phone and mobile electronic device to have its own address. IPv6 addresses are generally written in the following form: Example: hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh

17

Understanding Network Basics

Module 6 IP Addressingl

Topic 2 IP Address

IP Addressing Methods

Computers use IP addresses to locate and talk to each other on the Internet, much the same way people use phone numbers to locate and talk to one another on the telephone.
Static IP Address Dynamic IP Address Self-assigned (APIPA) A Static IP address is a number that is assigned to a computer by an administrator to be its permanent address on the Internet. To configure the IP settings,
Right Click on My Network Places Select Properties Double Click on Local Area Connection, the following window is shown as follows Click on Properties

Static IP Address

18

Understanding Network Basics

Module 6 IP Addressingl

Topic 2 IP Address

The following window is shown Double Click on Internet Protocol (TCP/IP)

19

Understanding Network Basics

Module 6 IP Addressingl

Topic 2 IP Address
Dynamic IP Address

A Dynamic IP address is one that is temporarily assigned to the devices by a DHCP server which maintains and assigns IP address. In order to assign the dynamic IP address click on Obtain an IP address automatically option as shown.

20

Understanding Network Basics

Module 6 IP Addressingl

Topic 2 IP Address
Self-assigned (APIPA)

Automatic Private IP Addressing is a Windows-based computer. It is configured to use DHCP which can automatically assign itself an Internet Protocol (IP) address if a DHCP server is not available. This is possible on a network without a DHCP server or on a network if a DHCP server is temporarily down for maintenance. It enables computer to assign itself an Internet Protocol (IP) address in the event that a DHCP server is not available or does not exist on the network. When the network adapter has been assigned an IP address, the computer can use TCP/IP to communicate with any other computer that is connected to the same LAN and that is also configured for APIPA or has the IP address manually set to the 169.254.x.y (x.y is the clients unique identifier) address range with a subnet mask of 255.255.0.0. If the computer cannot communicate with each other on other subnets or with computers which do not use automatic private IP addressing, Automatic Private IP Addressing is enabled by default.
Understanding Network Basics

21

Module 6 IP Addressingl

Topic 3 Subnet
Subnet is a physical segment of a network which allows the flow of

network that is connected to the network by means of network devices like routers. When creating a network it is essential to create an appropriate Host ID and Network ID to enable you to exactly locate the host in the network. Matching the Network ID can identify the hosts in the same subnet. Subnetting allows you to create the multiple logical networks that exist within a single class A, B or C. When a network is divided into subnets it is essential to have unique ID for each Subnet. Hence, the host part is divided into subnet ID and Host ID. The process of dividing the Host part of IP Address into subnet ID and Host ID is called Subnetting.

22

Understanding Network Basics

Module 6 IP Addressingl

Topic 3 Subnet
Advantages of using Subnet

By organizing hosts into logical groups, subnetting can improve network security and performance. Network traffic can be controlled by reducing the number of broadcast that is sent to each segment in the network. A subnet allows the flow of network traffic between hosts to be separated based on network configuration. By organizing the host into logical groups, subnetting can improve network security and performance. It is easier to identify the network problems in smaller connected networks than within one large network. The administrator has the flexibility to organize additional subnets without obtaining a new network. Subnets can isolate internal networks so they are not visible from external networks.
Understanding Network Basics

23

Module 6 IP Addressingl

Topic 3 Subnet

Example: Class A has 24 bits to split between subnet ID and host ID, Class B networks have 16 and Class C networks have only 8 bits.

Netmask

Netmask is the boundary between net ID and host ID. To identify the network ID and host ID in the IP address, netmask can be used. This is 32 bit value in which one bits (255s) identify network ID and the zero bits (0s) identify host Id. Using netmask value, you can easily determine number of bits assigned for the net ID and number of bits reserved for the host ID. Example: Network Address: 16.0.0.5 and netmask 255.0.0.0.
In the above example, you can see that the netmask has a value 255.0.0.0 which means the first octet contains all one bits and last three octets contains all zero bits, which indicates the first octet is the net ID and last three are the reserved for the host ID. Therefore, the IP address 16.0.0.5 is a Class A address with 16 being the net ID and 0.0.5 being the host ID.

24

Understanding Network Basics

Module 6 IP Addressingl

Topic 3 Subnet

Subnet Mask

Subnet mask is the boundary between net ID and subnet ID. Just like netmask, subnet mask is also made up of 32 bit value, in which one bits identify network ID and subnet ID while zero bits identify host ID. Subnet mask can be used for identifying the numbers of bits are assigned for the network ID, host ID and subnet ID.

25

Understanding Network Basics

Module 6 IP Addressingl

Topic 3 Subnet
To understand better let us consider an example. IP address: 200.23.34.77, Netmask: 255.255.0.0 and Subnet mask: 255.255.255.0. According to the netmask value, the first two octets are reserved for the network ID and last two octets are reserved for the host ID. Therefore, 200.23.34.77 can be broken as follows:
Net ID: 200.23 Host ID: 34.77

But this IP address has subnet mask of 255.255.255.0 which means that first three octets are used for the network ID and subnet ID and last octet is used for the host ID. According to this, 200.23.34.77 can be broken as follows:
Net ID and Subnet ID: 200.23.34 Host ID: 77

But, we determined that the network ID is 200.23. By combining all the above information, the IP address 200.23.34.77 is divided as follows:
Net ID: 200.23 Subnet ID: 34 Host ID: 77

26

Understanding Network Basics

Module 6 IP Addressingl

Topic 3 Subnet
Decimal Binary Conversions Binary numbers are composed of two digits 0 and 1. Each IP address is represented by four octets (32 bits). IP addresses are expressed in Dotted Decimal Notation which is four numbers separated by periods. When all eight bits are set to 1 it is 255 and if all eight bits are 0 it is 0.Hence the decimal value for each octet can vary from 0 to 255.
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

27

26

25

24

23

22

21

20

128

64

32

16

27

Understanding Network Basics

Module 6 IP Addressingl

Topic 3 Subnet
Converting a binary number to Decimal Format Starting from the leftmost digit of the binary octet multiply each digit by decreasing powers of 2 starting with 27 Add all the values to get the decimal value of the octet.

Table: Converting Binary Values to Decimal


Bit Value Calculation 0 20 20+21 20+21+22 20+21+22 +23 20+21+22 +23+24 20+21+22 +23+24+25 Decimal Value 0 1 3 7 15 31 63

Binary 0000 0000 0000 0001 0000 0011 0000 0111 0000 1111 0001 1111 0011 1111

0111 1111
1111 1111

20+21+22+23+24+25+26
20+21+22 +23+24+25+26+27

127
255

28

Understanding Network Basics

Module 6 IP Addressingl

Topic 3 Subnet
Conversion from decimal to binary

To convert the decimal number to binary repeatedly divide it by 2, keeping only the whole part and noting down the remainder at each step, until we reach zero At the end of this, we have the binary representation of the integer by reading the remainders in reverse order. For example
Convert decimal 131 to binary
Step 1 131/2 = 65 Step 2 65/2 = 32 Step 3 32/2 = 16 Step 4 16/2 = 8 Step 5 8/2 = 4 Step 6 4/2 = 2 Step 7 2/2 =1 Step 8 1/2 = 0 Remainder 1 Remainder 1 Remainder 0 Remainder 0 Remainder 0 Remainder 0 Remainder 0 Remainder =1

The binary equivalent of decimal 131 is (10000011)2


29 Understanding Network Basics

Module 6 IP Addressingl

Topic 3 Subnet
Creating Subnet

When defining a subnet mask, it is necessary to know the number of physical segments and the maximum number of hosts in each subnet. The Host ID is divided into Subnet ID and the Host ID. The bits are borrowed from the Host ID and are utilized to represent the Subnet ID. If the number of bits used to represent a subnet ID is more, then it is possible to have large number of physical segments but the number of bits available to represent the host gets reduced and hence the hosts in each physical segment of the subnet is less. Example:
consider the IP Address 192.168.1.10 and we need 6 Subnets.

Solution:
On seeing the IP Address, we conclude that it is a Class C IP Address. The host ID is therefore the last octet. To have 6 subnets it is necessary to borrow the first three bits from the Host ID. The last octet of the Subnet mask hence becomes 1110 0000 = 224 in decimal Hence the subnet mask for having six subnets is 255.255.255.224

30

Understanding Network Basics

Module 6 IP Addressingl

Topic 4 Private Addressing


The IP Address that is used internally and not made known to others is called

Private IP Address. In private addressing you can have both a Public and a Private IP address and in also you would be sharing your Public IP Address with others on your internal network, but your Private IP Address would be unique within your network. The Private IP Addresses are in three ranges that are reserved for use by private and non-Internet connected networks as shown in the table below.

Address Block
10.0.0.0-10.255.255.255 172.16.0.0-172.31.255.255 192.168.0.0-192.168.255.255

Classes of networks
A B C

Number of IP addresses
16,777,216 1,048,576 256

31

Understanding Network Basics

Module 6 IP Addressingl

Topic 4 Private Addressing


Public Addressing Public IP Addresses is also known as Static IP Addresses that are visible to the public. The public IP address allows other people to access the system, like a Web server. Public IP address is directly connected to the Internet. The table below differentiates the Private IP Address and Public IP Address:
Private IP Addressing
Can be used on private Networks and not directly accessible over the Internet The IP Address is assigned by the system Administrator and no registration of IP Address is required.

Public IP Addressing
Computers that directly use the Internet need a Public IP Address

The IP Address is assigned by Internet Assigned Numbers Authority (IANA) or ISP

Private IP Addresses are not given to public machines and hence duplication of IP Address is not possible

Public IP Address are limited in numbers

Information sent over Private IP address can travel only through the local Network

Information sent to a public IP address transmits over the Internet

32

Understanding Network Basics

Module 6 IP Addressingl

Summary

Media Access Control or MAC address is also known as hardware addresses or physical addresses. MAC addresses are 12-digit hexadecimal numbers which uniquely identifies each node of a network. IP address is the logical address which is used to identify a computer in the network. IP Address has two parts
1.Network Address 2.Host Address

Subnet is a physical segment of a network that is connected to the network by means of Network devices like Routers. Subnet masks are used to distinguish between the Host ID and the Network ID in the given IP address.
Understanding Network Basics

33

You might also like