IP Protocol


 

 

 

 

 

Introduction

The IP Protocol, or Internet Protocol, is a layer of software that is used within the internet, and is basically responsible for the addressing of packets of data, so that data can be sent over the internet from one computer to another.

 

Software layers within the internet

The Open Systems Interface, or OSI 7 layer model is a theoretical layering system for the transmission of data over networks.

Each layer has a specific task or tasks, and only communicates with the layer immediately above it or below it.

The layers cover the whole range of requirements, from the the user interacting with the application at the top, right down to the physical wiring of the network at the bottom.


Application
Presention
Session
Transport
Network
Data Link
Physical

However when the original version of a network protocol suite called TCP/IP was proposed for the ARPANET system, it was thought that the OSI 7 layer model was too rigid a structure, with not enough interaction between the layers.

So the TCP/IP protocol was developed with an approximate correlation with the Transport and Network layers of the OSI 7 layer model, but it is not an exact match.

The other noticible feature of TCP/IP compared to the OSI 7 layer model is that the upper three layers are combined into one.

So TCP/IP looks like


Application
TCP
IP
Data Link
Physical

As the ARPANET evolved, and was finally killed off to be replaced by what has become the internet, the TCP and IP protocols developed and matured, and other protocols emerged and were developed as well. So the internet layer structure had to take account of these developments.

Additionally, as far as the internet is concerned, how an individual network functions is not significant, as long as it can process and transmit data packets created by the network layer. So the internet layer structure combines the bottom two layers into a single layer with a typical name of Network Interface layer.

So the internet layer structure looks like


Application layer
Transport layer
Internet layer
Network Interface layer

The Internet Protocol, or IP, is one of the protocols that exist within the Internet layer.

 

Features of the Internet Protocol

IP is responsible for attaching the recipient`s address and the sender`s address to the data packet - these are what are commonly known as the IP addresses, and it is these addresses that are used to move the data across the internet.

IP is what is known as a connectionless oriented protocol - there is no procedure to set up a channel of communication between two computers prior to the sending of data. In essence, the data has the recipient`s IP address attached to it, and the whole packet is fired off onto the sending computer`s network.

IP does not provide a reliable or guaranteed delivery system - checking on the successfull delivery of data is the responsibility of the layer above it, ie, the Transport layer.

IP is responsible for making sure that any data packets that it creates and sends off have a finite life - if a packet can`t get to its destination within a certain number of hops, then the packet is killed off.

IP is responsible for fragmentation - this is a process by which IP divides up large data packets into smaller packets which are suitable for transmission via the Network Interface layer.

 

How IP works

When an application needs to send some data to another computer, it bundles the data into one or more packets - a packet is a block of data with a header at the front of it.

This packet is handed down to the Transport layer, which adds a new header in front of the original one.

The Transport layer hands the new larger packet down to the Internet layer, or IP. IP adds yet another header to the front of the packet, and hands the packet down to the Network Interface layer, which adds yet another header on the front.

The header which IP adds contains a number of sections which are the means of defining how the packet will be conveyed by the internet. The sections are as follows :-

Version
The version number of IP in use, most used version is currently IPv4
IHL
The length of the IP header
Type of service
An optional request for a specific type of service, eg, high throughput or high reliability
Total length
The total length of the whole packet
Identification
A unique identification number for each packet. All fragments of a packet have the same identification number
Fragmentation flags
Specifies whether packets can or cannot be fragmented, or whether a packet has already been fragmented
Fragment offset
Specifies the fragment number which this packet contains, in cases where a larger packet has been fragmented by IP
Time to live
Specifies the amount of time that a packet can survive on the internet before it is discarded. Usually set to around 20 seconds by the originating IP, each router or gateway that handles the packet reduces the time by 1 second.
Transport
Identifies the type of protocol in the Transport layer which handed the data down to the originating IP
Header checksum
The checksum for all the bits in the IP header. Since the time to live bits are changed by every router or gateway, this header checksum has to be recalculated by every router or gateway
Sending address
The 32 bit IP address which specifies the originating computer
Destination address
The 32 bit IP address which specifies the intended recipient computer
Options
There are several options available, too many to list here. They include specifying routes across the internet, and adding timestamps from each node.
Padding
Used to fill up the header to a round number of bytes, ie, divisible by 4

Each router or gateway that processes the packet of data examines the header information, and firstly checks that the checksum is correct - this ensures the integrity of the header.

The router or gateway then performs the following functions :-

  • examines the address of the intended recipient

  • checks for a non-zero value in the time to live indicator

  • looks for any options specifying the route or timestamps

  • works out the next part of the route

  • decrements the time to live indicator

  • calculates the new checksum

  • creates a new header

  • sends the packet on the next part of its route

If the time to live indicator has reached zero, then the router or gateway discards the packet, and sends an error message to the sending computer.

Routers or gateways can act in two ways :-

Fast forward
They only read the header information on an incoming packet. As soon as the router or gateway has done the above, it generates the new header, and sends it off, attaching the data portion of the incoming packet as it comes in. So any deficiencies in the data part of the packet are passed on.
Store and forward
They store the whole incoming packet in a buffer, then examine the whole packet for deficiencies - if it finds any, the packet is discarded. If it does not find any deficiencies, then the header is processed as above. This way of working is slower, but ensures that only good packets are sent on.

Eventually the packet will arrive at the intended recipient, the successive headers are stripped off by each layer, and the data is available for use by the application.

 

Representing IP addresses

As stated above, IP addressing is based on the use of 32 bits for each address.

But unfortunately, although computers can read a 32 bit word without any problem, human beings have difficulty remembering 5 or 6 bits, so 32 bits is a non-starter.

The solution is to divide up the 32 bits into 4 blocks of 8 bits each, then convert each 8 bit block into its decimal value. So a whole 32 bit address is represented by 4 of decimal values.

Since an 8 bit block can range from 00000000 to 11111111, the decimal values for eack block can range from 0 to 255.

To seperate out the decimal values for each block from the decimal values for the other blocks, the decimal values for each block are seperated by full stops, so a typical IP address looks like

134.36.2.60

This way of representing 32 bit IP addresses is known as dotted decimal notation.

 

Classes in IP addressing

Again, as stated above, IP addressing is based on the use of 32 bits for each address.

Each address is considered to have two parts, the address of the network that the computer is attached to, and the address of the computer on that network.

In the early days of IP addressing, it was realised that it was inefficient to divide up the 32 bits in a fixed way, as some organisations wanted a small number of networks with a large number of computers on each network, but other organisations wanted a lot of networks with only a few computers on each network.

So the concept of classes of IP addressing was created. The 32 bits are split up into 4 of 8 bit sections, and these 4 sections can be used in different ways, in order to enable the use of classes in IP addresses. There are five classes, as follows :-

Class A
The first 8 bits define the network address, and the next 24 bits define the computers on each of the networks
Class B
The first 16 bits define the network address, and the next 16 bits define the computers on each of the networks
Class C
The first 24 bits define the network address, and the next 8 bits define the computers on each of the networks
Class D
These are not allocated to hosts, they have special functions
Class E
These are not allocated to hosts, they have special functions

It was decided that it was important to be able to identify to what class an IP address belongs to, without having any additional bits above the 32 already used - so the following scheme was decided upon -

Look at the first decimal value of the IP address in dotted decimal notation -

Class A
Decimal values from 1 to 126
Class B
Decimal values from 128 to 191
Class C
Decimal values from 192 to 223
Class D
Decimal values from 224 to 239
Class E
Decimal values from 240 to 255

So now combining all the above information, and considering it all in dotted decimal notation, the three classes used for addressing are :-

Class A
The first decimal has values from 1 to 126.


Only the first decimal value defines the network address, and so allows 126 different networks to be uniquely addressed


The last 3 decimal values define the computers on the networks, and so allow 16,777,214 computers to be defined on each network



Class B
The first decimal has values from 128 to 191


The first and second decimal values define the network address, and so allows 16,384 different networks to be uniquely addressed


The last two decimal values define the computers on the networks, and so allow 65,534 computers to be defined on each network



Class C
The first decimal has values from 192 to 223.


The first, second, and third decimal values define the network address, and so allows 2,097,152 different networks to be uniquely addressed


Only the last decimal value defines the computers on the networks, and so only allows 254 computers to be defined on each network

 


© 2001 Ron Turner


Return to the IP protocol home page