Tag: Network packet

Say Goodbye to IPv4 … it has served as well

We have a survey on IPv6, please complete it here.

Introduction

Well, when they created ARPAnet, which eventually become the Internet, they had a network of 15 nodes and 23 hosts. It basically connected nine DEC PDP-10’s and five System/360’s. At the time the concept of the PC or even computers in the home was a long way off. So along come the concept of a layered model for networking, where we give each layer a specific role, such as for the physical layer which is responsible for the electrical characters of the cables, and the 1s and 0s which travel along the line. The level above, named the Data Link layer, focuses on defining an orderly way for the data to get from one host to another, and introduces the concept of a hardware address. It is in the layer above that we get the concept of inter-networking, using the concept of an network address. So let’s look at IPv4, and it’s role, and see if we can look to the future.

Let’s take an example

ip2
Figure 1

We will create a simple network, and watch the data packets are they travel over the network (Figure 1).  Let’s say that the node at 192.168.1.3 wants to communicate with 10.0.0.1. As they are on different networks, we cannot just send the data packet to the remote computer, so we need routers to be able to take packets from one network and find the best way to send them to their destination. First the host, let’s call in HOSTA, must find out the physical address of the gateway port. In this case it is the port on the router that the host connects to. So HOSTA sends out an ARP request for the physical address (typically known as the MAC address in an Ethernet network) of 192.168.1.254. This is sent to all the hosts and network connection which are contained within the area bounded by the router port. The only network connection to respond back is the gateway port (at 192.168.1.254) which will send back its MAC address to HOSTA. HOSTA then adds this to its ARP cache, so that is does not have to ask for the MAC address for a while. Now HOSTA will send out a data packet with the destination network address (10.0.0.1) and with a source address of its own network address (192.168.1.2). The physical addresses using in the Ethernet frame will be the destination MAC address of the router (1:2:3:4:5:5) with a source MAC address of the host ((1:2:3:4:5:1). The router will then pick this up and examine the destination network address. It knows that it can pass onto the next router, as this router has told it that it can reach that network in 1 hop. The network addresses will stay the same in the network packet, but the MAC addresses will now change to a destination MAC of 1:2:3:4:5:7 and a source MAC of 1:2:3:4:5:6. The next router picks it up, and actually knows that 10.0.0.x is connected to one of its ports. So it sends out an ARP address to that network asking “Who has 10.0.0.1?”, and the destination host (HOSTB) will respond with its MAC address, after which the router can then send the data packet to the destination.

And to IP

ip
Figure 2: IP, TCP and Ethernet

We can see that the key to the data moving over the interconnected networks is the network address, and the most popular address is the one used on the Internet: IP (Internet Protocol), or more specifically IP Version 4.  Figure 2 shows the basic format for IP, and also for the layer above: TCP, and for Ethernet. The first four bits of the IP header is key, as it these bits which actually define the IP version, which in most cases is Version 4. The key element of the address is the 32-bit source and destination address. At the time the Internet was created this size of address made sense, as it gave over 4 billion unique addresses. Unfortunately the number of devices which connect to the Internet has risen massively, and just last year, we ran out of IP address which can be given out. So we are at a cross-roads. What shall we do now? If the number of devices, from laptops to mobile devices, to sensors, increases by the day, all of which want a unique IP address.

Figure
Figure 3: NAT

The first solution is to use NAT (Network Address Translation), where the IP addresses on one network can be mapped to global IP addresses. So in the most efficient method, many addresses can be overloaded into a single address. In fact, if you are at home on a wireless network, there’s a good chance you are using overloaded NAT, where many addresses on the wireless will map to a single global IP address. So if you run “ipconfig” and see an address such as 192.168.0.1, which does not existing on the Internet, then your connection to the Internet will translate this address to a publicly available IP address. If you are interested it typically does this by mapping to TCP ports. All this is fine, but it makes for a fairly private network infrastructure, which is difficult to give each host on the Internet the full rights to exist in its own space.

And so to IPv6

The solution to this problem, and eventually it will be a major problem, and one which will hold back the future of the Internet is IPv6. Let’s look at a world in which we could connect every single electronic device directly on the Internet, and for it to be seen by all the other nodes. The main change is the move toward a 128-bit address, which gives up to 115,792,089,237,316,195, 423,570,985,008,687,907,853,269, 984,665,640,564,039,457,584,007,913, 129,639,936 different address … which should be enough to go round for a long time.

In IPv4 with have four groups of decimal values, each representing 8 bits. With IPv6 addresses there are eight groups of four hexadecimal digits, separated by colons, for example:

2001:0630:0012:0600:0001:0000:0000:0107

We can compress the zeros to give:

2001:630:12:600:1::107

where the :: replaces a series of 0s.

So how do we generate an IPv6 address? Well we can do it based on the MAC address of the computer from:

C8-F7-33-4B-82-37

and using the EUI-64 format will generate an address of:

::CAF7:33FF:FE4B:8237

We can also define an IPv6 address with a network part and a host part. For example:

2001:630:12:600:1::107/64

gives a network part of:

2001:630:12:600::/24

and a host part of:

::1:0:0:107

Here’s a sample for defining IPv6 on a Cisco router:

http://www.asecuritysite.com/cisco/router?chall=1ccna%2FChallenge_146