Questions tagged [packet]

A packet is one unit of binary data capable of being routed through a computer network.

This is a small amount of computer data sent over a network. Any time you receive data from the Internet, it comes to your computer in the form of many little packets.

Each packet contains:

  • A label which uniquely identifies it
  • The IP address of its origin and destination
  • A sequence number (for sorting)
  • A checksum (for error checking

The process of sending and receiving packets is known as "packet-switching." Packets from many different locations can be sent on the same lines and be sorted and directed to different routes by various computers along the way, the packets are then sorted by their sequence number once they reach their destination. It works a lot like the post office, except billions of packets are transferred each day, and most packets take less than a few seconds to reach their destination. Even FedEx same-day delivery can't compete with that.

Packet Definition. 2013. Packet Definition. [ONLINE] Available at: http://www.techterms.com/definition/packet. [Accessed 30 April 2013].

1562 questions
16
votes
4 answers

Get TCP Flags with Scapy

I'm parsing a PCAP file and I need to extract TCP flags (SYN, ACK, PSH, URG, ...). I'm using the packet['TCP'].flags value to obtain all the flags at once. pkts = PcapReader(infile) for p in pkts: F = bin(p['TCP'].flags) print F,…
auino
  • 1,644
  • 5
  • 23
  • 43
16
votes
4 answers

Parsing WiFi Packets (libpcap)

I've been working on a way to have an OpenWRT router log WiFi probe requests to a MySQL db (it stores MAC address and RSSI info for each probe request packet along with other, router-specific data). After researching libpcap quite a bit, I've been…
Kyle G.
  • 870
  • 2
  • 10
  • 22
16
votes
3 answers

Retrieving buffer/packet/payload sizes for USB serial write transfer in userspace Linux C code

Apologies in advance I won't be able to accept an answer here immediately - just thought I'd like to jot this down, while I have the problem... In brief: I can observe three different buffer sizes, when I initiate a write to an usb-serial port using…
sdaau
  • 36,975
  • 46
  • 198
  • 278
15
votes
3 answers

How to set the don't fragment (DF) flag on a socket?

I am trying to set the DF (don't fragment flag) for sending packets using UDP. Looking at the Richard Steven's book Volume 1 Unix Network Programming; The Sockets Networking API, I am unable to find how to set this. I suspect that I would do it with…
WilliamKF
  • 41,123
  • 68
  • 193
  • 295
15
votes
7 answers

Is there a Windows tool for capture and playback of modified UDP packets?

I'm looking for a tool (or a set of tools) for Windows that will perform the following: Capture UDP packets from a specific network interface to a file. Play a stream of packets from a file through a network interface. In addition to 2: replay the…
kshahar
  • 10,423
  • 9
  • 49
  • 73
15
votes
1 answer

Differences in Default Network Packet Size: SqlConnection vs. SQL Server defaults

I noticed yesterday that there is a noticeable difference between the default network packet size in .NET's SqlConnection class and the default in SQL Server itself. For the SqlConnection class' PacketSize property, per this link: The size (in…
Corey Adler
  • 15,897
  • 18
  • 66
  • 80
15
votes
1 answer

how does teamviewer find my computer even if my comp. behind of the firewall and firewall isn't configured?

Did you use teamviewer? (comic question i know... Who doesn't use it?) Do you have any idea how does teamviewer make connection even if i am behind the router, firewall, switch and my local firewall..? I'm trying to imagine a connection that is…
uzay95
  • 16,052
  • 31
  • 116
  • 182
15
votes
2 answers

Is websocket a stream-based or package-based protocol?

Imagine that I have server and client talking via WebSocket. Each of time sends another chunks of data. Different chunks may have different length. Am I guaranteed, that if server sends chunk in one call, then client will receive it in one message…
yeputons
  • 8,478
  • 34
  • 67
14
votes
5 answers

Android: Force data to be sent over radio vs WiFi

Is it possible to force an Android application to use only the mobile radio connection (3g/4g/etc), disallowing the use of WiFi? I think I want to use a HIPRI connection: (ex: WIFI turned on, use HIPRI…
wuntee
  • 12,170
  • 26
  • 77
  • 106
13
votes
4 answers

What is the size of udp packets if I send 0 payload data in c#?

I have figured out the maximum data before fragmentation between 2 endpoints using udp is 1472(other endpoints may vary). This states that mtu is 1500bytes and header overhead per packet is 28bytes. Is it safe to assume that if I send 0 bytes data…
Syaiful Nizam Yahya
  • 4,196
  • 11
  • 51
  • 71
13
votes
3 answers

How can I send a simple HTTP request with a lwIP stack?

Please move/close this if the question isn't relevant. Core: Cortex-M4 Microprocessor: TI TM4C1294NCPDT. IP Stack: lwIP 1.4.1 I am using this microprocessor to do some data logging, and I want to send some information to a separate web server via a…
tgun926
  • 1,573
  • 4
  • 21
  • 37
12
votes
4 answers

Protocol Terminology: Message versus Packet

In practice, what is the most appropriate term for the communications transmitted over a network in higher level protocols (those above TCP/IP, for example)? Specifically, I am referring to small, binary units of data. I have seen both "message" and…
Adam Paynter
  • 46,244
  • 33
  • 149
  • 164
12
votes
1 answer

Adding payload in packet

Can I insert image or document (in MBs) as a data in packet using scapy? This is what I did to send data. data = "University of texas at San Antonio" a = IP(dst="129.132.2.21")/TCP()/data send(a)
Chetan
  • 141
  • 1
  • 1
  • 4
12
votes
1 answer

How does pcap unix buffering work?

Hypothetical scenario: A udp packet stream arrives at machine X, which is running two programs - one which is listening for the packets with recv(), and another which is running pcap. In this case, as I understand it, the packets are stored in the…
Benubird
  • 18,551
  • 27
  • 90
  • 141
12
votes
6 answers

Ensuring packet order in UDP

I'm using 2 computers with an application to send and receive udp datagrams. There is no flow control and ICMP is disabled. Frequently when I send a file as UDP datagrams via the application, I get two packets changing their order and therefore -…
Davidallencoe
  • 121
  • 1
  • 1
  • 3