Previous Page | Next Page

  1. Introduction
  2. Network Topology
  3. Hardware Connections
  4. TCP/IP Ports and Addresses
  5. Network Protocol Levels
  6. Data Link Layer and IEEE
  7. Network Protocol Categories
  8. Repeaters, Bridges, Routers
  9. ARP and RARP Address Translation
  10. Basic Addressing
  11. IP (Network)
  12. TCP (Transport)
  13. UDP (Transport)
  14. ICMP
  15. Hardware Cabling
  16. Wireless media
  17. Outside Connections
  18. Ethernet
  19. Token Ring
  20. ARCnet
  21. AppleTalk
  22. FDDI
  23. IPX/SPX
  24. NetBEUI
  25. AppleTalk
  26. SNA
  27. Others
  28. Simple Routing
  29. More Complex Routing
  30. IP Masquerading
  31. Firewalls
  32. Domain Name Service (DNS)
  33. Virtual Private Networking
  34. DHCP
  35. BOOTP
  36. RPC and NFS
  37. Broadcasting and Multicasting
  38. IGMP
  39. Dynamic Routing Protocols
  40. Simple Mail Transfer Protocol (SMTP)
  41. Simple Network Management Protocol
  42. Network Services
  43. Installing Drivers
  44. Network Operating Systems
  45. Applications
  46. Wide Area Networks
  47. Backing up the network
  48. Fault Tolerance
  49. Troubleshooting
  50. Commonly used Network Ports
  51. Networking Terms and Definitions
  52. Networking RFCs and Protocols
  53. Further Reading
  54. Credits

Internet Protocol

Internet Protocol (IP) provides support at the network layer of the OSI model. All transport protocol data packets such as UDP or TCP are encapsulated in IP data packets to be carried from one host to another. IP is a connection-less unreliable service meaning there is no guarantee that the data will reach the intended host. The datagrams may be damaged upon arrival, out of order, or not arrive at all (Sounds like some mail services, doesn't it?). Therefore the layers above IP such as TCP are responsible for being sure correct data is delivered. IP provides for:

  • Addressing.
  • Type of service specification.
  • Fragmentation and re-assembly.
  • Security.

IP Message Format

IP is defined by RFC 791.

  1. Version (4 bits) - The IP protocol version, currently 4 or 6.
  2. Header length (4 bits) - The number of 32 bit words in the header
  3. Type of service (TOS) (8 bits) - Only 4 bits are used which are minimize delay, maximize throughput, maximize reliability, and minimize monetary cost. Only one of these bits can be on. If all bits are off, the service is normal. Some networks allow a set precedences to control priority of messages the bits are as follows:
    • Bits 0-2 - Precedence.
      • 111 - Network Control
      • 110 - Internetwork Control
      • 101 - CRITIC/ECP
      • 100 - Flash Override
      • 011 - Flash
      • 010 - Immediate
      • 001 - Priority
      • 000 - Routine
    • Bit 3 - A value of 0 means normal delay. A value of 1 means low delay.
    • Bit 4 - Sets throughput. A value of 0 means normal and a 1 means high throughput.
    • Bit 5 - A value of 0 means normal reliability and a 1 means high reliability.
    • Bit 6-7 are reserved for future use.
  4. Total length of the IP data message in bytes (16 bits)
  5. Identification (16 bits) - Uniquely identifies each datagram. This is used to re-assemble the datagram. Each fragment of the datagram contains this same unique number.
  6. flags (3 bits) - One bit is the more fragments bit
    1. Bit 0 - reserved.
    2. Bit 1 - The fragment bit. A value of 0 means the packet may be fragmented while a 1 means it cannot be fragmented. If this value is set and the packet needs further fragmentation, an ICMP error message is generated.
    3. Bit 2 - This value is set on all fragments except the last one since a value of 0 means this is the last fragment.
  7. Fragment offset (13 bits) - The offset in 8 byte units of this fragment from the beginning of the original datagram.
  8. Time to live (TTL) (8 bits) - Limits the number of routers the datagram can pass through. Usually set to 32 or 64. Every time the datagram passes through a router this value is decremented by a value of one or more. This is to keep the datagram from circulating in an infinite loop forever.
  9. Protocol (8 bits) - It identifies which protocol is encapsulated in the next data area. This is may be one or more of TCP(6), UDP(17), ICMP(1), IGMP(2), or OSPF(89). A list of these protocols and their associated numbers may be found in the /etc/protocols file on Unix or Linux systems.
  10. Header checksum (16 bits) - For the IP header, not including the options and data.
  11. Source IP address (32 bits) - The IP address of the card sending the data.
  12. Destination IP address (32 bits) - The IP address of the network card the data is intended for.
  13. Options - Options are:
    • Security and handling restrictions
    • Record route - Each router records its IP address
    • Time stamp - Each router records its IP address and time
    • Loose source routing - Specifies a set of IP addresses the datagram must go through.
    • Strict source routing - The datagram can go through only the IP addresses specified.
  14. Data - Encapsulated hardware data such as ethernet data.

The message order of bits transmitted is 0-7, then 8-15, in network byte order. Fragmentation is handled at the IP network layer and the messages are reassembled when they reach their final destination. If one fragment of a datagram is lost, the entire datagram must be retransmitted. This is why fragmentation is avoided by TCP. The data on the last line, item 14, is ethernet data, or data depending on the type of physical network.