GNS3 / vpcs

Simple Virtual PC Simulator
BSD 2-Clause "Simplified" License
101 stars 39 forks source link

VPCS creates invalid ARP packet #9

Closed ghost closed 7 years ago

ghost commented 7 years ago

Tested both with vpcs 0.6.1 and 0.8c

https://www.gns3.com/qa/gns3-2-0-bad-checksum-should-be-

The ARP packets from VPCS are invalid, they are shown in wireshark as packets with invalid FCS. Dynamips router (tested with cisco 3725) ignores that and respond normally. But some router (e.g. NX-OSv and vSRX) ignore those invalid arp packets. Then pings from VPCS to the router won't work.

I'm not sure, that the issue is really a bad FCS. As far as I know the packets in the UDP tunnel don't include a FCS.

julien-duponchelle commented 7 years ago

Could explain the troubles of VPCS when directly connected to cloud node on Windows.

On Wed, May 10, 2017 at 10:07 AM Bernhard Ehlers notifications@github.com wrote:

Tested both with vpcs 0.6.1 and 0.8c

https://www.gns3.com/qa/gns3-2-0-bad-checksum-should-be-

The ARP packets from VPCS are invalid, they are shown in wireshark as packets with invalid FCS. Dynamips router (tested with cisco 3725) ignores that and respond normally. But some router (e.g. NX-OSv and vSRX) ignore those invalid arp packets. Then pings from VPCS to the router won't work.

I'm not sure, that the issue is really a bad FCS. As far as I know the packets in the UDP tunnel don't include a FCS.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/GNS3/vpcs/issues/9, or mute the thread https://github.com/notifications/unsubscribe-auth/AAVFXUl_71RomLrNfN5ERYK1zJ4a4WUtks5r4XBUgaJpZM4NWT_Y .

ghost commented 7 years ago

My fix, now wireshark is happy:

diff --git a/src/ip.h b/src/ip.h
index 0225d99..bb8e0df 100644
--- a/src/ip.h
+++ b/src/ip.h
@@ -239,7 +239,7 @@ typedef struct tcpiphdr tcpiphdr;
 #define TCPOLEN_TIMESTAMP       10

 #define PKT_MAXSIZE 1520
-#define ARP_PSIZE 64
+#define ARP_PSIZE 60
 #define ICMP_PSIZE 128
 #define UDP_PSIZE 128

The ARP packet is smaller than the minimum ethernet size (64), so it's padded to 60 bytes plus the FCS results in a 64 bytes ethernet frame. But VPCS originally created a 64 byte frame, what was interpreted as 60 byte data + 4 byte FCS, what was not intended.

ghost commented 7 years ago

After further analysis I'm not sure, how important this issue is. Wireshark isn't happy about this ARP frame, but I couldn't reproduce having an issue with vSRX. So maybe I had another issue while testing the first time. And Andrew had no issue using this ARP towards NX-OSv (see the forum discussion).

So currently it looks more like an annoyance than an import issue.

grossmj commented 7 years ago

We don't really want to become the official maintainer for VPCS. We are looking at creating our own Python based implementation of VPCS.

What we can do for now if forward your patch to the creator of VPCS but I don't know think he still works on the project :(

ghost commented 7 years ago

Won't be fixed.