The Internet Protocol IP

The Internet Protocol (IP) is the Network Layer protocol used in the Internet suite of protocols.
IP provides:

The full specification is described in RFC791.

IP Addressing

An IP address is a 32 bit number which identifies uniquely every host connected to an internetwork.
It is usually represented in dotted decimal notation like this...
146.34.47.24
Each field between the periods is an 8-bit number (called an octet in the Internet world), and can have values from 0 to 255. The numbers 0, 127, and 255, however, have special meanings when they appear.

Hosts use these addresses to send each IP packet along to its final destination. The process of deciding where a particular packet should go next is known as routing.

There are several classes of IP addresses as defined by the IETF.

Depending on the network class, the IP address is divided into two parts. Part of the address is called the network address, and the remaining part is the host address.
Class A
This class is for very large networks. The first octet of the form 0xxxxxxx, which means it can range from 1 to 126. Networks of this type use the only the first octet as the network address. That means there can only be 126 class A networks. The remaining portion, 3 more octets or 24 bits, is used as the host address. This allows 16,194,277 computers on a class A network.
Class B
Class B networks are large networks. It is common for universities to have Class B addresses assigned to them. The first octet has the form 10xxxxxx, which gives a range from 128 to 191. The network address is defined to be the first two octets, which allows 16,382 class B networks. The last two octets are used for the host address, allowing 64,009 hosts. (remember that 0, 127, and 255 cannot be used)
Class C
This is a small network, with the first octect of the form 110xxxxx, or 192 to 223. The network address consists of the first three octets, allowing 1,984,279 different class C networks with only 253 hosts per network.
Other Classes
The IP specification states that addresses whose first octect have the form 111xxxxx are 'extended' addresses, reserved for future use. Some of these have since been allocated for other uses, i.e. multicast.

The IP Header

Whenever IP is called upon by an upper layer protocol (such as TCP) to send data out to the network, it attaches its own information to what it is given. This helps IP on other machines decide what to do with the packet. This information has the folowing form. Note that each tic mark represents a bit.

 0                   1                   2                   3   
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version|  IHL  |Type of Service|          Total Length         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Identification        |Flags|      Fragment Offset    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Time to Live |    Protocol   |         Header Checksum       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Source Address                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Destination Address                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Options                    |    Padding    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The IP Header taken from RFC791.

ICMP

The Internet Control Message Protocol is actually another protocol which is implemented within IP and required in every implementation of IP. ICMP is used to allow gateways and other hosts to report errors in datagram routing.
The complete specification of ICMP is RFC792.

[Top] [Ralph's Home Page]