There are several possibilities. You should make an appointment with a urologist for an accurate diagnosis.
Her is some info related to hernia:
http://www.mayoclinic.com/health/inguinal-hernia/DS00364
Infection of the epidydimis with bacteria causes redness and painful swelling called epidydimitis. The bacteria are usually the same ones that cause infection of the urine and they reach the testicles by travelling up through the penis. This type of infection may be confused with a twisted cord, as both cause a swollen and red scrotum.
Infections of the testicles are treated with antibiotics and a scrotal support to prevent painful movement of the testicles.
If the spermatic cord becomes twisted, it produces swelling and tenderness on one side of the scrotum. This is known as "torsion of the testicle". It is intensely painful and leads to swelling in the scrotum. If the twist is not reversed, the blood is not able to reach the testicle, which can die as a result. These twists are more common in people who have had a twisted cord before, or who have undescended or underdeveloped testes
Sometimes fluid can collect in the scrotum, to produce a large swelling called a hydrocele (pronounced high- drow-seal), which is usually painless. In most cases the reason why the fluid collects is not known. Some babies are born with a hydrocele, which often occur if the baby has a hernia. However, most hydroceles occur in adults, and are more common in older men.
Hydrocele can be left untreated if they are not causing discomfort. Alternatively, they can be drained with a needle and syringe, although the sac of the hydrocele may fill with fluid again after a few months. The only permanent treatment is removal of the hydrocele by a small operation