OREGON INSTITUTE OF TECHNOLOGY
Computer Systems Engineering Technology Department
CST 415 - Computer Networks
You MUST work with at least one other person on all projects for CST 415 for purposed of testing. This will be your communication partner, not coding partner. With your communication testing partner, you will define the format of a packet allwoing the tracing of the number of times a packet has been passed back and forth between your two machines. Your ping-pong system will exchange packets with your partners ping-pong system; however, code development must reflect individual work.
The first part of the packet you will need to be able to recognize is the MAC (Media Access Control) header. This is resident in Layer 2 of the protocol stack. Note that WinPCap will strip off the preamble and the SFD and pass a buffer starting at the 6 octets containing the Destination MAC address. Your program is to look at the packet and print out packet related information. You must also compare the destination address to make sure the packet is destined for your NIC. Note: 0xFFFFFFFFFFFF
Each address field shall be 48 bits in length. While IEEE 802 specifies the use of either 16- or 48-bit addresses, no conformant implementation of IEEE 802.3 uses 16-bit addresses. The use of 16-bit addresses is specifically excluded by this standard.
The first bit (LSB) shall be used in the Destination Address field as an address type designation bit to identify the Destination Address either as an individual or as a group address. If this bit is 0, it shall indicate that the address field contains an individual address. If this bit is 1, it shall indicate that the address field contains a group address that identifies none, one or more, or all of the stations connected to the LAN. In the Source Address field, the first bit is reserved and set to 0.
The second bit shall be used to distinguish between locally or globally administered addresses. For globally administered (or U, universal) addresses, the bit is set to 0. If an address is to be assigned locally, this bit shall be set to 1. Note that for the broadcast address, this bit is also a 1.
Each octet of each address field shall be transmitted least significant bit first.
This two-octet field takes one of two meanings, depending on its numeric value. For numerical evaluation, the first octet is the most significant octet of this field.
If the value of this field is less than or equal to the value of maxValidFrame (as speci.ed in 184.108.40.206 of the 802.3 standard)), then the Length/Type field indicates the number of MAC client data octets contained in the subsequent data field of the frame (Length interpretation).
If the value of this field is greater than or equal to 1536 decimal (equal to 0x0600), then the Length/Type field indicates the nature of the MAC client protocol (Type interpretation). The Length and Type interpretations of this field are mutually exclusive. When used as a Type field, it is the responsibility of the MAC client to ensure that the MAC client operates properly when the MAC sublayer pads the supplied data, as discussed in 3.2.7 of the 802.3 standard.
Regardless of the interpretation of the Length/Type field, if the length of the data field is less than the minimum required for proper operation of the protocol, a PAD field (a sequence of octets) will be added at the end of the data field but prior to the FCS field, specified below. The procedure that determines the size of the PAD field is specified in 4.2.8. The Length/Type field is transmitted and received with the high order octet first.
See http://www.iana.org/assignments/ethernet-numbers for number designations.
You must print out the following information as extracted from the incoming packet:
ETHER: ----- Ether Header -----
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, Ping-Pong (your definition) or UNKNOWN)
0000 08 00 20 01 3d 94 08 00 69 01 5f 0e 12 08 00 45 .......% /!@...E.
0010 00 40 89 a0 00 00 64 11 c3 05 0a 00 00 08 ff ff .@....d. ........
0020 ff ff 0b 2c 76 5f 00 2c 00 00 54 45 44 35 30 30 ...,v_., ..TED500
0030 30 20 20 20 20 20 20 20 20 7c 38 30 7c 30 30 2d 0....... |80|00-
0040 32 35 2d 32 46 2d 32 31 2d 34 30 2d 31 32 25 00 -2F-21.. -40-12..
After printing out the Ethernet header, print out the raw packet as shwon above. The hex dump must contain be formatted as: Byte Count - Hex (16 octets) - ASCII Representation. Print out non-pritable charcters as a ".". Begin the packet dump at the start of the buffer received from the WinPCap library.
Ehternet Level Ping-pong:
In the packet payload, you will put a hex designator that will indicate if the packet is to be passed back to the sender. This program will basically be a packet ping-pong system where your program will play ping-pong with your lab partners program, passing a MAC packet back and forth based on the special payload character you put in the enclosed packet. Note: To send a packet, you must have a proper type/len designation and a pakcet that has been padded to the correct size.
Project Requirements Summary: