X window system (X11 or X, but not X windows) is a windowing system for bitmap displays. X provides basic framework for a GUI env: drawing and moving windows on the display device and interacting with mouse and keyboard. It originated at MIT in 1984. XFree86 is the implementation of X that was used on all Linux computers until mid 2000. However due to change in it's license terms, a fork was created and development moved on to X.org. The first version, X11R6.7.0, was forked from XFree86 version 4.4 RC2. X.org foundation leads this project as of today, and almost all Linux OS have moved on to X.org. It's available as open source under MIT license.

Official website: https://www.x.org/wiki/

Older defunct website for xfree86 (not supported anymore, so do not use this website): http://www.xfree86.org/

good intro here: http://linuxdocs.org/HOWTOs/XWindow-Overview-HOWTO/index.html

other detailed link here: http://www.linux-tutorial.info/modules.php?name=MContent&pageid=98

X uses client/server model. Usually, the local computer runs X server program. X server interactes with hardware, it takes i/p from mouse/keyboard and displays on the monitor. Programs such as Xterm, browser, etc are called X clients. X server communicates with various client programs. The server accepts requests for graphical output (windows) and sends back user input (from keyboard, mouse, or touchscreen). X clients don't interact with hardware directly. This way X clients need not worry about h/w, they just follow the protocol to interact with X server, and the X server handles the actual process of interacting with h/w.

X provides the library, Xlib, which handles all low-level client-server communication tasks. The client has to invoke functions contained within Xlib to get work done.

Windows manager (WM):

A window manager is a "meta-client", whose most basic mission is to manage other clients. The WM program decides where to place windows, gives mechanisms for users to control the windows' appearance, position and size, and usually provides "decorations" like window titles, frames and buttons, that give us control over the windows themselves. X window system provides policy but not implementation of that policy. This is handled by window managers. The most basic WM is twm, ad other more fancy ones are fluxbox, Xfce4, etc. These WM have toolkits or widget library. Using Xlib functions directly is pretty tedious, so libraries were developed thru which we could control widgets like menus, buttons, scroll bars, canvas, etc, much more easily. One of the earliest toolkits developed was Motif. However, Motif wasn't free, so alternatives were developed. One such very popular alternative was Gtk (aka GNU tool kit, or GIMP tool kit). Another very popular toolkit used in KDE was Qt.

Desktop Environment (DE):

Since there are hundreds of different toolkits and they all have different looks and behaviour, applications developed using different toolkits will look dihttps://www.computerhope.com/unix/startx.htmff even when lauched on same computer. Even the way of launching pgms vary from one wm to another(i.e on some we may have to type cmd, while some may have gui to launch, etc). DE provides a set of facilities and guidelines aiming to standardizing all this stuff. Under Linux, 2 most popular DE are KDE and GNOME. KDE has kwm as it's WM (which is mandated by KDE), but GNOME allows any WM (although it's preferred WM is sawfish). GNOME uses the Gtk toolkit, and provides a set of higher-level functions and facilities through the gnome-libs set of libraries. The whole idea of a desktop environment is consistency, so all apps developed for one DE, would look and feel the same (i.e scrolling, left/right clicks, etc). However, we are completely free to run apps developed for KDE on GNOME or vice versa, they would just look different compared to other apps.

GUI startup:

Assuming we have GNOME DE, this is what happens on powerup. As explained in Linux installation, after powerup and succesful login, xinit is called for GUI desktops. Even the login i/f may be GUI (instead of text login i/f as found in older versions of Linux) which is managed by Display manager (dm). Here, dm starts the X server. When a Linux system starts X, the X server comes up and initializes the graphic device, waiting for requests from clients. First a program called gnome-session starts, and sets up the working session. A session includes things such as applications I always open, their on-screen positions, and such. Next, the panel gets started. The panel appears at the bottom (usually) and it's sort of a dashboard for the windowing environment. It will let us launch programs, see which ones are running, and otherwise control the working environment. Next, the window manager comes up. Since we're using GNOME, it could be any of several different window managers, but in this case we'll assume we're running Sawfish. Finally, the file manager comes up (gmc or Nautilus). The file manager handles presentation of the desktop icons (the ones that appear directly on the desktop). At this point my GNOME environment is ready to work.

Files:

X server executable is at /usr/bin/X. This is the original X server executable from MIT, but due to license issues, Xorg was forked from X, and it's executable is at /usr/bin/Xorg. Xorg is what is run as X Window system server executable, X is just for compatibility, and it eventually passes cmds to Xorg. (on my centOS system, X is just a softlink to Xorg). However, we never call Xorg executable directly to start X window system server, instead we call a script "startx".

startx => On a text only terminal, X server doesn't start automatically. The wrapper script "startx" can be typed on the text terminal to start X server. The startx script is a front end to xinit that provides a somewhat nicer user interface for running a single session of the X Window System. More details here: https://www.computerhope.com/unix/startx.htm

 

DISPLAY environment variable:

X server and X client need not be running on same computer. They can be on two computers. X client interacts with X server using TCP protocol via Port 6000 or higher, when they are on diff m/c. An env variable "DISPLAY" is used by X client to to find out where the X display server is (so that the client can interact with he user) and which screen it should use by default (on displays with multiple monitors). X client just sends it's display data to X server, and then X server displays it based on what display is connected to it, and what display the X client has asked it to use.

X server manages the display. A display consists (simplified) of:

  • a keyboard,
  • a mouse
  • and a screen.

DISPLAY environment var indicates to graphical clients which display server (I/O devices) to connect to. It can be set to aanything desired by user.

The display var is of the form

hostname:D.S

where:

hostname is the name of the computer where the X display server runs. An omitted hostname means the localhost. So, if we provide a name/addr here, that means X server is located at this IP addr.

D is a Display number (usually 0). It can be varied if there are multiple displays connected to one computer. TCP port used for Display 0 is 6000, Display 1 is 6001 and so on. The phrase "display" is usually used to refer to collection of monitors that share a common keyboard and pointer. Most workstations tend to only have one keyboard, and therefore, only one display with display number 0. Display number is required. When we connect via vnc to a remote m/c, it allows us to open connections to separate multiple displays as mc1.abc.com:0, mc1.abc.com:1, and so on. So, if 5 users are going to connect to a m/c via vnc, vnc can open connections to same m/c with 5 different displays, so that all 5 users can have their own display, even though all their pgms are running on same m/c on same cpu. These are virtual displays and Linux gui is displayed on each of these virtual displays independently.

S is the screen number. A display can actually have multiple screens. The phrase "screen" refers to physical monitors that share the same keyboard and mouse. So, on a system with 2 monitors, screen can take 2 values 0 or 1. Usually there's only one screen though where 0 is the default.

ex: echo $DISPLAY => returns :0 on my m/c by default. This means display is set to localhost, display 0, and screen 0 (since screen is omitted, it defaults to 0). Any X client, before connecting to X server, reads this var, and figures out where X display server is, that it's supposed to connect to. Here, it says it is connecting to X server on local computer. It connects to X server on local m/c, and asks it to display the data it's sending to display number 0.

We can set DISPLAY var to any value we want, and in that shell, X clients launched will talk to X server indicated by the var.

In BASH shell, we set any env var using export:

ex: export DISPLAY=abc.com:0.0 => This makes any X client connect to X server on abc.com. This communication b/w X client and X server will be made over TCP on port 6000. Running a X client as "firefox" will connect to X server on computer named abc.com. Display and Screen used are 0. So, firefox window will end up showing on display connected to X server on abc.com. However, most of the times, computer abc.com won't allow just any computer to connect to it's X display server. So, we'll get an error as "Error: cannot open display: abc.com:0.0".

In Csh, we set any env var using setenv:

ex: setenv DISPLAY abc.com:0.0

Many Xclients allow them to specify Xserver to connect to via cmdline.

ex: xterm -display :0 => this opens new xterm window on local X server, display 0. Basically, xterm opens locally on same display as where you ran this cmd.

ex: xterm -display :1 => This will error out: "Can't open display: :1". This is because there is no display 1

Virtual display:

The question that comes to mind is how do we get multiple displays on a given computer. These multiple displays are called "virtual display".. Any Linux OS has 6 virtual display from 0 to 5. It's explained below under tty section,

TTY:

If we set multi-user.target (look in systemctl section for more details) as default target, then system will start in CLI. (cmd line i/f) Any Linux system starts multiple TTY sessions at boot up. Each TTY session can be thought of a copy of OS running. Most Linux OS install 7 TTY session by default. CentOS has 6 tty, while Linux Mint has 7. TTY stands for  Tele Type, an old piece of equipment which allowed typing, which would appear on typed paper and then on pressing <ENTER>that was sent to computer and then the response would be typed back on the same piece of paper. On modern computers, cmd environment (whether CLI or GUI,) is called a TTY or specifically a PTTY (Pseudo TTY). A TTY session is the environment you are in while interacting with your computer. We use mouse, keyboard to enter inputs, but we can use virtual terminals (i.e "xterm" etc) to enter inputs (which eventually get their inputs from mouse/keyboard) and send it to processes that need it. That psuedo terminal that sends cmds to processes constitutes a TTY session.

So, these 7 (or 6 for some distro) different TTY session can be used to log into by 7 different users at same time. They are useful during debug too. These 7 TTY sessions are rep by device special files /dev/tty1 thru /dev/tty7. Of these 7 sessions (or 6 in CentOS), all but one start in CLI mode. In Linux Mint, the 7th session is the default session that is presented to the user as login screen. It can be CLI or GUI depending on whether we are in multi-user target or graphical target. These 7 TTY sessions can be entered by pressing Ctrl + Alt + F1 (for 1st tty) to Ctrl + Alt + F7 (for 7th tty). In CentOS, the first tty session (tty1) is the default session, and it has only 6 tty sessions from tty1 thru tty6. On any Linux distro, one of these many tty will be the default terminal (GUI or CLI), while remaining ones will be CLI terminal. Ctrl + Alt +F1 takes to tty1 session, while Ctrl + Alt + F7 takes to tty7 session. Which of these is default depends on OS distro.

We login to default CLI/GUI TTY session. However, we can login to other CLI TTY sessions too. We just have to press "Ctrl+Alt+F2" to login to 2nd tty session from the current session. Similarly for other sessions. In these 5 or 6 CLI TTY sessions, we  login by providing username and passowrd. Then we can use it the same way as would use any shell terminal from within GUI (the same way as we use xterm within GUI). We can logout by typing "exit". From these 5 or 6 CLI terminals, we can enter into GUI windows by typing "startx". We can get out of GUI mode by logging out from GUI mode. That will bring us back to Command line.

tty => this cmd prints the current terminal session.  i.e /dev/tty4 etc for 4th CLI terminal (most likely the one on Ctrl + Alt +F4). For GUI sessions, it shows /dev/pts/1, /dev/pts2, etc for multiple terminals opened within GUI. pts means psuedo terminal. Whatever CLI this gui session started from shows the dev/tty number when typed on cmd line before GUI gets invoked.

Unix supports 'device files', which aren't really files at all, but file-like access points to hardware devices. A 'character' device is one which is interfaced byte-by-byte (as opposed to buffered IO). /dev/tty is a character device file, it doesn't contain anything but can be read from and written to.

 

 

 

 

 

In the startup sequence discussed before, we saw that init was the first process to start. However, on newer linux versions, init has been replaced by systemd (system mgmt daemon, d represents daemon) as the first process to start. Init was based on old SysVInit, while systemd is based on newer SystemD, This is a very good link explaining it:

https://www.tecmint.com/systemd-replaces-init-in-linux/

/bin/systemd is run instead of /sbin/init as the process with PID=1. Purpose is the same. A systemd, may refer to all the packages, utilities and libraries around daemon, instaead of just the daemon. However, on my Linux Mint 18, and other linux distro, I still see init as the first process to start, even though systemd is enabled.

Init and systemd have different ways of calling on a service (such as apache2, ssh, cron, etc). This link, explains diff b/w diff methods: https://askubuntu.com/questions/911525/difference-between-systemctl-init-d-and-service

There are 3 different methods:

1. SysVInit using init.d: Under init method, init scripts would be written for any service, and placed in /etc/init.d dir. Then the script in init.d dir would be called directly with options to start/stop/restart/etc for that service. This is not used anymore on new Linux distro, so no need to learn this anymore. It's mentioned briefly below, in case you encounter this on some systems (as Ubuntu).

Selected scripts in /etc/init.d dir are run at startup automatically. Whether the scripts in init.d dir should be run or not is decided by symbolic links to these scripts stored in various dir in /etc/rc*.d/ (rcS.d, rc0.d, ... rc6.d). dir rcS.d has all symlinks in it starting with S where "S" indicate that the service should be started. rc0.d has symlinks starting with S or K where "K" indicate that the service should be stopped (killed). These scripts in rc0.d are executed for runlevel0. Similarly rc1.d is for runlevel1 and so on. The default runlevel for Ubuntu is 2. 

In CentOS 6, this is what I see in dir: /etc/rc.d/rc2.d/

S10network -> ../init.d/network
K50netconsole -> ../init.d/netconsole

This indicats that "network" pgm would be started at startup, while "netconsole" won't.

If we want to add a new pgm to start at startup, we don't modify the links directly, but run "update-rc.d" to update the links to enable/disable pgm.

ex: sudo update-rc.d <pgm1> enable => This updates symlinks to remove "K" symlinks and replaces them with "S" symlinks for program "pgm1". So, now pgm1 would start by default at startup

ex: sudo update-rc.d <pgm1> disable => This updates symlinks to remove "S" symlinks and replaces them with "K" symlinks for program "pgm1". So, now pgm1 would not start by default at startup

NOTE: On most new installation of any Linux distro, you won't see any files in /etc/init.d/ as those files have moved to systemd. On CentOS 6, I don't see any pgm in /etc/init.d, while on Linux Mint 19 (Tara), I see about 50 or so pgms as apache2, bluetooth, sql, etc in that dir. This indicates that many pgms still install files in /etc/init.d/ to control their startup behaviour. In CentOS 6, I do see a README in /etc/init.d/README stating that all the files have moved. However, do note that on many linux distro, traditional init scripts continue to function on a systemd system (even though all the files have moved to systemd). An init script /etc/rc.d/init.d/foobar is implicitly mapped into a service unit foobar.service during system initialization. This is to maintain compatibility, so that existing scripts or any new scripts in /etc/init.d/ don't suddenly stop working.

ex: /etc/init.d/apache2 status => Here, apache2 process init script is called to check status of apache2

2. SysVinit using service: Later on, service cmd was used for SysVinit based systems. It was intended to provide smoother transition into system dependency handling. In most cases,  this newer service cmd just linked scripts in /etc/init.d dir, while in some cases, it called scripts located in entirely diff dir. However, this method is not supported by all Linux distro, and most newer programs, don't even provide support for service. It's mostly there for legacy purpose, and should be avoided all together.

ex: sudo service apach2 status => may work on some distro

3. SystemD using systemctl: This is the newer method of controlling services. Earlier Linux OS used init system, whose fundamental purpose was to init the components that must be started after Linux kernel is booted, and then manage services and daemons. Now, most Linux distro have switched to using systemd, instead of init. However systemd also does same tasks as what "init" used to do. Moving forward, this is the only method that will be supported on all Linux systems. All others will be deprecated. So, use this as preferred method on newer Linux distro, that support it.

link with syntax of systemctl: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units

systemctl => cmd to control systemd "system and services manager". It can be used to enable, start, stop, check status of system services as sshd, httpd, etc.

/etc/systemd/ => contains all systemd config files. systemd looks in /etc/systemd/system/<some_target>.target.wants file for autostart of any systemd application. We see such files for applications as basic, graphical, bluetooth, getty, network, sysinit, multi-user, etc. Each target is dependent on bunch of services that it runs. symbolic links for *.service files are created here from below dir, whenever we want to autostart any service at boot.

/usr/lib/systemd/system/*.service => This has service file for applications as gdm, bluetooth, NetworkManager, etc, target, wants, etc.

/lib/systemd/system/ => has all units as service, target, wants, etc. This is basically replica of above dir. This is where systemctl looks for, so whatever program is in this dir, is what is supported by systemctl ??

ex: sudo systemctl status apache2.service => This works on all systems supporting systemd. Here, it looks for file "/lib/systemd/system/apache2.service"

ex: sudo systemctl status apache2 =>Here, we omitted the extension, .service, but it still works, as by default, systemctl cmd looks for .service file.

 Some systemd cmds for xinit/graphical services are explained in "Linux Installation".

 

 

 

USB: widely used communication protocol. At it's core, it has a pair of differential pins for data xfer. There is no clk pin, as clk is embedded within data, and is recovered from there. USB is a confusing protocol with many different terminology and loosely used terms. It defines 2 kinds of spec. One relates to the data communication protocol over wires (i.e USB 1.0, etc), while other refers to the physical connectors (i.e Type C, etc). On top of data communication protocol, USB also defines power delivery communication protocol (PD 1.0, etc). Not all data/power communication protocol are valid over all connector types. On many occasions, the 3 specs are mixed together. We'll talk about these separately.

History:

  • USB 1.0: Very earliest usb, came out in 1996. It is called LS (low speed) USB. It has speeds of 1.5Mbits/sec (or equivalently a clk with freq of 1.5MHz). It's power src is 5V @ 100mA (=0.5W max power)
    • USB 1.1: incremental update to USB 1.0, came out in 1998. It is called FS (full speed) USB. It has speed of 12Mbits/sec.
  • USB 2.0: next gen of USB, came out in 2001. It is called HS (high speed), and has speeds of 480Mbits/sec (gigantic leap). Power src was also improved to allow more power to be delivered at 2.5W = 5V @ 500mA.
  • Upto USB 2.0, usb connectors were identical. They were either Type A connectors, or Type B connectors. They had 4 pins = VBUS, GND, D+, D-. The data pins D+/D- were used for both transmitting and receiving data, so they were half duplex pins.
  • USB 3.0: 3rd gen of USB, came out in 2008. It is called SS (super speed) USB. It had 10X higher speeds of 5Gbits/sec (equiv to 5GHz clk freq). However, such high clk freq of 5GHz was not neededto provide 5GBits/sec Bandwidth. Instead USB 3.0 std added new wiring for full duplex operation, i.e new pins do not need to be bidirectional, one pair was receiver, while other pair was transmitter. To have backward compatibility, D+/D- pins were left untouched as bidirectional. New TX+/TX- and RX+/RX- pins were added. New USB 3.x connectors were made, which were still backward compatible with USB connectors from prev gen. New USB 3.x connectors just added new superspeed pins for faster data transfer, either by changing shapes of type A, type B connectors, or getting new pins in b/w the existing pins w/o chnaging shapes. All std connectors as type A, type B in all forms were supported. It supported 8B/10B encoding. There were new type of connectors called Type-C (explained below) which exclusively carried USB 3.2 signals.
    • USB 3.1: incremental update to USB 3.0, came out in 2013. It is called SS+ (super speed plus) USB. It doubled the speeds to 10Gbits/sec. It was called USB 3.1 and replaced the older USB 3.0 std. However, to distinguish b/w the older 3.0 vs the new 3.1 std, the older USB 3.0 was renamed as USB 3.1 Gen 1 (with per lane speeds of 5Gbits/sec). The newer std of USB 3.1 was renamed as USB 3.1 Gen2 (with per lane speeds of 10Gbits/sec). USB 3.1 Gen2 still used 8B/10B encoding (same as the original USB 3.0 spec). USB 3.1 spec was backward compatible with USB 3.0 and USB 2.0. From now on, there was USB 3.1 spec and USB 3.0 became obselete (USB 3.0 got rebranded as USB 3.1 gen1).
    • USB 3.2: incremental update to USB 3.1, came out in 2017. It doubled the speeds to 20Gbits/sec, while still preserving SS and SS+ speeds from prev gen. It was called USB 3.2 and replaced the older USB 3.1 std.  In order to double the speeds, it used 2 lanes for data xfer, instead of single lanes that were used until now. To support dual lanes, it required new type of connectors, called Type C connectors. These Type C connectors introduced the concept of Alternate mode (explained later). In order to support all prev gen, it's naming got more complex. Below naming is what is used. x1 or x2 implies single or dual lane. Gen 1 implies lower speed per lane, while Successive Gen imply higher speed per lane. Gen 1 has speed of 5bps/Lane, Gen2 has 10gbps/Lane, Gen3 has 20gbps/Lane while Gen4 has 40Gbps.Lane.
      • USB 3.2 Gen 1x1 = this is USB 3.1 Gen1 (aka USB 3.0, SS). Still supported single lanes (x1), so could use older connectors. Speed = 5Gbps/Lane, Lanes=1, Net speed or throughput =5Gbps.
      • USB 3.2 Gen 2x1 = this is USB 3.1 Gen2 (aka SS+). Still supported single lanes (x1), so could use older connectors. Speed = 10Gbps/Lane, Lanes=1, Net speed or throughput =10Gbps.
      • USB 3.2 Gen 1x2 = This is proper USB 3.2, with lower speeds. This has same speed as USB 3.1 Gen2 (SS+) of 10Gbits/sec, but has higher throughput because of more efficient coding of 128B/132B. It supplies data over 2 lanes (x2) with SS speeds, so kind of similar to USB 3.1 Gen1, but repeated twice (effective clk freq = 5Ghz). It needed newer type C connectors, to support dual lanes. Speed = 5Gbps/Lane, Lanes=2, So Net Speed or throughput =10Gbps.
      • USB 3.2 Gen 2x2 = This is proper USB 3.2, with higher speeds. This has higher speeds of 20Gbits/sec. It supplies data over 2 lanes with SS+ speeds, so kind of similar to USB 3.1 Gen2, but repeated twice (effective clk freq = 10Ghz). It needed newer type C connectors, to support dual lanes. USB 3.2 Gen 1x2 and Gen 2x2 is what we commonly see in today's devices which have USB PD connectors. These use both lanes (lane0 and lane1) for data xfer. Speed = 10Gbps/Lane, Lanes=2, So Net Speed or throughput =20Gbps.
  • USB4 (or USB 4.0): This new std announced in 2019, replaces all earlier std. It doesn't have a space b/w USB and 4 in it's name (it's written as USB4 and NOT "USB 4". However, most online docs and specs still write it as USB 4 which is incorrect), and is not expected to have further iterations as 4.1, 4.2, etc. It works only on Type C connector (with USB PD running too). It supports speeds from 20Gbps to 120 Gbps. It also supports more AltMode xfer than USB 3.2 (ThunderBolt3 as well as Display port). USB4 by itself does not provide any generic data transfer mechanism as USB 3.x, but serves mostly as a way to tunnel other protocols like USB 3.2, DisplayPort, and optionally PCI Express. The biggest advantage of USB4 is that it allows to share bandwidth b/w video and data.
    • USB4 Version 1: This is version 1.0 that was released on 2019. It has double the max speed of USB 3.2 with speeds up to 40Gbits/sec (20Gbits/sec per lane). It initially supported altMode DP 1.4 only, but in 2020, spec provided support for altMode DP 2.0 too. DisplayPort 2.0 can support 8K resolution at 60 Hz with HDR10 color and can use up to 80 Gbit/s which is same amount available to USB data, but just unidirectional. It's named as Gen2 for speeds similar to USB 3.2 and Gen3 for higher speeds. Below are USB4 Gen2 details:
      • USB4 Gen 2x1 = This has same speed as USB 3.2 Gen 2x1. It has single lane at 10Gbps. Speed = 10Gbps/Lane, Lanes=1, Net speed or throughput =10Gbps.
      • USB4 Gen 2x2 = This has same speed as USB 3.2 Gen 2x2. It has dual lanes at 10Gbps per lane for a total of 20Gbps. This is marketed as "USB4 20Gbps" or "20" written on peripheral instead of "SS 10" or "SS 20" that was written for USB3. Speed = 10Gbps/Lane, Lanes=2, So Net Speed or throughput =20Gbps.
      • USB4 Gen 3x1 = This is real USB4 where speed for single lane is doubled to 20Gbps. It has single lane at 20Gbps. Speed = 20Gbps/Lane, Lanes=1, Net speed or throughput =20Gbps.
      • USB4 Gen 3x2 = This has Gen 3 with dual lanes at 20Gbps per lane for a total of 40Gbps. This is marketed as "USB4 40Gbps" or "40" written on peripheral instead of "SS 10" or "SS 20" that was written for USB3. Speed = 20Gbps/Lane, Lanes=2, Net speed or throughput =40Gbps.
    • USB4 Version 2: This is Version 2 that was released in 2022. It doubled the speed to 80Gbps (40 Gbps per lane). It's named as Gen 4. It works in both Symmetric and Asymmetric mode where number of TX lanes doesn't need to be same as number of RX lanes. Below are USB4 Gen3 details:
      • USB4 Gen 4x1 = This is Gen 4 where speed for single lane is doubled to 40Gbps. It has single lane at 40Gbps. Speed = 40Gbps/Lane, Lanes=1, Net speed or throughput =40Gbps.
      • USB4 Gen 4x2 = This is Gen 4 with dual lanes at 40Gbps per lane for a total of 80Gbps. This is marketed as "USB4 80Gbps" or "80" written on peripheral? Speed = 40Gbps/Lane, Lanes=2, Net speed or throughput =80Gbps.
      • USB4 Gen 4x3 = This is Gen 4 with triple lanes at 40Gbps per lane for a total of 120Gbps. This works in Asymmetric mode, where 3 lanes are used for TX and 1 lane for RX or vice versa. Speed = 40Gbps/Lane, Lanes=3, Net speed or throughput =120Gbps.

 

USB connectors:

USB connectors also come in different types (for each type, they may come in different sizes):

1. Type A: This has standard 4 pins. It plugs into downstream facing ports (DFP), i.e host is the source. It came in one size called Standard USB connector. This is the most commonly used USB connector that is seen in USB drives, laptops, etc. Later in 2000, a mini usb connector was released, that was about half the width of standard connector. It was used in camera, Mp3 players, etc, but has been phased out since 2018. A successor to Micro USB is mini usb, which is even smaller and more flatter. This is the most compact form of usb connector, and is seen in phones, tablets, etc. which was flatterIt comes in 2 sizes: Standard and Micro.

Pins:    GND   D+   D-   VBUS => 4 pins 

2. Type B: This also has standard 4 pins. It plugs into upstream facing ports (UFP), i.e device is the sink. Here, the connector size is different. It's square shaped, and is mostly seen in printers.

3. Type C: This is totally new connector with 24 pins, is reversible and is round shaped. As the whole USB arch changed with type C, these required new connectors called as Type C connectors. Unlike Type A and Type B connectors, which came in diff sizes, Type C connectors come in only 1 size. Starting with proper USB 3.2, we need type C connectors to get higher speeds.

 

Pins side 1:    GND        TX1+  TX1-        VBUS           CC1    D+  D-   SBU1          VBUS            RX2-  RX2+         GND  => 12 pins

Pins side 2:    GND        RX1+  RX1-        VBUS          SBU2   D-   D+   CC2           VBUS            TX2-  TX2+         GND  => 12 pins

(NOTE: how pins on lower side are arranged symmetrical to upper side, so that the connector can be reversible)

 

 

  • D+/D- pins are retained to provide USB 2.0 functionality
  • 2 lanes of TX1/RX1 and TX2/RX2 provide dual lane capability to do high speed data xfer for USB 3.0 and above (GHz speeds)
  • SBU1/SBU2 pins are for providing side band signals.
  • CC1/CC2 pins are for providing configuration channel signals (used for PD protocol explained below)

 

USB Protocol:

USB 2.0 and earlier had only 4 pins, with only D+ and D- for data line. Basically data was the only signal sent out, with no associated clock. Data was sent with enough transitions so that a clock could be recovered out of it. This makes it simple to understand the transactions. USB3 and later become overly complicated, and not so easy to understand transactions.

This video connects an oscilloscope to the 2 usb data wires (D+ and D-) going from keyboard to PC, and examines the traffic, and figures out all transactions by manually drawing them on a piece of paper. Excellent video if you want to understand basic packet communication for USB2.

How does a USB keyboard work (by Ben Eater) => https://www.youtube.com/watch?v=wdgULBpRoXk

 

Power Delivery (PD):

With type C came a whole new functionality for power delivery. Until now, USB was primarily for data xfer. However with advent of portable devices that did not need much power to operate, the power pins on such portable devices were omitted. Instead, portable devices started drawing their power from 2 USB pins => VBUS and GND. This was OK in 1990s, as power delivery of 0.5W in USB 1.0 from USB host was sufficient to power these small devices. However, power requirement of these portable devices started going up in early 2000. To accommodate that, USB standards added power delivering capability of up to 2.5W in USB 2.0.

Then battery charging protocol was released in 2010 for USB 2.0 known as BC 1.1. This allowed up to 7.5W power from USB ports. What power to deliver was based on Resistance values on D+/D- pins. Refined BC 1.2 spec was released later. BC protocols are very complex and confusing. We'll not go into more details on those.

PD 1.0:

However, with power requirements for portable devices further increasing, a new spec for power delivery known as PD 1.0 was released. This allowed >7.5W power to be delivered over USB power pins. It was supported over Type A and Type B connectors.  Devices can request higher power from host. Voltages of 5V, 12V and 20V on VBUS were now supported, with currents up to 5A, resulting in 100W max power delivery. However, for V>5V, and I>3A, dedicated power communication pins as CC1/CC2 were needed, which were part of USB Type C spec.

PD 2.0:

With the release of USB 3.1 spec, PD 2.0 was released as part of this spec. It allowed power delivery to happen over USB Type C connectors/cable with special dedicated pin for power delivery communication. These new pins for power related communication were CC1/CC2 pins. Power was delivered over 4 VBUS pins. However for backward compatibility, previous BC1.2 and PD1.0 were still supported over D+/D- pins.

PD 2.0 is :

- single wire protocol on CC wires

- DFP is bus master and initiates all communication

- All msg are 32 bit 4B/5B encoded. It uses BMC (Biphase Mark Coded) encoding, which is a version of Manchester coding.

- It has a Baud rate of 300K (i.e clk rate of 300KHz), so pretty low frequency (wich is OK, since power requirements do not change frequently, i.e in uS)

- It supports CRC error detection + message retries

Out of the 2 configuration channels, CC1/CC2, one of them is used for cable orientation detection, while the other one is used for PD purpose. CC wire for PD communication needs to have valid resistances tied to Power/Gnd. That is how the USB logic figures out which of CC1 or CC2 to use for PD purpose.

CC wire for PD should have 5Kohm resistance tied to GND for UFP (sink device such as mouse), and 10Kohm to 55Kohm resistance tied to VBUS for DFP (host device such as PC). These resistance serve as a voltage divider determining the final voltage level of CC wire. This voltage determines initial current level supported by USB.

Rd = pull down resistance = 5 Kohm

Rp = pull up resistance = 3 different values:

  •  56 Kohm = default = 0.5A @ 5V for USB 2 and 0.9A @ 5V for USB 3. Voltage level on CC wire = 5/(56+5) * 5V = 0.4V
  • 22 Kohm = 1.5A @ 5V. Voltage level on CC wire = 5/(22+5) * 5V = 1.0V
  • 10 Kohm = 3.0A @ 5V. Voltage level on CC wire = 5/(10+5) * 5V = 1.65V

Any voltage > 1.65V on CC wire is taken as no connection, as then the pull down resistance is assumed to be much larger than 5 Kohms (ideally Rd is infinity, and voltage detected on CC wire would be 5V)

Successful attachment of connector would be indicated by presence of a valid voltage on one of the CC wires. that wire would be used for PD communication. Once a default power supply is provided based on resistance values, further PD communication can now happen on CC wire. This PD communication happens via messages sent b/w src and sink. Voltage level on VBUS and higher currents can only be supported after successful negotiation.

PD controller: There is a separate chip called "PD controller" chip that is provided by major vendors as TI, STM, etc that provides all the functionality to deal with PD communication. It takes in D+/D- lines as well as CC1/CC2 lines, and does all power negotiation work to put correct voltage and current on VBUS. High speed data lines go thru another chip which is the main USB data controller chip. D+/D- lines alo go to this main controller chip, as they carry data too. The reason D+/D- go to PD controller chip is to determine power delivery for USB 2.0 (they aren't used for data communication purpose at all in the PD controller chip).

Alternate Mode:

A very useful mode in USB Type C connectors is Alt Mode. Here, it allowed these connectors to support not only native USB mode data xfer, but also alternate mode data xfer (aka AltMode) for other protocols (as Display Port and HDMI protocols) on the same wires. 

Alternate modes are defined and configured via USB PD protocol. Same CC1/CC2 lines are used for AltMode configuration. Structured VDM (vendor defined messages) are used on CC lines to enter AltMode. Unused pins on USB-C are used for Alt Mode of operation.

Display Port (DP) AltMode: This is one of the Alt Mode supported on USB-C. DP protocol requires 4 lanes (8 pins, since differential signals) for data xfer, 1 lane as auxillary channel (2 pins, since differential signals), and 1 wire as HPD (hot plug detect = this line is used by upstream device to detect plugging of downstream device).

DP Alt Mode allows TX1/RX1 and TX2/RX2 lanes to be used as Data lanes for DP, and SBU1/SBU2 to be used as auxillary lanes (since auxillary lanes do not have high speed requirement, these 2 lines can be used as differential lines), and HPD line is provided by the USB PD controller. There is a mux that is controlled by the PD controller. This mux takes data from USB lines, and routes them to either USB contoller (for regular mode) or to Display devices (for AltMode). The 4 data lanes are all unidirectional as display data only goes from source to sink (to be consumed), so all 4 lanes are configured as TX lines. DP is called as simplex protocol (unidirectional xfer), while USB protocol is duplex protocol (bidir xfer).

ThunderBolt3 AltMode: This is another AltMode supported on USB-C for USB4 protocol.

USB4 AltMode: This is yet another AltMode

MultiFunction AltMode: A combination of regular mode on one of the lanes and AltMode on another, i.e USB3.2 + DP
 

 

 

 

openssh: This is the official link: https://www.openssh.com/

There are lot of programs available that allow you to remotely log into your machines. Openssh is open source and most popular on Linux. It has a client server model. So, in order to allow others to log into your machine, you need to install a server program on that machine. This server program keeps on looking for any incoming connections. If it finds an incoming connection, and credentials are valid, it allows you to log into this machine, just as a local user would. On the other computer (client computer) from which you are trying to connect to this server, you need to install a client program of openSSH.

Install:

Cient program of openssh are usually installed on all Lnux systems. We can verify this by typing cmd "which ssh" on terminal. It should show path as /usr/bin/ssh. ssh is the openssh client pgm. Server program of ssh is called "sshd" (ssh daeman) and is not installed by default. We can install it as follows:

On a terminal, type the below cmd:

sudo apt intsall openssh-server => This will install openssh server on your computer.

Now type, "which sshd", and it will show binary executable path as /usr/sbin/sshd.

sshd daeman by default runs on TCP port 22. It starts on boot time.

Syntax ssh/sshd:

ssh cmd syntax here: https://man.openbsd.org/ssh.1

ex: ssh This email address is being protected from spambots. You need JavaScript enabled to view it. => This is used to log into remote m/c maaldaar.com, with user name "hari" on that remote m/c.

sshd cmd syntax here: https://man.openbsd.org/sshd.8

We can manually start/stop sshd, or check status using various cmds (see in "init vs sytemd" section). Here, we'll show by 2 means: systemd based and init based.

1. init based: sudo /etc/init.d/ssh start

2. systemd based: systemctl status sshd

Adding New User for ssh:

If you want to allow any user from any machine to ssh into your server, then you need to create a new user with some name, give that user a password. Then others can login with that username and that password. Password can also be made optional. Follow the steps:

  • Open a new terminal on ssh server m/c and type below cmds:
    • su adduser guest => here "guest" is the user name. It will ask for a new password for this user. It will then add this user, make a home dir for guest at /home/guest.
    • su passwd guest => You can change the password by using this cmd.
    • usermod -aG sudo newuser => This gives sudo access to "guest" user so that he/she can run any root cmd by being superuser. This is very risky and should only be done for trusted users.
  • Once new user has been created on server m/c, log into client machine and make a ssh connection to server m/c:
    • ssh This email address is being protected from spambots. You need JavaScript enabled to view it. => It asks for the password, and if both username and password are correct, then it makes a ssh connection and opens a terminal on server m/c.

 


 

Linux ssh related cmds:

There are many cmds in linux that establish a connection b/w 2 machines. A lot of these are built on top of ssh. Either we establish a sssh before we can use these cmds, or ssh is inbuilt as part of these cmds. Either way sshd should be running on the server m/c or the cmds will fail. Few such cmds are below:

Linux Secure Copy (scp) cmd:

scp is the linux cmd to copy files from one computer to other. It's equivalent of cp or copy cmd, except that it's done to copy files between computers and is done securely so that files can't be seen by any third party. scp uses ssh under the hood, so scp can only work after sshd is installed and running. We need sshd, or server ssh, to be active and running on the remote machine that we are trying to connect to. If it doesn't has sshd running, scp to/from that remote machine won't work. Usage is simple:

scp <src_machine:src_file> <dest_machine:dest_file> => scp cmd asks for user's password on another machine, as it uses ssh for authentication.

ex: user1@laptop1$ scp user2@laptop2:test.txt project/. => This copies the file "test.txt" from remote machine "laptop2" in user2 home dir to "project" subdir of current dir in laptop1. Laptop1 is our local machine and user1 is logged on this machine. He's some dir "dir1". Now file is copied to dir1/project/test.txt.

ex: user1@laptop1$ scp project/test1.txt user2@laptop2:dir2/test2.txt => This is the reverse of above example, where we are copying from local machine (laptop1) to remote machine (laptop2). Here we are copying file test1.txt as test2.txt.

 

Linux remote sync (rsync) cmd: 

rsync is another linux cmd to copy and sync files b/w 2 m/c. rsync is very popular and is  included on most Linux distributions by default.

Detailed link: https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories

syntax: rsync <options> <src_files> <dest files>

Steps:

  • Log into the client m/c (or server m/c). Establish ssh connection b/w the 2 m/c using ssh cmd with correct user name.
  • cd ~; rsync -a ~/dir1/ dir2 => this copies files locally from dir1 to dir2. Since / is at end of dir1, dir1 itself is not copied to dir2. -a copies recursively preserving symbolic links, timestamps, etc. -anv option also used commonly which does a dry run of what the cmd is going to do (-n is for "not do it", -v is for verbose)
  • rsync -a ~/dir1 guest@maaldaar.com:dest_dir => This is push method where we push files from local m/c (~/dir1) to remote m/c (dest_dir)
  • rsync -a This email address is being protected from spambots. You need JavaScript enabled to view it.:/home/guest/dir1 ~/dest_dir => This is pull method where we pull files from remote m/c (/home/guest/dir1) to local m/c (~/dest_dir)

 


 

Other movies, shows and series in USA

Besides the bollywood and hollywood movies, there are many other movies and shows that are released each year, that never go in theatres or on dvds. These are exclusively released to be watched on internet or on any streaming service.

Most popular streaming services are netflix and amazon in USA. Apart from these 2 big players, we also see a lot of small players as HBO Max, Hulu, Roku, Paramount+, etc. Most of them produce their own movies and release it for their subscribers on their own streaming channel (sometimes exclusively). They also show a lot of movies/shows from other channels too (by buying them for a limited time). Many of the Indian shows/movies which are released by netflix or amazon are only available to watch with their subscription services.

Apart from these US streaming providers, a lot of Indian movies and TV/Web series are released by various production houses/channels as Hotstar, Zee TV Sony, etc. Either you have to get subscription services to these individually (usually Hotstar carries a lot of these web series), or you can get IP TV streaming services, which carry most of these. One such streaming service is boxiptv streaming services.

NOTE: Netflix, Amazon have completely different movies and shows available on Netlix India or Amazon India. Those are not available to watch here, unless you have account with netflix India or amazon India. What I'm listing below are only relevant for USA subscribers.

Pricing: Most of the streaming services can be had for almost free or very cheap. I would say that you have to spend more than $5/month for any streaming service, you are paying too much.

Popular subscription services:

Netflix:

Netflix subscription costs about $15/month for 2 screens, so can be shared b/w 2 people, for a cost of $90/year per person. Or you can upgrade to 4 screens and 4K content for $3/month more (As of Jan, 2022, it's $20/month for 4 screens). It has a small selection of Indian movies and Indian documentaries, on top of American movies and series. With Netflix prices going up by 10% every year, I don't think Netflix is worth the $100/year that you are going to pay. I would suggest that if you really want to watch netflix, just sign up for their 1 month free trial (witha junk email address), watch everything that you want, and then cancel it after 30 days. That way you don't get charged anything. Next time around, sign up with a different email address, and again get a free month of netflix. Keep on repeating this for ever. To get around the "changing address" with each new sign up, you can just buy prepaid debit cards, and assign any address to them, and use them for sign up.

UPDATE Aug 2023: Netflix raises prices by $1/month every year, so now it stands at $25/month with taxes. On top of that they don't allow to share b/w 2 different households (may be they figure it out based on IP addr. They do allow once a month or something to log in from another IP addr, but that might change too). So, it's horribly expensive compared to other streaming services out there. I would advise to just cancel Netflix and sign up for cheaper options as Amazon, Paramount, Disney, etc. In Oct 2024, they mentioned that their gross margins will be 40%-50% matching cable TV profit margins. Basically meaning that streaming is as expensive as cable now, the exact companies that they were meant to replace because of higher fees. May be time to switch back to cable to save money :)

Netflix Gift Cards: A lot of times Netflix Giftcards go on sale for 10% or 20% off (a places like BestBuy CVS, Walgreens, Grocery stores, etc). You can search on slickdeals.net for those offers. Be sure to apply these GC to your Netflix account immediately on receiving them, as there have been datapoints on these getting hacked. So with GC you are effecively getting 10%-20% discount. One thing to note is that once applied to your account, you don't get a refund even if you cancel your service earlier. So, no matter how much Netflix raise the prices by, you have to keep on paying, until all the balance in your account is drained out. You can't transfer the amount to any other account either. So, be careful with how much Netflix GC you want to accumulate.

Amazon:

Amazon video content (movies, shows, etc) subscription is included with amazon prime membership. Amazon has been late to the game, but now is putting a lot of quality content in Hindi too. It's worth watching since it's all for free (with Prime membership). Netflix raises it's price every year, which doesn't digest with me. So, I prefer amazon over netflix. Also, all 4K content in included with basic plan of amazon prime, unlike Netflix, where you have to take their higher paying plan to watch 4K. Just like Netflix, it has it's own shows, series, movies which are exclusively shown on Amazon only.

HBO Max:

HBO Max is another subscription service provided by HBO. HBO Max goes for $70/year subscription charge for ad supported streaming. However, most of the times you can get credit from Amex (if you have Amex credit card), or other coupons or use cash back sites to lower your cost. HBOMax used to be included free with high speed AT&T internet services (not anymore as of Sep 2022). There are a lot of pouplar american movies on hbomax. NOTE: hbomax was parimarily a movie channel, so it makes sense that they have the largest collection of most popular movies. They also have very good original tv shows, which i didn't know about at all. This is one the popular subscriptions for watching Hollywood movies.

Paramount+ (Previously known as CBS All Access):

Paramount+ is a streaming subscription service provided by Paramount Global. IT has a decent collection of good shows, movies etc. The best part is that you can always find coupons for Paramount+, which allows you to keep watching for free month after month. May of these coupons work for existing subscribers too, so you don't have to create new accounts. A nice link listing all coupons is here:

https://www.doctorofcredit.com/free-month-of-cbs-all-access-with-promo-code-giving-works-for-new-existing-previous-users/

 Paramount+ is also available for discounts from time to time. One such 50% ff promo for full year is here ($25 for full year for Essentials basic package):

https://slickdeals.net/f/16104523-1-year-paramount-streaming-service-premium-50-or-essential-25-new-or-returning-members?src=frontpage

Peacock:

Peacock is other streaming service. It's provided by NBC Universal. It launched in 2020, and already has 50M subscribers. It has a ad supported version that's available for free. It's premium paid version has 2 forms: premium with ads and premium plus with no ads. Premium and Premium has more content than free version. So, if you want to watch something which is only on premium version, you can get those for cheap as they have sale/discounts from time to time. One such offer is here ($20 for full year for premium package):

https://slickdeals.net/f/16100038-new-subscribers-only-1-year-peacock-tv-premium-streaming-service-20-valid-thru-11-19?src=frontpage

HotStar, Zee5, etc:

These are all available on Boss IPTV, or can be purchased separately. They have only Indian series, shows, etc.

 

Web Series and Movies on Amazon, Netflix, Zee5, Hotstar, etc

 


 

Indian TV Web series:

I'm listing only hindi language web series below. Many Indian web series or TV series are produced by amazon and netflix and can be watched on their streaming platform. But besides those, many others are released by media houses as Zee5, Hotstar, etc. The most reliable place to watch these is on bossiptv, rahul ip tv or hundreds of other IPTV streaming services. You can find hundreds of such web series over there. Many of them have multiple season, with each season having 10-15 episodes. So, these web series can easily be anywhere from 3 hours to 20 hours.

Here's a good link for top web series: https://en.wikipedia.org/wiki/Category:Indian_web_series

Hindi web series are here: https://en.wikipedia.org/wiki/Category:Hindi-language_web_series

This is the list of Top 50 Hindi web series: https://www.imdb.com/list/ls568832700/

TVF (The Viral Fever): This is a VOD channel, that produces Original web series. They used to be on Youtube, but became very popular, and started making series for big media companies as Netflix, etc. All of their series are worth watching, as it's one of the highest quality hindi web series you can watch. Wiki => https://en.wikipedia.org/wiki/The_Viral_Fever

Below are few selected ones that I enjoyed. If you don't like what you see here, then your taste is different than mine, so the list isn't of any use to you. I'm listing web series below which are filmed in style of a serial or movie. Documentaries are listed separately later.

 

2025:

Bada Naam Karenge: Released on Sony Liv and produced by Rajshree Productions, it's a very simple yet captivating teenage love story. As always, high quality and refreshing story line around love providing wholesome family entertainment typical of Rajshree. It's total of 9 episodes for season 1. You will enjoy it !!

Dabba Cartel: Released on Netflix, this is a drama series on a dabba wala girl running a business delivering food. It's not directly on dabbawala, but the character happens to be in dabbawala profession.

Gram Chikitsalaya: Created by TVF, and released on Amazon Prime, it's a series on a doctor trying to work in a village. It's similar to Panchayat, though not as superb. Still a good watch.

Dupahiya: Released on Amazon Prime, it's a comedy series set in a village about the stealing of a bike. Above avg comedy and story.

Lafangay: Released on Amazon MX Player (in India), it's a well knit story around 3 friends living with their parents and their struggles. It's little comical, but more drama and emotions. Keeps you tied.

Black Warrant: Released on Netflix,this is based on true real life experiences of a jailer in Tihar jail. Every episode has a different incident happening at Tihar, which keeps it exciting.

13th: Some Lessons Aren't Taught in Classrooms: Released on SonyLiv, this is inspired by life of famous Indian educator, Mohit Tyagi, who provides IIT coaching. It revolves around him and his student who want to venture into Ed Tech startup. Inspiring and well directed story.

 

2024:

Very Parivarik: TVF series. Very funny day to day comedy about a middle class couple who have the boy's parents come and live with them in a big city. Released in 2024.

Jamnapaar:  Amazon Mini TV Web series (The India one). This is about a middle class family, with their son trying trying to be a CA (Chartered Accountant), and his struggles. Very light hearted and fun to watch.

Lootere:  Released by Disney/Hotstar, it's one of the best directed series based on a ship taken hostage by pirates. Lots of blood and sequence of events keep you glued to your set. It's picturized in Somalia, and scenes look stunning.

Prachand Ashok:  Produced by Balaji Telefilms and originally released on Colors. It's very nicely directed series on Mauryan King Ashok's life. 39 episodes with each lasting 30 min or less.

IC814: The Kandahar Hijack Streaming on Netflix, it's based on true hijack story of IC814 in 1999. It's nicely directed series. Total 6 episodes.

 

2023:

Trial by Fire: Netflix series based on the true incident of fire in a movie hall in Delhi in which 60 people were killed. Starring Abhay Deol, it's a fictitious story of a couple who lost both their kids in this fire, and their fight for justice. Very nicely put together. It has total of 7 episodes lasting for a total of 5 hrs or more.

Pop Kaun?: Released by Hotstar series, it's an above avg comedy about a guy trying to find out his real father, and very funny events around it. It stars Kunal Khemu. I enjoyed it as it had an additional twist in the end. "Pop Kaun" pop song is humorous too.

United Kacche: Released by Zee5, it's a good comedy about a person who migrates to UK, and lives with illegal immigrants, works illegally and keeps on getting in trouble. It stars "Sunil Grover" from Kapil Sharma Show, and is directed in a very humorous way. The end is little abrupt.

Taj: Divided by blood: Released by Zee5, it's a historical drama based on Akbar and his 3 sons. It's very nicely photographed and directed.

Dahaad: Streamed on Amazon Prime, it's one of the finest thrillers starring Sonakshi Sinha. It is about a serial killer in the state of Rajasthan. All 8 episodes are just captivating, Can't miss !!

Half CA: Produced by TVF, and streamed on Amazon MiniTV (which is free on Amazon India app), it's a great series showing the struggles of kids preparing for CA (chartered Accountant) exam. Other series focus on more popular JEE and Engineering exams, but this gives a fresh view on equally hard CA exams for Commerce students.

Kohrra: Streamed on Netflix, this is another superb crime thriller involving the murder of an NRI bridegroom.

Aakhri Sach: Released by HotStar, this is an amazing crime thriller loosely based on the real story of mass suicide committed by a family. Keeps you on the edge.

The Railway Men: Netflix series based on true event of "Bhopal Gas tragedy of 1984", and how few heroes from Indian Railway saved thousands of lives evacuating people. Total 4 episodes of 1 hour each. Superb direction and heart wrenching plot. Keeps glued to the end.

Taaza Khabar: Disney+Hotstar series based on BB getting a blessing of getting Khabar early, which he uses to his advantage/disadvantage. 1st season is 6 episodes. 2nd season came out in 2024 with 6 episodes. It's highly rated on IMDB, but it's a below avg series. Part 1 is still ok, but Part 2 goes downhill pretty fast. I included it because it's constantly getting rated  as Top 50 Hindi series. probably because of BB popularity on youtube (see Dhindora below). Watch it if you run out of things to watch !!

UP 65: Released on Jio TV, it's about student life in a engineering college named "IIT-BHU". Very Comic series, though novelty is wearing out with so many similar hostel series coming out.

Guns and Gulaabs: Released on Netflix, starring Raj Kumar Rao, it's a chaotic story about gang killing, and a youngster caught into all of this with his dad's murder. Very entertaining and very different story. Ending is also superb.

 

2022:

Yeh Kaali Kaali Aankhen: Netfix series with lots of twists, on love, hate and crime. Lots of suspense and surprising twists all along. 2 seasons. Season 1 ends on a cliffhanger, Season 2 is supposed to come later.

Human: Disney/Hotstar series based on new drug development by a medical pharma, and associated crimes. Thrilling to the end.

The Great wedding of Munnes: Produced by Jio Studios. It's a very charming and enjoyable comedy that came after a long time. It's about a guy looking to get married, and the troubles he runs into. Worth watching !!

The Great Indian Murder: Produced by Disney+Hotstar, it's based on novel "The Six Suspects". Thrilling movie about a murder, where the unsuspecting murderer is revealed at the end. Above avg Thrilling series.

Physics Wallah: Produced by Amazon Mini TV (Amazon India), it's based on real life of Alakh Pandey, who started his Physics Coaching classes with unconventional teaching. As of 2025, his company is one of the rare unicorns in Edtech field in India.

The Fame Game: Produced by Netflix, it stars Madhuri Dixit in lead role, who is a superstar in the series. It's a mystery drama about her disappearance which keeps you tied to your seat, until the end. However, the plot itself andthe end looks bizarre. 

 

2021:

The Empire: Released by HotStar, It has stunning visuals. It's based on the story of Babur and his journey to establishing his kingdom in India. Very nicely portrayed in 8 episodes of Season 1. Each episode is around 45 minutes. Worth the watch.

Aranyak: Released by Netflix. Very thrilling and suspenseful story about a series of murders with mix of mythical character. Features Raveena Tandon and Ashutosh rana. Keeps you glued to the end.

Gullak: Released by Sony Liv, Gullak is a very charming web series of a poor middle class family, and day to day drama. It's serious comedy and lots of fun to watch. It has 4 seasons. 1s season came out in 2019, 2nd season in 2021, followed by 3rd season in 2022 and 4th in 2024. It has 5-6 episodes per season, but each episode is 30 minutes or so.

Metro Park: An Eros Now series, it's a very simple and entertaining series about a Gujarati couple with 2 kids living in NJ, USA. It has 2 seasons. 1st season came out in 2018, while 2nd season in 2021. Both seasons are superb depicting day to day comic activities. Enjoyed it thoroughly. Worth watching for sure !! Not sure, why it's not mentioned in any of the top 50 list.

Maharani: Sony Live series. If you enjoy movies on politics, you will definitely enjoy this series. It's based on politics in Bihar, where an uneducated wife of current chief minister is sworn in as chief minister. Season 1 came out out in 2021. The ending was left open, leading to season 2 in 2022, which was equally entertaining.

Decoupled: Netflix romantic comedy series. It's very funny, and talks about day to day things happening in a not so successful married couples life, featuring Madhavan.

Aspirants: Produced by TVF and streamed on Amazon Prime, it's a story about 3 friends preparing for IAS (UPSC) exams. Superbly directed showing the struggles and the afterlife of an IAS. 2nd season released in 2023. Very captivating.

Sunflower: It's a ZEE5 original series revolving around a murder mystery in a middle class apartment complex called "SunFlower". It's superbly funny with lots of twists, nonsense/dumb events and definitely not to be missed. Must watch !! Second series came out out in 2024.

Dhindora: It's on YouTube only. The producer is Bhuvan Bam (BB) who has a comedy channel on youtube called "BB Ki Vines". This is released on that channel. It's top rated on IMDB. It is full of foul language, but is a good nonsense thriller comedy series about a person winning a lottery, and everyone wanting a part of it. BB plays most of the important roles himself, which makes it more like cheap youtube shorts. "BB Ki Vines" Channel also has lot of 1 episode comedy on various topics, which are fun to watch too. There is

 

2020:

Aarya: Released by Hotstar, it's a real thriller with very surprising ending for the 1st season. Sushmita Sen is the lead character as Aarya. Season 2 came out in 2021, followed by Season 3 in 2023 and 2024.

Welcome Home: Released by Sony Liv, a very entertaining psychological thriller based on a true story. Start is slow, but movie picks up steam pretty quickly.

A Simple Murder: Released by Sony Liv, a very entertaining comical thriller about a murder gone wrong.

jamtara: Released by Netflix. good storyline about phishing in India. Lots of indian maa/bahen gaali if you miss that !!

Your Honor: Released by Sony Liv, it's a another nice thriller with a very unexpected ending

Panchayat: Released by amazon. Very nice light hearted movie about a educated guy getting a govt job in a village. Worth watching !!

Scam 1992: The Harshad Mehta Story: Fantastic web series based on true story of Harshad Mehta who most believe caused the 1992 stock market crash. Very entertaining and kind of makes you feel bad for Harshad.

Mirzapur: Released by Amazon. A story about crimes and don, it's very gripping and keeps you hooked till the end. It has 3 seasons, 1st was released in 2018, while 2nd season came in 2020. 3rd season came out in 2024. It's a dark story, with deaths and revenge. 1st season leaves you in a limbo, and 2nd season leaves you in a limbo too. May be 3rd season takes you out of that. Still worth your time.

Breathe: Into the shadows: Released by amazon. This stars Abhisekh bachann, and was one of the highly anticipated series of 2020. It is released as the sequel to Breathe season 1 that was released in 2018. Except for the cast that is mostly the same from season 1, there is no connection to the previous season story. However, the plot is very captivating about the kidnap of a couple's daughter. Breathe season 1 seemed better in terms of how the whole story was tied together. Still worth watching.

Undekhi: Released by sony Liv, it's a very good crime and thriller plot. It's based on true events, and is about a killing of a girl in a wedding, and subsequent drama. The end is disappointing, but it will keep you to the edge till the very end.Season 2 of this came out in 2022.

MannphodGanj Ki Binni: Sweet romantic and comic story about a young girl and her family in a small city. It shows typical day to day family activities, lovers, loafers, fights, etc.

Ashram: This is one of the must watch series about a baba, his huge following and power. This is based on a true story. It has 2 seasons. 2nd season came out towards end of 2020, while first season came out during mid 2020. The 2nd season left possibility of more season coming, as the story didn't end. However, the series is very interesting. Must watch.

Dangerous: There are more than one movie and web series with same name. This stars Bipasha Basu and her husband Karan Singh Grover. It's a nice thriller about the kidnapping of a person's wife in London. It's an above average movie, but has good scenes (if you know what I mean).

Pariwar: This is a comic Hotstar web series. It has 6 episodes totaling around 2 hours. It's very light hearted comedy about a old guy donating his land and his 3 grown up kids wanting a part of it. Definitely a above avg comedy with highly experienced starcast.

Hostages: A very long web series from Hotstar. It has 2 seasons with about 14 episodes each. It's about a doctor being held hostage, and a lot of drama around it. it's a very high paced movie, and keeps you stuck to your seat. However, the story itself is hard to follow, and made little sense. Nevertheless worth watching just for the high drama.

Asur: It's a long thriller web series. May be watched once for the high drama and starcast. Definitely keeps you glued. However, the story looked all non sense and hotch-potch to me.

 

2019:

Kota Factory: Released by amazon. This is based on the story of how all IIT-JEE aspiraants go to Kota for preparation, and their struggles in a very comic and real way. It will be enjoyed by people who have ever prepared for entrance exams in India. Season 2 of this came out in 2021, which is just as interesting.

Virgin Bhaskar: It's an adult comedy, but has barely any scenes. It's about a virgin boy falling in love with a girl. It has 2 seasons. Season 2 came out in 2020. It's an above average comedy, with some nice direction.

Delhi crime: netflix documentary about rape case in delhi on a bus. Multiple episodes

Hostel Daze: It's more relate able to people who have studied in an engineering college. It's an above average comedy about different activities that goes on in boys engineering college. It will keep you entertained till the end. Worth watching once.

Mind The Malhotras: Released on Amazon, it's a nice comedy based on a family where husband/wife are going thru mid life crisis, and funny day to day things going on in the family. Season 1 came out in 2019, followed by season 2 in 2022.

Criminal Justice (multiple seasons): Released on Hotstar, it's a crime thriller, that keeps you hooked till the end. Very nice story and direction. There are 4 seasons, with 4 different stories, all in the courtroom with lawyers fighting to save their client. The first season "Criminal Justice" was released in 2019. It is about an innocent guy indicted for murder, and his tortures in jail. The 2nd season "Criminal Justice: Behind closed doors" was released in 2020, which is about a wife murdering her husband. The 3rd season "Criminal Justice: Adhura Saach" was released in 2022, where a teenage boy is convicted of her sister's murder. The 4th season "Criminal Justice: Adhura Saach" was released in 2025, where a father is convicted of murdering the nurse who as taking care of his daughter.  

Hey Prabhu: Released on MX Player, it's a comedy web series. Very funny story around a 26 yr old living with his parents, who's working in a creative job, and his day to day activities in and out of office. The next season "Hey Prabhu 2" came out in 2021.

The Family Man: Released on Amazon, it was a hit show about a family man (Manoj Bajpayee) who works in a regular job, but is in fact a secret agent for NSA trying to protect the country. It has 19 episodes. I didn't find it interesting at all, but keeping it in the list for completeness.

 

2018:

Breathe: Released by Amazon. Thrilling story with a very unique plot, about how far a father goes to save his only son.

Damaged: Fatal Pursuit of Love: A very captivating thriller about a serial killer. Dark story, but keeps you stuck to your seat. It's 2nd season came out in 2019 named "Damaged 2: Love has it's secret". This is a completely different story, and has no relation to the 1st season. It's a much smaller series with just 6 episodes of over 1 hour total in length.

Swami Baba Ramdev: the untold story:  netflix documentary (FIXME: yet to watch)

Sacred Games:  One of the first highly popular Indian series released by Netflix. set around crime but fascinating and adult content. Not for everyone, with so much bloodshed and foul language.

Yeh Meri Family: Released by TVF. This is  a very light hearted comic story about a family living in 1990's. It's nostalgic and nicely directed. 1st season had 7 episodes.

Akoori: Released by Zee5. A light heart movie about a old guy and his two adult kids, who are about to lose their home. Nice comic twist of events. Feels good to watch.

 

2016:

Humorously Yours: Produced by TVF and released on mini TV series (amazon India), it's a very nicely made comedy about a young stand-up comedian and his struggles. Season 2 came out in 2019.

 

2015:

Bang Baaja Baaraat: Released by Amazon. Very hilarious movie about a marriage event. With parents on both sides involved, events take unexpected turns. Good adult subtle comedy, definitely on top of pack of comedy movies. Must watch.

TVF Pitchers: Produced by TVF and released on TVF Play and later on Youtube, it's a very nice and humorous plot of a startup started by 4 guys. It was single handed developed by the founder of TVF, Arunabh Kumar who also acts in this series. 2nd season came out in 2022 and was released on Zee5. Both series are directed very well.

 

2014: (Start of Web Series in India)

Permanent Roommates: Produced  by TVF, it's a humorous comedy on a young boyfriend girlfriend relation. it was the first web series in India, and was released on youtube. The second season was released in 2016 on TVF Play, TVF's own streaming medium. 3rd season in released in 2023 on Amazon Prime. 

 

2013: (Traditional Series until 2013)

Buddha (Rajaon ka Raja):  Original release was on Zee TV and DD. Later it aired on Netflix (As of 2023, it's NOT on netflix nor or any other channel). It's an epic serial, 55 episodes, beautifully picturized story about Buddha. Must watch for all ages.

Mahabharat (Star Plus):  This was produced by Swastik Production, and aired on StarPlus. It's available on Disney+ Hotstar. It starts with Shantanu, the father of Bhisma.  It had 267 episodes and ran for a year. It is one of the best portrayal of epic Mahabharat. This is better picturized than B.R.Chopra's Mahabharat that was aired in 1988. I've never seen Mahabharat portrayed anything better than this anywhere. Must watch for all ages.

 


 

USA TV Web series:

I'm listing all American Web series here that you can watch on Netflix, Amazon, HboMax etc.

Netflix: Top 150 netflix series (mostly american): https://editorial.rottentomatoes.com/guide/best-netflix-shows-and-movies-to-binge-watch-now/

Amazon: Below is the list of best web series on amazon as per rotten tomatoes https://editorial.rottentomatoes.com/guide/best-tv-shows-and-movies-original-to-amazon-prime-video/

HBO max: Best series to watch, produced or released by hbomax. Only English web series available. https://editorial.rottentomatoes.com/guide/the-best-hbo-max-shows-to-stream-now/

Misc: There are many other channels like NBC, CBS, ABC, etc where you can watch other webseries. However, most of the popular web series are above 3 platforms, so no need to waste time and money subscribing to 100's of streaming services.

2025:

Don't Die: A man who wants to live forever => On netflix. it's a documentary on real life story of multi Millionaire Bryan Johnson and his project Blueprint, where he's trying multiple things on his body to live forever. Very popular and interesting topic.

2020:

Tiger king => On netflix. real life story of a zookeeeper keeping 200 tigers.

The speed cubers => On netflix. This is a very short 40 minute documentary on speed cubing - solving 3x3 rubik's cube fastest. This documentary covers the fascinating world championship of speed cubing. Definitely something new and interesting.

Never Have I ever (2 seasons, Indian actors)=> On netflix. A fun charming movie about a teenage Indian girl, Devi, in USA and her high school life with lots of drama. It's decent enjoyable  comic series to watch. 2nd season came out in 2021. Equally entertaining.

The social dilemma => On netflix. A very good netflix documentary on harmful effects of social networks on our lives, right from mouths of inventors of these platforms. enlightening and fascinating

Bad Boy Billionaires (India) => On netflix. This documentary shows the rise and fall of 3 flamboyant (i.e bad) billionaires in India.

2019:

Inside Bill's Brain => On netflix. Nice documentary on what goes on inside Bill Gates brain, Perpective from Bill himself, as well as his wife, colleagues. It came before his divorce announcement, so wifey had good things to talk about him :)

Unbelieveable => On netflix. A nice cop, rapist and victim story. It's one of those thrilling murder investigation kind of series, nothing unexpected. 8 episodes in total keeps you busy. A decent series.

2018:

Wild Wild Country => On netflix. An eye opening documentary on ashram of Osho Rajneesh, a self proclaimed Bhagwan in 80's. It's based on interviews, but is picturized nicely. Osho Rajneesh became very popular in 80's with his radical ideas of free sex.

Mars => On netflix. TV series about Mars expedition, and people trying to live there. 2 seasons, 1st season came in 2016, 2nd season in 2018. Superb scenes, keeps you glued.

2017:

Saving Capitalism => On netflix. Nice documentary on how capitalism is destroying lives of people. My own views of Capitalism are different  than what's projected in movie, but the end effect is the same: gap between rich and poor widens.

Young Sheldon: On HBO Max. It premiered on CBS. 7 seasons long, with 1st season in 2017. 5th season came out in 2021. It's a prequel to very popular TV series "Big Bang Theory".  It's very comic series about a 9 year old genius kid, Sheldon, and funny events happening around him. It's on real life character, Sheldon who was a physicist and went on to win noble prize. The grown up kid from this series is the "Sheldon" in "Big Bang Theory". Both series can be watched independently. I found it very comic and worth watching. Not sure why it's not rated that high on internet. Here's a link: https://en.wikipedia.org/wiki/Young_Sheldon

2015:

master of none (2 seasons with 10 episodes each, Indian actors) => On netflix. great storyline about an indian immigrant, and his life. Rotten Tomatoes rates it at 100% (max possible rating !!)

2014: 

silicon valley: On HBO Max. This is rated R due to language, but is a must watch for it's witty plot on silicon valley startups. It's first season came out in 2014, and then a new season every year until 2019. It has 6 seasons so far. More details here: https://www.rottentomatoes.com/tv/silicon_valley

2013:

Orange is the new black => On netflix. american series about life of a lady in prison. Was one of the most popular shows of it's time

2011:

shameless => On netflix. good unpeculiar comic tragic show. It keeps you tied to the end. Watch it for nudity if not for anything else !!

2010:

The social network => story about facebook founder and the early history of facebook. Nicely directed.

2007:

Big Bang Theory => On HBO Max. It premiered on CBS. 12 seasons long, with 1st season in 2007. Final concluding season came out in 2017. It's one of the most hilarious TV series about a couple of very genius males, and their desperation for girls among other things. You have to watch it more than once to get all the funny stuff. Absolutely must watch. It started as not so popular, but quickly rose to number 1 in popularity. Here's a link: https://en.wikipedia.org/wiki/The_Big_Bang_Theory

2005:

The office => On netflix. It was first made in UK. It's US adaptation was the most popular and aired on NBC from 2005 to 2013. It ran for 9 seasons for a total of 201 episodes. It's about comical events happening in a office space, and became the top streamed show on Netflix in 2019. It's a very comical show, and again one of the hit sitcoms.

1994:

Friends => On HBO Max. It premiered on NBC from 1994 to 2004. It has 236 episodes from 10 seasons. The show revolves around 6 young friends and comical events around them, with some reomance thrown in between. One of the most famous sitcom, especially among young people. It was the most watched television shows of 2000s.

1989:

Seinfield: => On netflix. It premiered on NBC from 1989 to 1998. It has 180 episodes. One of the best comical shows about 4 friends living in a city trying to demean each other. It started very poorly, but became one of the most watched sitcom in history.

 

 


 

Nature/Wild life series:

Some of the best nature wild life series are on netflix. It would be a shame to not watch these, as they capture the finest natural scenes. David Attenborough has made a lot of these, and these are some of the highest quality documentary that will get you attached to these series, even though you may not be the type of person who usually watches these kind of shows ..

This lists some of his series which are also shown below (year released followed by the name of the series): https://www.imdb.com/name/nm0041003

2019: Our planet => consistently in top 100 of all time best netflix originals

2017: Blue Planet II

2013: Rise of Animals: Triumph of the vertebrates (2 episodes)

2013: Africa => 6 episodes

2011: Frozen Planet

2009: Charles Darwin and the tree of life

2006: Planet earth

2003: Deep blue

2002-2003: The life of mammals (10 episodes)

2001: The Blue Planet

1984: The living planet (12 episodes)

1979: Life on earth (13 episodes)

 


 

Movies (Bollywood/Hollywood):

Movies are listed under "Hollwood/Bollywood" section.I'm listing movie links again here, with links to best movies, etc on these channels. These are just quick way to find out best movies available to watch on your channel. Many of these links are updated every month, so what you see there should be what's available.

Netflix Bollywood: These are popular movies available on netflix USA site (netlix.com) as of Sept, 2019. This site lists all movies on netflix USA: https://www.finder.com/netflix-movies

It lists Bollywood movies separately (by selecting "Bollywood movies" under "genre"). There is no way to search for all bollywood movies on netflix, unless you know the name of the movie. Complicating matters is that different hindi movies are on USA netflix website and Indian netflix website . So, above link is good resource (it seems outdated as many movies listed here are not available on netflix anymore).

Another good updated link with all bollywood movies streaming on netflix USA: https://accessbollywood.net/bollywood-movies-streaming-on-netflix/.

Another link is: http://bestonnetflix.com/genre/bollywood-movies/g/5480.

Bollywood movies on netflix:

I've listed primarily Bollywood movies below available on netflix USA. Most of these movies are already listed under "Bollywood movies" section. Bollywood movies may include netlflix movies too (may be in english too, but with Indian actors). Movies get added/removed frequently on netflix(at least once every month), so this list will keep changing. Hard to keep up :(

2019: badla, mere pyare prime minister, thackerey,

2018: andhadhun, padman, sanju, parmanu: The story of Pokhran, ladies first (netflix documentary, 1 episode), lust stories (netflix original), rajma chawal (netflix original)

2017: drishyam, mom, baahubali 2, secret superstar, toilet: ek prem katha, kaabil,

2016: dangal, pink, budia singh: born to run, neerja, airlift, moh maya money

2015: baahubali, masaan, piku, talvar

2014: PK, queen, The Shaukeens

2013: madras cafe, ugly, special 26, fandry,  6-5=2 (FIXME, yet to watch), ankur arora murder case,

2012: paan singh tomar, shahid, OMG: oh my god, bol bachchan, fatso

2011: no one killed jessica, dhobi ghaat(FIXME, yet to watch),, delhi belly, pyaar ka punchnama, singham, saheb biwi aur gangster, shor in the city, ready, tanu weds manu

2010: do dooni char, tere bin laden, peepli live, love sex aur dhoka, we are family

2009: 3 idiots, rocket singh: salesman of the year, well done abba,

2008: jodha akbar, EMI, shourya: it takes courage to make right .. right, A wednesday, ghazini

2007: taare zameen par, guru, jab we met, namastey london, Shootout at Lokhandwala, laaga chunari me daag, johnny gaddar, Bhool Bhulaiyaa

2006: rang de basanti, khosla ka ghosla, malammal weekly, baabul, pyaar ke side effects

2005: sarkar, paheli, no entry, kya kool hai hum, bunty aur babli, main meri patni aur woh,

2004: Khakee, swades, veer zaara,

2003: Hazaaron Khwaishein Aisi (FIXME< yet to watch),

2002: legend of Bhagat Singh, saathiya

2001: Lagaan, Kyo Kii... Main Jhuth Nahin Bolta,

2000: hamaara dil appke paas hai, pukar

1999: Taal, hum saath saath hain,

1997: pardes,

1996: raja hindustani,

1994: andaaz apna apna

Netflix Hollywood: These keep changing, but here's a link for top 250 hollywood movies on netflix:https://editorial.rottentomatoes.com/guide/best-netflix-movies-to-watch-right-now/

Best comedy movies: https://www.ranker.com/list/best-netflix-original-comedies/ranker-streaming

Amazon: This link has top 100 movies on amazon as per "rotten tomatoes". https://editorial.rottentomatoes.com/guide/best-movies-on-amazon-prime-right-now/

HBOMax:This link has top 100 movies on hbomax as per "rotten tomatoes". https://editorial.rottentomatoes.com/guide/best-movies-on-hbo-max/