Questions tagged [packets]

Packets refer to network packets. A network packet is a formatted unit of data carried by a packet-switched network.

A network packet is a formatted unit of data carried by a packet-switched network.

A packet consists of control information and user data, which is also known as the payload. Control information provides data for delivering the payload, for example: source and destination network addresses, error detection codes, and sequencing information. Typically, control information is found in packet headers and trailers.

Use this tag for programming questions related to packet creation, packets contents analysis, packet sending and receiving, or other tasks that can be done with network packets.

Source: Wikipedia

372 questions
0
votes
1 answer

Reading uninitialized unsigned int arrays from a packet in C

Im stuck with a problem of reading bytes in my C tcp socket server which receives request from a python client. I have the following struct as my receive template struct ofp_connect { uint16_t wildcards; /* identifies ports to use…
m2r0007
  • 47
  • 1
  • 7
0
votes
0 answers

c# internet protocol instantiating packets the fastest?

I have a C# game server that creates a new object for every packet it receives that it then fills from the datasteam. After recently benchmarking it, I notice the line that does var packettype = Opcodes[opcode]; var packet =…
Vans S
  • 1,743
  • 3
  • 21
  • 36
0
votes
1 answer

.Net NetworkStream .Length not implemented how to know how much data available on stream

Since NetworkStream.Length was never implemented how else could I see how much data is already available on the networkstream. Note I can't simply just Read() while DataAvailable=True I use a thread where it keeps running a function while…
SSpoke
  • 5,656
  • 10
  • 72
  • 124
0
votes
0 answers

Asynchronous C# socket server - can't send multiple packets

http://msdn.microsoft.com/en-us/library/fx6588te.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1 I've added a couple of things that look like this to it: if (content.EndsWith("\x0")) { Console.ForegroundColor = ConsoleColor.Cyan; …
0
votes
1 answer

Is using packets in a networking library a good idea at all?

I've been programming a library for both TCP and UDP networking and thought about using packets. Currently I've implemented a packet class which can be used like the C++ standard library's stream classes (it has << and >> for inputting and reading…
Hassedev
  • 621
  • 6
  • 17
0
votes
1 answer

Reconstructing variable sized packets in verilog

I am trying to reconstruct a packet that was sent via UART RS232 connections, but am not sure how to reconstruct the packet in its entirety such that the packet can be taken apart and stuff can be done using it. The issue is that when I receive 1…
fysloc
  • 89
  • 3
  • 11
0
votes
2 answers

FD_READ: recv() returning two packets at once

I'm using winsock in my application to mantain client-server connection, and using non-blocking sockets in order to do that. But sometimes when I get FD_READ message, it appears that recv() returns not one, but two packets. I tried to change sizes…
PookyFan
  • 785
  • 1
  • 8
  • 23
0
votes
2 answers

What is the canonical way to create network packets in Objective C?

Coming from python I could do something like this. values = (1, 'ab', 2.7) s = struct.Struct('I 2s f') packet = s.pack(*values) I can pack together arbitrary types together very simply with python. What is the standard way to do it in Objective C?
user299648
  • 2,769
  • 6
  • 34
  • 43
0
votes
3 answers

C: packet send to a specific device (mobile devices)

How is a packet received by a wireless devices with thousands of users/devices connected to the same network? If we are using UDP, will it send the packets to all the devices such that only the authenticated devices will accept the packets and…
Rohith Gowda
  • 137
  • 2
  • 2
  • 12
0
votes
2 answers

How to split data into equal size packets having variable header size..

I am building peer to peer application in python. Its going to work over UDP. I have function called getHeader(packetNo,totalPackets) which returns me the header for that packet.Depending on size of header I am chopping data, attaching data to…
Xinus
  • 29,617
  • 32
  • 119
  • 165
0
votes
1 answer

tcpreplay and timestamps

I want to use tcpreplay to replay a packet trace made of TCP and UPD packets. Is there a way to attach a timestamp to each outgoing packet, so that I will be able to compute the round trip time once all replies have been received (and…
Ricky Robinson
  • 21,798
  • 42
  • 129
  • 185
0
votes
2 answers

Have been cursing over data packets for 36 hours now, please help!

Ok Here is the problem. I am trying to send through a structure or anything through the apple bluetooth send network packet code. The code to send is below -(void)sendMessagePacket:(GKSession *)session packetID:(int)packetID withData:(void *)data…
0
votes
2 answers

Is there a software to monitor all the ports opened and which programs are using each of them?

Also, that we can specifically know which running program is using certain ports and what kind of information they are sending and where specifically? This will work for many people to prevent MIM attacks, trojans, keylogger connections, etc. I know…
rodvaN
  • 21
  • 4
0
votes
1 answer

wireshark count packets by port

I have a very large trace file and am trying to use Wireshark to determine which dest port has the most packets sent to it. Is there a way to get counts of packets sent to particular ports? Or to sort by number of packets sent a port?
user1190650
  • 3,207
  • 6
  • 27
  • 34
0
votes
1 answer

Wireshark capture Magic Packet configuration

I have a laptop running Wireshark. I'd like to find out how to configure wireshark to capture Magic Packets. I have selected the interface, options, Capture filter, host 192.168.168.19 , Ok, Start on the laptop. Laptop is IP 192.168.168.14. I…
Docfxit
  • 137
  • 3
  • 6
  • 15