Computer Networking Fundamentals

What Is an IP Address? How It Works, Internet Protocol and MAC vs IP Address

A complete beginner-friendly guide to IP addressing, computer communication, network protocols and the difference between MAC and IP addresses.

Networking Basics IPv4 & IPv6 MAC Address Practical Examples
IP address explained - computer networking, IPv4, IPv6, MAC address and network communication

Introduction to IP Addressing

Every computer, smartphone, printer and network device needs a way to communicate with other devices. IP addressing makes this possible by providing logical addresses that help identify source and destination devices across interconnected networks. Understanding IP addresses is one of the most important foundations of computer networking.

1. What Is an IP Address?

An IP Address (Internet Protocol Address) is a logical address assigned to a device connected to an IP network. It helps identify the device's network location and allows it to communicate with other devices over a network.

Think of an IP address as the home address of a computer. Imagine sending a letter to a friend. You need the friend's home address to make sure the letter reaches the correct destination. Similarly, when one computer sends information to another, it needs the destination IP address to identify where the information should go.

Example of an IPv4 Address

An IPv4 address looks like this:

192.168.1.10
Example of an IPv4 address

An IPv4 address consists of four numbers separated by dots. Each number is called an octet.

192
1st Octet
168
2nd Octet
1
3rd Octet
10
4th Octet

Each IPv4 octet can have a decimal value from 0 to 255. An IPv4 address contains 32 bits in total (4 octets × 8 bits).

Example: IP Addresses of Devices in a Network

DeviceIP Address
Computer 1192.168.1.10
Computer 2192.168.1.11
Laptop192.168.1.12
Printer192.168.1.20
Router192.168.1.1

These are example private IP addresses used by devices within the same local network. Each device needs an appropriate address that does not conflict with another device on that network.

⚠️ Important: IP addresses do not always remain the same. A device may receive a different IP address when it reconnects to a network, depending on the network configuration and DHCP settings.

Two Main Versions of IP Addresses

IPv4

Uses 32-bit addresses divided into four octets.

192.168.1.10
IPv6

Uses 128-bit addresses written in hexadecimal notation.

2001:db8::1

IPv4 and IPv6 will be explored in more detail in separate networking lessons.

2. Why Do Computers Need IP Addresses?

Computers need IP addresses to identify devices and exchange information correctly over an IP network.

Imagine a classroom with 20 computers connected to the same network. If Computer 1 wants to send a file to Computer 15, the network needs a way to identify the destination computer. IP addressing helps make this communication possible.

Main Reasons Computers Need IP Addresses

01. To Identify Devices

IP addresses provide logical identification of devices on an IP network.

Example: Computer A – 192.168.1.10; Computer B – 192.168.1.11.

02. To Send and Receive Data

IP addresses help identify the source and destination of data packets.

Example: Computer A sends a file to Computer B using the destination IP address.

03. To Communicate Between Different Networks

IP addressing enables devices to communicate with devices outside their local network through routers.

Example: A computer in Sri Lanka communicates with a web server in another country.

04. To Access Internet Services

Devices use IP networking to access websites, email services, cloud storage and other online applications.

Example: Accessing Google Drive through a web browser.

05. To Help Routers Forward Data

Routers examine destination IP addresses and select appropriate next hops to forward packets towards their destinations.

Example: A home router forwards internet-bound packets towards the service provider's network.

Real-World Example: Computer Laboratory Network

Imagine three computers connected to a network switch in a computer laboratory.

🖥️
PC 01
192.168.1.10
🖥️
PC 02
192.168.1.11
🖥️
PC 03
192.168.1.12
↓
🔀
Network Switch
Connects devices within the local network
↓
🌐
Router
Connects the local network to other networks

If PC 01 sends a file to PC 02, the destination IP address helps identify the receiving device. The switch uses local network addressing to deliver the Ethernet frame to the correct interface.

Remember:

IP addressing is essential for identifying source and destination devices and enabling communication across IP networks.

3. What Is an Internet Protocol (IP)?

Internet Protocol (IP) is a set of communication rules that defines how data packets are addressed and forwarded from one device to another across interconnected networks.

Think about sending a parcel through a delivery service. The parcel needs a destination address, the delivery service must determine where it should go, and the parcel must travel through suitable delivery routes. IP performs a similar role in computer networking by providing addressing and packet-forwarding functions.

Main Functions of Internet Protocol

  1. Logical Addressing: IP uses source and destination IP addresses to identify the endpoints of communication.
  2. Packet Delivery: IP carries data in units called packets. In IPv4 these are called datagrams.
  3. Routing: Routers examine destination IP addresses and forward packets towards the appropriate network.
  4. Communication Across Networks: IP enables communication between devices located on different networks.

Does IP Guarantee Successful Data Delivery?

No. IP is a connectionless, best-effort delivery protocol. It attempts to deliver packets but does not guarantee that every packet will arrive, arrive only once, or arrive in the correct order.

Other transport-layer protocols provide additional communication features.

IP

Provides logical addressing and packet forwarding.

TCP

Provides reliable, ordered delivery using acknowledgements and retransmissions when necessary.

UDP

Provides connectionless communication with low overhead, without guaranteeing delivery or ordering.

Practical Example

When downloading a document from a website, IP helps packets travel between your computer and the web server. TCP can ensure that the required data is received correctly and in order.

4. Role of IP Addresses in Computer Communication

IP addresses play an important role in computer communication. Let's understand this using a practical example of accessing a website from a computer laboratory.

Example Network Configuration

Computer IP Address 192.168.1.10

Default Gateway 192.168.1.1

DNS Server 8.8.8.8

Target Website www.example.com

How Does Computer Communication Happen?

1
User Enters a Website Address

The student enters www.example.com into the web browser.

2
DNS Finds the IP Address

The computer uses DNS (Domain Name System) to find an IP address associated with the website's domain name.

3
Computer Prepares Data Packets

The computer prepares IP packets containing source and destination IP addresses.

4
Router Forwards the Packets

The computer sends the packets towards its default gateway. The router forwards them towards the destination network.

5
Website Server Receives the Request

The destination server receives and processes the request.

6
Response Returns to the Computer

The server sends the required data back towards the computer. The browser processes the response and displays the website.

Important Information Inside an IPv4 Packet

An IPv4 packet contains several header fields that help with network communication.

Information FieldPurpose / Example
Source IP Address192.168.1.10
Destination IP Address93.184.216.34
ProtocolIdentifies the next-layer protocol, such as TCP or UDP.
TTL (Time to Live)Limits the number of router hops.
Data (Payload)Contains the information being transmitted.
Important:

The source IP identifies the sending endpoint, while the destination IP identifies the intended receiving endpoint. Routers use the destination IP address to make forwarding decisions.

5. Difference Between MAC Address and IP Address

What Is a MAC Address?

A MAC Address (Media Access Control Address) is an address associated with a network interface, such as an Ethernet or Wi-Fi adapter. It is used for communication over a local network link at the Data Link Layer (Layer 2) of the OSI model.

00:1A:2B:3C:4D:5E
Example of a 48-bit MAC Address

A computer may have multiple MAC addresses because it can contain multiple network interfaces.

  • Ethernet adapter – one MAC address.
  • Wi-Fi adapter – another MAC address.

MAC Address vs IP Address: Comparison

Feature MAC Address IP Address
Full NameMedia Access Control AddressInternet Protocol Address
PurposeIdentifies a network interface at Layer 2Provides logical addressing for IP communication
OSI LayerData Link Layer (Layer 2)Network Layer (Layer 3)
Address TypeHardware-level / link-layer addressLogical address
Address LengthUsually 48 bits (EUI-48)IPv4: 32 bits; IPv6: 128 bits
Example00:1A:2B:3C:4D:5E192.168.1.10
AssignmentUsually assigned by manufacturerManual configuration or DHCP
ChangesCan be randomized or changedMay change according to network configuration

Easy Way to Understand the Difference

Think about a person travelling from one city to another.

IP Address

Similar to a person's current postal address. It indicates the network location used for communication.

MAC Address

Similar to an identifier associated with a particular network interface, used for local link communication.

Practical Example: Laptop Connecting to Two Networks

Imagine a student brings a laptop from home to a training centre. The laptop connects to two different networks.

InformationHome NetworkTraining Centre
MAC Address00:1A:2B:3C:4D:5E00:1A:2B:3C:4D:5E
IP Address192.168.8.105192.168.1.105
Important Observation

In this example, the MAC address remains the same, but the IP address changes because the laptop connects to a different network. MAC randomization, adapter replacement or manual changes can also affect the MAC address.

How Do MAC and IP Addresses Work Together?

When Computer A sends data to Computer B on the same IPv4 local network, both IP and MAC addressing work together.

  1. Computer A identifies Computer B using its destination IP address.
  2. If necessary, ARP (Address Resolution Protocol) discovers the MAC address associated with Computer B's IPv4 address.
  3. The IP packet is encapsulated inside an Ethernet frame.
  4. The Ethernet frame is delivered to Computer B using its MAC address.
What Happens When Communicating with Another Network?

When a computer communicates with a device on another network, it normally sends the Ethernet frame to its default gateway's MAC address. However, the IP packet retains the remote destination IP address, unless a network device performs address translation.

6. Summary – Important Points to Remember

TopicMain Idea
IP AddressLogical address used to identify a device's network location.
Need for IP AddressHelps devices communicate and exchange data.
Internet ProtocolRules for addressing and forwarding data packets.
Role of IPHelps deliver packets between source and destination networks.
MAC AddressIdentifies a network interface at the local network link layer.
IPv4Uses 32-bit addresses.
IPv6Uses 128-bit addresses.
TCPProvides reliable and ordered data delivery.
DNSResolves domain names into IP addresses.

⭐ The Most Important Concept

An IP address provides logical addressing for communication across IP networks, while a MAC address identifies a network interface for communication over a local network link. Both work together to make computer networking possible.

7. Knowledge Check – Test Your Understanding

Answer the following multiple-choice questions to evaluate your understanding of IP addresses, Internet Protocol and MAC addressing.

Instructions

Select one answer for each question. Submit your answers to see your score, correct answers and explanations. All seven questions must be answered before submission.

0 of 7 questions answered

1. What is the main purpose of an IP address?

2. Which protocol is responsible for addressing and forwarding IP packets?

3. Which of the following is a valid IPv4 address?

4. Which OSI layer is associated with MAC addresses?

5. What normally happens when a laptop connects to a different network?

6. Which protocol discovers a MAC address from an IPv4 address on a local network?

7. Which statement about Internet Protocol (IP) is correct?

Hands-on Networking Practice

Practical Activity: Find Your Computer's IP and MAC Addresses

Use Windows Command Prompt to identify the actual network configuration of your computer.

WINDOWS COMMAND PROMPT
ipconfig /all

Follow These Steps

  1. Open the Start menu in Windows.
  2. Search for Command Prompt and open it.
  3. Type ipconfig /all and press Enter.
  4. Find the IPv4 Address of your network adapter.
  5. Find the Physical Address (MAC address).
  6. Identify the Default Gateway.
  7. Compare the IP addresses of two computers connected to the same laboratory network.
What Should You Identify?
  • IPv4 Address
  • Physical Address (MAC)
  • Default Gateway
  • DNS Server

Conclusion

Understanding IP addresses, Internet Protocol and MAC addresses provides the foundation for learning computer networking. These concepts are essential for configuring network devices, troubleshooting connectivity problems, managing local area networks (LANs) and understanding how the internet works.

Computer Networking Fundamentals | IP Addressing and Network Communication

Educational resource for Computer Hardware Technicians and Networking Students.

Post a Comment