How does DHCP work in wireless router?

Thanks for asking this question. First a bit of background.

A modern wireless device like a wifi router is responsible for implementing all 4 layers of TCP/IP stack.

The link, internet, transmission and application are all implemented in the same box.

Of these 4 layers only the link is the actual physical component. Rest all the layers are logical and as such they are provided by the software inside the router.

A router has its own operating system that manages these software services automatically.

DHCP or dynamic host configuration protocol is one such service. It works on the application layer of the stack. When the router turns on, it automatically starts the DHCP server. From that point DHCP leases local IP addresses to each connected device. When a device is no longer connected to the network of that router that IP address is reclaimed.

As you might have guessed Opensource router operating systems give you a lot of freedom in configuring DHCP server. Where as closed source systems are a bit limited in this regard,but still good enough for normal use cases.

By the way, there is no difference between working of DHCP on a wired/wireless router. The protocol is independent of the link layer. Whether it’s a wired network or a wireless it’s all the same as far as DHCP is concerned.

Workrock Engineering

WRE

workrockin@gmail.com

Does wifi extender affect speed?

Thanks for asking this question.

In a wifi setup the internet speed depends on

  1. The main connection speed. How fast the line at your place actually is?

  2. The speed of devices. Do they support the latest standard? Are they capable of processing max throughput?

  3. How many devices are accessing the medium at once? Wifi is a shared access protocol. For small number of devices the waiting time is negligible and can be safely ignored. But as the devices increase the channel may get congested and you may feel the speed going down even though max amount of time is spent waiting to get the access of the network.

Now with these points in mind it’s easy to see that wifi can’t possibly increase the line speed. Assuming that you have the best client as well as access point hardware, wifi extender will increase the perceived speed by decongesting the channel.

Think of it as increasing the number of queues at a ticket counter. A single queue will have the longest waiting time. 2 queues will halve the waiting time and so on.

With an extender your client devices will have more communication paths to talk with your main line internet.

In the best case you want your extender to be connected via a cable to your modem. Although it can also be connected wirelessly (provided that the wireless connection does not use the same channel as used by other client devices)

On the flip side if you extended your WiFi with the same channel that other client devices are using then you simply add a bottleneck. Instead of adding 2 queues you double the length of your first queue.

Workrock Enterprise

WRE

workrockin@gmail.com

Can the internet be used without optic fibers? 

Optical fibers are used in internet backbone. The part of the network that is responsible for global communication.

Optical fibers form what is known as the PHYSICAL layer of the network. While any other medium may be used to carry data, fiber optic cables are the most cost effective and efficient data transport available.

So yes while you can use the internet without fiber optic cables in theory, practically all your data is carried through undersea fiber optic cables.

If someone wants to replace fiber optic then they’ll have to find a new way to transport data.

What are bootloaders?

When the computer is first turned on it has a clear state. Meaning there are no programs in it’s memory and it’s incapable of accessing its components (storage ,I/O devices etc)

So the first step that is required is to enable the computer to gain access to them. For this purpose as soon as the computer starts it runs a bootloader that bootstraps the startup process.

Bootloaders initialize the hardware and pass on the control to the kernel which proceeds to initialize the operating system. That’s all they do.

Since bootloaders sit between hardware and software they give booting choices to users. They can let us

  1. Choose from different operating systems

  2. Boot operating system into safe mode for recovery.

  3. Choose different versions of operating systems.

  4. Or boot directly into a program without starting the operating system first. (This is used for example in many game consoles,if you have a game disc inserted when you start the console.it can take you right into the game rather than a welcome screen)

For PCs the ROM contains BIOS (or EFI) that looks for a bootloader at a certain location and execute it [1]

As you might have guessed there are stages to a bootloader. The bootloader is read from a ROM and executed. At the end of this process I/O components and storage components are ready.

The computer has changed its state from passive just a powered in CPU, to active a device can use different parts. It can now use these components.

The last thing that remains for the first stage bootloader to do is find the second stage bootloader so that the control may be passed on to the operating system.

Now most of the times the second stage bootloader is located on a storage within a device itself. Some place in a hard disk. The first stage bootloader knows about this location and hence finds and executes the second stage loader.

From there on the OS kernel is loaded followed by os itself.

As it often happens at the time of a new purchase a hard disk,there may not actually be a boot record for the bootloader. Therefore the first stage bootloader allows the user to specify boot locations. Most modern bootloaders allow you to boot from

  1. CD/DVD

  2. USB stick

  3. Network disk

In case of storage medium like CD and USB, the devices are formatted so that the first stage bootloader can find the boot record on it.

For network booting a boot image is placed on a known location on a server. This image is downloaded and executed on the machine.

Most of the time the interaction with the bootloader is rather minimal. It’s only when you want to install a new operating system. Or want to diagnose problems with your existing ones/use a different os, is the time when you take the trouble of going to the boot menu.

But understanding the boot process is important if you want to learn how computers work.

All electronic devices are turned on in the same way. Whether it’s your mobile, your laptop, your gaming consoles or your PC. They all boot the same way.

But some devices use the concept of a boot image on a flash. In such devices that kernel and the bootloader is packed into a single file and written onto the flash. This approach is quite common in smart phones like Android and in devices like wifi routers. [2]

Packing the kernel and bootloader into a single image does not change the boot process in anyway however. A bootloader still initializes the hardware and then passes the control to the kernel which will initialize the operating system.

However packing the bootloader with the kernel makes it difficult for the user to make changes to the device the way he wants. ROMs need to be packaged in exactly the same way as the device expects it to. And running multiple OS is more difficult because now there is no separation between the kernel and the bootloader.

Switching an Android operating system for instance is not quite as straightforward as switching the os in PC. And impossible if the bootloader is locked (as it is in many phones)

Still because embedded systems have a lot less room than PCs it makes sense to pack things together.

Types of bootloader and UBOOT

Since there are many types of computer architectures and many operating systems it’s natural that the bootloaders are specific to architecture and operating systems. This means that are many, many bootloaders on the market. Often they are proprietary and incompatible with each other. However open source applications like DAS U Boot are standardizing the process.

https://en.m.wikipedia.org/wiki/Das_U-Boot

DAS U BOOT works on almost all the system architectures and provides both first stage and second stage bootloading. It can also be packed into an image consisting both the Linux kernel as well as a bootloader in a package.

References

[1]https://askubuntu.com/questions/173248/where-is-the-bootloader-stored-in-rom-ram-or-elsewhere

[2]https://android.stackexchange.com/questions/29706/can-somebody-explain-the-boot-process-of-an-android-device/29738#29738

[3] A presentation on the boot process

https://www.cs.tau.ac.il/telux/lin-club_files/linux-boot/slide0000.htm

workrockin@gmail.com

What does the gigahertz band (like 2.4 GHz, 5 GHz) in a WiFi router mean?

It represents the frequency of the carrier wave.

In communication systems a carrier wave is the medium on which the message is transferred.

Wifi and Bluetooth have no wires (unlike Ethernet). So they emit a signal that acts as a communication channel. This channel is shared among all the connecting devices.

2.4Ghz means that the electromagnetic signal oscillates 2.4 billion times per second (giga is billion or 10^9) 5Ghz is an electromagnetic wave oscillating 5 billion times per second.

These signals are created by chips inside your router and radiated with the help of an antenna.

Before a carrier wave is generated information is encoded on it with the help of a process known as modulation.

[Modulation is the process of altering some aspect of the carrier that can be reliably detected by the receiver]

At the receiver antenna will “catch” the wave and then extract information from it. This is the reverse of modulation and is called demodulation.

Some Notes

  1. The frequency of information signal is less than the carrier frequency. The reason is simple: if the frequency is greater the carrier won’t be able to carry it. Like, for example, a bag the carries 1L of milk has slightly greater capacity than 1L.

  2. Carrier waves represent the Physical layer in the OSI model. You can think of them as invisible wires. It is in this foundation other layers are built. For internet communication the entire TCP IP stack is built on a wireless router.

  3. Any application that is running on a wireless router can then be accessed by simply connecting to the wifi. This is the foundation for the beacon technology that is promising a physical internet. A world where you can interact with physical devices by simply connecting to WiFi signals.

workrockin@gmail.com

How much programming should a normal technology user learn?

A general technology user (most of us these days) will rarely need to program. Once the fundamentals of how a computer works are clear it’s not necessary to dive deeper. A good computer program will abstract away low level details so you can focus on getting the job done rather than tweaking the system endlessly.

However things like shell scripts, basic understanding of computer networks, getting comfortable with command line can greatly enhance the way you interact with the computer. And make you better at using them,allowing you to do more with what you have.

Rather than going for a low level language course it would be way more useful to learn how existing programs work. Like operating systems, databases, version control systems etc. Things that are proven, open source and have been in operation for decades.

Always ask yourself if your requirement can be fulfilled by something that already exists.Minimize the energy you have to spend on the ground work.

Think of learning computers as a process. Not something that’d you’d do once and then leave it. As you hit the limits of your knowledge ask yourself if learning something new can benefit you. If it would go ahead and learn. If not then postpone or focus energy on things that need attention.

It pays to know the details. But only when they help you achieve your goals.

Whatever you do, don’t learn for the sake of learning. Always seek to determine practical benefits in advance before digging deeper.

workrockin@gmail.com

Why is LiFi not being used in place of wifi?

In my view there are a few reasons why LiFi is experiencing slower adoption

  1. People underestimate sheer momentum of an existing technology. All the effort that has been put by wifi into educating the customers, building a supply chain and creating an ecosystem is not easy to change. Definitely not by any technological invention/scientific discovery. It requires more than that. Wifi is used in billions of devices. It has been in operation for decades. No matter how good a replacement is, it will not make things that already work obsolete. If we look past that LiFi also has to overcome the chicken and egg problem. It needs special devices to function for transmitting as well as receiving signals. New investment to deliver the same result?

  2. Rather than disrupting an existing market the goal of a new technology should be to create something new. Something that does not yet exist. LiFi has that potential to do that but it insists on going after existing wifi markets and it runs against difficulties described point #1.

  3. Wifi works everywhere. It does not need any special conditions to be satisfied before it can be set up. LiFi on the other hand can only be successful in places where there is no interference to it’s light signals. These places are hard to discover. Sunlight, tubes, bulbs, flashlights all seem to be working against LIFI. It is true that LiFi signals are modulated (as opposed to natural light) but even then the signals get weaker as they interact with light from other sources. Reducing the distance of communication. Something similar to what happens when wifi signals are within range of electronic appliances like microwave ovens [3]. Use of optical filters can filter out data signal just as easily as it does light noise. LiFi’s carrier signal deals with much higher environmental noise than WiFi’s carrier wave.

Does this mean LiFi has no future?

On the contrary I think that LiFi has very bright future. I don’t think that it’s going to be in consumer grade communication equipment though. I believe that the real application of LiFi would be in photonic computing [1]. More specially in specialized wireless computing chips.

[Data in computers is moved along electrical paths connected by wires. In optical computing it’s not the electrons that move but the photons. Minimizing the heat loss and in reading the data width. And when you talk about microchip level movement why do you need wires at all?]

At the moment (going by expert opinion) most computer chip manufacturers are facing issues with power management.Technology that replaces electronic communication with photonic communication is going to win big time. Right now fiber optic interconnects are being investigated. [2] But LiFi maybe the alternative.

However that’s just my layman opinion. Smarter, more knowledgeable people are working on the technology and I’m sure they’d have already considered and overcome these objections. Maybe we’ll see something unexpected from them. I feel that LiFi is in capable hands. And it will surely make it’s impact.

workrockin@gmail.com

Footnotes

  1. https://en.m.wikipedia.org/wiki/Optical_computing

  2. https://www.electronicdesign.com/power/prize-winning-fiber-optic-chip-solution-knocks-out-copper-wires

  3. https://io9.gizmodo.com/why-does-your-microwave-oven-mess-with-the-wi-fi-connec-1666117933/amp

How does the internet work?

Internet is not a single technology. Instead it’s a stack. A group of technologies working together. These technologies form what is known as internet protocol suite. Which powers computer networks. Many such computer networks work together to form what we know as the global internet.

[ Please note that the explanation below is by no means an exhaustive guide just an overview that’ll quickly help you understand how different networking technologies work together.]

Let’s quickly go through the internet protocol suite (or TCP/IP stack as it’s commonly known)

It consists of 4 layers

  1. The link layer

  2. The internet layer

  3. The transport layer

  4. The application layer

The link layer provides the foundation for communication within a network. This may consist of physical wires like ethernet/fiber optics. Or wireless medium like wifi. Besides providing the physical medium it’s also responsible for giving access to the channel.

This is the layer that is responsible for implementing MAC address required to transmit information between two devices.

The internet layer is responsible for providing communication between networks. It is at this layer internet protocol is implemented. The process of moving data between networks is called routing.

  1. Each host on the network is identified by an IP address.

  2. Data packets are sent from source by passing them from one router to another until they reach their destination.

The transmission of data through the internet layer is unreliable. It provides no guarantee that the source packet will reach the destination.

[This is because it is difficult to know beforehand what path data will take as it’s routed to destination. ]

[ It may be said that the Internet protocol is stateless. All of the effort is spent in forwarding if packets. None is spent on verifying whether the individual packet was successfully delivered. And due to this property it’s able to address billions of hosts.

And this type of communication is known as connection less communication. ]

The transport layer implements the transmission control protocol (or TCP).

The actual data packets that are transmitted by the internetworking layer over the link layer are generated here. Here they are called segments. Once generated segments are forwarded to internet layer where they are assembled into a packet and stamped with IP address.

TCP layer defines the communication channel using ports. It is at these ports that applications and services are running.

Client devices can connect to these applications using the link layer as defined above. The TCP facilitates communication between the client and the application server over network ports.

TCP is a reliable and connection oriented protocol.

While the internet layer provides routing. TCP layer manages the communication process. Making sure it’s reliable, efficient and standardized.

—-

Application layer is the is the place where the services (that a client uses) are running.

Services like

  1. Domain name system

  2. Dynamic host configuration protocol

  3. Simple mail transfer protocol

  4. HTTP servers

run on application layer.

These protocols are used for process to process communication. A client device having a web browser can access the website using http protocol.

An email client like an Android app can access emails using SMTP protocol.

Data encoded by the application layer is passed on to the transport layer where it’s assembled into segments.

Application layer is the one using which we interact with the internet. It’s also the one with which most people are familiar with. We don’t need to know about any other underlying layers. As far as we’re concerned it may not even exist.

But it does.

And this illustrates the core principle of the internet stack. The abstraction of layers. A layer does not need to concern itself with how the other layers perform or work. It only has to make sure that it’s protocol is fulfilled.

——-

That is the gist of how the network works. If you want more specific details into the protocols involved please check out this Wikipedia index

https://en.m.wikipedia.org/wiki/Outline_of_the_Internet

[It’s important to note that the internet is more than just the web. There are many other services running on it that are defined by their own protocols.]

[ Finally TCP/IP and OSI are conceptual models to help understand how things work. In real world layers are not stacked as neatly as the model expects. But it’s much simpler nevertheless]

How it all comes together?

To best understand the internet consider a wireless router in your home connected to the internet via your service provider.

When your router is on and connected to the internet

  1. It gets an IP address by your ISP.

  2. It assigns a local IP address to each one of your connected devices using DHCP

  3. On request of client it establishes a connection with a service provider. Like a web server or an email server.

  4. It then routes the client request using the internet layer to a service provider. The web server processes the request and sends the response to the router.

  5. The router sends the response to the device that requested it using the IP address it assigned.

Application

Practically speaking the logical components TCP/IP model are coded into the operating system. Like Debian. So if you buy an appropriate hardware like PC with a network card and some Ethernet cables you can create your own data center.

There is a huge demand for local services that the internet is not able to satisfy. Applications that don’t need global internet to work. That can run offline so to speak.

These services are critical to digitization of processes. Both business and administrative. They don’t require to be available anywhere. But are context sensitive.

Wireless data centers running in colleges, and public places can fulfill this demand. Localized social networks, e-commerce, document management systems that are only needed where they are. Eg in a hospital or a court. To reduce the administrative burden. To improve the information flow.

Such portable data centers present a new opportunity to entrepreneurs, researchers and individuals to create rich and efficient local networks.

workrockin@gmail.com

References

https://en.m.wikipedia.org/wiki/Internet

https://en.m.wikipedia.org/wiki/Outline_of_the_Internet

OSI and TCP video explanation

https://youtu.be/3b_TAYtzuho

How is NVRAM used in a router?

NV RAM stands for non volatile random access memory. As the name suggests it’s used to store data that can be retrieved later. Unlike RAM the data is not lost after the device is powered off.

Flash is the most popular type of NV RAM. It’s used in USBs and also in “system on chips” to store firmware data. Because flash is significantly slower as compared to RAM the firmware is first loaded into the RAM before execution starts. To make it faster.

Since flash has limited write/delete cycles the on chip version is generally used for reading. Only at the time of firmware upgrades is the data written. This greatly increases the longevity of the chip. Otherwise a bad flash might render the whole thing obsolete.

[Although in some cases configuration parameters may also be stored on it]

[By the way flash is used not just in routers but also in many other devices like PCI cards, hard disks etc. Anywhere you need a boot process for a device, flash comes in handy for storing the firmware that “turns on” the device and make it ready for operation. Just like your computer needs to power on it’s components need to do the same]

How is bootloader used in a router?

The flash storage contains the bootloader that is executed every time the machine is powered on. There are many types of bootloaders both open source and proprietary and it’s execution is device specific. But all bootloader’s do three things

  1. Initialize the hardware

  2. Find the location of the kernel

  3. Execute the kernel and handover the control to it.

Once #3 is done the bootloader is no longer needed.

Because bootloader is executed before the kernel there are some special features that can be used especially in an embedded environment like a router that has no visible interface for handling errors(No monitor etc)

  1. Supporting additional boot devices. Like booting from USB or over the network.[ Networking booting is one of the most popular ways to boot embedded devices. ]

  2. Upgrading firmware “over the air”.

  3. Verifying the authenticity of the firmware.

But of course since bootloader controls the kernel execution, oftentimes manufacturers impose limitations on users ability to change it giving the excuse of security.

It’s quite common to see in Android phones in which the owner can’t change the operating system just because the bootloader is locked. Making it yet another way to control the usage after the device has been sold.

workrockin@gmail.com

Alternative business models for hotels

While selling room nights remain the most popular model for hotels, alternatives such as conferences, dining and work spaces are increasingly becoming more lucrative as sources of supplemental income.

Video games and other forms guest entertainment in lobbies , hassle free internet connectivity for guests and provision for meetings can increase the appeal of a property in the eyes of a prospect. Making it something more than just a place to stay.

Small things matter.

workrockin@gmail.com

Design a site like this with WordPress.com
Get started