packet

Benefits of “Don't Fragment” on TCP Packets?

不想你离开。 提交于 2019-12-04 16:05:46
问题 One of our customers is having trouble submitting data from our application (on their PC) to a server (different geographical location). When sending packets under 1100 bytes everything works fine, but above this we see TCP retransmitting the packet every few seconds and getting no response. The packets we are using for testing are about 1400 bytes (but less than 1472). I can send an ICMP ping to www.google.com that is 1472 bytes and get a response (so it's not their router/first few hops). I

C++ UDP sockets packet queuing

◇◆丶佛笑我妖孽 提交于 2019-12-04 09:36:57
I am using the same UDP socket for sending and receiving data. I am wondering if packet queuing for DGRAM sockets is already present, or do we have to handle it separately. If the user code has to handle queueing, how is it done? Do we have separate threads to recvfrom for the socket and put the packet in the reciver_queue and to sendto from another sending_queue? An example code will be absolutely awesome. Thanks for your help. There is a packet queue. However when the packet queue is filled then UDP packets start getting discarded. When they are discarded they are lost forever so make sure

How to get data out of network packet data in Java

走远了吗. 提交于 2019-12-04 08:21:44
In C if you have a certain type of packet, what you generally do is define some struct and cast the char * into a pointer to the struct. After this you have direct programmatic access to all data fields in the network packet. Like so : struct rdp_header { int version; char serverId[20]; }; When you get a network packet you can do the following quickly : char * packet; // receive packet rdp_header * pckt = (rdp_header * packet); printf("Servername : %20.20s\n", pckt.serverId); This technique works really great for UDP based protocols, and allows for very quick and very efficient packet parsing

Scapy packet sent cannot be received

孤街醉人 提交于 2019-12-04 06:54:39
I'm trying to send UDP Packets with scapy with the following command: >> send(IP(dst="127.0.0.1",src="111.111.111.111")/UDP(dport=5005)/"Hello") . Sent 1 packets. And from tcpdump I can see: 22:02:58.384730 IP 111.111.111.111.domain > localhost.5005: [|domain] I'm trying to receive this packet with the following code: import socket UDP_IP = "127.0.0.1" UDP_PORT = 5005 sock = socket.socket(socket.AF_INET, # Internet socket.SOCK_DGRAM) # UDP sock.bind((UDP_IP, UDP_PORT)) while True: data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes print "received message:", data But cannot receive

android UDP connection, not receiving any data

為{幸葍}努か 提交于 2019-12-04 06:37:20
问题 Im a newbie in this so please escuse me if i ask dumb questions. Im trying to make a UDP connection between Eclipse's PC Emulator & a android phone (or between two android phone devices). I have a router and the phone connects to the internet thru router's wifi network. The PC is on same network also (direct cable router-PC connection). Im trying to send some text data from Server thread to Client thread but nothing is received/sent. :( The Server java class ( RE-EDITED, Server receives msg.

Message sent in UDP datagram is not sanitized?

落花浮王杯 提交于 2019-12-04 06:23:53
问题 My code is as follows. Everything works the way I want it to, but when my messages are received they have many boxes on the end somewhat like this like this "Message: hello▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀" How can I make it so what is received and printed is only "Message: hello"? I greatly appreciate any help. import java.io.*; import java.net.*; public class UDPChat { public static void main(String args[]) throws Exception { new UDPChat(); } public UDPChat() { try { runChat(); } catch (Exception

How do I get the message from the message id in smack.

丶灬走出姿态 提交于 2019-12-04 05:01:41
问题 I am trying to fetch the chat history using below function: var mamManager:MamManager= MamManager.getInstanceFor(connection) var prevMsg=mamManager.queryArchive(JidCreate.entityBareFrom(jid)).forwardedMessages println(msg.forwardedStanza) But I am getting the output as 04-19 14:17:58.414 7964-7964/com.example.itstym.smackchat I/System.out: Message Stanza [to=user2@replica3377.cloudapp.net,from=user1@replica3377.cloudapp.net/307135084148417199024926,id=qQ73x-27,] I can also get stanza id using

Reading information from PAT section (MPEG-TS)

一个人想着一个人 提交于 2019-12-04 04:22:34
问题 I'm writing a MPEG-TS file parser and I'm stuck on getting program_numbers and PIDs from the PAT section. I'm using a packet analyser to compare my results. For example, here's a PAT packet 47 40 00 16 00 00 B0 31 00 14 D7 00 00 00 00 E0 10 00 01 E0 24 00 02 E0 25 00 03 E0 30 00 04 E0 31 00 1A E0 67 00 1C E0 6F 43 9D E3 F1 43 A3 E3 F7 43 AC E4 00 C3 69 A6 D8 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

Adding payload in packet

青春壹個敷衍的年華 提交于 2019-12-04 02:38:09
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) Yes, you can send raw data like this. In this example, data will be ASCII encoded. >>> data = 'University of Texas at San Antonio' >>> a = IP(dst='129.132.2.21') / TCP() / Raw(load=data) >>> sendp(a) 来源: https://stackoverflow.com/questions/6605118/adding-payload-in-packet

Windows network packet modification

风流意气都作罢 提交于 2019-12-03 16:46:17
I'm looking to write a small program which will intercept network packets (on the local machine) and modify them before they go out on the network. I need to be able to modify the headers as well, not just the data. I've already looked through several possibilities but am unsure which one is best to pursue. There are open source packet filters out there, but filtering only seems to be able to either allow or reject packets, not much else. The other solution would be to write an NDIS intermediate driver, but writing drivers is a beyond me. Even the simple pass-thru example in the WinDDK is