The first two are easy to explain – you live in an area with a fair amount of Wi-Fi noise or are far away from the router or have a crappy router, so a wired connection is faster – indeed that represents the typical maximum speed you will get.
Your Internet -> modem -> laptop is a lot harder to answer. In the naive case, yes, connecting to the laptop should be the fastest option, however it assumes a number of things which may not be true.
My speculation is that there is some kind of authentication going on on the router – possibly through PPPoE or using its MAC address. This authentication is failing and the router is being put in a very low bandwidth pool by the ISP. It’s also possible that VLANS are involved that the router knows about but your PC doesn’t. These kinds of thing are deliberately set up by telecommunications companies for a number of reasons on about which I can only speculate.
It is, of-course possible that there is a negotiation issue between the router and the modem.
It could possibly be a QoS issue. I recently attended a presentation at work that included some discussion about a problem where people who paid for a 100 Mbit/s Internet connection could only use 5 Mbit/s.
QoS refers to the way your bandwidth is limited. I’m simplifying this for a general audience, but in this case (that I was told about) the Internet connection was very strict about the 100 Mbit/s limit – you couldn’t go over that amount, even for a few milliseconds. If you did, the ISP’s equipment would simply drop (discard) the traffic. Your computer thinks the dropped traffic means that your Internet connection is at its maximum capacity, even though it’s only sent a little bit of traffic, so it slows right down.
If this is the problem, it would be because your ISP has configured your router with the right QoS settings so this doesn’t happen (your router would hold onto the extra traffic for a few milliseconds instead, to avoid going over 100 Mbit/s or whatever your speed is). But your laptop doesn’t have the right settings so it runs into the problem.
I may be able to offer an explanation for #3, at least.
First, my assumptions going into this, since there’s a good deal of detail missing from your question. Please do correct anything I got wrong (by adding the relevant details to your question).
The router in your #1 and #2 was the same router, and nothing about its internet-side connectivity changed between those two scenarios. (Meaning, you simply changed how the laptop connected to the router, but didn’t touch anything between the router, modem, and upstream connection.)
You then unplugged the router from the modem, and plugged your laptop directly into the modem where the router used to be connected.
You didn’t reboot the modem between your #2 and #3.
Many consumer-grade “broadband” type modems, especially those provided/leased to customers by their providers, are programmed to support only a single downstream client device. I suppose it’s intended as some sort of protection against wirejacking or who knows what. When they boot up, they register the MAC address of the first device they contact on their local network port, and that device becomes their sole reason for existence. Connecting any other devices directly to the modem will then either fail to communicate at all, or they’ll experience vastly degraded performance, because the modem is holding out for its one true love.
TL;DR: Always, ALWAYS power-cycle your broadband modem when connecting a different device to its LAN port.
With the current information given, the difference between the wired connection through a router and without a router cannot be definitely answered. I want to mention one more possibility: MTU issues. I’ll try a gentle description of the problem.
The connection between a router and a modem may be established via PPPoE. PPPoE adds an additional header to every transmitted packet, lowering the maximum possible payload (data) size. If some communication participant along the way does not know about this and sends IP packets with the usual maximum size of 1500 Bytes, the packet has to be fragmented before entering the PPPoE tunnel. Fragment reassembly at the receiver can cause latency jitter, which may be interpreted as a connection being close to its capacity limit, causing slowdowns.
Now, if you connect your laptop directly to the modem, your laptop should know about the correct MTU since it is the one that established the connection, making this explanation somewhat unlikely. However, the fact that there is a lower-than-normal MTU on the tunnelled connection may have been forgotten by whatever PPP implementation you are using.
Lastly, why would this issue not appear with the router? Most routers are aware of this kind of problem and “clamp the MSS”, meaning they use a hack one layer above IP: to participants establishing a TCP connection, they indicate that the maximum acceptable TCP segment size is lower than usual (by modifying the connection establishment packets), effectively bringing down the size of IP packets being used for that connection.
Adding to Davidgo’s answer, point 3 could also be a negotiation Issue: When a device is connected, it starts to negotiate the ‘terms’ (speed, rates, …) of the communication with other devices and selects the highest possible standard that both devices are able to understand.
So in your case the ISP’s modem might use some protocol that your laptop is unable to understand. Your router however is ok with that protocol.
It’s really dependent on the hardware tho.
Agree with davidgo. Now, if your modem is a pure modem (or a router in bridge mode), you can try spoofing the MAC address of your router as that may be what your ISP is looking at.
Does the router have a configuration that includes a username/password or keypair information? If so, the ISP may have client software for the PC, or a Web Page for entering this data.
Also try a crossover cable. The router may have auto-MDIX.
I do not feel my answer is the complete answer, but may be part of the total answer, and has not been mentioned in another answer.
In my setup, the router is placed in bridged mode, and my firewall is attached behind. I see a relatively constant incoming stream of traffic to the firewall, all dropped. Your computer may be “unaccustomed” to the constant attempted connections, all valid to a normally isolated machine. Your machine may be performing connection handshakes with, or otherwise consumed with processing, this incoming traffic. It may not be necessary for trouble, but I can only hope the handshake fails, because many of these connections are, I believe, zero day exploits to unpatched systems.
I would recommend you not connect directly to the Internet, unless you have very heavy-duty protection in place.
This really sounds like a TCP window scale option problem (often conflated with MTU and MSS). Your laptop is asking the other end of the connection to only send it a small amount of data between acknowledgements. This means that a long latency in the connection will lead to a much lower throughput than the link is capable of because only a small amount of unacknowledged data can be in flight at any one time, and acknowledgements are limited by latency. This is called BDP.
When you insert the router in there, the router can use a much larger TCP window scale option going to the remote end of the connection. So you get high throughput from remote to router because of the large window size, and high throughput from the router to the laptop due to the lower latency between them.
Depending on the age and OS and OS version of your laptop, you might be able to adjust the window scale option on it.
Also, it might be that your laptop is infected with some malware, and that firewall in router is dropping connections to/from your laptop, thus preserving all available bandwidth for your test and you get better peeds.
And when you connect your laptop directly to the modem, it is unprotected and additional malware connections are made to/from it which uses up most of the bandwidth, leaving only a little for your test.