The Internet protocol defines the basics of the data
communication on the lowest level. It allows binding many different
network and hardware archtitectures together into an entire network
without dealing with the physical media. The internet protocol enables
you to transport data through a connectionless and not secured way.
Data security and consistency is done on a higher level, e.g. TCP.
Basics for network communication: |
- |
Addressing mechanisms in order to
have a unique way to identify the
transmitter and the receiver |
 |
- |
Concepts for the transportation of data packages
via router |
- |
Format of the data exchange (defined header with
important informations
Protocol layers of the Internet >
|
| |
|
|
|
|
Internet Addresses
Each host in the internet has an unique internet address. This address
is comprised of a 32 bit value, which is specified for better readability
in dot notation, e.g. four bytes separated by dots. |
 |
| The IP
address is build by the network and the host ID. The number of bits
being used for the network and the host ID depends on the class of
the network. |
 |
| |
|
|
| According to the table above the following
ranges are available for the different classes: |
| |
| Class |
Lowest Net-ID |
Highest Net-ID |
| A |
0.1.0.0 |
126.0.0.0 |
| B |
128.0.0 |
191.255.0.0 |
| C |
192.0.1.0 |
223.255.255.0 |
| D |
224.0.0.0 |
239.255.255.255 |
| E |
240.0.0.0 |
247.255.255.255 |
Normally IP addresse are defined for classes A through C and you get
involved with classes D or E. Class D comprises nets for multicasting
and class E has been reserved for research purposes.
Certain IP addresses have a special meaning and may not be used as
addresses for an IP host:
| all
bits zero |
actual host
with net and host - ID, only startup |
| all bits zero |
host - ID |
host with ID, only during startup |
| all
bits one |
Boradcast in
the local net |
| net - ID |
all bits one |
Braodcast in the given net |
| 0111 1111 |
all bits one |
Loopback inside the TCP stack |
|
| |
|
|
The packet format of IP
|
|
A datagram is made up by a header and
the data area. The header contains information about the datagram
like the addresses of the transmitter and the receiver, routing information,
special options and the number of the higher level protocol.
datagram header / datagram data area |
| |
|
|
Format IP datagram header
|
|
| |
| 0 |
4 |
8 |
16 |
19 |
31
|
|
VERS
|
HLEN
|
SERVICE TYPE |
Total length |
| Identification |
Flags |
Fragment
offset |
| Time to live |
PROTOCOL
|
Header Checksum |
| Source
IP address |
| Destination IP
address |
| IP
options (if any) |
padding
|
|
Data area
|
|
.......
|
|
| |
|
|
| - |
version: binary codes version of the
IP protocol, currently 4.0 |
| - |
HLEN: length of the IP header in DWORDS
(32 bit) |
| - |
service type: priority of the packet
and properties of the desired routing |
| - |
total length: total length of the packet
including header and data in bytes |
| - |
identification: Value of the transmitter
for a fragment |
| - |
flags: 3 bits: |
| |
- bit2: fragmentation
allowed 0= yes, 1 = no |
| |
- bit3: 0= last
fragment, 1= more fragments follow |
| - |
time to live: value which is decremented
in each router. If the value reaches zero the packet will be discarded |
| - |
protocol: number of the higher level
protocol |
| |
- TCP =
6 |
| |
- UDP=
17 |
| - |
header checksum: checksum over the header |
| - |
source-IP: IP address of the transmitter |
| - |
dest-IP: IP address of the receiver |
| - |
options: options if desired |
| - |
padding: fill bytes, in order to bring
the headerlength to a multiple of DWORDS |
| |
|
|
Routing of IP packages
|
|
Routing is the transport of a datagram
from the transmitter to the receiver. We have to distinguish between
direct and indirect routing. Direct routing occurs inside of a local
network, e.g. we do not need a router. Indirect routing occurs between
two hosts in different subnets. The transmitter does not talk directly
to the receiver rather than to the router.
The descision whether to route directly or indirectly is rather easy:
the software compares the net ID of the receiver with the local net
ID. If they do not match, the packet will be sent to the router. |
| |
The picture above shows an example of a network with hosts and routers.
The host PAULA is "multi-homed host", which means it has access to
more than one network with two NIC's, but does not provide any routing
mechanism.
PAULA, JOHN and HENRY belong to a class B network (128.10.0.0). The
token ring network is a class C network (192.5.48.0) which is connected
by the router DONALD to another network. |
 |
| |
|
|
Subnets
|
|
If a local net is not sufficient or
it is too large (for example a class A net with more than 16 million
hosts) the net will be structured into smaller parts, so called subnets.
Different network technologies in the various departments, limitations
because of the cable length and the number of connected stations or
optimization considerations are other reasons for dividing a net into
smaller subnets.
Due to the fact that the IP address has no options for implementing
further sub-divisions in the address itself, a subnet-masj has been
invented. It specifies, which bits of the host ID are being used for
encoding the subnet ID and which bits are being used for the host
ID.
The subnet mask is defined by an administrator and is specified in
the same dot-notation as the IP address.
Binary operations with the subnet mask
Host-ID = IP-address AND(NOT(Subnet-mask))
Net-IDS = IP-address AND Subnet-mask
Subnet-ID: set the Net-ID to zero
Example for an IP address in a class B network: |
| |
| IP address |
172.16.233.200 |
10101100 |
00010000 |
11101001 |
11001000 |
| Subnet mask |
255.255.255.128 |
11111111 |
11111111 |
11111111 |
10000000 |
| Host ID |
72 |
00000000 |
00000000 |
00000000 |
01001000 |
| Net-ID |
172.16.0.0 |
10101100 |
00010000 |
00000000 |
00000000 |
| Net-IDS |
172.16.233.128 |
10101100 |
00010000 |
11101001 |
10000000 |
| Subnet-ID |
0.0.233.128 |
00000000 |
00000000 |
11101001 |
10000000 |
|