If absolute realism isn't necessarily the goal, I'd use Illustrator for this. Although, you can get pretty close to realism with enough care.
You can simply use a Gradient on a path in Illustrator....
The gradient stops have varying opacities.
If you want to be more intricate with the "tubelike" appearance you could use an Artbrush.
Draw two rectangles on top of each other - one black with a white rectangle on top.
Select both rectangles and choose
Object > Blend > Make
Select each rectangle individually with the Direct Selection tool and adjust its opacity.
Drag the Blend to the Brush Panel and create an Artbrush of the blend.
Apply that Artbrush to a path.
You'll need to split and align paths for any "overlaps" of the tube. But that shouldn't be too difficult. (The circle shape above is actually 2 paths to accommodate the overlap)
Then, if you need it in Photoshop, copy/paste.
The blend in the Artbrush can slow the appearance redrawing in Illustrator. What I've shown here is a simple 2 object blend and it still takes a couple seconds for AICS6 to draw the shape (CC may be better). It is possible to take more care with the blend for added realism, it will simply be slower to redraw.
I did think this may be possible with stroking paths in Photoshop and a custom brush, but, well, that proved to be more troubling and time consuming due to how Photoshop brushes work. I lost interest in trying to sort it out in Photoshop alone.