Linux slang explained: What are upstream and downstream? | Linux China

thumbnail

Introduction: In its simplest form, upstream and downstream are the directions in which information flows.                                   

The number of words in this article: 2947, the reading time is about 5 minutes

https://linux.cn/article-14215-1.html

Author: Bill Dyer

Translator: Xingyu.Wang

The terms “upstream” and “downstream” are rather vague, and I don’t think the average person really uses them. If you’re just a Linux user and don’t write or maintain software, there’s a good chance that these terms mean nothing to you, but they’re useful for the way various communities in the Linux world communicate.

These terms are used for networking, programming, kernels, and even in non-computer domains like supply chains. When we talk about upstream and downstream, it is important to discuss the context.

In its simplest form, upstream and downstream are the directions of information flow.

Summary: what I need or want (your communication) is upstream. What you provide to me (welcome words and actual communications) is downstream.

Whether the data is upstream or downstream may not matter to us users, but it does matter to server administrators who monitor bandwidth usage, as well as to distributors (makers of distributions) and programmers.

In the Linux world, upstream and downstream have two main contexts. One is about the kernel and the other is about the application. There are others, but I hope I can express my thoughts through these two.

Upstream and downstream in the context of the Linux kernel

Linux is the kernel. When creating a distribution, Linux distributions first use the unmodified kernel source code. Then add the necessary patches to configure the kernel. The configuration of the kernel is based on the features and options that the distribution wants to provide. Once decided, the kernel is created accordingly.

The original kernel is from the upstream of the distribution. When the distribution gets the source code, it flows downstream. Once the distro gets the kernel code, it stays with the distro while it is retrofitted. It remains upstream for our users until it’s ready to be released.

The kernel version created by the distribution will add patches and enable certain features and options. This configuration is determined by the publisher. That’s why there are several flavors of Linux, for example, Debian 🔗 www.debian.org and Red Hat 🔗 www.redhat.com . Publishers decide what options to offer their user base and compile the kernel accordingly.

Once the work is done, it’s put in a repository ready for release and we can get a copy. This copy flows downstream to us.

Likewise, if a publisher finds a bug in the kernel, fixes it, then sends the patch to the kernel developers so they can patch the kernel for everyone downstream. This is called a contribution to upstream, because here the traffic is going up to the original source.

Upstream and downstream in the context of the application

Again, technically Linux is the kernel and everything else is add-on software. Publishers also add additional software to their projects. In this case, there are several upstreams. A distribution can contain any number of applications, such as X, KDE, Gnome, and more.

Let’s imagine that you use the nano 🔗 www.nano-editor.org editor and find that it doesn’t work properly, so you file a bug report with the distribution. The publisher’s programmers will look at it, and if they find that they have inserted a bug in nano, they will fix it and publish a new version in their repositories. If they find that they did not make the bug, the publisher will submit a bug report to the upstream nano programmer.

When it comes to things like bug reports, feature requests, etc, it’s best to send them to the upstream distributor, as they maintain the kernel and add-on applications for the distribution you’re using. For example, I use a distribution called Q4OS 🔗 q4os.org on several machines. If I find a bug in a program, I’ll report it to the people at Q4OS. If you happen to be using Mint 🔗 linuxmint.com, you will report it to the Mint project.

For example, if you post a question on a normal Linux forum and you mention that you’re using Mint, you’re bound to get a response like this. “This question is best dealt with on the Mint forum”. Using the previous example of nano bugs, it’s possible that Mint programmers modified nano to work better in their distribution. If they do make a mistake, they’ll want to know about it, and after making the mistake, they’ll be the one to fix it.

Once fixed, the updated program will be put into the repository where you can use it. When you get an update, it goes downstream to you, like this:

◈ If the publisher makes a fix, the new version is made available in the release repository.

◈ If the programmer of the application makes a fix, it will be sent to the publisher who will test the new code. Once it is found to be working properly, it is placed in the warehouse and flows downstream.

automatic flow downstream

There was a time when users had to get updates themselves. The user gets the updated source code and compiles a new executable. Over time, tools like apt were created to allow users to pull updated binaries (executables) from software repositories. The apt program is Debian’s, but other distributions have their own similar programs for this purpose.

Programs like apt take care of the upstream/downstream work. If you run apt with the upgrade option, like this:

sudoapt upgrade

It will look in the (upstream) distribution repositories, find any needed updates, pull them to your machine (downstream) and install them.

Some distributions go a step further. Programmers and maintainers of distributions are always checking their products. Many times, programmers of applications make improvements to their programs. System libraries are updated frequently, security holes are closed, and so on. These updates are made available to the publisher, who then provides the new version in the distribution repository.

Rather than having you run apt every day, some distributions will alert you that updates are available and ask you if you need them. If you want, just accept and the update will be sent to your machine and installed.

Summarize

Upstream and downstream are really just the direction of data flow. How this data flows upstream or downstream depends on who ultimately needs to process it. Basically, programmers are upstream and users are downstream.

Again, as users, we don’t really need to care about these terms, but these concepts do help with software development and maintenance. By directing work to the appropriate group, duplication of work is avoided. This also ensures standard maintenance. For example, the Chrome browser might need some minor changes in order to run on a certain distribution, but at its core, it’s the Chrome browser that doesn’t look or behave much differently.

If you find a bug in any program in your distro, simply report it to the distro’s maintainer, usually via their website. You’ll be sending it upstream, but it doesn’t matter if you remember you’re sending a report upstream.

via: https://itsfoss.com/upstream-and-downstream-linux/

Author: Bill Dyer Topic: lujun9972 Translator: wxy Proofreading: wxy

This article was originally compiled by LCTT, and was launched with honor by Linux China

Welcome to reprint in accordance with the CC-BY-NC-SA agreement,

If you want to reprint, please leave a message under the article “ Reprint: Official Account Name “,

We will add a whitelist for you to authorize “ modification when reprinting articles “.

終端大師 Terminal Master

Related Posts