OREGON INSTITUTE OF TECHNOLOGY

Computer Systems Engineering Technology Department

CST 415 - Computer Networks

 

Description

In this portion of the project, you will parse out and dump the ICMP packet.

The MAC header looks like:

The IP header that look like:

           0               1                 2             3   
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| IHL |Type of Service| Total Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Identification |Flags| Fragment Offset |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Time to Live | Protocol | Header Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ...
| Data
| ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Example Internet Datagram Header

In this lab you will also parse out the ICMP packets that are contained in the "Data" or "Payload" portion of the IP Datagram packet.

ICMP


ICMP is the Internet Control Messaging Protocol packet. ICMP packets are sent from Router to Host machines to inform the originating host of problems that may have happened with the packet the host sent out. For a good reference to the ICMP packet, follow the link:

 

ICMP Packet Format

Yoru parser will recognize, fullly parse, and print four of the following ICMP packets:

Type
Name Reference
0
Echo Reply RFC792
3
Destination Unreachable RFC792
4
Source Quench RFC792
5
Redirect RFC792
8
Echo RFC792
9
Router Advertisement RFC1256
10
Router Solicitation RFC1256
11
Time Exceeded RFC792

 

For all other types, just print out the number and ignore the rest of the packet.

Programming Requirements

Packet Dump:

You must print out the following information as extracted from the incoming packet. This is only a sample. Use this as a guide for the other option types mentioned above.

    ETHER:  ----- Ether Header -----
     ETHER:
     ETHER:  Packet size : 210 bytes
     ETHER:  Destination : 08-00-20-01-3d-94   Type: Individual Global
     ETHER:  Source      : 08-00-69-01-5f-0e        Type: Individual Global
     ETHER:  Ethertype   : 0800 (IP) (Note: Here it prints either ARP, IP, or UNKNOWN)
     ETHER:

              IP:   ----- IP Header -----
     IP:
     IP:   Version = 4
     IP:   Header length = 20 bytes
     IP:   Type of service = 0x00
     IP:         xxx. .... = 0 (precedence)
     IP:         ...0 .... = normal delay
     IP:         .... 0... = normal throughput
     IP:         .... .0.. = normal reliability
     IP:   Total length = 40 bytes
     IP:   Identification = 25372
     IP:   Flags = 0x4
     IP:         .1.. .... = do not fragment
     IP:         ..0. .... = last fragment
     IP:   Fragment offset = 0 bytes
     IP:   Time to live = 254 seconds/hops
     IP:   Protocol = 1 (ICMP)
    IP:   Header checksum = 4b14
     IP:   Source address = 128.211.1.31, shecky.jnltech.com
     IP:   Destination address = 204.145.255.20, beer.net
     IP:   Options - None

     ICMP:  ----- ICMP Header -----
     ICMP:
     ICMP:  Type = 8 (Echo request)
     ICMP:  Code = 0
     ICMP:  Checksum = 8dfd
     ICMP:  Identifier = 1f8e
     ICMP:  Seq. Num = 0002
     ICMP:

--------------- ASCII Dump - Hex ------------------------------------ ASCII Dump - ASCII -----------------------


Also, make the correct modifications to your command options to allow the toggling of these additional types of packets.

Project Requirements Summary:

  1. Acquire the packet buffer and parse and label:
    1. Layer 2 (Ethernet) - Done in the first lab.
    2. Layer 3 (IP) - Done in the second lab.
    3. Layer 3 (ARP) - Done in the third lab.
    4. Layer 4 (ICMP)
      1. Type - All differnt types defined above must be fully parsed.
      2. Code
      3. Checksum
      4. Identifier
      5. Sequence Number
  2. Hex Dump Packet.

Extra Credit - Cyber War:

Build an ICMP based cyber attack to shut down peer machines playing Layer 4 ping-ping. The goal is to shut down your peer machines (even crash them, if possible) while maintaining good operation of your ping-pong program. Extra credit will be awarded based on:

You may receive up to 50 extra credit points.