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.
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.
📑 Quick Navigation
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:
An IPv4 address consists of four numbers separated by dots. Each number is called an 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
| Device | IP Address |
|---|---|
| Computer 1 | 192.168.1.10 |
| Computer 2 | 192.168.1.11 |
| Laptop | 192.168.1.12 |
| Printer | 192.168.1.20 |
| Router | 192.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.
Two Main Versions of IP Addresses
Uses 32-bit addresses divided into four octets.
192.168.1.10
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
IP addresses provide logical identification of devices on an IP network.
Example: Computer A – 192.168.1.10; Computer B – 192.168.1.11.
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.
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.
Devices use IP networking to access websites, email services, cloud storage and other online applications.
Example: Accessing Google Drive through a web browser.
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.
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.
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
- Logical Addressing: IP uses source and destination IP addresses to identify the endpoints of communication.
- Packet Delivery: IP carries data in units called packets. In IPv4 these are called datagrams.
- Routing: Routers examine destination IP addresses and forward packets towards the appropriate network.
- 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.
Provides logical addressing and packet forwarding.
Provides reliable, ordered delivery using acknowledgements and retransmissions when necessary.
Provides connectionless communication with low overhead, without guaranteeing delivery or ordering.
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
192.168.1.10
192.168.1.1
8.8.8.8
www.example.com
How Does Computer Communication Happen?
The student enters www.example.com into the web browser.
The computer uses DNS (Domain Name System) to find an IP address associated with the website's domain name.
The computer prepares IP packets containing source and destination IP addresses.
The computer sends the packets towards its default gateway. The router forwards them towards the destination network.
The destination server receives and processes the request.
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 Field | Purpose / Example |
|---|---|
| Source IP Address | 192.168.1.10 |
| Destination IP Address | 93.184.216.34 |
| Protocol | Identifies 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. |
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.
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 Name | Media Access Control Address | Internet Protocol Address |
| Purpose | Identifies a network interface at Layer 2 | Provides logical addressing for IP communication |
| OSI Layer | Data Link Layer (Layer 2) | Network Layer (Layer 3) |
| Address Type | Hardware-level / link-layer address | Logical address |
| Address Length | Usually 48 bits (EUI-48) | IPv4: 32 bits; IPv6: 128 bits |
| Example | 00:1A:2B:3C:4D:5E | 192.168.1.10 |
| Assignment | Usually assigned by manufacturer | Manual configuration or DHCP |
| Changes | Can be randomized or changed | May change according to network configuration |
Easy Way to Understand the Difference
Think about a person travelling from one city to another.
Similar to a person's current postal address. It indicates the network location used for communication.
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.
| Information | Home Network | Training Centre |
|---|---|---|
| MAC Address | 00:1A:2B:3C:4D:5E | 00:1A:2B:3C:4D:5E |
| IP Address | 192.168.8.105 | 192.168.1.105 |
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.
- Computer A identifies Computer B using its destination IP address.
- If necessary, ARP (Address Resolution Protocol) discovers the MAC address associated with Computer B's IPv4 address.
- The IP packet is encapsulated inside an Ethernet frame.
- The Ethernet frame is delivered to Computer B using its MAC address.
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
| Topic | Main Idea |
|---|---|
| IP Address | Logical address used to identify a device's network location. |
| Need for IP Address | Helps devices communicate and exchange data. |
| Internet Protocol | Rules for addressing and forwarding data packets. |
| Role of IP | Helps deliver packets between source and destination networks. |
| MAC Address | Identifies a network interface at the local network link layer. |
| IPv4 | Uses 32-bit addresses. |
| IPv6 | Uses 128-bit addresses. |
| TCP | Provides reliable and ordered data delivery. |
| DNS | Resolves 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.
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.
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?
Practical Activity: Find Your Computer's IP and MAC Addresses
Use Windows Command Prompt to identify the actual network configuration of your computer.
ipconfig /all
Follow These Steps
- Open the Start menu in Windows.
- Search for Command Prompt and open it.
- Type
ipconfig /alland press Enter. - Find the IPv4 Address of your network adapter.
- Find the Physical Address (MAC address).
- Identify the Default Gateway.
- Compare the IP addresses of two computers connected to the same laboratory network.
- 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