Remote Requests with payload larger than 1500 bytes blocked

Viewed 124

I'm currently facing a problem I can't really wrap my head around.

The setup

I've got a client that communicates via with an ASP.NET MVC webservice running on different Windows Servers (2012 R2 up to 2016) via normal HTTP Requests (GET, POST, ...). With the vast majority of the Windows Servers this communication works well, however, I do have two servers that seem to have a problem with those requests. Note that the webservice itself is always the same, it just runs on a different machine.

The problem

If I send an HTTP request containing some content (basically anything but a GET, DELETE, ..) I'll get a BadHttpRequestException with the message

Reading the request body timed out due to data arriving too slowly. See MinRequestBodyDataRate.

That error is related to kestrel which I'm using with the web services, so I've looked around and found the MinRequestBodyDataRate and MinRequestBodyDataRate property which I then adjusted, hoping that will solve the problem. Currently, the values are set to 20bytes/sec and a timeout of 20 which I thought would be enough.

options.Limits.MinRequestBodyDataRate =
    new MinDataRate(20, TimeSpan.FromSeconds(20));

options.Limits.MinResponseDataRate =
    new MinDataRate(20, TimeSpan.FromSeconds(20));

However, the problem still remains.

What I've figured out

  1. The BadHttpRequestException exception only occurs when the size of the payload is larger than exactly 1398 bytes — which is oddly close to the 1500 byte size of an Ethernet frame if we add the overhead. Everything below that value works fine.
  2. The exception only occurs when sending the request from a remote network, meaning client and the webservice are not in the same one. If they are, however, it all works fine.

At this point I wasn't sure if this is actually a kestrel-related problem, so I've tried a different approach: I've used PsPing to start a listener on the server and to send raw TCP packages from a different network. Surprisingly, that worked. I was able to send TCP packages with a payload of more than 2000 bytes to the listener. That made things even weirder for me, so,

  1. Starting a listener (without ASP.NET MVC, without kestrel, without .NET) on the server and sending TCP packages with a payload > 2000 bytes works.

Conclusion

I'm not sure what to do here. It doesn't work with the ASP.NET webservice from a different network (whereas it works locally), but it does work if I use a 'non-ASP.NET listener' — even remotely. Maybe that's a firewall problem, but I've never heard that such a filter can be configured. I doubt that it's actually a kestrel problem - but it works with PsPing, which is weird.

Does someone have an idea on how to proceed?

0 Answers
Related