IP mapping is a technique widely used in computer networking to direct the network traffic from one point in the network to another predefined address. This ensures that the data traffic reaches the intended destination point in the network. There are different types of IP mapping for different purposes, for example, static IP mapping, dynamic mapping, ARP mapping, etc. It is used in routers as NAT to route the data from a local network to the outer Internet. It is used to redirect traffic to the migrated server. Here in this article, we take a deep look at the concept of IP address mapping in easy-to-understand points.
IP is short for Internet Protocol. It is the third layer in the TCP/IP internet protocol stack. The main job of this layer of the protocol is to route the traffic from source to destination on the worldwide Internet. Every device on the Internet has a public IP address used to communicate with the device. If the device is also a part of a local network such as an Ethernet LAN or WiFi, it also has its own local IP used only for local device intercommunication. If the data has to be transmitted to the outer network, it must go through NAT in the default gateway, which uses IP mapping.
Every device on the Internet has its unique public IP address. There are two versions of the IP addressing scheme used on the Internet. IPv4 is a 32-bit address, written as the combination of four eight-bit numbers. IPv6 is a newer addressing scheme that uses 64-bits to represent an address. It is such a bit number that it is usually expressed in hexadecimal. The Internet is transitioning from IPv4 to IPv6 due to the small number of IP addresses available in the 32-bit scheme.
NAT and IP mapping
NAT shorts for Network Address Translation. It is a technique implemented in network gateways (typically a router), it maps the private IP addresses of the locally connected devices to its own public IP address, Which means all the locally connected devices can access the Internet using a similar public IP address of the gateway. The router keeps track of the addresses and data routing in a NAT table, which the router maintains in its working memory to distinguish communication data of different devices. The following paragraph explains the concept of NAT and IP mapping.
Consider a network scenario of one router (gateway) and two computers in a local network setting both connected to the router connected to the Internet. If computer 1 wants to send data to computer 2, it can do so easily without using NAT or IP mapping by using their local private IP addresses. If computer 1 wants to communicate to the outer network, a web server, for example, sends a request to the server through the gateway router with its own local private IP address as the source and server’s IP as the destination using an arbitrary port number.
The NAT-enabled router stores the source local IP and port number on the left side of the mapping table (NAT table), replaces the source IP of the data packets with its public IP address, and sends the request on behalf of the computer 1 with its different port number. This new Public IP and new port number are stored next to the previous entry and mapped with the initial IP address. When the server responds to the router, the router redirects the data to computer 1 local IP after matching the entries in its NAT table. Computer 1 receives its response from the webserver without being exposed to the Internet directly.
This is an abstract nutshell description of the working of NAT, IP mapping, and traffic routing and management for just understanding the concept.
IP mapping in ARP
ARP stands for Address Resolution Protocol. It is a link-layer protocol used to map a private IP address of the device with its physical or MAC address. Every network device or NIC has a MAC (Multiple Access Control) unique to itself. The ARP works under the IP protocol and is implemented in the link layer of the protocol stack. It is used in the intercommunication of devices at a low level of abstraction.
The switch is the networking device installed in the link layer and implements the ARP protocol. Like the router maintains the NAT table, the switch maintains an ARP table that maps the Local IPs to their corresponding MAC addresses.
IP mapping File
The IP mapping file is a simple text file that contains the source IP address, and corresponding mapped IP address, separated by whitespace. It could be thought of as a table with two columns that contain source IP in the first column and the corresponding mapped IP in another. The simple data structure of the file makes it easy to use and efficient. The file can be easily created in any text editor and saved with the (.txt) extension.
IP mapping software
IP mapping can be employed in many ways. In devices like routers or switches, it is hardcoded in their software, but it can be deployed manually by configuring the network settings in operating systems. But to save yourself the hassle of configuring or tinkering with system files, you could always use software mainly designed for network mapping. Here the term IP mapping is used in whole network mapping or scanning. There are many options available in this category of software. There are quite a few free and open-source network mapping tools, but they are also proprietary alternatives for professional or enterprise purposes. Here is a list of popular mapping softwares.
- Nmap (open-source)
- Zmap scan (open-source)
- Massscan (open-source)
- SolarWind network topology mapper (Licensable)
- EdrawMax (Licensable)
- Datadog (Licensable)
IP mapping cmd
A network can be mapped with a few commands. Here we demonstrate how to map a network in Windows using Nmap. It is free and open-source. You can download it for your platform from its official website www.nmap.org. After installing Nmap run the ‘Nmap –help’ command for all scan options available and their description. For aggressive scan options, the user should have admin privileges.
IP mapping linux
Comparatively, network mapping is more straightforward in Linux as most distributions come preinstalled with Nmap. If you use a security testing-based distribution such as kali or parrot Linux, you get additional tools also. The process and working of Nmap are similar irrespective of the platform. Therefore, referencing its documentation is recommended to map a network efficiently and effectively using Nmap. https://nmap.org/docs.html
FAQs on IP Mapping
How many abstraction layers are in the TCP/IP protocol stack?
The internet protocol stack has five layers: Application, Transport, Network, Link, and Physical layer.
What is the main difference between a router and a switch?
A router is a Network layer device, while a Switch is a Link layer device.
How many bits is a MAC address?
A MAC address is 48 bits or 8 bytes.
IP mapping is an essential concept of Computer networking and is used in more than one layer of the Internet (TCP/IP) protocol stack. The word IP mapping can also be used in other contexts, such as redirecting traffic from one server to another, migrating servers, redirecting domains, etc. We looked at the NAT tables, ARP tables, and IP mappings files. This was just a bird-eye view of the topic with a lot of abstraction, but we provided you with sufficient information to explore the topic furthermore.