IP: Internet Protocol

 


Overview

IP provides a connectionless datagram service : packets are not guaranteed to arrive correctly at their destination or even to arrive at all! This type of service is only as reliable as the service it is constructed on. But it is cheap. TCP builds a reliable delivery service based on IP datagrams.

Major IP issues included here are addressing, datagram format, forwarding, fragmentation, and error reporting.

 

 


Addressing

Address Class

 

Expressing IP addresses

Class

Binary Range

Decimal Range

A

00000000 - 01111111

0-127

B

10000000 - 10111111

128-191

C

11000000 - 11011111

192-233

D

11100000 - 11101111

224-239

E

11110000 - 11111111

240-255

Classes D and E are reserved for multicast addresses future use, respectively.

Where does a network owner obtain IP addresses? From internet service provider. Ultimately, they come from central registry, to assure no conflicts. Ownership of the central registry has changed several times in recent years.

 

IP Addresses and Routers

 

Some special IP addresses

1. host i.d. is all 1's. packet delivered across internet to destination network, where it is then broadcast to all hosts.

2. host i.d. is all 0's. Identifies network. Cannot be a source or destination.

3. IP address is all 1's. broadcast throughout sender's physical network (used at startup).

4. IP address is all 0's. host uses it at boot time for protocol which determines its own address.

5. class A prefix all 1's (127 decimal). Loopback address. Use this to test network applications when you don't want packets to actually leave the host. Sender and receiver run on same host, and packets work down the sender's protocol stack and up the receiver's, all without leaving host.

 

If IP can address 2 billion machines, why are we running out of addresses?

 

Solutions to IP Address Shortage

Stop-gap solution:

Long-term solution:

 


Datagram Format

 

Consists of Header and Data. Minimum size is Header + 1 byte. Maximum size is 64K bytes. Header part is almost fixed-length. Datagram format is:

Field

Length in Bits

Description

Version

4

IP version number (4)

Header Length

4

length in 32-bit words

Service Type

8

tell router to optimize delay, throughput, reliability

Total Length

16

total datagram length (header+data) in bytes

Identification

16

datagram I.D. (for reassembling fragments)

unused

1

 

Don't Fragment

1

whether or not datagram can be split up

More Fragments

1

0 if this is last fragment of datagram, else 1

Fragment Offset

13

fragment I.D. within datagram (0-8191)

Time To Live

8

init to 255, decrement each hop, discard upon 0

Protocol

8

transport layer protocol (e.g. TCP, UDP)

Header Checksum

16

sum 16-bit chunks of header using 1's complement

Source IP Address

32

 

Destination IP Address

32

 

IP Options (optional)

0-240

specify options for security, routing, timestamp,...

Padding (optional)

0-31

Enough to bring header length to 32-bit boundary

Data

1-64K bytes

maximum actually is (64K - header length) bytes.

 

Additional Notes on IP Header:

 


Datagram Forwarding

When IP datagram arrives at router, router reads destination IP address, and looks up destination network (not host) in its routing table. Table entry contains destination network, 32-bit mask, and IP address of next-hop router (none, if this is last hop). Mask is applied to destination IP address (from datagram) as part of lookup. e.g.

for router table entry i

if (DestIP & Mask[i] == DestNet[i]) forward to NextHop[i];

The mask is part of CIDR.


IP Subnet technique

 

 

IP subnet allows organization to utilize its class B network more effectively

 

ROUTING TABLE ENTRIES ARE OF TWO GENERAL TYPES:
1. External network, no host.

2. This network, host.

 

SUBNET ROUTING TABLE ENTRIES ARE OF THREE GENERAL TYPES:

1. External network, no host.

2. This network,other subnet

3. This network,this subnet,host.


Fragmentation

 

The Problem

  1. Removed from the frame structure
  2. Destination is inspected and looked up in routing table
  3. Encapsulated into another frame

 

The Solution

 

Fragmentation in IPv6

 


Error Reporting : Internet Control Message Protocol (ICMP)

  1. Source Quench: router buffers are full so it tells sender to back off
  2. Time Exceeded: datagram's TTL or fragment reassembly timer has expired -- notify sender.
  3. Destination Unreachable: when router learns this, transmits message to sender
  4. Redirect: tell sender to use a different route
  5. Fragmentation Required: datagram too big but can't be fragmented -- drop it and notify sender.

 

The sender can learn about the network by cleverly crafting datagrams designed to trigger ICMP messages.

Example: traceroute

Example: ping

Example: determine smallest max. datagram length

 

  


Related Home Pages: notes | CSC 465 | Peter Sanderson | Computer Science | SMSU


Last reviewed: 15 April 1998

Peter Sanderson ( pete@csc.smsu.edu )