//tasks used by each constructor path private void init() { //not really sure what the capture device is, I think it refers to the NIC device = CaptureDeviceList.New()[3]; //better than .instance[3] apparently, according to author device.Open(); //opens device, whatever that means //TCP packet is the payload of the IP packet //TcpPacket tcpPacket = new TcpPacket(localPort, destPort); //creates empty packet and sets the source and destination ports <port> //tcpPacket.Flags = 0x02; //syn flag //tcpPacket.WindowSize = 64240; UdpPacket udpPacket = new UdpPacket(localPort, destPort); //IP packet delivers TCP packet as its payload. IP packet is the payload of the Ethernet packet going to the gateway IPv4Packet ipPacket = new IPv4Packet(srcAddress, destAddress); ipPacket.TotalLength = 52; ipPacket.Id = 0xa144; ipPacket.FragmentFlags = 0x40; ipPacket.TimeToLive = 128; //Ethernet packet delivers the IP packet to the gateway PhysicalAddress srcMAC = getLocalMAC(); //Console.WriteLine(srcMAC); //just check that it is getting the right one, otherwise you'll have to enter it manually ethernetPacket = new EthernetPacket(srcMAC, destMAC, EthernetType.None); //matryoshka doll the packets ethernetPacket.PayloadPacket = ipPacket; ipPacket.PayloadPacket = udpPacket; //this may need to be moved elsewhere incase time factors into the checksum udpPacket.Checksum = udpPacket.CalculateUdpChecksum(); ipPacket.Checksum = ipPacket.CalculateIPChecksum(); sendTimer = new Timer(); sendTimer.Elapsed += new ElapsedEventHandler(sendPacket); //method to be done every interval sendTimer.Enabled = true; //does not start timer, it means the method will be done every interval }