Subnet mask assignment in wireless module

I am using AirPrime MC7544 modem and get the IP address from ISP (Verizon) after SIM get initially registers. But do not know how the subnet mask and remote IP is assigned.

Is it generated and assigned locally within modem or not?

Example:
SIM IP Details:
IP : 10.7.8.45 (from ISP)
Mask: 255.255.255.252 (from ? )
Gateway:10.7.8.46

Hi,
For MC7544, when you connect device to PC, a peer to peer connection is established, PC will get device’s IP for PC’s interface. Device will not assign or generate any other IP
When device gets IP 10.7.8.45, so the PC’s interface will get that IP.
For subnet mask 255.255.255.252, the operator is assigned 2 Hosts in this subnet (.45 and .46), 1 IP broadcast .47

Thanks,

Locally. The network, broadcast and gateway addresses do not exist. They are artifacts for your routing table. The modem will actually forward traffic for all 3 to the ISP, so that you can reach other customers being assigned those addresses from the pool (if it weren’t for the firewall rules which probably forbid this).

The modem gets one address from the ISP. It calculates a mimimum netmask alllowing a virtual gateway address in the same subnet. The size of the subnet depends on how many of the least significant address bits are zero. The requirement is that “address & netmask != address”. The netmask must also allow one other address, for the virtual gateway, so the absolute longest mask possible is 255.255.255.252

You got 10.7.8.45. The LSB is set, so the modem can use the long mask. The gateway is then the only other possible address in that subnet.

If your ISP had assigned e.g. 10.7.8.64 to you instead, then the modem would have had to use a mask with 7 zero bits. I.e. 255.255.255.128. It could then use any of the 125 other addresses as gateway. I don’t know which one it will choose.

1 Like

Thanks for the detailed explanation for query on subnet mask. So, with this logic, mask is calculated at runtime within this modem. Can we somehow made this static for us, using any command or flag or API ?

Hi,
This IP address is allocated by your cellular network. If you need the static IP, you need to contact them.

Thanks,

1 Like

If your talking about the mask and gateway, then you can set them as you like without involving the modem in the decision. It doesn’t matter to anything outside the host. The modem will forward any packets you throw at it to the ISP, regardless of destination address. The only exception is the address assigned by the ISP, which is forwarded your way.