packet

Send Raw IP packet in C#, everything above the ethernet layer

谁说我不能喝 提交于 2019-12-01 04:28:13
I don't want to modify the ethernet portions of the frame, but I need to modify the IP packet and the data portion of the frame. I try sending a raw frame and it still puts in the IP information. I basically need to send a frame without defining the endpoint except in the bits I'm sending. Here's what I got: Socket s = new Socket(AddressFamily.Unspecified, SocketType.Raw, ProtocolType.Raw); EndPoint ep = new IPEndPoint(IPAddress.Parse("205.188.100.58"),80); s.SendTo(GetBytes(""),ep); //im sending nothing, so i expect the frame to just have ethernet stuff s.SetSocketOption(SocketOptionLevel.IP,

Send Raw IP packet in C#, everything above the ethernet layer

 ̄綄美尐妖づ 提交于 2019-12-01 02:18:02
问题 I don't want to modify the ethernet portions of the frame, but I need to modify the IP packet and the data portion of the frame. I try sending a raw frame and it still puts in the IP information. I basically need to send a frame without defining the endpoint except in the bits I'm sending. Here's what I got: Socket s = new Socket(AddressFamily.Unspecified, SocketType.Raw, ProtocolType.Raw); EndPoint ep = new IPEndPoint(IPAddress.Parse("205.188.100.58"),80); s.SendTo(GetBytes(""),ep); //im

Processing packets with unknown IPv6 extension headers

帅比萌擦擦* 提交于 2019-11-30 20:08:30
Question Should one discard a packet with an unknown IPv6 extension header? Details I could not find an answer to this question by examining the RFC . The book IPv6 Essentials states on page 22: If a node is required the next header but cannot identify the value in the Next Header field, it is required to discard the packet and send an ICMPv6 Parameter Problem message back to the source of the packet. I read this as: a IPv6 packet with a custom extension header cannot will be dropped unless all IPv6 stacks along the path know how to deal with the header. Or equivalently, if a single IPv6

Ensuring packet order in UDP

被刻印的时光 ゝ 提交于 2019-11-30 18:57:45
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 - packet loss. I've disabled and kind of firewall and there is no hardware switch connected between the computers (they are directly wired). Is there a way to make sure Winsock and send() will send the packets the same way they got there? Or is the OS doing that? Or network device configuration needed? UDP is a lightweight protocol that by design doesn

Windows network packet modification

怎甘沉沦 提交于 2019-11-30 16:07:03
问题 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

How should I mark the end of a TCP packet?

家住魔仙堡 提交于 2019-11-30 11:09:19
问题 In a client/server application were text data of varying length will be sent back and forth between the client and server, how should I mark the end of a packet that is being sent? For example, when the server is receiving packet data from a client how does the server know that the client packet has fully been received? Is it more common to tell the server the full length of the packet that it is going to receive before the data or to have something marking the end of the packet? Some of the

Get TCP Flags with Scapy

微笑、不失礼 提交于 2019-11-30 07:10:32
问题 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, bin(F), p.summary() # manual flags extraction from F Is there a way to obtain a single TCP flag without manually extract it from packet['TCP'].flags value? 回答1: Normally, the usual way to handle FLAGS is with a bitmap and bitwise operators. If your Packet class doesn

Ensuring packet order in UDP

陌路散爱 提交于 2019-11-30 03:04:18
问题 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 - packet loss. I've disabled and kind of firewall and there is no hardware switch connected between the computers (they are directly wired). Is there a way to make sure Winsock and send() will send the packets the same way they got there? Or is the OS

How should I mark the end of a TCP packet?

此生再无相见时 提交于 2019-11-30 00:22:59
In a client/server application were text data of varying length will be sent back and forth between the client and server, how should I mark the end of a packet that is being sent? For example, when the server is receiving packet data from a client how does the server know that the client packet has fully been received? Is it more common to tell the server the full length of the packet that it is going to receive before the data or to have something marking the end of the packet? Some of the data sent will only be a few characters long and some could be thousands of characters. TCP provides a

What is the mask in a WebSocket frame?

跟風遠走 提交于 2019-11-29 20:44:51
I am working on a websocket implementation and do not know what the sense of a mask is in a frame. Could somebody explain me what it does and why it is recommend? 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-------+-+-------------+-------------------------------+ |F|R|R|R| opcode|M| Payload len | Extended payload length | |I|S|S|S| (4) |A| (7) | (16/64) | |N|V|V|V| |S| | (if payload len==126/127) | | |1|2|3| |K| | | +-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - + | Extended payload length continued, if payload len == 127 | + - - - - - - -