Hi ! The swelling could be a benign cyst
from the skin or subcutaneous tissue
around the testis, or it may be a benign cyst attached to the testis by a stalk. This swelling could also be from epididymis
, but as you say it is not attahced to the testis and so this can be excluded. Anyway, such benign cysts are harmless, but if it is subjected to trauma, they by the way of inflammation give rise to pain and discomfort. For the sake of diagnosis, your doctor may advise you for an ultrasound
of both the testicles. He may also prescribe for you a good scrotal support, some antibiotic and anti inflammatory drugs along with advice for rest during the period. Hopefully this information helps you in getting yourself treated. Good luck.