IP: (Internet Protocol)
Format for an IP datagram
| 4-bit version | 4-bit header length | 8-bit type of service | 16-bit total length (in bytes) | ||||
| 16-bit identifier | 3-bit flag | 13-bit fragment offset | |||||
| 8-bit time to live (TTL) | 8-bit protocol | 16-bit header checksum | |||||
| 32-bit source IP address | |||||||
| 32-bit destination IP address | |||||||
| options if any | |||||||
| data | |||||||
Recommended values for type of service field.
| Application | Minimize delay | Maximize throughput | Maximize reliability | Minimize monetary cost | Unused | Hex value |
| Telenet/Rlogin | 1 | 0 | 0 | 0 | 0 | 0x10 |
| FTP control FTP data FTP bulk data |
1 0 0 |
0 1 1 |
0 0 0 |
0 0 0 |
0 0 0 |
0x10 0x08 0x08 |
| TFTP | 1 | 0 | 0 | 0 | 0 | 0x10 |
| SMTP command SMTP data |
1 0 |
0 1 |
0 0 |
0 0 |
0 0 |
0x10 0x08 |
| DNS UDP query DNS TCP query DNS zero transfer |
1 0 0 |
0 0 1 |
0 0 0 |
0 0 0 |
0 0 0 |
0x10 0x00 0x08 |
| ICMP error ICMP query |
0 0 |
0 0 |
0 0 |
0 0 |
0 0 |
0x00 0x00 |
| any IGP | 0 | 0 | 1 | 0 | 0 | 0x04 |
| SNMP | 0 | 0 | 1 | 0 | 0 | 0x04 |
| BOOTP | 0 | 0 | 0 | 0 | 0 | 0x00 |
| NNTP | 0 | 0 | 0 | 1 | 0 | 0x02 |
Each host in the
internetwork has a unique 32 bit IP address.
This 32 bit
binary number is usually presented as a 4 part decimal number
delimited by a full stop (".").
decimal - 255.255.255.255
These addresses have been divided into classes:
| class | bbb | bbbbb | bbbbbbbb | bbbbbbbb | bbbbbbbb |
| A | 000 | net | host | host | host |
| B | 100 | net | net | host | host |
| C | 110 | net | net | net | host |
| D | 1110 | multicast address | |||
| E | 11110 | reserved for future use | |||
The subnet mask is used to determine which part of the 32 bit address represents the network and which part represents the host.
The default subnet mask for Class A, Class B, and Class C.
| Class | Default subnet mask |
| A | 255.0.0.0 |
| B | 255.255.0.0 |
| C | 255.255.255.0 |
IP
routing is achieved by first searches a routing table in memory
each time a datagram is recieved to send.
Each
entry contains: