welcome back in this section of the course uh we will talk about the role of dns in the ltepc dns is the domain name system and we will see how dns plays an important role in the epc operation dns is used in the lte pc for a variety of reasons they are as follows the most important of them is the s gateway np gateway selection so the serving gateway selection and the p gateway selection which is the packet gateway as you can imagine in a given telco operator you can have multiple instances of the serving gateway running and you have you can have multiple p gateways running in order for the mme to select which s gateway and which p gateway to pick it relies on the dns functionality and how it does that we will just look at in these slides the third function that the dns is used for is also for mme selection and the reason it is used is so say you have a network that has multiple mmes and a subscriber attaches uh to a new mme with a guti now since this is a new mme that has no context for this subscriber the the mme can actually query the dns and fetch the ip address details of the old mme and this is done because of the guti the guti in the lte attach message you can derive the gumi which is the globally unique mme identifier and construct a hostname and then query the dns to get the ip address of that mme and you can go and fetch the context so the new mme can go and fetch the context from the old mme that way as well so there are three essential areas where the dns is used uh skateway selection pk twist selection and fetching of old context from an old mme we will look at the s gateway and p gateway selection uh primarily in this section um the mme selection is there is not much to it is fairly straightforward so we will skip that so the s gateway selection in the lte pc is based on the tracking area code and you will need to provision your dns with these records for it to work so if you look at the wireshark capture from the mme point of view so say you see a ue tries to attach to the network using a tracking area code of 3f7c in hex in that case the mme constructs a dns query and sends it to the server and waits for a response so now let's look at how the query looks like so the query is actually constructed using the low byte and the high byte uh of the tracking area code so whatever your tracking area code is you convert it into hex and then you take the low byte and take the high byte and you construct your uh your hostname based on this and then you send it to your server and wait for a response to come back in so this is how the query would look like okay the 3f7c is in hex where the decimal translation would be anything but in this case it happens to be 16252 now the p gateway selection is based on the apn so apn fqdn which is needed for the dns query is constructed by taking your apn network identifier and your apn operator identifier and combining these two to come up with the apn fqdn so let's look at the the s gateway responses that the dns would send us back so when you look at the response dns response in wireshark uh the the packet would kind of appear like this where you would see the original query that was sent which is right here and then these are the answers there were two answers in this case and these answers are what the dns server responded with so if you look at the first answer it gives you um this maps with the uh the original query but then you would see new details around service and we will not talk about just in just a second what this means and then you also see the two fields these are the two fields that you need to be really careful about you need to be careful about the service and you need to look at the replacement so in each of these two answers we see we have the service and we have the replacement so the service uh let's talk about what the service means when you look at the service you would notice there is uh x 3g p s gateway x s 5 gtp and xs11 so what this means is that the host which is represented by this fqdn in a sense is able to offer services of the serving gateway s5 interface using gtp and also the x s11 interface which are the typical interfaces for a serving gateway now if you look at the second answer which also lists these same services this may be a different serving gateway so so once the mme queries the dns it will send it a bunch of serving gateway records depending on what is being provisioned and then the mme follows some logic which we will talk about on how to select from those records or answers one serving gateway that makes the most sense so this is the first step so the mme sends a dns query based on tracking area code it gets these responses now within each response you have a replacement fqdn now the mme needs to query for every replacement you need to find a record right so that's what happens we send we take the replacement in this example this one we send this query back to the dns server and we wait for an answer and once the answer comes in this is what the answer looks like it will return the answer where this is the same that was sent in the query and then we now finally have an ip address so if you guys are familiar with the dns the domain name system the main function of domain name system is that you are able to send a query with a host name and you are able to retrieve a record or an ip address because at the end of the day when your packets go out on the wire they have to have a destination ip address in their frame so in order to get that ip address you rely on dns so 3gpp took this dns functionality and kind of modified it a little bit to introduce some new records but the overall logic remains the same so you would need to provision your dns server with that all the tracking area codes that you have in your network and you need to provision them with the correct host names now you may be wondering what is top off and how is that important we will look into that in just a few minutes uh but for now just keep in mind every s gateway uh needs to be provisioned in your dns with the host name and the tracking area codes need to be populated as well now the p gateway selection like i said before is based on the apn fqdn and the ap and fqdn for as an example would some look something like internet as an example internet test dot ap and rdpc mnc blah blah blah mcc uh dot 3 gpp network. org so if you look at this this consists of two parts there is a network identifier part which is the internet test string here right before apn and then there is an operator identifier which is the string that is uh that follows after the network identifier so what happens is once the mme knows what the ap and fqdn is it will query the dns server which is what is shown here this query say in this example the apn network identifier is next-gen phone it will construct the query and then send it to the dns and wait for the answer in this case when the dns responded back it gave us one answer and in that answer the services that were listed were x 3gpp gateway xs5 gtp and xgn these are all the interfaces that this node supports and these are all what we want really we need we want the p gateway functionality we want the s5 and then gn is there we won't use it but it's there and then we get a replacement record here now this replacement record will again be queried and we will finally get an ip address that will be used for all the comms so hopefully you get a high level understanding of how dns works in the epc for s gateway selection and p gateway selection in the next section we will talk about the significance of top off and how that plays its role in the selection so the host names uh like we saw the replacement they typically have this form top on they will either be top on or top off followed by a single label interface name followed by the canonical node name where the first label is top on or top off to indicate whether or not collocated and topologically close node selection shall be preferred so just to give you some background so serving gateway and packet gateway they can either be in the same platform so think of it like a server rack they can either be in the same server rack or they can be which is what is called as co-located co-located here and if they are in different server racks they may be classified as not co-located or if they are in different parts of the network then also they qualify as being not co-located so if by definition 3gpp always prefers co-located serving gateway in packet gateway that's that's a blanket statement that that's always the first preference if that is not hold if that does not hold true then it will go through the selection of identifying which of the nodes are the most topologically close and it will start uh by sorting those pairs and selecting the pre the pair with the highest priority and we let's look into how that is done so we were talking about the host name so we talked about top on top of what that means so top one if you see uh top on in in the host name that means uh the topologically closed node selection will be preferred you have to take that into account if it says top off you can you can ignore the the close node selection algorithm in a sense and you can treat it as an independent record a single label interface name is a single label used to name a specific interface on a node so you can see as an example you can be either 0 s 8 or it can be it can represent an interface essentially and the canonical node name is the canonical node name of a specific node so it is the kind of the name of that node a node shall have exactly one canonical node name so a host name always includes the canonical name of the node so the hostname and the canonical name are not the same but the hostname always includes the canonical name in addition it can include other aspects of that platform hence when comparing two hostname fqdns to find out whether the nodes are actually the same the first two labels of the hostname fqdn shall be ignored so when using hostnames with top on as the first label the canonical node names of the nodes shall be hierarchically structured to allow an operator to reflect the topological closeness of two nodes by naming the nodes with the canonical node names sharing a common suffix domain name the number of labels in the common suffix shall represent how close the network operator considers them during node selection the higher the number of labels in the common suffix the closer the nodes are in other words to topologically close zest nodes are those with the longest matching suffix in their respective canonical node names okay let's now look into some examples so that we can understand this concept better the following list consists contains examples of domain names where canonical node names are in bold so if you can have replacement records like we saw in the dns they can be of the following examples right you can have topon. e0.
gateway32. californiawest. example.
com so the one in bold is actually the canonical node name so what you really need to find out if first of all you need if you first look at top on and top off if it's top off then you don't need to look into the closeness aspect you would treat it as an independent record but if you do if you look at top on that means you have to take into account the uh topologically closeness in the node selection now if now what we'll try to do is we'll try to see which of these nodes are closer to each other than the rest of them so if you compare top on eth0 and top on s8 if you look at their canonical node name they are exactly the same so what that means is they are pretty close they are pretty close right and since they have the same canonical node name they mean that means that they are on the same platform so in this example this and this are two different interfaces on the same node because the canonical name is the same so they are kind of co-located you can think of them like that now when you look at s gateway 3 oregon west example. com now if you compare this with any of the others here you can see that it is not closer to any of them because the canonical node name has really no match to any of these if you let's take another example so let's take this example here cluster one so top on board three p gateway one cluster one dot net 27 right and then let's take an example of this now if you look at the canonical name cluster1. net 27 and this they are exactly the same right so that means these guys are also co-located now if you compare p gateway1 cluster2.
net27example. net so if you look at this and you look at this this record there is some similarity but there is some differentiation as well so you can see that this one has in the canonical node name it has cluster one this guy has cluster two uh but net27example. net is kind of common in both these records that means there is some closeness so the operators depending on the closeness in the suffix can kind of adjust how close or apart these nodes are right so that's what we have listed here on the other hand this is topologically closer to cluster one net 27 they are both connected to the cluster 1 net 27 sub network right because they are part of the same sub network okay then the p gateway 1 cluster 2 net that is only connected to the wider net 27 right so we are essentially looking for the longest match so longer the match the closer the node is so in this case the match was exact for the canonical name so they were like co-located on the same platform here the match was relatively close uh up until this point where you were cluster one so they are relatively close but not on the same platform and then this is uh not is is is further uh because the only common part is the net 27 uh example.
net right uh this part the the the earlier part is different so that means it's a little further so in terms of closeness this is the closest uh followed by uh this and then this is closer to both of them because of the common net 27 example. net so in this case if this were a priority you would select um you know if if this were s gateway and this were a p gateway you would select this pair because they are the closest to each other hopefully that makes sense uh it it takes a little used to learning used to but this is as per 3gpp so how does the selection process actually work now that we have some background so the overall and the final priority is performed according to the following steps co-location the mme starts by analyzing the gateway names gateways with the same canonical node name are collected in the same combined s gateway p gateway node such as if you have a node one north. op.