512 questions
2
votes
1
answer
113
views
Sending raw packets back to host's networking stack
I'm writing a TCP/IP stack for embedded systems, but I wanted to test it on my host system.
Originally I tried with tap0 + a bridge. But I quickly realized it would make the most sense to bind to the ...
3
votes
0
answers
42
views
Parse http via node_http_parser.cc/http_parser.cc and node.js readable/writable streams
Thanks for understanding, I'm really noob in c/c++ languages.
Prerequisites:
I'm trying to create http-parser.js/ts lib at the lowest possible cost. Moreover, I want my own parser work with node.js ...
2
votes
1
answer
87
views
Proper way to obtain dynamic source port for raw socket (IP_HDRINCL) on macOS for custom TCP implementation
I am implementing TCP from scratch using raw sockets on macOS. I want to:
Get a dynamic source port from the kernel
Use this port with IP_HDRINCL for full IP/TCP header control
Current approach:
...
0
votes
1
answer
143
views
Raw Socket Buffer
When we using a raw socket, we need to handle everything including handling which packet we need to process.
Suppose I receive 2 packets with 10 byte size. The packets contain the message "...
1
vote
0
answers
48
views
How to receive a UDP packet over raw scokets in c++ in windows?
I tried to receive a UDP packet with the following function:
int UDP::recv(byte* data, const uint16_t dataLen, uint16_t srcPort, IPV4& srcIp)
{
const size_t totalHeadersLen = IP_HEADERS_SIZE + ...
0
votes
2
answers
217
views
How can I get the destination MAC address of the node my macOS device is connected to in C?
So I'm implementing TCP sockets in C with raw sockets in order to further understand computer networking. I'm working on writing the ethernet header code, and I can get the source MAC address that's ...
0
votes
0
answers
77
views
Raw UDP packet being dropped
I am learning raw socket programming in linux Ubuntu but i have a problem. My udp packet is not shown in Wireshark. I suspect that its being dropped by my router because of a mistake I made.
here is ...
0
votes
1
answer
498
views
How to build a raw UDP packet in C++?
I am programming a code that sends a text message to a specific port using UDP. I initialize IP header and UDP myself. My problem is that the finished UDP packet is corrupted and Wireshark doesn't ...
0
votes
1
answer
296
views
Extra Bytes Added to Packet When Sending via Raw Socket
Description
I'm currently trying to send packets via a raw socket in Rust. I'm currently using libc to manage the socket.
I've had success with sending the packet but the packet sent is never the same ...
1
vote
0
answers
73
views
sendto sends packet twice
I am using unix sockets on layer 2 to send layer 2 packets in the air. I have an Alfa Awus adapter which I set to monitor mode via iwconfig wlanAdapter mode monitor command.
I have this c function ...
1
vote
1
answer
181
views
Sendto In Raw Socket
the sendto function we have to pass destination struct sockaddr or sockaddr_in But what's the purpose?
isn't it, if we use raw Socket, we create our own header, which means we will specify the address ...
0
votes
1
answer
85
views
How The network header is represented at the bit level [closed]
how the header structure in bit representation let's take the example icmp header because this icmp has fewest fields.
| TYPE | CODE | CHECKSUM |
CONTENT
Just for example then let's assign some ...
1
vote
1
answer
76
views
PHP - Preparing a packet for TCP Socket
I'm trying to write a PHP TCP client to connect to an Unreal Engine 5 RCON server. I'm using an existing C# project on GitHub as a reference but I'm having trouble preparing packets to send. The ...
0
votes
0
answers
20
views
Freebsd is not RECV the packet, although successfully sent [duplicate]
I have a new problem with the migration to freebsd. I've tried to give everything I can.
The problem with recvfrom is it just can't wait for a packet, even when I remove the timeout.
Here is a ...
0
votes
1
answer
433
views
why my raw socket recv() seemed to get nothing?
Main Situation
I'm using raw socket trying to recv OSPF packet. Although I've successfully grabbed the packet through Wireshark, I could not receive anything through function recv(), where the thread ...
0
votes
1
answer
334
views
How do I get complete Layer 2 -> Layer 7 data from a Python socket?
I'm trying to write a simple python server that accepts a connection from whatever and digests the entire frame, down to the ethernet headers. The server will not maintain a connection or care about ...
1
vote
2
answers
2k
views
Difference between how Linux raw sockets and DPDK pass data to userspace?
I am trying to understand the difference between how DPDK passes packet data to userspace, versus Linux raw sockets?
The Man page for raw sockets implies the Kernel does no packet processing:
Packet ...
1
vote
0
answers
220
views
How to get the IPv6 headers on WIndows using raw-socket?
I would like to implement a sniffer for incident response and forensic investigations, to sniff the traffic and identifying malicious packets and C2 (C&C -Command and Control) IP.
In incident ...
1
vote
0
answers
282
views
UDP packets visible in wireshark are not captured in Windows sockets (even with raw sockets)
I have a board (with FPGA) connecting to a windows 10 host through a 10G NIC. The board is set to static IP 10.254.210.10 & the host is 10.254.210.11. I can see the UDP packets in wireshark but it ...
1
vote
0
answers
405
views
Is it possible to use Scapy to send a raw TCP packet on Windows?
Windows usually blocks sending raw IP packets with app-specied TCP payloads. I would like to be able to do this because it would allow students to use Python's beautiful sockets library to send TCP ...
1
vote
0
answers
236
views
Berkeley raw socket exclusive access (Linux)
I have implemented my own raw socket operating on „raw“ Ethernet frames (socket(AF_PACKET,SOCK_RAW,htons(ETH_P_ALL));) and bound it to one specific network Interface. Sending and receiving raw packets ...
0
votes
0
answers
457
views
How can I add UDP header to raw packet?
I wish to manually add a UDP header to a raw packet which I make with a RAW socket (with ProtocolType.IP and NOT ProtocolType.Udp).
I found code in Python, taken from here, which did the thing I need:
...
0
votes
1
answer
2k
views
Creating TCP connection and getting the Header
Im making an application that needs to receive a TCP connection that comes with a request that contains some header data that i need to read and send back with more info later.
The issue is that after ...
0
votes
1
answer
938
views
C raw UDP socket failing to receive sent data using recvfrom() on loopback address
I have 2 programs. One program sends data to the other program. Both programs use raw UDP sockets. The sending program sends to loopback address 127.0.0.1, from port 25252 to port 80. The receiving ...
0
votes
1
answer
540
views
Why extra 6 bytes are appended by the OS at the end on TCP packet when TCP payload is absent
I am doing raw socket programming and trying to send TCP packets. I have created ethernet header, IPv4 header and TCP header. The ethernet header is 14 bytes long, IPv4 header is 20 bytes long and the ...