<div dir="ltr"><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">fırat sönmez</b> <span dir="ltr"><<a href="mailto:firatssonmez@gmail.com">firatssonmez@gmail.com</a>></span><br>Date: 2018-02-01 15:51 GMT+03:00<br>Subject: Re: icmp encapsulation<br>To: Pau Espin Pedrol <<a href="mailto:pespin@sysmocom.de">pespin@sysmocom.de</a>><br><br><br><div dir="ltr">Hi Pau,<div><br></div><div>Thank you for your response.</div><div><br></div><div>You are right, I should have told the configuration in more detail. However, you came to the point already. I am talking about the second case where there is NAT. There is a slight difference though.</div><div><br></div><div>After the NAT two IP (IP1 and IP2) will be IPnat, but the NAT maps the IP1 and IP2 to the port range. Since, there is no port in ICMP, both IP1 and IP2 will be go to uplink as IPg and but on the return there must be problem for NAT machine to traverse the two different paths from IPnat to IP1 and IPnat to IP2. I looked into the ICMP header and observed the packets have different identifiers. So, NAT machine must be using the identifies to reverse the packets.</div><div><br></div><div>Anyways, in my case the <b>IP1=IP2</b> (In my experimental architecture, the GGSN will not be assigning distinct IP for each host. Instead, GGSN will assign 1 IP address for 32 hosts (seems like NAT). My configuration is probably out of standard architectures, but I need to understand how would gtp handle matching these two pdp contexts. I have tried this configuration, pinging from two different host with same IP and it was successful!</div><div><br></div><div>Two packets coming from the server to the GGSN will be <b>[src:IPs | dst:IP1]</b> and <b>[src:IPs | dst:IP2]</b>   IP1=IP2, but two packets have different icmp identifier. And pdp contexts are still resolved successfully. so a big HOW in my mind?</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Fırat</div><div><br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2018-02-01 13:46 GMT+03:00 Pau Espin Pedrol <span dir="ltr"><<a href="mailto:pespin@sysmocom.de" target="_blank">pespin@sysmocom.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi firat,<br>
<br>
I didn't understand fully the configuration you are describing. Something like this?<br>
<br>
Host1 --SGSN1--\GGSN--Server<br>
Host2 --SGSN2--/<br>
<br>
Where Host1 has been assigned IP1 and Host2 has been assigned IP2, both assigned by GGSN where IP1 != IP2. Let's assume the server IP is IPs and the GGSN public uplink (non-GTP) IP is IPg.<br>
<br>
As far as I understand, it works as follow:<br>
<br>
- Case without NAT between GGSN and Server:<br>
Host1 sends ICMP packet with saddr=IP1 daddr=IPs, which gets encapsulated through GTP and GGSN decapsulates it. Same for Host2 but in this case the packet will have saddr=IP2. As there's no NAT (eg. host clients are assigned a public IP), the server receives 2 ICMP packets with different saddr, and when answering back using the original saddr now as daddr. As GGSN keeps track of the saddr assigned to each pdp context, when it receives a packet from the uplink (non-GTP side), it matches the daddr of the packet against the saddr of the active pdp ctx to find to which pdp ctx should forward the packet.<br>
<br>
- Case with NAT between GGSN and Server:<br>
Almost the same but with extra steps done by the NAT. When the GGSN sends the packet saddr=IP1 daddr=IPs to the server, the NAT changes saddr=IP1->IPg. It does the same for saddr=IP2, but the NAT keeps track of the binding. When the response is received from the server, the NAT converts back IPg->IP1 and GGSN can again track the pdp ctx as described in the previous case.<span class="m_2353586918614455785HOEnZb"><font color="#888888"><br>
<br>
-- <br>
- Pau Espin Pedrol <<a href="mailto:pespin@sysmocom.de" target="_blank">pespin@sysmocom.de</a>>         <a href="http://www.sysmocom.de/" rel="noreferrer" target="_blank">http://www.sysmocom.de/</a><br>
==============================<wbr>==============================<wbr>===========<br>
* sysmocom - systems for mobile communications GmbH<br>
* Alt-Moabit 93<br>
* 10559 Berlin, Germany<br>
* Sitz / Registered office: Berlin, HRB 134158 B<br>
* Geschaeftsfuehrer / Managing Director: Harald Welte<br>
</font></span></blockquote></div><br></div>
</div></div></div><br></div>