maybe you have to see your dentist
Hello~
I would see your dentist as soon as possible, it sounds like you are getting an infection of the gums, this needs to looked into soon.
You may be suffering from a tooth gum infection that has involved the nerves around. Or may be the ulcer has got infected and has caused some infection plus inflammation around. You must get diagnosed in person by a doctor who may prescribe the necessary antibiotics or anti inflammatory medicines as well as some pain killers in case of too much pain. Sometimes the skin is torn on the roof of the mouth due to hot coffee or any food and usually heals on its own within days but an infection is something to seek help for.