MME only knows for which APN, UE is trying to connect. MME will get the PDN information(based on APN - PDN Address/ PDN host name) from HSS in diameter ULA(Update Location Answer) message. if MME receives PDN host name, then MME will resolve this host name from DNS server and will get PDN IP address. this PDN IP adress will share with SGW in create session request to which PGW, SGW will contact for this UE. Based on tracking Area(TA) SGW will be selected by MME. So, if TA changed, then SGW may change for this UE. but for each APN there will be fixed set of PDN's(IPv4, IPv6, IPv4v6) mapped at HSS.