Hi thanks for your question.
From the symptoms which you have described,it looks like most probably your having eighther haemorrides(pile mass) or peri anal abscess
I would suggest you to avoid constipation
by taking plenty of fresh vegetables and fruits.
Get yourself examined by a physician who may perform proctoscopy/sigmoidoscopy
(looking at your anus, rectum and last segment of colon with a scope) on you to differentiate between anal abscess and pile.mass.
In case of abscess incision drainage
is advised and in case of pile,intially conservative treatment is advised,followed by surgery if needed.
Hope this answers your question.