37

My system is essentially:

Wall -> Ethernet -> router -> Wi-Fi -> computer

But I'd like to simplify it for this purpose and just do:

Wall -> Ethernet -> router -> Ethernet -> computer

(Or if that's incorrect, whatever the correct cord system is.)

I'm wondering why you can't just plug the computer straight into the wall:

Wall -> Ethernet -> computer

I wonder why I can't just open the terminal and write some code that listens for the Ethernet device/interface, and then reads/writes stuff "to the internet". Maybe this is possible; I am not sure. I would like to know if this is possible, and if so, what is happening at a more granular level, or if not, why not.

I'm in the process of understanding virtual routers and am wondering how a router is actually playing a part in getting the Internet, and if it can be removed from the equation for this example.

closed as too broad by Ramhound, Canadian Luke REINSTATE MONICA, Mokubai Jan 4 at 18:12

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 32
    It depends. What is the plug or connection type at your "wall"? Is it a conventional home ISP connection, a business network connection, or something else entirely? If it is a "home" connection is it ADSL, VDSL or some other connection? We cannot really tell you what you can or cannot do with no information on what it actually is. Knowing what you are plugging cables into is pretty key information. – Mokubai Jan 2 at 10:18
  • 2
    What kind of router is it? A combination modem / router, provided or recommended by your ISP? Is there an ISP / modem device somewhere on the source end of the wall's cable? – Xen2050 Jan 2 at 21:27
  • 10
    Based on a comment below in reference to something deleted(?) it sounds like your wall -> ethernet -> router is really a wall -> dsl -> [modem + router in a box]... – Nick T Jan 2 at 22:39
  • 2
    You can absolutely do this: wall -> ethernet -> router -> ethernet -> computer right now. It is very likely that your router in fact has an ethernet port on the back ... they almost all do. You definitely can and should do this if you want to! – Fattie Jan 3 at 13:15
  • 2
    Can you post a picture of the wall connector? – Mike Waters Jan 3 at 18:03
82

If your "wall" output is really Ethernet which is possible if your "wall" is a fibre media convertor or Ethernet wired apartment (and not dsl for example) then it is technically possible to plug a PC into it directly, but, if you need to ask the question, doing so is probably a bad idea because -

  1. It can directly expose your computer to the Internet, allowing remote computers to scan, fingerprint and likely exploit it - one side effect of NAT in routers is that it largely prevents this.

  2. It prevents more than one device getting online (unless you turn your PC into a router.)

  3. It may well not work without tricky configuration depending on the ISP configuration - for example PPPoE encapsulates the Internet connection in a PPP connection to provide the ISP more control, and/or Ethernet may be delivered on a tagged port.

  • 4
    That comment was a bit confusing, because "a standard modem" pretty much means an ADSL modem around here. Maybe it's an European thing (cable modems are quite rare here). – grawity Jan 2 at 10:00
  • 3
    @Grawity - I see what you mean. To me (and I used to run an ISP in New Zealand in the days of dial up) a modem is something you use(d) for dial up connections, they could normally do faxing as well, and some acted as a pots line interface for asterisk PABX. You are right in as much as a DSL modem also converts analog to digital signals, but such devices are not commonly found on computers, whereas most old-enough computers have the kind of modem I was referring to. – davidgo Jan 2 at 10:17
  • 4
    ISPs don't run Ethernet cables to a house. It is typically: ADSL, which is phone wire. Cable, which is coaxial cable. Fiber, which is optical wire. All of them requires a modem to change that to Ethernet. For the jacks to be in the wall, it also depends on whether the installers were paid to then connect this Ethernet to a network in the house, or they simply have their carrier media (phone, cable, fiber) right up to the jack, plug the modem in, then you plug the router into the modem. – Nelson Jan 3 at 5:52
  • 3
    @Nelson I largely agree with you. Of-course there is the not uncommon setup where an ISP wires up an entire apartment building with Ethernet and sells that. Also, very often media convertors and cellular/ Telco grade wifi/4g have devices in the ceiling/on the roof/otherwise hidden in a ceiling/floor cavity and present as an ethernet cable. It's also possible that by wall the OP meant meadia converter attached to walk for a fibre cable. – davidgo Jan 3 at 7:25
  • 4
    @Nelson In Sweden, I had two Ethernet outlets in my apartment, one owned by a private ISP, one by a town-owned company on which other private ISPs could provide internet. Although I didn't plug my computer directly in, rather I used a switch, I never used a router and never had wifi. I had the same in Dutch student accommodation back in 2003. There may have been a modem in the basement of the building. – gerrit Jan 3 at 10:34
29

wall -> ethernet -> router -> wifi -> computer

This makes sense if your computer connects using WiFi.

wall -> ethernet -> router -> ethernet -> computer

That will work so long as your computer doesn't require a WiFi connection.

I'm wondering why you can't just plug the computer straight into the wall:

wall -> ethernet -> computer

That would be fine if you only wanted to connect one computer to your Internet connection. But if you want to connect more than one, something has to take the arriving packets and figure out which of your computers to send them to. It makes great practical sense to design a machine specifically for this purpose and include all the needed functionality in a purpose-built device.

  • This is the only correct answer so far. I would add that there ARE valid options beyond, wall -> ethernet -> computer. You could do wall -> ethernet -> computer=>gateways to other networks. This is how you would configure your network if you wanted to use one of these: en.wikipedia.org/wiki/List_of_router_and_firewall_distributions . Of course, in nearly all of the legit setups which work like this, computer is actually, computer acting as a network device and this computer has multiple ethernet cards and is not generally used as a desktop. – krowe2 Jan 2 at 19:37
  • 2
    @krowe2: How do you consider this as correct? The OSI 0 and 1 layer coming out of the wall is likely not matching Ethernet. At least not where I live. – Thomas Weller Jan 2 at 20:41
  • 3
    @Thomas, The question states that there is ethernet coming out of the wall. (Of course, it may be mistaken.) – prl Jan 2 at 21:01
  • 6
    The router IS a specific purpose computer, so the third option is quite normal. – Criggie Jan 2 at 23:10
  • 1
    @BeowulNode42 I largely agree with you but none of this invalidates my point or question. A router is, however, nothing more then a computer optimised for a certain task. From a computers point of view a modem is just another device - and you CAN add these as internal cards to a PC. – davidgo Jan 3 at 7:18
19

Because you most likely actually have....

wall -> [tcp/ip over ADSL]-> [ADSL modem + TCP/IP router in one box] -> ethernet/wifi -> computer 

There are of course exceptions (rare for consumer ISP) as mentioned by the other answers

The ADSL modem listens to the signal on the wire from your ISP and converts it to digital signals (which contain TCP/IP data) in much the same way that the NIC circuit in your computer listens to the signal on the ethernet cable and converts it to digital signals (which contain TCP/IP data).

If your NIC in your computer could understand ADSL then in theory you would not need the [ADSL modem + TCP/IP router in one box]

  • 2
    (Not going to downvote because I posted but) this is wrong. ADSL modems and NICs/ethernet cards have no concept of tcp/ip. Ethernet cards know only of packets - which can handle multiple kinds of traffic - including but not limited to IP. Modems typically also convert analog streams into handled by a modem (but is handled by a router). – davidgo Jan 2 at 20:14
  • 1
    thanks @davidgo , edited to address your accurate observation hopefully without over complicating the answer relative to the actual question. the full sequence of events is obviously far more complex – John McNamara Jan 2 at 20:55
  • 3
    I think this is the crux of the problem that the OP has, the box isn't just a router but a modem+router. If you bought a separate modem box and router box (possible, but can be hard to find a standalone modem) then you could get rid of the router box, but not the modem box. – user3067860 Jan 2 at 23:06
  • @user3067860 If you only wanted to connect one computer to the Internet, sure. – David Schwartz Jan 3 at 0:46
  • @user3068760 If you have Ethernet coming out of your wall then the modem is somewhere else and presumably not your problem. – user253751 Jan 4 at 3:25
11

The answer fundamentally depends on what the "wall" is, which usually depends on how you connect to the Internet Service Provider.

1) If the "wall" is an RJ45 jack connected directly to an Ethernet switch or a router (say in an apartment or office building) that is expecting to connect to and hand out an IP address (via DHCP) to a host computer, then direct connection will work but may not be very secure.

2) If the "wall" is an RJ11 (phone) jack, then you'll need an ADSL modem first to connect to the wall which will provide an RJ45 jack and provide an IP address via DHCP.

3) If the "wall" is a cable connection (usually a coax or "F" connector), then you will need a cable modem first that terminates the coax and provides an RJ45 jack and an IP address via DHCP.

4) If the "wall" is an RJ45 plug or a Cat 5 or Cat 6 Ethernet cable from a microwave setup (more common in rural areas), then usually the provider will require a router to terminate their interface. This router will then provide an RJ46 jack, an IP address via DHCP, and often an incorporated WiFi access point.

Sometimes the DSL modem, cable modem, or router will have a firewall built in, but sometimes they don't and often the basic configurations they come with are not very secure, so it would be wise to either configure the firewall on these devices or install a firewall before you connect your host computer(s).

  • 1
    Did you really mean to say RJ46 in the 4th option? – Xan Jan 4 at 12:40
5

I'll try to fill in the theory you're missing. This is going to play a bit "hard and loose" with analogies, and simplify a lot, but it should help. After that, I'll come back to your actual question with concrete answers.

One thing - you are asking about "virtual routers" and at the same time, basic theory like "what is a router anyway". I'm going to assume no knowledge (or very basic only) and start from the beginning, because it sounds like that's what you are actually trying to learn.

How your computer connects to the internet

You can imagine your computer's connection to the internet as being a bit like you talking on a landline telephone. Somewhere "out there", a company (or multiple companies) have put together a tangle of cables that connect all homes and offices. You don't really need to know about that side of it, because as far as you're concerned, you can pick up your home phone, dial a number, and if it's a valid number, you can speak to who you want - your main concern is the landline within your own home (handsets, base unit if you have one, master socket, sockets in other rooms, phone connections etc).

Similarly with the internet, many companies have put together the infrastructure outside your home. Your computer can "call" any "number" and if it's a valid "number", it can "speak" to any other computer it wants to. That could be, say, Google, Facebook, Spotify, or StackExchange.

That part is pretty automatic, so your question is mainly about what happens inside your house.

Inside the house

If we go back to the landline analogy, say you're using AT&T (USA) or British Telecom/BT (UK). They provide a master socket in your hallway (say), and link it to the external phone network. Within the home, you have a lot of choices, but in all cases, you have to link your landline handsets to that master socket, then they work.

You can do that in a lot of ways. For example:

  • You can plug a phone directly into the master socket

  • You can attach a wire to the master socket, with a second socket at the other end, in the bedroom or kitchen. Then you can connect your handset to that socket as well

  • You can attach a base unit to the master socket, or the bedroom socket, and then use a cordless landline handset. The cordless landline handset finds the base unit and "speaks" to it using radio; the base unit forwards that, going through the master socket, to the external landline phone network

Similarly, and simplifying it all, the things you are asking about are all just "things that help your computer to reach the external internet". It's very similar.

What those parts are doing

I'll leave the word "Ethernet" to the end, but here are the other things you might have:

  1. Your house has one external connection that the internet is linked through. Depending on your supplier and setup, it could be a satellite plug in the wall, a cable socket in the wall, or the same landline master phone socket as your landline telephone uses.

  2. There may also be a "modem" or another box, that directly connects to the external connection, and acts as a "translator". For example:

    - if your external connection is a satellite downlink, it might need a box from the satellite company to "translate" to/from satellite downlink signals, and computer data signals.

    - If you have a fibre or other connection that uses the external phone network, you might need an ADSL or VDSL modem, to translate to/from the external signals sent over the local copper wiring your phone company uses, and computer data signals.

    - If you use a cable company, they might use encryption on their external network to prevent fraud, and they might provide a box and some kind of smart card that translates to/from encrypted external cable signals, to "normal" computer data signals.

  3. You probably have a router. This is a box that, like a landline base unit, allows multiple computers to share a single external internet connection. When many computers or cellphones have to talk to each other, the router is the device that tracks which ones are talking to which, so that when "replies" arrive, they get sent to the right computer/cellphone. So the router will always be a box that multiple other computers can connect to.

    As a bonus, the router often does some security stuff, like blocking "fake" replies or inquiries from outside, when a device in your home didn't ask for anything. (Called a "firewall": most routers also do some kind of firewall too). It also makes sure every device gets a "fair share", so one device can't use all the internet blocking others from access. Some routers can operate parental controls. You might have a separate firewall on your computer - it doesn't hurt to have both.

    In some cases, the router also does the "translator" job above, in which case you'll have one box doing both things. For example, if you use ADSL, a home router can often connect straight to your master phone socket, pick up the external ADSL signal, "translate" it to normal computer data signals, and THEN act as a router to work out which computer those data signals need to be sent to.

  4. Last, you will have cables or WiFi to connect your actual computer/cellphone/devices to the router. The router has to be able to talk to your devices, to relay data between them and the external internet (or each other!). Like your home phone system, this can be done by adding wires between them (called a "wired connection"), or by using radio to link them (called "wifi"). If it's a wifi connection, it works almost the same as your cordless landline - the wifi equivalent of a cordless landline "base unit" is usually built into the router, and it sorts out what data is meant to be sent to and from each device.

Hopefully that's clear so far...

Some more info on how WiFi works

This isn't strictly relevant, so you can ignore it, but might help you get a basic idea "how this stuff works".

Any device that wants to connect to the internet by radio [wifi], must have a standard way it can use, to send a signal to everything in its wifi radio range, that says roughly: "hey, any wifi base units out there? I'd like to be allowed to use you!" Usually the wifi "base unit" in the router replies _"I am managing an internet connection called JOHNS_HOUSE and here is how to reach me directly, instead of shouting at everyone, but you can only use the internet connection called JOHNS_HOUSE if you know the password"_ Your device says _"Yes, JOHNS_HOUSE is the one I want"_, and sends the password (or asks you to enter it, if needed), then the router says "okay, you're allowed", and will begin allowing your device to send data over radio to and from it, and from there to the external internet.

Your cellphone might also get other replies that say "I manage ANNES_HOUSE" or "I manage STARBUCKS_CUSTOMER_WIFI"_, but when itnlists them all, the user chooses which wifi "base unit" should be used, because that's the one they know the password for!

"Ethernet"

The other term you used, "Ethernet", is a word with multiple meanings, that's why I left it till last.

Ethernet really means, the way that typical home computers as well as the wider internet, package up data to send to other computers. It's a "protocol" - a clearly set out definition that says exactly how one computer should send data to another computer, so the other computer can understand it, and exactly how they talk. It's a bit like a written definition of a very strict kind of electrical conversation. Ethernet and other common standards cover everything like this:

  • What do the electrical signals look like, that are sent on all these wires? How should electrical signals be converted to data, and vice-versa?
  • What "addresses" do computers use? How does my computer figure out how to talk to "google" or facebook" when I could be anywhere on the world and using any connection? How does the data get from me to Facebook and how do replies make their way back again?
  • What does data look like, when it's being sent? (People talk using words, but computers need to know how to send data in bunches, called "packets", and how a packet is made up). How does a computer know if a packet it sent is received properly? How can the other computer tell it to slow down or wait a bit, if it's "speaking" too quickly for it?
  • How does a computer track which packets are in the same conversation, if it's talking to lots of other computers? What happens if packets don't arrive in order? What should a computer do, if it thinks some data is missing, or got "mangled" in transit, and wants to request a re-send, or thinks there's an error?
  • When a computer wants to start talking to another computer, what is the computer version of "hello"? What should the other computer reply, if it is happy to talk, or doesn't want to talk?

So that's what Ethernet actually is. Ethernet (and a bunch of other protocols) are written down standards that everyone follows, so that whoever makes or uses a computer, or a cellphone, knows exactly what to make it do, so it can find, connect with, and talk to other devices and websites.

But because Ethernet is so common, the word is also used as a shorthand for other things. For example, the cable between a computer and a router, or the router and a separate modem, is a computer data cable that specifically carries data that's been "bundled up" into Ethernet packets, so it's usually just called an Ethernet cable. Also the computer software (Windows/Linux/whatever) may identify the connection as an "ethernet port", meaning "the RJ45 connector for an ethernet cable at the back of your computer".

The plugs at each end of an Ethernet cable also have a name - they are called RJ45 plugs (and they go into RJ45 sockets). The term RJ45 defines their exact size and shape, and the exact shape of the plugs and sockets and their connectors, so when you plug in a cable, it actually works. But sometimes they could be called Ethernet plugs and sockets.

Other terms for Ethernet cables are "Cat4/Cat5/Cat6/Cat7 cable". "Cat" stands for "category" and means its a cable capable of carrying data that's bundled up according to the Ethernet standard, up to a particular speed and distance. So a cat7 cable can carry data faster than a cat5 cable, all other things being equal. Ethernet itself is closely related to TCP/IP, a protocol that defines much of how the Internet works. TCP/IP stands for Transmission Control Protocol /Internet Protocol, and describes a lot of the actual way that data is sent between computers.

There's a ton more, but hopefully that's most of the basics. If any of it is confusing, read it again, or ask.

Getting back to your original question

So let's go back to your diagrams and question:

My system is essentially: wall -> ethernet -> router -> wifi -> computer

You will need to say what kind of signal comes into your house. "Wall" could mean anything. It sounds like there is a wall plate with a phone/satellite/cable/fibre socket of some kind, that you plug things into, but it just isn't clear. After that, there's a cable linking that to your router, which also acts as a wifi base unit and might also be acting as an ADSL modem, and your computer connects to that. But it's really unclear, so its hard to comment.

Can you add photos or model numbers to your post, to make clear what you actually have, and what kind of internet connection you're using g?

But I'd like to simplify it for this purpose and just do: wall -> ethernet -> router -> ethernet -> computer

(or if that's incorrect, whatever the correct cord system is).

Your router needs to connect to the computer. But it doesn't matter how. Some people prefer wifi, some prefer wired (an ethernet cable). Both work just as well as each other, it's completely your own preference. The router should recognise either, if it has the correct RJ45 sockets at the back - and most of them do.

Pros and cons might be: wired can be more reliable (fewer disconnects), and more secure (can't accidentally use a weak wifi password because its an actual cable). Its also faster than wifi historically, but very new wifi can be almost as fast or faster. On the other hand, it needs a cable - more computers, more cables - so portability is a real issue, and many devices don't have a cable connection these days. Wifi is cable free however many devices connect.

I'm wondering why you can't just plug the computer straight into the wall: wall -> ethernet -> computer

I wonder why I can't just open the terminal and write some code that listens for the ethernet device/interface, and then reads/writes stuff "to the internet". Maybe this is possible, not sure. Would like to know if this is possible, and if so, what is happening at a more granular level, or if not, why not.

At a minimum, almost all domestic internet requires an external connection socket of some kind, a modem that translates normal data packets to and from "whatever your supplier uses external to your house", almost always a router, to protect the network somewhat, and handle multiple devices sharing the same connection (strictly this is optional but it's almost always used), and connections between these, and from the router to your computer, which could be wired (Ethernet cables) or wifi, whichever you prefer.

The external connection (only) may need a different cable to connect to the modem (or a router with internal modem), like a phone wire or satellite coax cable.

Because this combination/setup is so very common, many/most consumer routers these days handle all of these tasks - they contain an ADSL modem, a router, and both kinds of connectors (a wifi base unit as well as Ethernet sockets, so you can choose).

If your internet isn't ADSL, you may haveva second box that goes between the router and the external connection, and only connects those two - that'll be a modem. If you only have one computer, and a supplier modem, you can plug the computer directly into the modem, and skip on the router, but it isn't recommended - the other things most router do, like firewalling/basic protection, are too useful to skip.

You can make it more complicated, but that's the basics of what is usually done in many houses.

I'm in the process of understanding virtual routers, and am wondering how a router is actually playing a part in getting the internet, and if it can be removed from the equation for this example.

Don't even go to "virtual routers" yet. You aren't ready, judging from the question, and to be honest, it doesn't sound like you need it. What's the purpose, or what do you imagine it will help with? The odds are good it needs more tech, and will complicate things, for no benefit at all.

You should now understand what a router does.

Hope this helps!

0

I have my computer plugged in directly to my wall. That works because I live in a student dormitory where the dorm has the router and my wall plug is connected to it. The necessary configuration was given to my by our network administrators. Notably I also pay my dormitory for Internet and not some Internet provider.

So (AFAIK) there needs to be a router somewhere, and if you pay for your Internet to an Internet provider directly good chance you need the router yourself. It may be possible without a router in some cases but I'm sure the computer then requires complex setup as already mentioned in other answers. We would need more information for that.

I also want to point to the other answers concerning security. This is similar to using your laptop in public wifis.