Layer 3 IP Models

How IP and IPv6 are modeled

Packet Tracer 5.0 models only certain aspects of IP.

- IP version 4 is modeled.
- IP addresses are 32 bits long, and displayed using the dot-decimal notation, where each octet or byte of the IP address is displayed in decimal number and separated by a dot.
- All class A, B, and C addresses (1.0.0.0 to 224.255.255.255) except loopback addresses (127.0.0.0 to 127.255.255.255) can be assigned to ports.
- All IP packet fields are displayed in the PDU details. However, only the following four fields are used: Destination IP Address, Source IP Address, TTL, and Protocol.
- The Protocol field in the IP packet identifies the layer 4 PDU. When a device sends an IP packet, it places the value corresponding to the layer 4 process or service in the Protocol field. When a device receives an IP packet, it dispatches the layer 4 PDU to a process or service corresponding to the value of the Protocol field.

Packet Tracer 5.0 also models IPv6.

- IP addresses are 128 bits long, and displayed as eight groups of four hexadecimal digits separated by colons.
- There are no classes of addresses in IPv6. Each address assignment has an address and a prefix in the format with / followed by the prefix length of the network.
- All IPv6 packet fields are displayed in the PDU details. However, only the following four fields are in used: Destination IPv6 Address, Source IPv6 Address, Hop Limit, and Next Header.
- The Next Header field in the IPv6 packet identifies the layer 4 PDU or the next option in the IPv6 header. When a device sends an IPv6 packet, it places the value corresponding to the layer 4 process or service in the Next Header field. When a device receives an IPv6 packet, it dispatches the layer 4 PDU or the IPv6 header to a process or service corresponding to the value of the Next Header field.

How devices process incoming ICMP packets

When a device receives an ICMP packet:

- It checks the ICMP message contained in the packet.
  - If the packet contains the message "TTL Exceeded" or "Echo Reply:"
    - It checks to see if it has recently sent an ICMP message with the same identification as the received ICMP message.
      - If so, it sends out the ICMP.

How devices process incoming ICMPv6 packets

ICMPv6 works similar to ICMP for Echo, Echo Reply, Hop Limit Expire (TTL Expire), Unreachable messages. For Neighbor Discovery (ND) messages, ICMPv6 process sends them to the ND process. Refer to ND process for more details.

How ND for IPv6 processes incoming packets

When an ND process for IPv6 receives a packet (flowchart here):

- If the packet is a Neighbor Solicitation, the process executes the following actions:
  - It will drop the packet if it doesn’t contain a Link Layer option.
  - If the destination IPv6 address doesn’t match with the receiving interface’s IPv6 address:
    - If there is an entry already exists in the ARP table, the entry will be updated with the information in the packet.
  - If matched,
    - If the host device is not a switch, the process will update the ARP table with information from the packet (source IPv6 address, source MAC address).
    - Then ND process creates an ARP Reply packet that contains its MAC address and sends to the source device.
- If the packet is a Neighbor Advertisement, the process executes the following actions:
  - It will drop the packet if it meets any of the following conditions:
    - It does not contain a Link Layer option.
    - It has not sent an ARP request but received an ARP reply
  - Otherwise, it will do the following actions:
    - The device’s ARP process will updates the ARP table with the received information.
    - If there are buffers contained in the received packet, the ARP process takes out these buffers and resends them.
- It the packet is a Router Solicitation, the process executes the following actions:
  - It will drop the packet if the message is a not valid Router Solicitation. A valid Router Solicitation message must meet the following conditions:
    - The IP Hop Limit field has a value of 255.
    - ICMP code is 0.
    - ICMP length is 8 or more octets.
    - All included options have a length that is greater than zero.
    - If the IP source address is the unspecified address, there is no source link-layer address option in the message.
  - If the packet is a valid Router Solicitation, it will create a Router Advertisement and multicast it to the all-nodes group.
- If the packet is a Router Advertisement, the process executes the following actions:
  - It cancels any existing router solicitation timer scheduled on the receiving interface.
  - It retrieves information from the Router Advertisement such as source IPv6 address, prefix and prefix length, and with the receiving interface’s local link address, it creates an IPv6 address.
    - If the Router Advertisement’s prefix option is on-link, the ND process sets the newly created IPv6 address to the receiving interface.
    - If the Router Advertisement’s prefix option is off-link, the ND process removes the IPv6 address from the receiving interface.