- Forward


The Internet Protocol (IP)
An Introduction


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu

Print

Overview
Back SMYC Forward
  • Purpose:
    • Provides for the delivery of data through a (set of interconnected) packet-switched network(s)
  • Specifications:
    • IPv4 - RFC791
    • IPv6 - RFC2460
Frame Format
Back SMYC Forward
  • Version (4 bits)
  • Internet Header Length (4 bits)
    • The length in 32-bit words
  • Type of Service (8 bits)
    • Precedence (3 bits)
    • Desired Frame Delay (1 bit; normal or low)
    • Desired Frame Throughput (1 bit; normal or high)
    • Desired Frame Reliability (1 bit; normal or high)
    • Reserved (2 bits, must be 0)
  • Total Length (16 bits)
    • The length in octets
  • Identification (16 bits)
    • Used to assemble fragments
  • Flags (3 bits)
    • Reserved (1 bit, must be 0)
    • Fragmentable? (1 bit; not-allowed or allowed)
    • Last? (1 bit; yes or no)
  • Fragment Offset (13 bits)
    • 0-based position of this fragment (measured in 64-bit words)
  • Time to Live (8 bits)
    • The remaining hop count (which is reduced by 1 by each router)
  • Protocol (8 bits)
    • Identifies the protocol that should be used to process the payload (see RFC1700 for options)
  • Header Checksum (16 bits)
  • Source Address (32 bits)
  • Destination Address (32 bits)
  • Options (variable length)
  • Payload
Moving through the Stack/Layers
Back SMYC Forward
  • Moving Down:
    • The IP datagram becomes the payload of the link layer (e.g., Ethernet) frame
  • Moving Up:
    • The payload of the IP datagram is handed off to the protocol (e.g., TCP, UDP) identified in the protocol portion of the header
IP Addresses
Back SMYC Forward
"Classfull Addressing"
ip-addresses
IP Addresses (cont.)
Back SMYC Forward

A Class C (110...) Example

ip-addresses_example
Assigning/Obtaining an IP Address
Back SMYC Forward
  • Static Address:
    • Specified in a file created by the system administrator
  • Dynamic Address:
    • DHCP - dynamic host configuration protocol
Sending from Source to Destination
Back SMYC Forward

From A to B (Within a Network)

ip-routing
  1. Look up the address of B
  2. Find B is on the same network as A
  3. Link layer sends directly to B
Sending from Source to Destination (cont.)
Back SMYC Forward

From A to E (Between Networks)

ip-routing
  1. Look up the address of E
  2. Find E is on a different network from A
  3. Learn that the appropriate router is 223.1.1.4
  4. Link layer sends packet to 223.1.1.4
  5. Packet arrives at 223.1.1.4 (destined for E)
  6. Look up the address of E
  7. Find E is on the same network as the router
  8. Router sends to E
Subnetting and Netmasks
Back SMYC Forward
  • Netmasks:
    • A dotted-quad that can be ANDed with an address to obtain the network portion of that address (e.g., the netmask for a class C address is is 11111111.11111111.11111111.00000000 or 255.255.255.0)
  • Creating a Subnet:
    1. Extend the network portion of the address n bits to the right (creating \(2^n -2\) possible subnets since subnets of all 0s and all 1s are not allowed)
    2. Create the appropriate netmask
  • An Example:
    • Consider 134.126.0.0 (i.e., a class B network)
    • Extending the network portion by 3 bits yields \(2^3 - 2\) (i.e., 6) possible subnets
    • Each subnet can have \(2^{13} -2\) (i.e., 8190) possible nodes
    • The netmask is 11111111 11111111 11100000 00000000 (i.e., 255.255.224.0)
Supernetting
Back SMYC Forward
  • A Problem:
    • Class C networks have a maximum of 256 hosts
    • Class B exhaustion
  • Supernets:
    • Combine/aggregate multiple class C networks (again using netmasks)
  • Details?
    • We'll discuss CIDR instead
IP Fragmentation and Reassembly
Back SMYC Forward
  • The Issue:
    • The link/physical layer probably imposes a limit on the maximum frame size
  • Fragmentation and Reassembly:
    • One frame is divided into multiple fragments
    • The fragments are sent to the destination
    • The fragments are reassembled at the destination
IP Fragmentation and Reassembly (cont.)
Back SMYC Forward
ip-fragmentation
  • The overall length increases by 60 octets because three additional IP headers are required (each of which is 160 bits or 20 octets). In other words, the original data length was 5140 - 20 = 5120. 5120 octets of data requires 4 fragments, each of which has a header of 20 octets. 5120 + 4*20 = 5200 - 5140 = 60.
  • The offset is listed in multiples of 8 (e.g., 185 x 8 = 1480 = 1500 - 20)
What's Different About IPv6?
Back SMYC Forward
  • Larger address space (128 bit addresses)
  • Different packet format
  • Mandatory use of Internet Protocol Security (IPsec)
  • Some services provided using different protocols (e.g., the services provided by ARP are provided by the Neighbor Discovery Protocol, stateless configuration is provided using ICMPv6, stateful configuration is provided using DHCPv6)
There's Always More to Learn
Back -