Where do you measure a barrel or gas hole from?

I can’t remember where to start your measurement from to see if the gas hole drilled in the barrel is carbine or midlength. Does it measure from the back of the extension or the front “ring”. I’m not sure the term. Anyway, is the barrel length measured from the same location as well?

Thanks.

CAR length is 6.75" from the front of the extension to the gas block shoulder.

Mid is 8.75"

https://www.m4carbine.net/showthread.php?t=62645