Difference between TCP and UDP

If you work with computers, you probably have heard about the TCP and UDP protocols. While they both are mechanisms to transmit data to other computers, they do not operate in the same manner. Below I’ll show you some differences between the two data protocols.

TCP (stands for “Transmission Control Protocol”)

  • It’s a connection-orientated data protocol
  • TCP is best used for applications that require high reliability
  • There is more overhead (more computer resources used) when using TCP
  • Other protocols such as: HTTP, HTTPs, FTP, and SMTP make use of the TCP protocol
  • TCP makes sure that the order in which data is received is the same order in which it was originally sent
  • TCP is typically slower than UDP
  • TCP allows for “flow control”
  • TCP checks for errors in the data transmission
  • TCP acknowledges segments
  • TCP has both error checking and options to recover in-case of an error

UDP (stands for “User Data-gram Protocol”)

  • Not a connection-oriented protocol
  • UDP is useful for applications that need fast transmission of data (regardless of data integrity)
  • Less overhead when using UDP, since UDP is a connectionless protocol
  • Other protocols such as: DNS, DHCP, and VOIP make use of the UDP protocol
  • UDP does not make sure that data received is in the same order that it was originally transmitted (less reliable, but faster)
  • UDP is typically faster than TCP
  • UDP has no “flow control”
  • UDP does not check for errors in the data transmission (less reliable, but faster)
  • UDP does not acknowledge segments
  • UDP has error checking but does not have any way to recover from errors it detects

Posted in Computers, Internet and Servers, Operating Systems

Web Hosting at Home – Pros and Cons

Have you ever thought of hosting your own website from home? This is a question many people on the Internet have asked before. While there are many answers to the question I wrote above, I will give my basic opinion on the matter.

Hosting from home is not always easy. You must manage:

  • Your Internet connection (at least to a certain degree)
  • Internet router
  • Server hardware
  • Software (including securing your server OS installation and keeping the software up-to-date)
  • Dealing with hacking attempts
  • Clean-up successful hacking attempts (this rarely happens on a properly setup server)
  • Keep consistent backups of your data (I do three backups daily on my server)
  • Putting in battery backups and power surge protectors
  • Dealing with support requests

My context when saying “hosting from home” is not running a large web-hosting business. I mean hosting your own private/business website as well as a few friends’ websites (including email). Obviously, you cannot be a large “GoDaddy” web-host, while you are running out of your home. That is not a realistic expectation.


The advantages of hosting from home are the following:

1) Privacy of your data

If setup correctly, no one can easily snoop on your private, confidential data that is on your own server.

2) You can choose your own server hardware

You are not limited by a web host’s hardware options for your server.

3) You can easily deal with server hardware failures

You don’t have to wait for a technician to fix your server.

4) Possibly cheaper for you in the long run

A decent Virtual Private Server purchased online could easily run $20.00/month, and a decent dedicated server could be as much as $100.00/month minimum!

5) No commitments to a web hosting company

You do not have to worry about some web hosting company making unreasonable demands (e.g., 50,000 file limit — on some large websites, you could easily go over a limit like this).

The disadvantages of hosting from home are the following:

1) Possible higher Internet service cost

Your ISP may require you to purchase an Internet service business plan instead of a residential one; this can possibly be expensive but not guaranteed to be expensive.

2) You may not have enough upstream bandwidth

To host efficiently from home, you will need to have at least 30 Mbps of upload speed; any less and you will notice performance degradation with loading your websites from other locations.

Please keep in mind if you are wanting to host several large videos, I recommend either lowering the bit-rate of your videos – so they will stream faster for your users – or use a 3rd party hosting service just for the videos themselves. Most self-hosters will not have enough upload bandwidth to properly serve 1GB+ video files.

3) Unstable home power

Few people may not have stable power at their house or business and thus their server goes on and off; this can easily be fixed by putting in a battery backup for your server.

4) Reliability of your Internet Service Provider

Unless you have a signed agreement with your ISP, they are under no obligation to keep your Internet connection up 24/7.

5) More manual labor required

On a hosted solution online, someone else does the hard work with maintaining your server; when you host from home, you must do it all yourself.


I hope the above helps you decide on whether to self-host web services. I know there are a lot of people online who say it is “bad, silly, stupid, not smart, wouldn’t recommend it” when it comes self-hosing web services.

With all due respect to those people, most of them have never done web hosting by themselves before, and are trashing something they have never done (which is silly and bad in itself!).


Posted in Computers, Internet and Servers

Akamai Discovers Linux Botnet that Hits with 150 Gbps DDoS Attacks

According to a web article, Akamai (a Content Delivery Network company) discovered a massive Linux botnet. A botnet is basically a bunch of compromised computers that allow attackers to perform various tasks that would otherwise be virtually impossible to accomplish without everyone’s compromised computers.

Basically, the botnet comes in the form of a Trojan. This Trojan targets Linux systems (including network routers). Once it gets into the system, it proceeds to download software to connect the computer to the botnet. The botnet is reportedly able to give up to a 150 Gbps DDoS** attack.

As I have said on my blog repeatedly, Linux is not immune to security problems. No operating system on the planet is immune to security problems. In this case, it is people using weak, insecure passwords on their Linux boxes.

If I set my Windows box’s Administrator password to ‘password123’ or ‘qwerty’, enabled remote desktop on my computer, and allow remote desktop through the firewall, I would eventually get hacked. Was that Windows’ fault or Microsoft’s fault? No, of course not. It would be my fault for setting a bad password on my computer.

Many people say “Linux is more secure than Windows”, but if you notice – most of the time – they do not give any technical arguments to backup what they said.

For example, a part of one of someone’s comment posted online said (direct quote):
“The primary attack vector to take over these systems is default or weak login passwords, and allowing internet-facing remote root. That has no bearing on Linux suddenly being less secure than it was yesterday, or in any way magically now just as insecure as Windows.”

Notice he said “That has no bearing on Linux suddenly being less secure than it was yesterday, or in any way magically now just as insecure as Windows.”, but he did not give any technical arguments to backup what he said. How is Windows “insecure”? How is Linux I have seen this dozens of times (no kidding).

What is worse is people will listen to them, assuming they are correct (e.g., Linux is more secure than Windows), and go off and repeat the same misinformation around on the Internet without even bothering to check if the information they received is in fact accurate.

Web article link: https://www.engadget.com/2015/09/29/linux-botnet-hits-with-150-gbps-ddos/

** Simply put, a DDoS attack is basically an attack that uses up the victim’s available bandwidth. This causes the victim’s computers to not correctly function when communicating with the outside world and internal network.


Posted in Computers, Internet and Servers, Operating Systems, Software

Pros and Cons to Web and Desktop Applications

Last Updated: 09/29/2019

Pretty much everyone who has used a computer has used a desktop application (e.g., Microsoft Word, VLC Player, Notepad, Adobe Photoshop, Internet Explorer, etc.) Desktop applications can be found just about everywhere for just about every kind of use.

However, over the past (roughly) 10-15 years, another kind of application for users has come about. They are called web applications. Web applications, simply put, are programs that users can interact with using their web browsers. Users also do not have to install web applications. They are already “installed” on the server you are accessing with your web browser.

Now many programmers feel passionate about both. I have written several desktop and web applications alike. So, I have a good enough feel for both to give some insight into the pros and cons of both. You must remember there is no “one size fits all” when it comes to the desktop or web. Both have their strengths and weaknesses. Anyone that says (or at least implies) otherwise, does not know what they are talking about!

Features

Desktop Applications

Web Applications

 Rapid Development

Designed from the beginning to be a quick and easy solution to building graphical user interfaces (GUIs), especially when using Windows Forms in Visual Studio for Windows.

Never was designed for rapid development. Using the MVC (model, view, control) architecture is typically seen as the “correct” way to create web applications.

 

I have spent hours and hours looking into this and the closest thing to “rapid development” for web applications I have found is ASP.NET WebForms.

Of course, I am aware that WebForms is not a solution for everyone, since it is designed to run on a Windows Server.

 Security

Since the user keeps his or her data on their own computer systems, this makes it harder for hackers to gain access to people’s data.

 

There are some desktop applications (usually for businesses) that connect to a central database server to get and store its information.

In that case, the desktop application would be like a web application.

Since all the user’s data is stored online, technically there is a greater chance of the users’ data being compromised.

 Available Controls

Desktop application developers have a whole buffet of user-interactive controls to choose from. This goes for the out-of-the-box controls (e.g., Visual Studio for Windows) as well as 3rd-party controls.

No real controls “out-of-the-box” to speak of, except for HTML controls (e.g., text boxes, buttons, check boxes, etc).

 

While you can add controls via jQuery or something else, these are not as mature as the desktop equivalents (in my opinion).

 Flexibility

It is very easy to write desktop applications that take advantage of the user’s hardware (such as:  scanners, cameras, WiFi, serial ports, network ports, etc.)

Web applications do not compare to the flexibility of desktop applications.

 

If you want to write a web application that interacts with the user’s hardware, you are doing it wrong. Just stick with a desktop application for your program. You will be happy you did.

 Portability

Desktop applications can be portable, but most are not portable and require manual installation from the user.

Web applications have desktop apps beat here.

 

Web applications are very portable and will work with just about any computer with a decent web browser.

 Maintenance

Desktop applications usually need to be updated either automatically or manually.

Web applications have desktop apps beat here…again.

 

End-users do not have to install any updates. All the updates are already taken care of by the web application administrators.

 Performance

Usually you will find that well-written desktop software running on a decent computer runs faster than web applications.

Web applications usually have slower performance than desktop applications, due to having to transmit data across the Internet.

 

The Internet (and web browsers in general) were never designed with huge web applications in mind.

For example, if Adobe created a full-blown Photoshop (all features, nothing removed) that ran in the web browser, I would say a lot of people would have trouble using it.

For one, web browsers would not be optimized for such a web application.

Secondly, most people would not have enough Internet bandwidth to run it smoothly, not to mention many broadband subscribers have a monthly bandwidth limit that they would easily go over if they used such a web application.

 


Posted in Internet and Servers, Software