1

I have a situation where I am using pcap_sendpacket() to put packets on the wire at the LLC layer at the same time as I am receiving packets using pcap_dispatch() with an associated callback function. The sending and receiving is occuring in different threads of execution.

I have observed when the incoming packet rate is particularly high, I am not seeing my outgoing packets appear on the wire (using wireshark). However, I am also not seeing pcap_sendpacket() failing (returning -1). Is it possible that the connection is not full duplex, i.e. if the bandwidth of the network connection is full then the outgoing packets could be blocking indefinitely somehow?

bph
  • 10,728
  • 15
  • 60
  • 135
  • 1
    99% of real-world Ethernet is full-duplex. Packets can be dropped for any reason, e.g. when going from 1Gbit to 100Mbit. If Wireshark is not responding, e.g. due to system load, the kernel will not queue them up forever. – maxy Apr 07 '19 at 12:38

1 Answers1

1

I have a situation where I am using pcap_sendpacket() to put packets on the wire at the LLC layer

That's not the layer at which packets are put on the wire - they're put on the wire at the data link layer, below the LLC layer; on Ethernet, it's at the 802.3 layer, not the 802.2 layer.

Is IEEE 802.2 Logical Link Control Layer (Ethernet) full duplex?

It is neither full-duplex nor half-duplex.

It's also not Ethernet; it can run on top of Ethernet, but it can also run on top of FDDI or Token Ring or IEEE 802.11 or....

Perhaps you're thinking about IEEE 802.3, which is Ethernet? If so, there are both full-duplex and half-duplex versions of Ethernet.

I have observed when the incoming packet rate is particularly high, I am not seeing my outgoing packets appear on the wire (using wireshark).

Ethernet adapters don't receive their own packets; if a host sends a packet, and code on that host is capturing on the adapter on which the packet is being sent, that's because the OS's networking stack takes packets being sent and provides them as input to the packet capture mechanism, not because the packet was received by the network adapter on which you're capturing.

Perhaps the packets are arriving too fast for the packet receiving thread to see them? Use pcap_stats() to see if any packets are being dropped.

user9065877
  • 193
  • 1
  • 1
  • 2