Learning Objective

This assignment is the designated final exam. You need to use what you have learned to approach the problem. The assignment is revised based on a capstone project composed by Professor Odile Wolf.

Problem Overview

You will be creating a Python program saved in a file named "extractFrame.py". The Python program will read text from a file named "wireShark.txt" and display the frames with essential frame data.

What is provided?

You are provided a file named wireShark.txt, which contains several Ethernet II frames you need to extract. For each frame, you will need to extract and present its frame number, the source and destination addresses, as well as the frame type. The frame number always appears after "Frame" at the beginning of each frame in the document. For either source or destination address, it is composed of 12 hexadecimal digits, every two of which are separated by colon. The address examples could be like below:

00:14:ee:08:dd:b1
01:00:5e:7f:ff:fa

The frame type is a hexadecimal value that is used to indicate the type of upper-level protocol in the data fields. A common value is 0x800 that describes the IPv4 protocol.

For example, the first frame in the given "wireShark.txt" file is presented below. Note that here I highlight the data fields that you need to extract from each frame in the document.


Frame 1: 372 bytes on wire (2976 bits), 372 bytes captured (2976 bits) on interface 0
Ethernet II, Src: WesternD_08:dd:b1 (00:14:ee:08:dd:b1), Dst: IPv4mcast_7f:ff:fa (01:00:5e:7f:ff:fa)
    Destination: IPv4mcast_7f:ff:fa (01:00:5e:7f:ff:fa)
        Address: IPv4mcast_7f:ff:fa (01:00:5e:7f:ff:fa)
        .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
        .... ...1 .... .... .... .... = IG bit: Group address (multicast/broadcast)
    Source: WesternD_08:dd:b1 (00:14:ee:08:dd:b1)
        Address: WesternD_08:dd:b1 (00:14:ee:08:dd:b1)
        .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
        .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
    Type: IPv4 (0x0800)
Internet Protocol Version 4, Src: 192.168.1.180, Dst: 239.255.255.250
    0100 .... = Version: 4
    .... 0101 = Header Length: 20 bytes (5)
    Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
    Total Length: 358
    Identification: 0xfe2a (65066)
    Flags: 0x4000, Don't fragment
    Time to live: 4
    Protocol: UDP (17)
    Header checksum: 0xc505 [validation disabled]
    [Header checksum status: Unverified]
    Source: 192.168.1.180
    Destination: 239.255.255.250
User Datagram Protocol, Src Port: 35064, Dst Port: 1900
Simple Service Discovery Protocol

No. Time Source Destination Protocol Length Info 2 0.307821 192.168.1.180 239.255.255.250 SSDP 422 NOTIFY * HTTP/1.1